Audacity 3.2.0
Functions | Variables
anonymous_namespace{PluginMenus.cpp} Namespace Reference

Functions

bool ShowManager (wxWindow *parent, int effectsCategory)
 
void DoManagePluginsMenu (AudacityProject &project, int effectsCategory)
 
void DoManageRealtimeEffectsSidePanel (AudacityProject &project)
 
void OnResetConfig (const CommandContext &context)
 
void OnManageGenerators (const CommandContext &context)
 
void OnEffect (const CommandContext &context)
 
void OnManageEffects (const CommandContext &context)
 
void OnAddRealtimeEffects (const CommandContext &context)
 
void OnAnalyzer2 (wxCommandEvent &evt)
 
void OnRepeatLastGenerator (const CommandContext &context)
 
void OnRepeatLastEffect (const CommandContext &context)
 
void OnRepeatLastAnalyzer (const CommandContext &context)
 
void OnManageAnalyzers (const CommandContext &context)
 
void OnManageTools (const CommandContext &context)
 
void OnBenchmark (const CommandContext &context)
 
void OnSimulateRecordingErrors (const CommandContext &context)
 
void OnDetectUpstreamDropouts (const CommandContext &context)
 
void OnWriteJournal (const CommandContext &)
 
const ReservedCommandFlagHasLastGeneratorFlag ()
 
auto GenerateMenu ()
 
static const ReservedCommandFlagIsRealtimeNotActiveFlag ()
 
const ReservedCommandFlagHasLastEffectFlag ()
 
static const ReservedCommandFlagHasTrackFocusFlag ()
 
auto EffectMenu ()
 
const ReservedCommandFlagHasLastAnalyzerFlag ()
 
auto AnalyzeMenu ()
 
auto ToolsMenu ()
 

Variables

AttachedItem sAttachment1 { Indirect(GenerateMenu()) }
 
AttachedItem sAttachment2 { Indirect(EffectMenu()) }
 
AttachedItem sAttachment3 { Indirect(AnalyzeMenu()) }
 
AttachedItem sAttachment4 { Indirect(ToolsMenu()) }
 

Function Documentation

◆ AnalyzeMenu()

auto anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu ( )

Definition at line 411 of file PluginMenus.cpp.

412{
413 // All of this is a bit hacky until we can get more things connected into
414 // the plugin manager...sorry! :-(
415 static auto menu = std::shared_ptr{
416 Menu( wxT("Analyze"), XXO("&Analyze"),
417 Section( "Manage",
418 Command( wxT("ManageAnalyzers"), XXO("Plugin Manager"),
420 ),
421
422 Section("RepeatLast",
423 // Delayed evaluation:
425 {
426 const auto &lastAnalyzer =
428 TranslatableString buildMenuLabel;
429 if (!lastAnalyzer.empty())
430 buildMenuLabel = XO("Repeat %s")
431 .Format(EffectManager::Get().GetCommandName(lastAnalyzer));
432 else
433 buildMenuLabel = XO("Repeat Last Analyzer");
434
435 return Command(wxT("RepeatLastAnalyzer"), buildMenuLabel,
439 Options{}.IsGlobal());
440 }
441 ),
442
443 Section( "Analyzers",
444 Items( "Windows" ),
445
446 // Delayed evaluation:
447 [](AudacityProject &) {
448 auto result = Items("");
450 *result,
454 &OnEffect);
455 return result;
456 }
457 )
458 ) };
459 return menu;
460}
wxT("CloseDown"))
const ReservedCommandFlag & AudioIONotBusyFlag()
const ReservedCommandFlag & TimeSelectedFlag()
const ReservedCommandFlag & WaveTracksSelectedFlag()
@ EffectTypeAnalyze
ChoiceSetting EffectsGroupBy
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
wxString Read() const
Definition: Prefs.cpp:388
static CommandManager & Get(AudacityProject &project)
PluginID mLastAnalyzer
static EffectManager & Get()
Holds a msgid for the translation catalog; may also bind format arguments.
void PopulateEffectsMenu(Group &menuItems, EffectType type, CommandFlag batchflags, const wxString &groupby, void(*onMenuCommand)(const CommandContext &), std::function< bool(const PluginDescriptor &)> pred={})
Definition: MenuHelper.cpp:563
constexpr auto Section
Definition: MenuRegistry.h:436
constexpr auto Items
Definition: MenuRegistry.h:427
constexpr auto Command
Definition: MenuRegistry.h:456
constexpr auto Menu
Items will appear in a main toolbar menu or in a sub-menu.
Definition: MenuRegistry.h:445
const ReservedCommandFlag & HasLastAnalyzerFlag()
void OnRepeatLastAnalyzer(const CommandContext &context)
void OnEffect(const CommandContext &context)
void OnManageAnalyzers(const CommandContext &context)
Options && IsGlobal() &&
Definition: MenuRegistry.h:56

