Merge pull request #358 from knnniggett/prevbutton

Fix prev button while in gapless mode.  All buttons tested and working.
This commit is contained in:
Andrew Bauer 2014-07-04 10:33:05 -05:00
commit 9163536219
1 changed files with 8 additions and 3 deletions

View File

@ -877,6 +877,11 @@ void EventStream::processCommand( const CmdMsg *msg )
// Clear paused flag // Clear paused flag
paused = false; paused = false;
} }
// If we are in single event mode and at the last frame, replay the current event
if ( (mode == MODE_SINGLE) && (curr_frame_id == event_data->frame_count) )
curr_frame_id = 1;
replay_rate = ZM_RATE_BASE; replay_rate = ZM_RATE_BASE;
break; break;
} }
@ -1050,7 +1055,7 @@ void EventStream::processCommand( const CmdMsg *msg )
if ( replay_rate >= 0 ) if ( replay_rate >= 0 )
curr_frame_id = 0; curr_frame_id = 0;
else else
curr_frame_id = event_data->frame_count-1; curr_frame_id = event_data->frame_count+1;
paused = false; paused = false;
forceEventChange = true; forceEventChange = true;
break; break;
@ -1059,7 +1064,7 @@ void EventStream::processCommand( const CmdMsg *msg )
{ {
Debug( 1, "Got NEXT command" ); Debug( 1, "Got NEXT command" );
if ( replay_rate >= 0 ) if ( replay_rate >= 0 )
curr_frame_id = event_data->frame_count-1; curr_frame_id = event_data->frame_count+1;
else else
curr_frame_id = 0; curr_frame_id = 0;
paused = false; paused = false;
@ -1168,7 +1173,7 @@ void EventStream::checkEventLoaded()
loadEventData( event_id ); loadEventData( event_id );
Debug( 2, "Current frame id = %d", curr_frame_id ); Debug( 2, "Current frame id = %d", curr_frame_id );
if ( curr_frame_id <= 0 ) if ( replay_rate < 0 )
curr_frame_id = event_data->frame_count; curr_frame_id = event_data->frame_count;
else else
curr_frame_id = 1; curr_frame_id = 1;