mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 00:50:52 +02:00
Scrub & seek toolbar buttons disable during recording, as was intended
This commit is contained in:
parent
4b437b8cb9
commit
3e3cf24c01
@ -178,16 +178,7 @@ const ReservedCommandFlag
|
||||
gAudioIO->GetNumCaptureChannels() > 0
|
||||
);
|
||||
}
|
||||
},
|
||||
HasWaveDataFlag{
|
||||
[](const AudacityProject &project){
|
||||
auto range = TrackList::Get( project ).Any<const WaveTrack>()
|
||||
+ [](const WaveTrack *pTrack){
|
||||
return pTrack->GetEndTime() > pTrack->GetStartTime();
|
||||
};
|
||||
return !range.empty();
|
||||
}
|
||||
}; // jkc
|
||||
|
||||
const ReservedCommandFlag
|
||||
LabelTracksExistFlag{
|
||||
|
@ -31,8 +31,7 @@ extern AUDACITY_DLL_API const ReservedCommandFlag
|
||||
|
||||
extern AUDACITY_DLL_API const ReservedCommandFlag
|
||||
AudioIOBusyFlag, // lll
|
||||
CaptureNotBusyFlag,
|
||||
HasWaveDataFlag; // jkc
|
||||
CaptureNotBusyFlag;
|
||||
|
||||
extern AUDACITY_DLL_API const ReservedCommandFlag
|
||||
LabelTracksExistFlag,
|
||||
|
@ -26,6 +26,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../Track.h"
|
||||
#include "../../TrackPanel.h"
|
||||
#include "../../ViewInfo.h"
|
||||
#include "../../WaveTrack.h"
|
||||
#include "../../prefs/PlaybackPrefs.h"
|
||||
#include "../../prefs/TracksPrefs.h"
|
||||
#include "../../toolbars/ControlToolBar.h"
|
||||
@ -247,6 +248,18 @@ Scrubber::~Scrubber()
|
||||
mWindow->PopEventHandler();
|
||||
}
|
||||
|
||||
static const auto HasWaveDataPred =
|
||||
[](const AudacityProject &project){
|
||||
auto range = TrackList::Get( project ).Any<const WaveTrack>()
|
||||
+ [](const WaveTrack *pTrack){
|
||||
return pTrack->GetEndTime() > pTrack->GetStartTime();
|
||||
};
|
||||
return !range.empty();
|
||||
};
|
||||
|
||||
static const ReservedCommandFlag
|
||||
HasWaveDataFlag{ HasWaveDataPred }; // jkc
|
||||
|
||||
namespace {
|
||||
const struct MenuItem {
|
||||
CommandID name;
|
||||
@ -1194,9 +1207,10 @@ std::vector<wxString> Scrubber::GetAllUntranslatedStatusStrings()
|
||||
|
||||
bool Scrubber::CanScrub() const
|
||||
{
|
||||
// Return the enabled state for the menu item that really launches the scrub or seek.
|
||||
auto &cm = CommandManager::Get( *mProject );
|
||||
return cm.GetEnabled(menuItems[ 0 ].name);
|
||||
// Recheck the same condition as enables the Scrub/Seek menu item.
|
||||
auto gAudioIO = AudioIO::Get();
|
||||
return !( gAudioIO->IsBusy() && gAudioIO->GetNumCaptureChannels() > 0 ) &&
|
||||
HasWaveDataPred( *mProject );
|
||||
}
|
||||
|
||||
// To supply the "finder" argument
|
||||
|
Loading…
x
Reference in New Issue
Block a user