References AudioIONotBusyFlag(), MenuRegistry::Command, EffectsGroupBy, EffectTypeAnalyze, EffectManager::Get(), CommandManager::Get(), HasLastAnalyzerFlag(), MenuRegistry::Options::IsGlobal(), MenuRegistry::Items, MenuRegistry::Menu, CommandManager::mLastAnalyzer, OnEffect(), OnManageAnalyzers(), OnRepeatLastAnalyzer(), MenuHelper::PopulateEffectsMenu(), project, ChoiceSetting::Read(), MenuRegistry::Section, TimeSelectedFlag(), WaveTracksSelectedFlag(), wxT(), XO(), and XXO().

Here is the call graph for this function:

◆ DoManagePluginsMenu()

void anonymous_namespace{PluginMenus.cpp}::DoManagePluginsMenu ( AudacityProject project,
int  effectsCategory 
)

Definition at line 43 of file PluginMenus.cpp.

44{
45 auto &window = GetProjectFrame( project );
46 auto &pm = PluginManager::Get();
47 if (ShowManager(&window, effectsCategory))
49}
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
static void RebuildAllMenuBars()
static PluginManager & Get()
bool ShowManager(wxWindow *parent, int effectsCategory)
Definition: PluginMenus.cpp:37

References PluginManager::Get(), GetProjectFrame(), project, MenuCreator::RebuildAllMenuBars(), and ShowManager().

Referenced by OnManageAnalyzers(), OnManageEffects(), OnManageGenerators(), and OnManageTools().

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

◆ DoManageRealtimeEffectsSidePanel()

void anonymous_namespace{PluginMenus.cpp}::DoManageRealtimeEffectsSidePanel ( AudacityProject project)

Definition at line 51 of file PluginMenus.cpp.

52{
53 auto &trackFocus = TrackFocus::Get(project);
54 auto &panel = RealtimeEffectPanel::Get(project);
55 if (panel.IsShown())
56 panel.HidePanel();
57 else if (auto pTrack = dynamic_cast<SampleTrack *>(trackFocus.Get()))
58 panel.ShowPanel(pTrack, true);
59}
static RealtimeEffectPanel & Get(AudacityProject &project)
Track * Get()
Definition: TrackFocus.cpp:156

References TrackFocus::Get(), RealtimeEffectPanel::Get(), and project.

Referenced by OnAddRealtimeEffects().

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

◆ EffectMenu()

auto anonymous_namespace{PluginMenus.cpp}::EffectMenu ( )

Definition at line 345 of file PluginMenus.cpp.

