mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Momentary Stop push-down happens in yield to the idle time handler...
... So that ControlToolBar::StopPlaying now does nothing directly to the buttons, and can be moved to another place with no dependency on ControlToolBar
This commit is contained in:
@@ -808,10 +808,20 @@ void ControlToolBar::StopPlaying(bool stopStream /* = true*/)
|
||||
if (!CanStopAudioStream())
|
||||
return;
|
||||
|
||||
mStop->PushDown();
|
||||
|
||||
auto gAudioIO = AudioIO::Get();
|
||||
|
||||
auto cleanup = finally( [&]{
|
||||
projectAudioManager.SetStopping( false );
|
||||
} );
|
||||
|
||||
if (stopStream && gAudioIO->IsBusy()) {
|
||||
// flag that we are stopping
|
||||
projectAudioManager.SetStopping( true );
|
||||
// Allow UI to update for that
|
||||
while( wxTheApp->ProcessIdle() )
|
||||
;
|
||||
}
|
||||
|
||||
if(stopStream)
|
||||
gAudioIO->StopStream();
|
||||
|
||||
@@ -1296,8 +1306,11 @@ void ControlToolBar::OnIdle(wxIdleEvent & event)
|
||||
);
|
||||
}
|
||||
|
||||
// push-downs of the stop button are only momentary and always pop up now
|
||||
mStop->PopUp();
|
||||
if ( projectAudioManager.Stopping() )
|
||||
mStop->PushDown();
|
||||
else
|
||||
// push-downs of the stop button are only momentary and always pop up now
|
||||
mStop->PopUp();
|
||||
|
||||
UpdateStatusBar();
|
||||
EnableDisableButtons();
|
||||
|
||||
Reference in New Issue
Block a user