mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +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/tooltip.h>
|
||||||
#include <wx/datetime.h>
|
#include <wx/datetime.h>
|
||||||
|
|
||||||
#include "TranscriptionToolBar.h"
|
|
||||||
|
|
||||||
#include "../AColor.h"
|
#include "../AColor.h"
|
||||||
#include "../AdornedRulerPanel.h"
|
#include "../AdornedRulerPanel.h"
|
||||||
#include "../AllThemeResources.h"
|
#include "../AllThemeResources.h"
|
||||||
@ -487,12 +485,6 @@ void ControlToolBar::EnableDisableButtons()
|
|||||||
// Only interested in audio type tracks
|
// Only interested in audio type tracks
|
||||||
bool tracks = p && TrackList::Get( *p ).Any<AudioTrack>(); // PRL: PlayableTrack ?
|
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);
|
mPlay->SetEnabled(CanStopAudioStream() && tracks && !recording);
|
||||||
mRecord->SetEnabled(
|
mRecord->SetEnabled(
|
||||||
CanStopAudioStream() &&
|
CanStopAudioStream() &&
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include "ControlToolBar.h"
|
#include "ControlToolBar.h"
|
||||||
#include "../AllThemeResources.h"
|
#include "../AllThemeResources.h"
|
||||||
#include "../AudioIOBase.h"
|
#include "../AudioIO.h"
|
||||||
#include "../ImageManipulation.h"
|
#include "../ImageManipulation.h"
|
||||||
#include "../KeyboardCapture.h"
|
#include "../KeyboardCapture.h"
|
||||||
#include "../Project.h"
|
#include "../Project.h"
|
||||||
@ -288,6 +288,18 @@ void TranscriptionToolBar::Populate()
|
|||||||
|
|
||||||
void TranscriptionToolBar::EnableDisableButtons()
|
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
|
#ifdef EXPERIMENTAL_VOICE_DETECTION
|
||||||
AudacityProject *p = GetActiveProject();
|
AudacityProject *p = GetActiveProject();
|
||||||
if (!p) return;
|
if (!p) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user