346{
347 // All of this is a bit hacky until we can get more things connected into
348 // the plugin manager...sorry! :-(
349 static auto menu = std::shared_ptr{
350 Menu( wxT("Effect"), XXO("Effe&ct"),
351 Section( "Manage",
352 Command( wxT("ManageEffects"), XXO("Plugin Manager"),
354 ),
355
356 Section( "RealtimeEffects",
357 Command ( wxT("AddRealtimeEffects"), XXO("Add Realtime Effects"),
359 ),
360
361 Section( "RepeatLast",
362 // Delayed evaluation:
364 {
365 const auto &lastEffect = CommandManager::Get(project).mLastEffect;
366 TranslatableString buildMenuLabel;
367 if (!lastEffect.empty())
368 buildMenuLabel = XO("Repeat %s")
369 .Format( EffectManager::Get().GetCommandName(lastEffect) );
370 else
371 buildMenuLabel = XO("Repeat Last Effect");
372
373 return Command( wxT("RepeatLastEffect"), buildMenuLabel,
377 wxT("Ctrl+R") );
378 }
379 ),
380
381 Section( "Effects",
382 // Delayed evaluation:
383 [](AudacityProject &) {
384 auto result = Items("");
386 *result,
390 &OnEffect);
391 return result;
392 }
393 )
394 ) };
395 return menu;
396}
@ EffectTypeProcess
PluginID mLastEffect
void OnRepeatLastEffect(const CommandContext &context)
const ReservedCommandFlag & HasLastEffectFlag()
static const ReservedCommandFlag & HasTrackFocusFlag()
void OnManageEffects(const CommandContext &context)
void OnAddRealtimeEffects(const CommandContext &context)

References AudioIONotBusyFlag(), MenuRegistry::Command, EffectsGroupBy, EffectTypeProcess, EffectManager::Get(), CommandManager::Get(), HasLastEffectFlag(), HasTrackFocusFlag(), MenuRegistry::Items, MenuRegistry::Menu, CommandManager::mLastEffect, OnAddRealtimeEffects(), OnEffect(), OnManageEffects(), OnRepeatLastEffect(), MenuHelper::PopulateEffectsMenu(), project, ChoiceSetting::Read(), MenuRegistry::Section, TimeSelectedFlag(), WaveTracksSelectedFlag(), wxT(), XO(), and XXO().

Here is the call graph for this function:

◆ GenerateMenu()

auto anonymous_namespace{PluginMenus.cpp}::GenerateMenu ( )

Definition at line 269 of file PluginMenus.cpp.

270{
271 // All of this is a bit hacky until we can get more things connected into
272 // the plugin manager...sorry! :-(
273 static auto menu = std::shared_ptr{
274 Menu( wxT("Generate"), XXO("&Generate"),
275 Section( "Manage",
276 Command( wxT("ManageGenerators"), XXO("Plugin Manager"),
278 ),
279
280 Section("RepeatLast",
281 // Delayed evaluation:
283 {
284 const auto &lastGenerator =
286 TranslatableString buildMenuLabel;
287 if (!lastGenerator.empty())
288 buildMenuLabel = XO("Repeat %s")
289 .Format(EffectManager::Get().GetCommandName(lastGenerator));
290 else
291 buildMenuLabel = XO("Repeat Last Generator");
292
293 return Command(wxT("RepeatLastGenerator"), buildMenuLabel,
297 Options{}.IsGlobal());
298 }
299 ),
300
301 Section( "Generators",
302 // Delayed evaluation:
303 [](AudacityProject &) {
304 auto result = Items("");
306 *result,
310 &OnEffect);
311 return result;
312 }
313 )
314 ) };
315 return menu;
316}
@ EffectTypeGenerate
PluginID mLastGenerator
void OnRepeatLastGenerator(const CommandContext &context)
const ReservedCommandFlag & HasLastGeneratorFlag()
void OnManageGenerators(const CommandContext &context)

References AudioIONotBusyFlag(), MenuRegistry::Command, EffectsGroupBy, EffectTypeGenerate, EffectManager::Get(), CommandManager::Get(), HasLastGeneratorFlag(), MenuRegistry::Options::IsGlobal(), MenuRegistry::Items, MenuRegistry::Menu, CommandManager::mLastGenerator, OnEffect(), OnManageGenerators(), OnRepeatLastGenerator(), MenuHelper::PopulateEffectsMenu(), project, ChoiceSetting::Read(), MenuRegistry::Section, wxT(), XO(), and XXO().

Here is the call graph for this function:

◆ HasLastAnalyzerFlag()

const ReservedCommandFlag & anonymous_namespace{PluginMenus.cpp}::HasLastAnalyzerFlag ( )

Definition at line 401 of file PluginMenus.cpp.

401 { static ReservedCommandFlag flag{
402 [](const AudacityProject &project) {
405 return true;
407 }
408 }; return flag;
409}
static std::once_flag flag
int mLastAnalyzerRegistration

References flag, CommandManager::Get(), CommandManager::mLastAnalyzer, CommandManager::mLastAnalyzerRegistration, project, and CommandManager::repeattypeunique.

Referenced by AnalyzeMenu().

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

◆ HasLastEffectFlag()

const ReservedCommandFlag & anonymous_namespace{PluginMenus.cpp}::HasLastEffectFlag ( )

Definition at line 328 of file PluginMenus.cpp.

328 { static ReservedCommandFlag flag{
329 [](const AudacityProject &project) {
330 return !CommandManager::Get(project).mLastEffect.empty();
331 }
332 }; return flag;
333}

References flag, CommandManager::Get(), CommandManager::mLastEffect, and project.

Referenced by EffectMenu().

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

◆ HasLastGeneratorFlag()

const ReservedCommandFlag & anonymous_namespace{PluginMenus.cpp}::HasLastGeneratorFlag ( )

Definition at line 263 of file PluginMenus.cpp.

263 { static ReservedCommandFlag flag{
264 [](const AudacityProject &project){
265 return !CommandManager::Get( project ).mLastGenerator.empty();
266 }
267 }; return flag; }

References flag, CommandManager::Get(), CommandManager::mLastGenerator, and project.

Referenced by GenerateMenu().

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

◆ HasTrackFocusFlag()

static const ReservedCommandFlag & anonymous_namespace{PluginMenus.cpp}::HasTrackFocusFlag ( )
static

Definition at line 336 of file PluginMenus.cpp.

336 { static ReservedCommandFlag flag{
337 [](const AudacityProject &project) {
338 auto& trackFocus = TrackFocus::Get(const_cast<AudacityProject&>(project));
339 return (trackFocus.Get() != nullptr);
340 }
341 };
342 return flag;
343}

References flag, TrackFocus::Get(), and project.

Referenced by EffectMenu().

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

◆ IsRealtimeNotActiveFlag()

static const ReservedCommandFlag & anonymous_namespace{PluginMenus.cpp}::IsRealtimeNotActiveFlag ( )
static

Definition at line 319 of file PluginMenus.cpp.

319 { static ReservedCommandFlag flag{
320 [](const AudacityProject &project){
322 }
323}; return flag; } //lll
static RealtimeEffectManager & Get(AudacityProject &project)
bool IsActive() const noexcept
To be called only from main thread.

References flag, RealtimeEffectManager::Get(), RealtimeEffectManager::IsActive(), and project.

Here is the call graph for this function:

◆ OnAddRealtimeEffects()

void anonymous_namespace{PluginMenus.cpp}::OnAddRealtimeEffects ( const CommandContext context)

Definition at line 139 of file PluginMenus.cpp.

140{
141 auto& project = context.project;
143}
AudacityProject & project
void DoManageRealtimeEffectsSidePanel(AudacityProject &project)
Definition: PluginMenus.cpp:51

References DoManageRealtimeEffectsSidePanel(), CommandContext::project, and project.

Referenced by EffectMenu().

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

◆ OnAnalyzer2()

void anonymous_namespace{PluginMenus.cpp}::OnAnalyzer2 ( wxCommandEvent &  evt)

Definition at line 145 of file PluginMenus.cpp.

145{ return; }

◆ OnBenchmark()

void anonymous_namespace{PluginMenus.cpp}::OnBenchmark ( const CommandContext context)

Definition at line 202 of file PluginMenus.cpp.

203{
204 auto &project = context.project;
205 CommandManager::Get(project).RegisterLastTool(context); //Register Run Benchmark as Last Tool
206 auto &window = GetProjectFrame( project );
207 ::RunBenchmark( &window, project);
208}
void RunBenchmark(wxWindow *parent, AudacityProject &project)
Definition: Benchmark.cpp:91
void RegisterLastTool(const CommandContext &context)

References CommandManager::Get(), GetProjectFrame(), CommandContext::project, project, CommandManager::RegisterLastTool(), and RunBenchmark().

Referenced by ToolsMenu().

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

◆ OnDetectUpstreamDropouts()

void anonymous_namespace{PluginMenus.cpp}::OnDetectUpstreamDropouts ( const CommandContext context)

Definition at line 221 of file PluginMenus.cpp.

222{
223 auto &project = context.project;
224 auto &commandManager = CommandManager::Get( project );
225
226 auto gAudioIO = AudioIO::Get();
227 auto &setting = gAudioIO->mDetectUpstreamDropouts;
228 auto oldValue = setting.load(std::memory_order_relaxed);
229 commandManager.Check(wxT("DetectUpstreamDropouts"), !oldValue);
230 setting.store(!oldValue, std::memory_order_relaxed);
231}
static AudioIO * Get()
Definition: AudioIO.cpp:126

References AudioIO::Get(), CommandManager::Get(), CommandContext::project, project, and wxT().

Referenced by ToolsMenu().

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

◆ OnEffect()

void anonymous_namespace{PluginMenus.cpp}::OnEffect ( const CommandContext context)

Definition at line 127 of file PluginMenus.cpp.

128{
129 // using GET to interpret parameter as a PluginID
130 EffectUI::DoEffect(context.parameter.GET(), context, 0);
131}
CommandParameter parameter
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1148

References EffectUI::DoEffect(), Identifier::GET(), and CommandContext::parameter.

Referenced by AnalyzeMenu(), EffectMenu(), GenerateMenu(), and ToolsMenu().

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

◆ OnManageAnalyzers()

void anonymous_namespace{PluginMenus.cpp}::OnManageAnalyzers ( const CommandContext context)

Definition at line 190 of file PluginMenus.cpp.

191{
192 auto &project = context.project;
194}
void DoManagePluginsMenu(AudacityProject &project, int effectsCategory)
Definition: PluginMenus.cpp:43

References DoManagePluginsMenu(), EffectTypeAnalyze, CommandContext::project, and project.

Referenced by AnalyzeMenu().

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

◆ OnManageEffects()

void anonymous_namespace{PluginMenus.cpp}::OnManageEffects ( const CommandContext context)

Definition at line 133 of file PluginMenus.cpp.

134{
135 auto &project = context.project;
137}

References DoManagePluginsMenu(), EffectTypeProcess, CommandContext::project, and project.

Referenced by EffectMenu().

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

◆ OnManageGenerators()

void anonymous_namespace{PluginMenus.cpp}::OnManageGenerators ( const CommandContext context)

Definition at line 121 of file PluginMenus.cpp.

122{
123 auto &project = context.project;
125}

References DoManagePluginsMenu(), EffectTypeGenerate, CommandContext::project, and project.

Referenced by GenerateMenu().

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

◆ OnManageTools()

void anonymous_namespace{PluginMenus.cpp}::OnManageTools ( const CommandContext context)

Definition at line 196 of file PluginMenus.cpp.

197{
198 auto &project = context.project;
200}
@ EffectTypeTool

References DoManagePluginsMenu(), EffectTypeTool, CommandContext::project, and project.

Referenced by ToolsMenu().

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

◆ OnRepeatLastAnalyzer()

void anonymous_namespace{PluginMenus.cpp}::OnRepeatLastAnalyzer ( const CommandContext context)

Definition at line 169 of file PluginMenus.cpp.

170{
171 auto& commandManager = CommandManager::Get(context.project);
172 switch (commandManager.mLastAnalyzerRegistration) {
174 {
175 auto lastEffect = commandManager.mLastAnalyzer;
176 if (!lastEffect.empty())
177 {
179 lastEffect, context, commandManager.mRepeatAnalyzerFlags);
180 }
181 }
182 break;
185 commandManager.mLastAnalyzerRegisteredId);
186 break;
187 }
188}
void DoRepeatProcess(const CommandContext &context, int)

