MCPcopy Create free account
hub / github.com/LMMS/lmms / stop

Method stop

src/core/Song.cpp:666–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664
665
666void Song::stop()
667{
668 // do not stop/reset things again if we're stopped already
669 if( m_playMode == Mode_None )
670 {
671 return;
672 }
673
674 TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine;
675 m_paused = false;
676 m_recording = true;
677
678 if( tl != NULL )
679 {
680
681 switch( tl->behaviourAtStop() )
682 {
683 case TimeLineWidget::BackToZero:
684 m_playPos[m_playMode].setTicks( 0 );
685 m_elapsedMilliSeconds = 0;
686 if( gui && gui->songEditor() &&
687 ( tl->autoScroll() == TimeLineWidget::AutoScrollEnabled ) )
688 {
689 QMetaObject::invokeMethod(gui->songEditor()->m_editor, "updatePosition", Qt::AutoConnection, Q_ARG(MidiTime, 0));
690 }
691 break;
692
693 case TimeLineWidget::BackToStart:
694 if( tl->savedPos() >= 0 )
695 {
696 m_playPos[m_playMode].setTicks( tl->savedPos().getTicks() );
697 m_elapsedMilliSeconds =
698 ( ( ( tl->savedPos().getTicks() ) * 60 * 1000 / 48 ) /
699 getTempo() );
700 if( gui && gui->songEditor() &&
701 ( tl->autoScroll() == TimeLineWidget::AutoScrollEnabled ) )
702 {
703 QMetaObject::invokeMethod(gui->songEditor()->m_editor, "updatePosition", Qt::AutoConnection, Q_ARG(MidiTime, tl->savedPos().getTicks()));
704 }
705 tl->savePos( -1 );
706 }
707 break;
708
709 case TimeLineWidget::KeepStopPosition:
710 default:
711 break;
712 }
713 }
714 else
715 {
716 m_playPos[m_playMode].setTicks( 0 );
717 m_elapsedMilliSeconds = 0;
718 }
719 m_playing = false;
720
721 m_playPos[m_playMode].setCurrentFrame( 0 );
722
723 m_vstSyncController.setPlaybackState( m_exporting );

Callers 1

~RemotePluginMethod · 0.45

Calls 12

framesPerTickFunction · 0.85
mixerFunction · 0.85
behaviourAtStopMethod · 0.80
setTicksMethod · 0.80
getTicksMethod · 0.80
setCurrentFrameMethod · 0.80
setPlaybackStateMethod · 0.80
setAbsolutePositionMethod · 0.80
currentFrameMethod · 0.80
autoScrollMethod · 0.45
savePosMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected