Audacity  3.0.3
Functions | Variables
CommonCommandFlags.cpp File Reference
#include "CommonCommandFlags.h"
#include <wx/frame.h>
#include "AudioIO.h"
#include "Menus.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectFileIO.h"
#include "ProjectHistory.h"
#include "ProjectSettings.h"
#include "ProjectWindows.h"
#include "UndoManager.h"
#include "ViewInfo.h"
#include "WaveTrack.h"
#include "commands/CommandManagerWindowClasses.h"
Include dependency graph for CommonCommandFlags.cpp:

Go to the source code of this file.

Functions

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

Variables

const CommandFlagOptions noiseReductionOptions
 

Function Documentation

◆ AnyTracksSelectedFlag()

const ReservedCommandFlag& AnyTracksSelectedFlag ( )

Definition at line 188 of file CommonCommandFlags.cpp.

188  { static ReservedCommandFlag flag{
190  { []( const TranslatableString &Name ){ return
191  // i18n-hint: %s will be replaced by the name of an action, such as "Remove Tracks".
192  XO("\"%s\" requires one or more tracks to be selected.").Format( Name );
193  },"Audacity_Selection" }
194  }; return flag; }

References AnyTracksSelectedPred(), flag, and XO.

Referenced by anonymous_namespace{TrackMenus.cpp}::TracksMenu().

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

◆ AnyTracksSelectedPred()

bool AnyTracksSelectedPred ( const AudacityProject project)

Definition at line 54 of file CommonCommandFlags.cpp.

55 {
56  auto range = TrackList::Get( project ).Selected();
57  return !range.empty();
58 };

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

Referenced by AnyTracksSelectedFlag().

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

◆ AudioIOBusyFlag()

const ReservedCommandFlag& AudioIOBusyFlag ( )

Definition at line 208 of file CommonCommandFlags.cpp.

208  { static ReservedCommandFlag flag{
211  }; return flag; } //lll

References AudioIOBusyPred(), flag, and CommandFlagOptions::QuickTest().

Referenced by anonymous_namespace{SelectMenus.cpp}::ExtraSeekMenu(), anonymous_namespace{TransportMenus.cpp}::ExtraTransportMenu(), and anonymous_namespace{LabelMenus.cpp}::LabelEditMenus().

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

◆ AudioIOBusyPred()

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

const ReservedCommandFlag& AudioIONotBusyFlag ( )

Definition at line 127 of file CommonCommandFlags.cpp.

127  { static ReservedCommandFlag flag{
128  [](const AudacityProject &project ){
129  return !AudioIOBusyPred( project );
130  },
131  CommandFlagOptions{ []( const TranslatableString& ) { return
132  // This reason will not be shown, because options that require it will be greyed out.
133  XO("You can only do this when playing and recording are\nstopped. (Pausing is not sufficient.)");
134  } ,"FAQ:Errors:Audio Must Be Stopped"}
135  .QuickTest()
136  .Priority( 1 )
137  }; return flag; }//lll

References AudioIOBusyPred(), flag, and XO.

Referenced by anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu(), anonymous_namespace{SelectMenus.cpp}::CursorMenu(), ProjectAudioManager::DoRecord(), anonymous_namespace{EditMenus.cpp}::EditMenu(), anonymous_namespace{PluginMenus.cpp}::EffectMenu(), anonymous_namespace{ExtraMenus.cpp}::ExtraDeviceMenu(), anonymous_namespace{EditMenus.cpp}::ExtraEditMenu(), anonymous_namespace{PluginMenus.cpp}::ExtraScriptablesIIMenu(), anonymous_namespace{PluginMenus.cpp}::ExtraScriptablesIMenu(), anonymous_namespace{TrackMenus.cpp}::ExtraTrackMenu(), anonymous_namespace{TransportMenus.cpp}::ExtraTransportMenu(), anonymous_namespace{FileMenus.cpp}::FileMenu(), anonymous_namespace{PluginMenus.cpp}::GenerateMenu(), anonymous_namespace{HelpMenus.cpp}::HelpMenu(), anonymous_namespace{FileMenus.cpp}::HiddenFileMenu(), anonymous_namespace{LabelMenus.cpp}::LabelEditMenus(), DEFINE_VERSION_CHECK::RegisterMenuItems(), anonymous_namespace{NyqBench.cpp}::RegisterMenuItems(), anonymous_namespace{PluginMenus.cpp}::ToolsMenu(), anonymous_namespace{TrackMenus.cpp}::TracksMenu(), and anonymous_namespace{TransportMenus.cpp}::TransportMenu().

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

◆ CaptureNotBusyFlag()

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

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

const ReservedCommandFlag& EditableTracksSelectedFlag ( )

Definition at line 180 of file CommonCommandFlags.cpp.

180  { static ReservedCommandFlag flag{
182  { []( const TranslatableString &Name ){ return
183  // i18n-hint: %s will be replaced by the name of an action, such as "Remove Tracks".
184  XO("\"%s\" requires one or more tracks to be selected.").Format( Name );
185  },"Audacity_Selection" }
186  }; return flag; }

References EditableTracksSelectedPred(), flag, and XO.

Referenced by anonymous_namespace{SelectMenus.cpp}::CursorMenu(), anonymous_namespace{EditMenus.cpp}::EditMenu(), anonymous_namespace{EditMenus.cpp}::ExtraEditMenu(), SelectUtilities::SelectAllIfNone(), SelectUtilities::SelectAllIfNoneAndAllowed(), anonymous_namespace{SelectMenus.cpp}::SelectMenu(), and anonymous_namespace{TrackMenus.cpp}::TracksMenu().

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

◆ EditableTracksSelectedPred()

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

const ReservedCommandFlag& IsNotSyncLockedFlag ( )

Definition at line 279 of file CommonCommandFlags.cpp.

279  { static ReservedCommandFlag flag{
280  [](const AudacityProject &project){
281  return !ProjectSettings::Get( project ).IsSyncLocked();
282  }
283  }; return flag; } //awd

References flag, ProjectSettings::Get(), and ProjectSettings::IsSyncLocked().

Here is the call graph for this function:

◆ IsSyncLockedFlag()

const ReservedCommandFlag& IsSyncLockedFlag ( )

Definition at line 285 of file CommonCommandFlags.cpp.

285  { static ReservedCommandFlag flag{
286  [](const AudacityProject &project){
287  return ProjectSettings::Get( project ).IsSyncLocked();
288  }
289  }; return flag; } //awd

References flag, ProjectSettings::Get(), and ProjectSettings::IsSyncLocked().

Referenced by anonymous_namespace{SelectMenus.cpp}::SelectMenu().

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

◆ LabelTracksExistFlag()

const ReservedCommandFlag& LabelTracksExistFlag ( )

Definition at line 224 of file CommonCommandFlags.cpp.

224  { static ReservedCommandFlag flag{
225  [](const AudacityProject &project){
226  return !TrackList::Get( project ).Any<const LabelTrack>().empty();
227  }
228  }; return flag; }

References TrackList::Any(), flag, and TrackList::Get().

Referenced by anonymous_namespace{FileMenus.cpp}::FileMenu().

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

◆ NoAutoSelect()

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

const ReservedCommandFlag& NoiseReductionTimeSelectedFlag ( )

Definition at line 154 of file CommonCommandFlags.cpp.

154  { static ReservedCommandFlag flag{
157  }; return flag; }

References flag, noiseReductionOptions, and TimeSelectedPred().

Referenced by anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItems().

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

◆ NotMinimizedFlag()

const ReservedCommandFlag& NotMinimizedFlag ( )

Definition at line 291 of file CommonCommandFlags.cpp.

291  { static ReservedCommandFlag flag{
292  [](const AudacityProject &project){
293  const wxWindow *focus = FindProjectFrame( &project );
294  if (focus) {
295  while (focus && focus->GetParent())
296  focus = focus->GetParent();
297  }
298  return (focus &&
299  !static_cast<const wxTopLevelWindow*>(focus)->IsIconized()
300  );
301  },
303  }; return flag; } // prl

References FindProjectFrame(), flag, and CommandFlagOptions::QuickTest().

Here is the call graph for this function:

◆ PausedFlag()

const ReservedCommandFlag& PausedFlag ( )

Definition at line 305 of file CommonCommandFlags.cpp.

305  { static ReservedCommandFlag flag{
306  [](const AudacityProject&){
307  return AudioIOBase::Get()->IsPaused();
308  },
310  }; return flag; }

References flag, AudioIOBase::Get(), AudioIOBase::IsPaused(), and CommandFlagOptions::QuickTest().

Here is the call graph for this function:

◆ RedoAvailableFlag()

const ReservedCommandFlag& RedoAvailableFlag ( )

Definition at line 247 of file CommonCommandFlags.cpp.

247  { static ReservedCommandFlag flag{
248  [](const AudacityProject &project){
249  return ProjectHistory::Get( project ).RedoAvailable();
250  }
251  }; return flag; }

References flag, ProjectHistory::Get(), and ProjectHistory::RedoAvailable().

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

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

◆ StereoRequiredFlag()

const ReservedCommandFlag& StereoRequiredFlag ( )

Definition at line 139 of file CommonCommandFlags.cpp.

139  { static ReservedCommandFlag flag{
140  [](const AudacityProject &project){
141  // True iff at least one stereo track is selected, i.e., at least
142  // one right channel is selected.
143  // TODO: more-than-two-channels
144  auto range = TrackList::Get( project ).Selected<const WaveTrack>()
145  - &Track::IsLeader;
146  return !range.empty();
147  },
148  { []( const TranslatableString& ) { return
149  // This reason will not be shown, because the stereo-to-mono is greyed out if not allowed.
150  XO("You must first select some stereo audio to perform this\naction. (You cannot use this with mono.)");
151  } ,"Audacity_Selection"}
152  }; return flag; } //lda

References flag, TrackList::Get(), Track::IsLeader(), TrackList::Selected(), and XO.

Referenced by anonymous_namespace{TrackMenus.cpp}::TracksMenu().

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

◆ TimeSelectedFlag()

const ReservedCommandFlag& TimeSelectedFlag ( )

Definition at line 159 of file CommonCommandFlags.cpp.

159  { static ReservedCommandFlag flag{
162  }; return flag; }

References cutCopyOptions(), flag, and TimeSelectedPred().

Referenced by anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItems(), anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu(), anonymous_namespace{SelectMenus.cpp}::CursorMenu(), anonymous_namespace{EditMenus.cpp}::EditMenu(), anonymous_namespace{PluginMenus.cpp}::EffectMenu(), anonymous_namespace{EditMenus.cpp}::ExtraEditMenu(), anonymous_namespace{FileMenus.cpp}::FileMenu(), anonymous_namespace{LabelMenus.cpp}::LabelEditMenus(), EffectUIHost::OnApply(), and anonymous_namespace{ViewMenus.cpp}::ViewMenu().

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

◆ TimeSelectedPred()

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

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

const ReservedCommandFlag& TracksExistFlag ( )

Definition at line 173 of file CommonCommandFlags.cpp.

173  { static ReservedCommandFlag flag{
174  [](const AudacityProject &project){
175  return !TrackList::Get( project ).Any().empty();
176  },
178  }; return flag; }

References TrackList::Any(), CommandFlagOptions::DisableDefaultMessage(), flag, and TrackList::Get().

Referenced by anonymous_namespace{SelectMenus.cpp}::ExtraCursorMenu(), anonymous_namespace{NavigationMenus.cpp}::ExtraFocusMenu(), anonymous_namespace{SelectMenus.cpp}::ExtraSelectionMenu(), anonymous_namespace{ClipMenus.cpp}::ExtraTimeShiftItems(), anonymous_namespace{TrackMenus.cpp}::ExtraTrackMenu(), anonymous_namespace{FileMenus.cpp}::FileMenu(), anonymous_namespace{SelectMenus.cpp}::SelectMenu(), anonymous_namespace{TrackMenus.cpp}::TracksMenu(), and anonymous_namespace{ViewMenus.cpp}::ViewMenu().

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