References EffectUI::DoEffect(), CommandManager::DoRepeatProcess(), CommandManager::Get(), CommandContext::project, CommandManager::repeattypeplugin, and CommandManager::repeattypeunique.

Referenced by AnalyzeMenu().

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

◆ OnRepeatLastEffect()

void anonymous_namespace{PluginMenus.cpp}::OnRepeatLastEffect ( const CommandContext context)

Definition at line 158 of file PluginMenus.cpp.

159{
160 auto& commandManager = CommandManager::Get(context.project);
161 auto lastEffect = commandManager.mLastEffect;
162 if (!lastEffect.empty())
163 {
165 lastEffect, context, commandManager.mRepeatEffectFlags);
166 }
167}

References EffectUI::DoEffect(), CommandManager::Get(), and CommandContext::project.

Referenced by EffectMenu().

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

◆ OnRepeatLastGenerator()

void anonymous_namespace{PluginMenus.cpp}::OnRepeatLastGenerator ( const CommandContext context)

Definition at line 147 of file PluginMenus.cpp.

148{
149 auto& commandManager = CommandManager::Get(context.project);
150 auto lastEffect = commandManager.mLastGenerator;
151 if (!lastEffect.empty())
152 {
154 lastEffect, context, commandManager.mRepeatGeneratorFlags | EffectManager::kRepeatGen);
155 }
156}

