void Song::savePos() { TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine; if( tl != NULL ) { tl->savePos( m_playPos[m_playMode] ); } }
void Song::stop() { // do not stop/reset things again if we're stopped already if( m_playMode == Mode_None ) { return; } TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine; m_playing = false; m_paused = false; m_recording = true; if( tl != NULL ) { switch( tl->behaviourAtStop() ) { case TimeLineWidget::BackToZero: m_playPos[m_playMode].setTicks( 0 ); m_elapsedMilliSeconds = 0; break; case TimeLineWidget::BackToStart: if( tl->savedPos() >= 0 ) { m_playPos[m_playMode].setTicks( tl->savedPos().getTicks() ); m_elapsedMilliSeconds = ( ( ( tl->savedPos().getTicks() ) * 60 * 1000 / 48 ) / getTempo() ); tl->savePos( -1 ); } break; case TimeLineWidget::KeepStopPosition: default: break; } } else { m_playPos[m_playMode].setTicks( 0 ); m_elapsedMilliSeconds = 0; } m_playPos[m_playMode].setCurrentFrame( 0 ); m_vstSyncController.setPlaybackState( m_exporting ); m_vstSyncController.setAbsolutePosition( m_playPos[m_playMode].getTicks() ); // remove all note-play-handles that are active Engine::mixer()->clear(); m_playMode = Mode_None; emit playbackStateChanged(); }