1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-01 12:04:49 +02:00

Update Play button appearance in idle time...

... so most calls to ControlToolBar::SetPlay are removed.  One remains in
TransportMenus, which will not be problematic for untangling dependencies,
and one remains where the toolbar remakes its own buttons.

But the routines that start and stop the streams, importantly, don't use it.
This commit is contained in:
Paul Licameli
2019-07-01 10:30:54 -04:00
parent cac04e9fb8
commit 830f772625
5 changed files with 62 additions and 45 deletions

View File

@@ -192,6 +192,18 @@ void ProjectAudioManager::OnSoundActivationThreshold()
}
}
bool ProjectAudioManager::Playing() const
{
auto gAudioIO = AudioIO::Get();
return
gAudioIO->IsBusy() &&
ControlToolBar::Get( mProject ).CanStopAudioStream() &&
// ... and not merely monitoring
!gAudioIO->IsMonitoring() &&
// ... and not punch-and-roll recording
gAudioIO->GetNumCaptureChannels() == 0;
}
bool ProjectAudioManager::Recording() const
{
auto gAudioIO = AudioIO::Get();
@@ -265,7 +277,6 @@ bool DoPlayStopSelect
//If busy, stop playing, make sure everything is unpaused.
if (scrubber.HasMark() ||
gAudioIO->IsStreamActive(token)) {
toolbar.SetPlay(false); //Pops
toolbar.SetStop(true); //Pushes stop down
// change the selection
@@ -321,7 +332,6 @@ void DoPlayStopSelect(AudacityProject &project)
toolbar.OnStop(evt);
else if (!gAudioIO->IsBusy()) {
//Otherwise, start playing (assuming audio I/O isn't busy)
//toolbar->SetPlay(true); // Not needed as set in PlayPlayRegion()
toolbar.SetStop(false);
// Will automatically set mLastPlayMode