References EffectUI::DoEffect(), CommandManager::Get(), EffectManager::kRepeatGen, and CommandContext::project.

Referenced by GenerateMenu().

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

◆ OnResetConfig()

void anonymous_namespace{PluginMenus.cpp}::OnResetConfig ( const CommandContext context)

Definition at line 68 of file PluginMenus.cpp.

69{
70 auto &project = context.project;
71 auto &commandManager = CommandManager::Get(project);
72 commandManager.mLastAnalyzerRegistration = CommandManager::repeattypenone;
73 commandManager.mLastToolRegistration = CommandManager::repeattypenone;
74 commandManager.mLastGenerator = "";
75 commandManager.mLastEffect = "";
76 commandManager.mLastAnalyzer = "";
77 commandManager.mLastTool = "";
78
80
81 // Directory will be reset on next restart.
83
84 // There are many more things we could reset here.
85 // Beeds discussion as to which make sense to.
86 // Maybe in future versions?
87 // - Reset Effects
88 // - Reset Recording and Playback volumes
89 // - Reset Selection formats (and for spectral too)
90 // - Reset Play-at-speed speed to x1
91 // - Stop playback/recording and unapply pause.
92 // - Set Zoom sensibly.
96 gPrefs->Flush();
98
101
102 // These are necessary to preserve the newly correctly laid out toolbars.
103 // In particular the Device Toolbar ends up short on next restart,
104 // if they are left out.
105 gPrefs->Write(wxT("/PrefsVersion"), wxString(wxT(AUDACITY_PREFS_VERSION_STRING)));
106
107 // write out the version numbers to the prefs file for future checking
108 gPrefs->Write(wxT("/Version/Major"), AUDACITY_VERSION);
109 gPrefs->Write(wxT("/Version/Minor"), AUDACITY_RELEASE);
110 gPrefs->Write(wxT("/Version/Micro"), AUDACITY_REVISION);
111
112 gPrefs->Flush();
113
116
118 .SetRate(gPrefs->ReadDouble("/DefaultProjectSampleRate", 44100.0));
119}
BoolSetting SoundActivatedRecord
Definition: AudioIO.cpp:3354
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
void ResetPreferences()
Call this to reset preferences to an (almost)-"new" default state.
Definition: Prefs.cpp:253
#define AUDACITY_PREFS_VERSION_STRING
Definition: Prefs.h:39
void DoReloadPreferences(AudacityProject &project)
IntSetting SelectionToolbarMode
StringSetting SnapToSetting
Definition: SnapUtils.cpp:29
EnumSetting< SnapMode > SnapModeSetting
Definition: SnapUtils.cpp:31
BoolSetting SyncLockTracks
Definition: SyncLock.cpp:163
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
void SetRate(double rate)
Definition: ProjectRate.cpp:58
void SetSnapMode(SnapMode mode)
Definition: ProjectSnap.cpp:41
void SetSnapTo(Identifier snap)
Definition: ProjectSnap.cpp:59
static ProjectSnap & Get(AudacityProject &project)
Definition: ProjectSnap.cpp:27
bool Reset()
Reset to the default value.
Definition: Prefs.h:284
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
static void OnResetToolBars(const CommandContext &context)
void SetToDefaultSize()
Send a message to the main window PARENT of the viewport, to resize.
Definition: Viewport.cpp:761
static Viewport & Get(AudacityProject &project)
Definition: Viewport.cpp:33
virtual bool Flush() noexcept=0
double ReadDouble(const wxString &key, double defaultValue) const
virtual bool Write(const wxString &key, bool value)=0
FILES_API void UpdateDefaultPath(Operation op, const FilePath &path)
FILES_API const FilePath & DefaultTempDir()

