Audacity 3.2.0
Functions
CommonCommandFlags.h File Reference
#include "commands/CommandFlag.h"
Include dependency graph for CommonCommandFlags.h:

Go to the source code of this file.

Functions

AUDACITY_DLL_API bool EditableTracksSelectedPred (const AudacityProject &project)
 
AUDACITY_DLL_API bool AudioIOBusyPred (const AudacityProject &project)
 
AUDACITY_DLL_API bool TimeSelectedPred (const AudacityProject &project)
 
AUDACITY_DLL_API const CommandFlagOptionscutCopyOptions ()
 
AUDACITY_DLL_API const ReservedCommandFlagAudioIONotBusyFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagStereoRequiredFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagNoiseReductionTimeSelectedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagTimeSelectedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagWaveTracksSelectedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagTracksExistFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagEditableTracksSelectedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagAnyTracksSelectedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagTrackPanelHasFocus ()
 
AUDACITY_DLL_API const ReservedCommandFlagAudioIOBusyFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagCaptureNotBusyFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagLabelTracksExistFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagUndoAvailableFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagRedoAvailableFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagZoomInAvailableFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagZoomOutAvailableFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagWaveTracksExistFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagIsNotSyncLockedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagIsSyncLockedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagNotMinimizedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagPausedFlag ()
 
AUDACITY_DLL_API const ReservedCommandFlagNoAutoSelect ()
 

Function Documentation

◆ AnyTracksSelectedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & AnyTracksSelectedFlag ( )

◆ AudioIOBusyFlag()

AUDACITY_DLL_API const ReservedCommandFlag & AudioIOBusyFlag ( )

◆ AudioIOBusyPred()

AUDACITY_DLL_API bool AudioIOBusyPred ( const AudacityProject project)

Definition at line 60 of file CommonCommandFlags.cpp.

61{
63 ProjectAudioIO::Get( project ).GetAudioIOToken());
64};
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:93
bool IsAudioTokenActive(int token) const
Returns true if the stream is active, or even if audio I/O is busy cleaning up its data or writing to...
static ProjectAudioIO & Get(AudacityProject &project)

References AudioIOBase::Get(), ProjectAudioIO::Get(), and AudioIOBase::IsAudioTokenActive().

Referenced by AudioIOBusyFlag(), and AudioIONotBusyFlag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AudioIONotBusyFlag()

AUDACITY_DLL_API const ReservedCommandFlag & AudioIONotBusyFlag ( )

◆ CaptureNotBusyFlag()

AUDACITY_DLL_API const ReservedCommandFlag & CaptureNotBusyFlag ( )

Definition at line 213 of file CommonCommandFlags.cpp.

213 { static ReservedCommandFlag flag{
214 [](const AudacityProject &){
215 auto gAudioIO = AudioIO::Get();
216 return !(
217 gAudioIO->IsBusy() &&
218 gAudioIO->GetNumCaptureChannels() > 0
219 );
220 }
221 }; return flag; };
static std::once_flag flag
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static AudioIO * Get()
Definition: AudioIO.cpp:123

References flag, and AudioIO::Get().

Referenced by anonymous_namespace{TranscriptionToolBar.cpp}::ExtraPlayAtSpeedItems(), anonymous_namespace{TransportMenus.cpp}::ExtraSelectionItems(), anonymous_namespace{TransportMenus.cpp}::ExtraTransportMenu(), and anonymous_namespace{Scrubbing.cpp}::menuItems().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cutCopyOptions()

AUDACITY_DLL_API const CommandFlagOptions & cutCopyOptions ( )

Definition at line 73 of file CommonCommandFlags.cpp.

73 {
74static CommandFlagOptions result{
75// In reporting the issue with cut or copy, we don't tell the user they could also select some text in a label.
76 []( const TranslatableString &Name ) {
77 // PRL: These strings have hard-coded mention of a certain shortcut key,
78 // thus assuming the default shortcuts. That is questionable.
80#ifdef EXPERIMENTAL_DA
81 // i18n-hint: %s will be replaced by the name of an action, such as Normalize, Cut, Fade.
82 format = XO("You must first select some audio for '%s' to act on.\n\nCtrl + A selects all audio.");
83#else
84#ifdef __WXMAC__
85 // i18n-hint: %s will be replaced by the name of an action, such as Normalize, Cut, Fade.
86 format = XO("Select the audio for %s to use (for example, Cmd + A to Select All) then try again."
87 // No need to explain what a help button is for.
88 // "\n\nClick the Help button to learn more about selection methods."
89 );
90
91#else
92 // i18n-hint: %s will be replaced by the name of an action, such as Normalize, Cut, Fade.
93 format = XO("Select the audio for %s to use (for example, Ctrl + A to Select All) then try again."
94 // No need to explain what a help button is for.
95 // "\n\nClick the Help button to learn more about selection methods."
96 );
97#endif
98#endif
99 return format.Format( Name );
100 },
101 "Selecting_Audio_-_the_basics",
102 XO("No Audio Selected")
103};
104return result;
105}
int format
Definition: ExportPCM.cpp:53
XO("Cut/Copy/Paste")
Holds a msgid for the translation catalog; may also bind format arguments.

