Logo Search packages:      
Sourcecode: kdenlive version File versions

QPtrListIterator< DocClipRef > DocTrackBase::firstClip ( GenTime  startValue,
GenTime  endValue,
bool  selected 
) [inherited]

Returns an iterator to the first clip (chronologically) which overlaps the start/end value range specified. You must choose which list of tracks you are interested in - the selected or unselected.

Definition at line 107 of file doctrackbase.cpp.

References DocTrackBase::m_selectedClipList, and DocTrackBase::m_unselectedClipList.

Referenced by TrackPanelClipSlipFunction::createAddClipsCommand(), TrackPanelClipMoveFunction::createAddClipsCommand(), Gui::KTrackPlacer::drawToBackBuffer(), DocTrackBase::endClip(), Gui::KdenliveApp::populateClearSnapMarkers(), and DocClipProject::selectedClip().

{
    QPtrListIterator < DocClipRef >
      itt(selected ? m_selectedClipList : m_unselectedClipList);

    DocClipRef *clip;

    if (itt.isEmpty())
      return itt;

    while ((clip = itt.current()) != 0) {
      if (clip->trackStart() > endValue) {
          // out of range, return iterator with a current() value of null.
          itt.toLast();
          ++itt;
          return itt;
      }
      if (clip->trackStart() + clip->cropDuration() >= startValue) {
          if (clip->trackStart() <= endValue) {
            // this clip is at least partially on screen.
            return itt;
          } else {
            // this clip is not on screen, return iterator with current() value of null
            itt.toLast();
            ++itt;
            return itt;
          }
      }
      ++itt;

    }

    return itt;
}


Generated by  Doxygen 1.6.0   Back to index