Audacity  3.0.3
Functions
CommonCommandFlags.h File Reference
#include "commands/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 ReservedCommandFlagUnsavedChangesFlag ()
 
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 };

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; };

References flag, and AudioIO::Get().

Referenced by anonymous_namespace{TransportMenus.cpp}::ExtraPlayAtSpeedMenu(), 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  {
74 static 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 };
104 return result;
105 }

References format, and XO.

Referenced by CutCopyAvailableFlag(), and TimeSelectedFlag().

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 };

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

Referenced by 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 312 of file CommonCommandFlags.cpp.

312  { static ReservedCommandFlag flag{
313  [](const AudacityProject &){ return true; }
314  }; 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 };

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

Referenced by 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

References CommandFlagOptions::DisableDefaultMessage(), 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 ( )

◆ UnsavedChangesFlag()

AUDACITY_DLL_API const ReservedCommandFlag & UnsavedChangesFlag ( )

◆ 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 ( )
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:241
CommandFlagOptions::DisableDefaultMessage
CommandFlagOptions && DisableDefaultMessage() &&
Definition: CommandFlag.h:54
flag
static std::once_flag flag
Definition: WaveformView.cpp:1119
ReservedCommandFlag
Definition: CommandFlag.h:89
XO
#define XO(s)
Definition: Internat.h:31
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
format
int format
Definition: ExportPCM.cpp:56
AudioIOBase::Get
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:89
CommandFlagOptions
Definition: CommandFlag.h:38
AudioIOBase::IsAudioTokenActive
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...
Definition: AudioIOBase.cpp:358
NonKeystrokeInterceptingWindow
Definition: CommandManagerWindowClasses.h:20
TrackList::Get
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:506
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
NotifyingSelectedRegion::isPoint
bool isPoint() const
Definition: ViewInfo.h:52
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
TrackList::Selected
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1388