mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-07 16:07:44 +02:00
ControlToolBar.cpp doesn't depend directly on TranscriptionToolBar...
... TranscriptionToolBar updates its own button, doesn't need a push from the ControlToolBar
This commit is contained in:
parent
f179de7a82
commit
5751ddba4f
@ -56,8 +56,6 @@
|
||||
#include <wx/tooltip.h>
|
||||
#include <wx/datetime.h>
|
||||
|
||||
#include "TranscriptionToolBar.h"
|
||||
|
||||
#include "../AColor.h"
|
||||
#include "../AdornedRulerPanel.h"
|
||||
#include "../AllThemeResources.h"
|
||||
@ -487,12 +485,6 @@ void ControlToolBar::EnableDisableButtons()
|
||||
// Only interested in audio type tracks
|
||||
bool tracks = p && TrackList::Get( *p ).Any<AudioTrack>(); // PRL: PlayableTrack ?
|
||||
|
||||
if (p) {
|
||||
const auto playAtSpeedTB = &TranscriptionToolBar::Get( *p );
|
||||
if (playAtSpeedTB)
|
||||
playAtSpeedTB->SetEnabled(CanStopAudioStream() && tracks && !recording);
|
||||
}
|
||||
|
||||
mPlay->SetEnabled(CanStopAudioStream() && tracks && !recording);
|
||||
mRecord->SetEnabled(
|
||||
CanStopAudioStream() &&
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include "ControlToolBar.h"
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../AudioIOBase.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../ImageManipulation.h"
|
||||
#include "../KeyboardCapture.h"
|
||||
#include "../Project.h"
|
||||
@ -288,6 +288,18 @@ void TranscriptionToolBar::Populate()
|
||||
|
||||
void TranscriptionToolBar::EnableDisableButtons()
|
||||
{
|
||||
AudacityProject *p = GetActiveProject();
|
||||
|
||||
auto gAudioIO = AudioIO::Get();
|
||||
bool canStopAudioStream = (!gAudioIO->IsStreamActive() ||
|
||||
gAudioIO->IsMonitoring() ||
|
||||
gAudioIO->GetOwningProject() == p );
|
||||
bool recording = gAudioIO->GetNumCaptureChannels() > 0;
|
||||
|
||||
// Only interested in audio type tracks
|
||||
bool tracks = p && TrackList::Get( *p ).Any<AudioTrack>(); // PRL: PlayableTrack ?
|
||||
SetEnabled( canStopAudioStream && tracks && !recording );
|
||||
|
||||
#ifdef EXPERIMENTAL_VOICE_DETECTION
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (!p) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user