@@ -99,7 +99,7 @@ PlaybackController::PlaybackController()
9999void PlaybackController::init ()
100100{
101101 dispatcher ()->reg (this , PLAY_CODE, [this ]() { PlaybackController::togglePlay (); });
102- dispatcher ()->reg (this , PLAY_FROM_SELECTION, this , &PlaybackController::playFromSelection);
102+ dispatcher ()->reg (this , PLAY_FROM_SELECTION, [ this ]() { &PlaybackController::playFromSelection () } );
103103 dispatcher ()->reg (this , STOP_CODE, [this ]() { PlaybackController::pause (/* select*/ false ); });
104104 dispatcher ()->reg (this , PAUSE_AND_SELECT_CODE, [this ]() { PlaybackController::pause (/* select*/ true ); });
105105 dispatcher ()->reg (this , REWIND_CODE, this , &PlaybackController::rewind);
@@ -656,28 +656,14 @@ void PlaybackController::togglePlay(bool showErrors)
656656 }
657657}
658658
659- void PlaybackController::play ( )
659+ void PlaybackController::playFromSelection ( bool showErrors )
660660{
661- IF_ASSERT_FAILED ( currentPlayer ()) {
661+ if ( selection ()-> isNone ()) {
662662 return ;
663663 }
664664
665- if (isLoopEnabled ()) {
666- secs_t startSecs = playbackStartSecs ();
667- seek (startSecs);
668- }
669-
670- secs_t delay = 0 .;
671- if (notationConfiguration ()->isCountInEnabled ()) {
672- notationPlayback ()->triggerCountIn (m_currentTick, delay);
673- }
674-
675- currentPlayer ()->play (delay);
676- }
677-
678- void PlaybackController::playFromSelection ()
679- {
680- if (selection ()->isNone ()) {
665+ if (showErrors && m_onlineSoundsController->shouldShowOnlineSoundsProcessingError (isPlaying ())) {
666+ m_onlineSoundsController->showOnlineSoundsProcessingError ([this ]() { playFromSelection (false /* showErrors*/ ); });
681667 return ;
682668 }
683669
@@ -707,6 +693,25 @@ void PlaybackController::playFromSelection()
707693 }
708694}
709695
696+ void PlaybackController::play ()
697+ {
698+ IF_ASSERT_FAILED (currentPlayer ()) {
699+ return ;
700+ }
701+
702+ if (isLoopEnabled ()) {
703+ secs_t startSecs = playbackStartSecs ();
704+ seek (startSecs);
705+ }
706+
707+ secs_t delay = 0 .;
708+ if (notationConfiguration ()->isCountInEnabled ()) {
709+ notationPlayback ()->triggerCountIn (m_currentTick, delay);
710+ }
711+
712+ currentPlayer ()->play (delay);
713+ }
714+
710715void PlaybackController::rewind (const ActionData& args)
711716{
712717 secs_t startSecs = playbackStartSecs ();
0 commit comments