Logo Search packages:      
Sourcecode: kdenlive version File versions  Download package

void Gui::KTimeLine::autoScroll (  )  [slot]

automatically scroll the timeline while playing

Definition at line 395 of file ktimeline.cpp.

References drawPartialTrackViewBackBuffer(), GenTime::frames(), m_framesPerSecond, mapLocalToValue(), mapValueToLocal(), seekPosition(), timeScale(), and viewWidth().

                               {
      int max = (int) mapLocalToValue(viewWidth());
      int min = max - (max - mapLocalToValue(0))/2.4;
      int currPos = seekPosition().frames( m_framesPerSecond );
      // Only scroll if the cursor is in the right part of the timeline and 
      // zoom factor is lower than 2 frames 
      if (currPos < min || currPos > max || timeScale() > 50 ) return;
      int step = mapValueToLocal(currPos) - mapValueToLocal(min);
      m_scrollBar->setValue( m_scrollBar->value() + step );
      if (timeScale() > 3) drawPartialTrackViewBackBuffer(currPos - (int) timeScale(), currPos);
    }


Generated by  Doxygen 1.6.0   Back to index