src/menus/SelectMenus.cpp
// Handle small cursor and play head movements
Handle small cursor and play head movements
Handle small cursor and play head movements
void SeekLeftOrRight
(AudacityProject &project, double direction, SelectionOperation operation,
 SeekInfo &info)
{
   if( ProjectAudioIO::Get( project ).IsAudioActive() )
   {
      if( operation == CURSOR_MOVE )
         SeekWhenAudioActive( info.mSeekShort * direction,
            info.mLastSelectionAdjustment );
      else if( operation == SELECTION_EXTEND )
         SeekWhenAudioActive( info.mSeekLong * direction,
            info.mLastSelectionAdjustment );
      return;
   }
   const wxLongLong curtime = ::wxGetUTCTimeMillis();
   enum { MIN_INTERVAL = 50 };
   const bool fast =
      (curtime - info.mLastSelectionAdjustment < MIN_INTERVAL);
   info.mLastSelectionAdjustment = curtime;
   enum { LARGER_MULTIPLIER = 4 };
   const double seekStep = (fast ? LARGER_MULTIPLIER : 1.0) * direction;
   SeekWhenAudioInactive( project, seekStep, TIME_UNIT_PIXELS, operation);
}
void SeekLeftOrRight ( AudacityProject & project , double direction , SelectionOperation operation , SeekInfo & info ) { if ( ProjectAudioIO :: Get ( project ) . IsAudioActive ( ) ) { if ( operation == CURSOR_MOVE ) SeekWhenAudioActive ( info . mSeekShort * direction , info . mLastSelectionAdjustment ) ; else if ( operation == SELECTION_EXTEND ) SeekWhenAudioActive ( info . mSeekLong * direction , info . mLastSelectionAdjustment ) ; return ; } const wxLongLong curtime = :: wxGetUTCTimeMillis ( ) ; enum { MIN_INTERVAL = 50 } ; const bool fast = ( curtime - info . mLastSelectionAdjustment < MIN_INTERVAL ) ; info . mLastSelectionAdjustment = curtime ; enum { LARGER_MULTIPLIER = 4 } ; const double seekStep = ( fast ? LARGER_MULTIPLIER : 1.0 ) * direction ; SeekWhenAudioInactive ( project , seekStep , TIME_UNIT_PIXELS , operation ) ; }
Handle small cursor and play head movements
Handle small cursor and play head movements
// PRL:  What I found and preserved, strange though it be: // During playback:  jump depends on preferences and is independent of the // zoom and does not vary if the key is held // Else: jump depends on the zoom and gets bigger if the key is held // Note: no action for CURSOR_CONTRACT // If the last adjustment was very recent, we are // holding the key down and should move faster. // How much faster should the cursor move if shift is down?