Audacity 3.2.0
Functions
CommonCommandFlags.h File Reference
#include "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};
const auto project
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:94
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 204 of file CommonCommandFlags.cpp.

204 { static ReservedCommandFlag flag{
205 [](const AudacityProject &){
206 auto gAudioIO = AudioIO::Get();
207 return !(
208 gAudioIO->IsBusy() &&
209 gAudioIO->GetNumCaptureChannels() > 0
210 );
211 }
212 }; 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(), anonymous_namespace{Scrubbing.cpp}::KeyboardScrubbingItems(), 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 __WXMAC__
81 // i18n-hint: %s will be replaced by the name of an action, such as Normalize, Cut, Fade.
82 format = XO("Select the audio for %s to use (for example, Cmd + A to Select All) then try again."
83 );
84
85#else
86 // i18n-hint: %s will be replaced by the name of an action, such as Normalize, Cut, Fade.
87 format = XO("Select the audio for %s to use (for example, Ctrl + A to Select All) then try again."
88 );
89#endif
90 return format.Format( Name );
91 },
92 "Selecting_Audio_-_the_basics",
93 XO("No Audio Selected")
94};
95return result;
96}
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:110
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:967

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

293 { static ReservedCommandFlag flag{
294 [](const AudacityProject &){ return true; }
295 }; 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 187 of file CommonCommandFlags.cpp.

187 { static ReservedCommandFlag flag{
188 [](const AudacityProject &project){
189 for (auto w = wxWindow::FindFocus(); w; w = w->GetParent()) {
190 if (dynamic_cast<const NonKeystrokeInterceptingWindow*>(w))
191 return true;
192 }
193 return false;
194 },
196 }; return flag; }; //lll
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:375
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 ( )