◆ UndoAvailableFlag()

const ReservedCommandFlag& UndoAvailableFlag ( )

Definition at line 241 of file CommonCommandFlags.cpp.

241  { static ReservedCommandFlag flag{
242  [](const AudacityProject &project){
243  return ProjectHistory::Get( project ).UndoAvailable();
244  }
245  }; return flag; }

References flag, ProjectHistory::Get(), and ProjectHistory::UndoAvailable().

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

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

◆ UnsavedChangesFlag()

const ReservedCommandFlag& UnsavedChangesFlag ( )

Definition at line 230 of file CommonCommandFlags.cpp.

230  { static ReservedCommandFlag flag{
231  [](const AudacityProject &project){
232  auto &undoManager = UndoManager::Get( project );
233  return
234  undoManager.UnsavedChanges()
235  ||
236  ProjectFileIO::Get( project ).IsModified()
237  ;
238  }
239  }; return flag; }

References flag, ProjectFileIO::Get(), UndoManager::Get(), and ProjectFileIO::IsModified().

Here is the call graph for this function:

◆ WaveTracksExistFlag()

const ReservedCommandFlag& WaveTracksExistFlag ( )

Definition at line 273 of file CommonCommandFlags.cpp.

273  { static ReservedCommandFlag flag{
274  [](const AudacityProject &project){
275  return !TrackList::Get( project ).Any<const WaveTrack>().empty();
276  }
277  }; return flag; }

References TrackList::Any(), flag, and TrackList::Get().

Referenced by anonymous_namespace{ClipMenus.cpp}::ClipCursorItems(), anonymous_namespace{ClipMenus.cpp}::ClipSelectMenu(), anonymous_namespace{TransportMenus.cpp}::ExtraTransportMenu(), anonymous_namespace{FileMenus.cpp}::FileMenu(), anonymous_namespace{LabelMenus.cpp}::LabelEditMenus(), anonymous_namespace{SelectMenus.cpp}::SelectMenu(), and anonymous_namespace{TransportMenus.cpp}::TransportMenu().

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

◆ WaveTracksSelectedFlag()

const ReservedCommandFlag& WaveTracksSelectedFlag ( )

Definition at line 164 of file CommonCommandFlags.cpp.

164  { static ReservedCommandFlag flag{
165  [](const AudacityProject &project){
166  return !TrackList::Get( project ).Selected<const WaveTrack>().empty();
167  },
168  { []( const TranslatableString& ) { return
169  XO("You must first select some audio to perform this action.\n(Selecting other kinds of track won't work.)");
170  } ,"Audacity_Selection"}
171  }; return flag; }

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

Referenced by anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu(), anonymous_namespace{EditMenus.cpp}::EditMenu(), anonymous_namespace{PluginMenus.cpp}::EffectMenu(), anonymous_namespace{FileMenus.cpp}::FileMenu(), EffectUIHost::OnApply(), anonymous_namespace{SelectMenus.cpp}::SelectMenu(), and anonymous_namespace{TrackMenus.cpp}::TracksMenu().

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

◆ ZoomInAvailableFlag()

const ReservedCommandFlag& ZoomInAvailableFlag ( )

Definition at line 253 of file CommonCommandFlags.cpp.

253  { static ReservedCommandFlag flag{
254  [](const AudacityProject &project){
255  return
256  ViewInfo::Get( project ).ZoomInAvailable()
257  &&
258  !TrackList::Get( project ).Any().empty()
259  ;
260  }
261  }; return flag; }

References TrackList::Any(), flag, ViewInfo::Get(), TrackList::Get(), and ZoomInfo::ZoomInAvailable().

Referenced by anonymous_namespace{ViewMenus.cpp}::ViewMenu().

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

◆ ZoomOutAvailableFlag()

const ReservedCommandFlag& ZoomOutAvailableFlag ( )

Definition at line 263 of file CommonCommandFlags.cpp.