References AUDACITY_PREFS_VERSION_STRING, TempDirectory::DefaultTempDir(), DoReloadPreferences(), audacity::BasicSettings::Flush(), CommandManager::Get(), ProjectRate::Get(), ProjectSnap::Get(), Viewport::Get(), gPrefs, ToolManager::OnResetToolBars(), CommandContext::project, project, Setting< T >::Read(), audacity::BasicSettings::ReadDouble(), CommandManager::repeattypenone, Setting< T >::Reset(), ResetPreferences(), SelectionToolbarMode, ProjectRate::SetRate(), ProjectSnap::SetSnapMode(), ProjectSnap::SetSnapTo(), Viewport::SetToDefaultSize(), SnapModeSetting, SnapToSetting, SoundActivatedRecord, SyncLockTracks, FileNames::UpdateDefaultPath(), audacity::BasicSettings::Write(), and wxT().

Referenced by ToolsMenu().

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

◆ OnSimulateRecordingErrors()

void anonymous_namespace{PluginMenus.cpp}::OnSimulateRecordingErrors ( const CommandContext context)

Definition at line 210 of file PluginMenus.cpp.

211{
212 auto &project = context.project;
213 auto &commandManager = CommandManager::Get( project );
214
215 auto gAudioIO = AudioIO::Get();
216 bool &setting = gAudioIO->mSimulateRecordingErrors;
217 commandManager.Check(wxT("SimulateRecordingErrors"), !setting);
218 setting = !setting;
219}

