Audacity 3.2.0
Functions
CommonCommandFlags.h File Reference
#include "CommandFlag.h"
Include dependency graph for CommonCommandFlags.h:
This graph shows which files directly or indirectly include this file:

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};
const auto project
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(), AudioIOBase::IsAudioTokenActive(), and project.

Referenced by AudioIOBusyFlag(), AudioIONotBusyFlag(), and anonymous_namespace{EditMenus.cpp}::JoinClipsAvailableFlag().

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 209 of file CommonCommandFlags.cpp.

209 { static ReservedCommandFlag flag{
210 [](const AudacityProject &){
211 auto gAudioIO = AudioIO::Get();
212 return !(
213 gAudioIO->IsBusy() &&
214 gAudioIO->GetNumCaptureChannels() > 0
215 );
216 }
217 }; 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:126

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 );
88
89#else
90 // i18n-hint: %s will be replaced by the name of an action, such as Normalize, Cut, Fade.
91 format = XO("Select the audio for %s to use (for example, Ctrl + A to Select All) then try again."
92 );
93#endif
94#endif
95 return format.Format( Name );
96 },
97 "Selecting_Audio_-_the_basics",
98 XO("No Audio Selected")
99};
100return result;
101}
XO("Cut/Copy/Paste")
Holds a msgid for the translation catalog; may also bind format arguments.

References anonymous_namespace{ExportPCM.cpp}::format, and XO().

Referenced by 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:122
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:347
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1096

References TrackList::Get(), project, 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 298 of file CommonCommandFlags.cpp.

298 { static ReservedCommandFlag flag{
299 [](const AudacityProject &){ return true; }
300 }; 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
71};
bool isPoint() const
Definition: ViewInfo.h:40
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:215
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References ViewInfo::Get(), NotifyingSelectedRegion::isPoint(), project, 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 192 of file CommonCommandFlags.cpp.

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

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

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 ( )