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