References AudioIO::Get(), CommandManager::Get(), CommandContext::project, project, and wxT().

Referenced by ToolsMenu().

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

◆ OnWriteJournal()

void anonymous_namespace{PluginMenus.cpp}::OnWriteJournal ( const CommandContext )

Definition at line 233 of file PluginMenus.cpp.

234{
235 auto OnMessage =
236 /* i18n-hint a "journal" is a text file that records
237 the user's interactions with the application */
238 XO("A journal will be recorded after Audacity restarts.");
239 auto OffMessage =
240 /* i18n-hint a "journal" is a text file that records
241 the user's interactions with the application */
242 XO("No journal will be recorded after Audacity restarts.");
243
244 using namespace Journal;
245 bool enabled = RecordEnabled();
246 if ( SetRecordEnabled(!enabled) )
247 enabled = !enabled;
248 if ( enabled )
249 AudacityMessageBox( OnMessage );
250 else
251 AudacityMessageBox( OffMessage );
252}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Facilities for recording and playback of sequences of user interaction.
bool SetRecordEnabled(bool value)
Definition: Journal.cpp:209
bool RecordEnabled()
Definition: Journal.cpp:204

References AudacityMessageBox(), Journal::RecordEnabled(), Journal::SetRecordEnabled(), and XO().

Referenced by ToolsMenu().

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

◆ ShowManager()

bool anonymous_namespace{PluginMenus.cpp}::ShowManager ( wxWindow *  parent,
int  effectsCategory 
)

Definition at line 37 of file PluginMenus.cpp.

38{
39 PluginRegistrationDialog dlg(parent, effectsCategory);
40 return dlg.ShowModal() == wxID_OK;
41}

