Logo Search packages:      
Sourcecode: kdenlive version File versions

bool DocTrackSound::canAddClip ( DocClipRef *  clip  )  const [virtual]

Returns true if the specified clip can be added to this track, false otherwise.

This method needs to be implemented by inheriting classes to define which types of clip they support.

Returns true if the specified clip can be added to this track, false otherwise.

Implements DocTrackBase.

Definition at line 31 of file doctracksound.cpp.

References DocTrackBase::m_unselectedClipList.

{
    DocClipRef *search;

    if (!clip)
      return false;

    QPtrListIterator < DocClipRef > u_itt(m_unselectedClipList);

    for (; (search = u_itt.current()) != 0; ++u_itt) {
      if (search->trackStart() + search->cropDuration() <=
          clip->trackStart())
          continue;
      if (search->trackStart() <
          clip->trackStart() + clip->cropDuration()) {
          return false;
      }
      // we can safely break here, as the clips are sorted in order - if search->trackStart is already past
      // the clip that we was looking at, then we are ok.
      break;
    }

    QPtrListIterator < DocClipRef > s_itt(m_unselectedClipList);

    for (; (search = s_itt.current()) != 0; ++s_itt) {
      if (search->trackStart() + search->cropDuration() <=
          clip->trackStart())
          continue;
      if (search->trackStart() <
          clip->trackStart() + clip->cropDuration())
          return false;
      // we can safely break here, as the clips are sorted in order - if search->trackStart is already past
      // the clip that we was looking at, then we are ok.
      break;
    }

    return true;
}


Generated by  Doxygen 1.6.0   Back to index