mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +02:00
Remove unused command flags
This commit is contained in:
parent
6c860229e8
commit
1f763984c9
@ -32,7 +32,6 @@
|
||||
|
||||
#include "AdornedRulerPanel.h"
|
||||
#include "AudioIO.h"
|
||||
#include "Clipboard.h"
|
||||
#include "LabelTrack.h"
|
||||
#include "ModuleManager.h"
|
||||
#ifdef USE_MIDI
|
||||
@ -53,7 +52,6 @@
|
||||
#include "prefs/TracksPrefs.h"
|
||||
#include "toolbars/ControlToolBar.h"
|
||||
#include "toolbars/ToolManager.h"
|
||||
#include "widgets/FileHistory.h"
|
||||
|
||||
#include <wx/menu.h>
|
||||
#include <wx/windowptr.h>
|
||||
@ -405,19 +403,9 @@ CommandFlag MenuManager::GetFocusedFrame(AudacityProject &project)
|
||||
wxWindow *w = wxWindow::FindFocus();
|
||||
|
||||
while (w) {
|
||||
if (w == ToolManager::Get( project ).GetTopDock()) {
|
||||
return TopDockHasFocus;
|
||||
}
|
||||
|
||||
if (w == &AdornedRulerPanel::Get( project ))
|
||||
return RulerHasFocus;
|
||||
|
||||
if (dynamic_cast<NonKeystrokeInterceptingWindow*>(w)) {
|
||||
return TrackPanelHasFocus;
|
||||
}
|
||||
if (w == ToolManager::Get( project ).GetBotDock()) {
|
||||
return BotDockHasFocus;
|
||||
}
|
||||
|
||||
w = w->GetParent();
|
||||
}
|
||||
@ -457,14 +445,12 @@ CommandFlag MenuManager::GetUpdateFlags( bool checkActive )
|
||||
|
||||
if( gAudioIO->IsPaused() )
|
||||
flags |= PausedFlag;
|
||||
else
|
||||
flags |= NotPausedFlag;
|
||||
|
||||
// quick 'short-circuit' return.
|
||||
if ( checkActive && !window.IsActive() ){
|
||||
const auto checkedFlags =
|
||||
NotMinimizedFlag | AudioIONotBusyFlag | AudioIOBusyFlag |
|
||||
PausedFlag | NotPausedFlag;
|
||||
PausedFlag;
|
||||
// short cirucit return should preserve flags that have not been calculated.
|
||||
flags = (lastFlags & ~checkedFlags) | flags;
|
||||
lastFlags = flags;
|
||||
@ -533,9 +519,6 @@ CommandFlag MenuManager::GetUpdateFlags( bool checkActive )
|
||||
#endif
|
||||
);
|
||||
|
||||
if( Clipboard::Get().Duration() > 0 )
|
||||
flags |= ClipboardFlag;
|
||||
|
||||
auto &undoManager = UndoManager::Get( project );
|
||||
|
||||
if (undoManager.UnsavedChanges() ||
|
||||
@ -558,12 +541,6 @@ CommandFlag MenuManager::GetUpdateFlags( bool checkActive )
|
||||
if (ViewInfo::Get( project ).ZoomOutAvailable() && (flags & TracksExistFlag))
|
||||
flags |= ZoomOutAvailableFlag;
|
||||
|
||||
// TextClipFlag is currently unused (Jan 2017, 2.1.3 alpha)
|
||||
// and LabelTrack::IsTextClipSupported() is quite slow on Linux,
|
||||
// so disable for now (See bug 1575).
|
||||
// if ((flags & LabelTracksExistFlag) && LabelTrack::IsTextClipSupported())
|
||||
// flags |= TextClipFlag;
|
||||
|
||||
flags |= GetFocusedFrame(project);
|
||||
|
||||
const auto &playRegion = viewInfo.playRegion;
|
||||
@ -580,9 +557,6 @@ CommandFlag MenuManager::GetUpdateFlags( bool checkActive )
|
||||
}
|
||||
}
|
||||
|
||||
if (FileHistory::Global().GetCount() > 0)
|
||||
flags |= HaveRecentFiles;
|
||||
|
||||
const auto &settings = ProjectSettings::Get( project );
|
||||
if (settings.IsSyncLocked())
|
||||
flags |= IsSyncLockedFlag;
|
||||
|
@ -23,8 +23,7 @@ enum CommandFlag : unsigned long long
|
||||
TracksExistFlag = 0x00000008,
|
||||
LabelTracksExistFlag = 0x00000010,
|
||||
WaveTracksSelectedFlag = 0x00000020,
|
||||
ClipboardFlag = 0x00000040,
|
||||
TextClipFlag = 0x00000040, // Same as Clipboard flag for now.
|
||||
|
||||
UnsavedChangesFlag = 0x00000080,
|
||||
HasLastEffectFlag = 0x00000100,
|
||||
UndoAvailableFlag = 0x00000200,
|
||||
@ -32,9 +31,9 @@ enum CommandFlag : unsigned long long
|
||||
ZoomInAvailableFlag = 0x00000800,
|
||||
ZoomOutAvailableFlag = 0x00001000,
|
||||
StereoRequiredFlag = 0x00002000, //lda
|
||||
TopDockHasFocus = 0x00004000, //lll
|
||||
|
||||
TrackPanelHasFocus = 0x00008000, //lll
|
||||
BotDockHasFocus = 0x00010000, //lll
|
||||
|
||||
LabelsSelectedFlag = 0x00020000,
|
||||
AudioIOBusyFlag = 0x00040000, //lll
|
||||
PlayRegionLockedFlag = 0x00080000, //msmeyer
|
||||
@ -43,16 +42,16 @@ enum CommandFlag : unsigned long long
|
||||
WaveTracksExistFlag = 0x00400000,
|
||||
NoteTracksExistFlag = 0x00800000, //gsw
|
||||
NoteTracksSelectedFlag = 0x01000000, //gsw
|
||||
HaveRecentFiles = 0x02000000,
|
||||
|
||||
IsNotSyncLockedFlag = 0x04000000, //awd
|
||||
IsSyncLockedFlag = 0x08000000, //awd
|
||||
IsRealtimeNotActiveFlag= 0x10000000, //lll
|
||||
CaptureNotBusyFlag = 0x20000000,
|
||||
CanStopAudioStreamFlag = 0x40000000,
|
||||
RulerHasFocus = 0x80000000ULL, // prl
|
||||
|
||||
NotMinimizedFlag = 0x100000000ULL, // prl
|
||||
PausedFlag = 0x200000000ULL, // jkc
|
||||
NotPausedFlag = 0x400000000ULL, // jkc
|
||||
|
||||
HasWaveDataFlag = 0x800000000ULL, // jkc
|
||||
PlayableTracksExistFlag = 0x1000000000ULL,
|
||||
AudioTracksSelectedFlag = 0x2000000000ULL,
|
||||
|
@ -208,8 +208,7 @@ namespace TransportActions {
|
||||
// Stop playing or recording, if paused.
|
||||
void StopIfPaused( AudacityProject &project )
|
||||
{
|
||||
auto flags = MenuManager::Get( project ).GetUpdateFlags();
|
||||
if( flags & PausedFlag )
|
||||
if( AudioIOBase::Get()->IsPaused() )
|
||||
DoStop( project );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user