Referenced by DoManagePluginsMenu().

Here is the caller graph for this function:

◆ ToolsMenu()

auto anonymous_namespace{PluginMenus.cpp}::ToolsMenu ( )

Definition at line 464 of file PluginMenus.cpp.

465{
466 static auto menu = std::shared_ptr{
467 Menu( wxT("Tools"), XXO("T&ools"),
468 Section( "Manage",
469 Command( wxT("ManageTools"), XXO("Plugin Manager"),
471
472 //Separator(),
473 ),
474
475 Section( "Other",
476 Command( wxT("ConfigReset"), XXO("Reset &Configuration"),
479
480 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
481 // as they used to in 1.3.x
482 //#ifdef IS_ALPHA
483 // TODO: What should we do here? Make benchmark a plug-in?
484 // Easy enough to do. We'd call it mod-self-test.
485 Command( wxT("Benchmark"), XXO("&Run Benchmark..."),
487 //#endif
488 ),
489
490 Section( "Tools",
491 // Delayed evaluation:
492 [](AudacityProject &) {
493 auto result = Items("");
495 *result,
499 &OnEffect);
500 return result;
501 }
502 )
503
504#ifdef IS_ALPHA
505 ,
506 Section( "",
507 Command( wxT("SimulateRecordingErrors"),
508 XXO("Simulate Recording Errors"),
512 [](AudacityProject&){
513 return AudioIO::Get()->mSimulateRecordingErrors; } ) ),
514 Command( wxT("DetectUpstreamDropouts"),
515 XXO("Detect Upstream Dropouts"),
519 [](AudacityProject&){
521 .load(std::memory_order_relaxed); } ) )
522 )
523#endif
524
525#if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
526 ,
527 Section( "",
528 Command( wxT("WriteJournal"),
529 /* i18n-hint a "journal" is a text file that records
530 the user's interactions with the application */
531 XXO("Write Journal"),
535 return Journal::RecordEnabled(); } ) )
536 )
537#endif
538
539 ) };
540 return menu;
541}
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
bool mSimulateRecordingErrors
Definition: AudioIO.h:396
std::atomic< bool > mDetectUpstreamDropouts
Definition: AudioIO.h:400
void OnWriteJournal(const CommandContext &)
void OnResetConfig(const CommandContext &context)
Definition: PluginMenus.cpp:68
void OnManageTools(const CommandContext &context)
void OnDetectUpstreamDropouts(const CommandContext &context)
void OnBenchmark(const CommandContext &context)
void OnSimulateRecordingErrors(const CommandContext &context)
Options && CheckTest(const CheckFn &fn) &&
Definition: MenuRegistry.h:74

References AlwaysEnabledFlag, AudioIONotBusyFlag(), MenuRegistry::Options::CheckTest(), MenuRegistry::Command, EffectsGroupBy, EffectTypeTool, AudioIO::Get(), MenuRegistry::Items, AudioIoCallback::mDetectUpstreamDropouts, MenuRegistry::Menu, AudioIoCallback::mSimulateRecordingErrors, OnBenchmark(), OnDetectUpstreamDropouts(), OnEffect(), OnManageTools(), OnResetConfig(), OnSimulateRecordingErrors(), OnWriteJournal(), MenuHelper::PopulateEffectsMenu(), ChoiceSetting::Read(), Journal::RecordEnabled(), MenuRegistry::Section, wxT(), and XXO().

Here is the call graph for this function:

Variable Documentation

◆ sAttachment1

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment1 { Indirect(GenerateMenu()) }

Definition at line 325 of file PluginMenus.cpp.

◆ sAttachment2

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment2 { Indirect(EffectMenu()) }

Definition at line 398 of file PluginMenus.cpp.

◆ sAttachment3

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment3 { Indirect(AnalyzeMenu()) }

Definition at line 462 of file PluginMenus.cpp.

◆ sAttachment4

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment4 { Indirect(ToolsMenu()) }

Definition at line 543 of file PluginMenus.cpp.