263  { static ReservedCommandFlag flag{
264  [](const AudacityProject &project){
265  return
266  ViewInfo::Get( project ).ZoomOutAvailable()
267  &&
268  !TrackList::Get( project ).Any().empty()
269  ;
270  }
271  }; return flag; }

References TrackList::Any(), flag, ViewInfo::Get(), TrackList::Get(), and ZoomInfo::ZoomOutAvailable().

Referenced by anonymous_namespace{ViewMenus.cpp}::ViewMenu().

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

Variable Documentation

◆ noiseReductionOptions

const CommandFlagOptions noiseReductionOptions
Initial value:
{
[]( const TranslatableString &Name ) {
auto format = XO("Select the audio for %s to use.\n\n1. Select audio that represents noise and use %s to get your 'noise profile'.\n\n2. When you have got your noise profile, select the audio you want to change\nand use %s to change that audio.");
return format.Format( Name, Name, Name );
},
"Noise_Reduction",
}

Definition at line 108 of file CommonCommandFlags.cpp.

Referenced by NoiseReductionTimeSelectedFlag().

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
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
flag
static std::once_flag flag
Definition: WaveformView.cpp:1119
AudioIOBusyPred
bool AudioIOBusyPred(const AudacityProject &project)
Definition: CommonCommandFlags.cpp:60
ReservedCommandFlag
Definition: CommandFlag.h:89
XO
#define XO(s)
Definition: Internat.h:31
ProjectFileIO::Get
static ProjectFileIO & Get(AudacityProject &project)
Definition: ProjectFileIO.cpp:266
ProjectSettings::Get
static ProjectSettings & Get(AudacityProject &project)
Definition: ProjectSettings.cpp:44
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
ProjectHistory::UndoAvailable
bool UndoAvailable() const
Definition: ProjectHistory.cpp:59
AudioIOBase::IsPaused
bool IsPaused() const
Find out if playback / recording is currently paused.
Definition: AudioIOBase.cpp:327
cutCopyOptions
const CommandFlagOptions & cutCopyOptions()
Definition: CommonCommandFlags.cpp:73
ProjectSettings::IsSyncLocked
bool IsSyncLocked() const
Definition: ProjectSettings.cpp:179
ProjectHistory::RedoAvailable
bool RedoAvailable() const
Definition: ProjectHistory.cpp:68
ZoomInfo::ZoomInAvailable
bool ZoomInAvailable() const
Definition: ZoomInfo.cpp:70
CommandFlagOptions::QuickTest
CommandFlagOptions && QuickTest() &&
Definition: CommandFlag.h:52
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
noiseReductionOptions
const CommandFlagOptions noiseReductionOptions
Definition: CommonCommandFlags.cpp:108
ZoomInfo::ZoomOutAvailable
bool ZoomOutAvailable() const
Definition: ZoomInfo.cpp:75
format
int format
Definition: ExportPCM.cpp:56
AudioIOBase::Get
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:89
EditableTracksSelectedPred
bool EditableTracksSelectedPred(const AudacityProject &project)
Definition: CommonCommandFlags.cpp:45
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
Track::IsLeader
bool IsLeader() const
Definition: Track.cpp:379
UndoManager::Get
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:57
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
FindProjectFrame
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
Definition: ProjectWindows.cpp:88
TimeSelectedPred
bool TimeSelectedPred(const AudacityProject &project)
Definition: CommonCommandFlags.cpp:66
NotifyingSelectedRegion::isPoint
bool isPoint() const
Definition: ViewInfo.h:52
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1371
ProjectFileIO::IsModified
bool IsModified() const
Definition: ProjectFileIO.cpp:2211
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:141
TrackList::Selected
auto Selected() -> TrackIterRange< TrackType >
Definition: Track.h:1388
AnyTracksSelectedPred
bool AnyTracksSelectedPred(const AudacityProject &project)
Definition: CommonCommandFlags.cpp:54
ProjectHistory::Get
static ProjectHistory & Get(AudacityProject &project)
Definition: ProjectHistory.cpp:26