References format, and XO().

Referenced by anonymous_namespace{EditMenus.cpp}::CutCopyAvailableFlag(), and TimeSelectedFlag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EditableTracksSelectedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & EditableTracksSelectedFlag ( )

◆ EditableTracksSelectedPred()

AUDACITY_DLL_API bool EditableTracksSelectedPred ( const AudacityProject project)

Definition at line 45 of file CommonCommandFlags.cpp.

46{
47 auto range = TrackList::Get( project ).Selected()
48 - []( const Track *pTrack ){
49 return !pTrack->SupportsBasicEditing(); };
50 return !range.empty();
51};
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:161
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:360
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1319

References TrackList::Get(), and TrackList::Selected().

Referenced by anonymous_namespace{EditMenus.cpp}::CutCopyAvailableFlag(), and EditableTracksSelectedFlag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsNotSyncLockedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & IsNotSyncLockedFlag ( )

◆ IsSyncLockedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & IsSyncLockedFlag ( )

◆ LabelTracksExistFlag()

AUDACITY_DLL_API const ReservedCommandFlag & LabelTracksExistFlag ( )

◆ NoAutoSelect()

AUDACITY_DLL_API const ReservedCommandFlag & NoAutoSelect ( )

Definition at line 301 of file CommonCommandFlags.cpp.

301 { static ReservedCommandFlag flag{
302 [](const AudacityProject &){ return true; }
303 }; return flag; } // jkc

References flag.

Referenced by anonymous_namespace{EditMenus.cpp}::EditMenu(), and anonymous_namespace{EditMenus.cpp}::ExtraEditMenu().

Here is the caller graph for this function:

◆ NoiseReductionTimeSelectedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & NoiseReductionTimeSelectedFlag ( )

◆ NotMinimizedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & NotMinimizedFlag ( )

◆ PausedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & PausedFlag ( )

◆ RedoAvailableFlag()

AUDACITY_DLL_API const ReservedCommandFlag & RedoAvailableFlag ( )

◆ StereoRequiredFlag()

AUDACITY_DLL_API const ReservedCommandFlag & StereoRequiredFlag ( )

◆ TimeSelectedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & TimeSelectedFlag ( )

◆ TimeSelectedPred()

AUDACITY_DLL_API bool TimeSelectedPred ( const AudacityProject project)

Definition at line 66 of file CommonCommandFlags.cpp.

67{
68 // This is equivalent to check if there is a valid selection,
69 // so it's used for Zoom to Selection too
70 return !ViewInfo::Get( project ).selectedRegion.isPoint();
71};
bool isPoint() const
Definition: ViewInfo.h:40
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:219
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References ViewInfo::Get(), NotifyingSelectedRegion::isPoint(), and ViewInfo::selectedRegion.

Referenced by anonymous_namespace{EditMenus.cpp}::CutCopyAvailableFlag(), NoiseReductionTimeSelectedFlag(), and TimeSelectedFlag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TrackPanelHasFocus()

AUDACITY_DLL_API const ReservedCommandFlag & TrackPanelHasFocus ( )

Definition at line 196 of file CommonCommandFlags.cpp.

196 { static ReservedCommandFlag flag{
197 [](const AudacityProject &project){
198 for (auto w = wxWindow::FindFocus(); w; w = w->GetParent()) {
199 if (dynamic_cast<const NonKeystrokeInterceptingWindow*>(w))
200 return true;
201 }
202 return false;
203 },
205 }; return flag; }; //lll
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:343
CommandFlagOptions && DisableDefaultMessage() &&
Definition: CommandFlag.h:53

References CommandFlagOptions::DisableDefaultMessage(), BasicUI::FindFocus(), and flag.

Referenced by anonymous_namespace{SelectMenus.cpp}::ExtraCursorMenu(), anonymous_namespace{NavigationMenus.cpp}::ExtraFocusMenu(), anonymous_namespace{TransportMenus.cpp}::ExtraSelectionItems(), anonymous_namespace{SelectMenus.cpp}::ExtraSelectionMenu(), anonymous_namespace{ClipMenus.cpp}::ExtraTimeShiftItems(), and anonymous_namespace{TrackMenus.cpp}::ExtraTrackMenu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TracksExistFlag()

AUDACITY_DLL_API const ReservedCommandFlag & TracksExistFlag ( )

◆ UndoAvailableFlag()

AUDACITY_DLL_API const ReservedCommandFlag & UndoAvailableFlag ( )

◆ WaveTracksExistFlag()

AUDACITY_DLL_API const ReservedCommandFlag & WaveTracksExistFlag ( )

◆ WaveTracksSelectedFlag()

AUDACITY_DLL_API const ReservedCommandFlag & WaveTracksSelectedFlag ( )

◆ ZoomInAvailableFlag()

AUDACITY_DLL_API const ReservedCommandFlag & ZoomInAvailableFlag ( )

◆ ZoomOutAvailableFlag()

AUDACITY_DLL_API const ReservedCommandFlag & ZoomOutAvailableFlag ( )