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

Functions

bool ShowManager (PluginManager &pm, wxWindow *parent)
 
void DoManagePluginsMenu (AudacityProject &project)
 
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 ()
 
BaseItemSharedPtr GenerateMenu ()
 
static const ReservedCommandFlagIsRealtimeNotActiveFlag ()
 
const ReservedCommandFlagHasLastEffectFlag ()
 
static const ReservedCommandFlagHasTrackFocusFlag ()
 
BaseItemSharedPtr EffectMenu ()
 
const ReservedCommandFlagHasLastAnalyzerFlag ()
 
BaseItemSharedPtr AnalyzeMenu ()
 
BaseItemSharedPtr ToolsMenu ()
 

Variables

AttachedItem sAttachment1
 
AttachedItem sAttachment2
 
AttachedItem sAttachment3
 
AttachedItem sAttachment4
 

Function Documentation

◆ AnalyzeMenu()

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

Definition at line 412 of file PluginMenus.cpp.

413{
414 // All of this is a bit hacky until we can get more things connected into
415 // the plugin manager...sorry! :-(
416
418
419 static BaseItemSharedPtr menu{
420 Menu( wxT("Analyze"), XXO("&Analyze"),
421 Section( "Manage",
422 Command( wxT("ManageAnalyzers"), XXO("Plugin Manager"),
424 ),
425
426 Section("RepeatLast",
427 // Delayed evaluation:
428 [](AudacityProject &project)
429 {
430 const auto &lastAnalyzer = MenuManager::Get(project).mLastAnalyzer;
431 TranslatableString buildMenuLabel;
432 if (!lastAnalyzer.empty())
433 buildMenuLabel = XO("Repeat %s")
434 .Format(EffectManager::Get().GetCommandName(lastAnalyzer));
435 else
436 buildMenuLabel = XO("Repeat Last Analyzer");
437
438 return Command(wxT("RepeatLastAnalyzer"), buildMenuLabel,
442 Options{}.IsGlobal());
443 }
444 ),
445
446 Section( "Analyzers",
447 Items( "Windows" ),
448
449 // Delayed evaluation:
450 [](AudacityProject&)
451 { return Items( wxEmptyString, MenuHelper::PopulateEffectsMenu(
455 &OnEffect)
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")
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:354
static EffectManager & Get()
PluginID mLastAnalyzer
Definition: Menus.h:53
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:69
Holds a msgid for the translation catalog; may also bind format arguments.
MenuTable::BaseItemPtrs PopulateEffectsMenu(EffectType type, CommandFlag batchflags, const wxString &groupby, void(*onMenuCommand)(const CommandContext &), std::function< bool(const PluginDescriptor &)> pred={})
Definition: MenuHelper.cpp:558
std::unique_ptr< MenuItem > Menu(const Identifier &internalName, const TranslatableString &title, Args &&... args)
std::unique_ptr< MenuPart > Section(const Identifier &internalName, Args &&... args)
std::unique_ptr< MenuItems > Items(const Identifier &internalName, Args &&... args)
std::unique_ptr< CommandItem > Command(const CommandID &name, const TranslatableString &label_in, void(Handler::*pmf)(const CommandContext &), CommandFlag flags, const CommandManager::Options &options={}, CommandHandlerFinder finder=FinderScope::DefaultFinder())
std::shared_ptr< BaseItem > BaseItemSharedPtr
Definition: Registry.h:72
const ReservedCommandFlag & HasLastAnalyzerFlag()
void OnRepeatLastAnalyzer(const CommandContext &context)
void OnEffect(const CommandContext &context)
void OnManageAnalyzers(const CommandContext &context)
Options && IsGlobal() &&

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

Here is the call graph for this function:

◆ DoManagePluginsMenu()

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

Definition at line 44 of file PluginMenus.cpp.

45{
46 auto &window = GetProjectFrame( project );
47 auto &pm = PluginManager::Get();
48 if (ShowManager(pm, &window))
50}
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()
Definition: Menus.cpp:621
static PluginManager & Get()
bool ShowManager(PluginManager &pm, wxWindow *parent)
Definition: PluginMenus.cpp:37

References PluginManager::Get(), GetProjectFrame(), 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 52 of file PluginMenus.cpp.

53{
54 auto &trackFocus = TrackFocus::Get(project);
55 auto &panel = RealtimeEffectPanel::Get(project);
56 if (panel.IsShown())
57 panel.HidePanel();
58 else
59 panel.ShowPanel(trackFocus.Get(), true);
60}
static RealtimeEffectPanel & Get(AudacityProject &project)
Track * Get()

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

Referenced by OnAddRealtimeEffects().

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

◆ EffectMenu()

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

Definition at line 347 of file PluginMenus.cpp.

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

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

Here is the call graph for this function:

◆ GenerateMenu()

BaseItemSharedPtr 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
275
276 static BaseItemSharedPtr menu{
277 Menu( wxT("Generate"), XXO("&Generate"),
278 Section( "Manage",
279 Command( wxT("ManageGenerators"), XXO("Plugin Manager"),
281 ),
282
283 Section("RepeatLast",
284 // Delayed evaluation:
285 [](AudacityProject &project)
286 {
287 const auto &lastGenerator = MenuManager::Get(project).mLastGenerator;
288 TranslatableString buildMenuLabel;
289 if (!lastGenerator.empty())
290 buildMenuLabel = XO("Repeat %s")
291 .Format(EffectManager::Get().GetCommandName(lastGenerator));
292 else
293 buildMenuLabel = XO("Repeat Last Generator");
294
295 return Command(wxT("RepeatLastGenerator"), buildMenuLabel,
299 Options{}.IsGlobal());
300 }
301 ),
302
303 Section( "Generators",
304 // Delayed evaluation:
305 [](AudacityProject &)
306 { return Items( wxEmptyString, MenuHelper::PopulateEffectsMenu(
310 &OnEffect)
311 ); }
312 )
313 ) };
314 return menu;
315}
@ EffectTypeGenerate
PluginID mLastGenerator
Definition: Menus.h:51
void OnRepeatLastGenerator(const CommandContext &context)
const ReservedCommandFlag & HasLastGeneratorFlag()
void OnManageGenerators(const CommandContext &context)

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

Here is the call graph for this function:

◆ HasLastAnalyzerFlag()

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

Definition at line 404 of file PluginMenus.cpp.

404 { static ReservedCommandFlag flag{
405 [](const AudacityProject &project) {
407 return !MenuManager::Get(project).mLastAnalyzer.empty();
408 }
409 }; return flag;
410}
static std::once_flag flag
@ repeattypeunique
Definition: Menus.h:62
int mLastAnalyzerRegistration
Definition: Menus.h:54

References flag, MenuManager::Get(), MenuCreator::mLastAnalyzer, MenuCreator::mLastAnalyzerRegistration, and MenuCreator::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 330 of file PluginMenus.cpp.

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

References flag, MenuManager::Get(), and MenuCreator::mLastEffect.

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 !MenuManager::Get( project ).mLastGenerator.empty();
266 }
267 }; return flag; }

References flag, MenuManager::Get(), and MenuCreator::mLastGenerator.

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 338 of file PluginMenus.cpp.

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

References flag, and TrackFocus::Get().

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 318 of file PluginMenus.cpp.

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

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

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:52

References DoManageRealtimeEffectsSidePanel(), and CommandContext::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:89
void RegisterLastTool(const CommandContext &context)
static CommandManager & Get(AudacityProject &project)

References CommandManager::Get(), GetProjectFrame(), CommandContext::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:147

References AudioIO::Get(), CommandManager::Get(), CommandContext::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:1263

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;
193 DoManagePluginsMenu(project);
194}
void DoManagePluginsMenu(AudacityProject &project)
Definition: PluginMenus.cpp:44

References DoManagePluginsMenu(), and CommandContext::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;
136 DoManagePluginsMenu(project);
137}

References DoManagePluginsMenu(), and CommandContext::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;
124 DoManagePluginsMenu(project);
125}

References DoManagePluginsMenu(), and CommandContext::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;
199 DoManagePluginsMenu(project);
200}

References DoManagePluginsMenu(), and CommandContext::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& menuManager = MenuManager::Get(context.project);
172 switch (menuManager.mLastAnalyzerRegistration) {
174 {
175 auto lastEffect = menuManager.mLastAnalyzer;
176 if (!lastEffect.empty())
177 {
179 lastEffect, context, menuManager.mRepeatAnalyzerFlags);
180 }
181 }
182 break;
185 menuManager.mLastAnalyzerRegisteredId);
186 break;
187 }
188}
void DoRepeatProcess(const CommandContext &context, int)
@ repeattypeplugin
Definition: Menus.h:61

References EffectUI::DoEffect(), CommandManager::DoRepeatProcess(), CommandManager::Get(), MenuManager::Get(), CommandContext::project, MenuCreator::repeattypeplugin, and MenuCreator::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& menuManager = MenuManager::Get(context.project);
161 auto lastEffect = menuManager.mLastEffect;
162 if (!lastEffect.empty())
163 {
165 lastEffect, context, menuManager.mRepeatEffectFlags);
166 }
167}

References EffectUI::DoEffect(), MenuManager::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& menuManager = MenuManager::Get(context.project);
150 auto lastEffect = menuManager.mLastGenerator;
151 if (!lastEffect.empty())
152 {
154 lastEffect, context, menuManager.mRepeatGeneratorFlags | EffectManager::kRepeatGen);
155 }
156}

References EffectUI::DoEffect(), MenuManager::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 69 of file PluginMenus.cpp.

70{
71 auto &project = context.project;
72 auto &menuManager = MenuManager::Get(project);
73 menuManager.mLastAnalyzerRegistration = MenuCreator::repeattypenone;
74 menuManager.mLastToolRegistration = MenuCreator::repeattypenone;
75 menuManager.mLastGenerator = "";
76 menuManager.mLastEffect = "";
77 menuManager.mLastAnalyzer = "";
78 menuManager.mLastTool = "";
79
81
82 // Directory will be reset on next restart.
84
85 // There are many more things we could reset here.
86 // Beeds discussion as to which make sense to.
87 // Maybe in future versions?
88 // - Reset Effects
89 // - Reset Recording and Playback volumes
90 // - Reset Selection formats (and for spectral too)
91 // - Reset Play-at-speed speed to x1
92 // - Stop playback/recording and unapply pause.
93 // - Set Zoom sensibly.
96 gPrefs->Write("/SelectionToolbarMode", 0);
97 gPrefs->Flush();
98 DoReloadPreferences(project);
99
102
103 // These are necessary to preserve the newly correctly laid out toolbars.
104 // In particular the Device Toolbar ends up short on next restart,
105 // if they are left out.
106 gPrefs->Write(wxT("/PrefsVersion"), wxString(wxT(AUDACITY_PREFS_VERSION_STRING)));
107
108 // write out the version numbers to the prefs file for future checking
109 gPrefs->Write(wxT("/Version/Major"), AUDACITY_VERSION);
110 gPrefs->Write(wxT("/Version/Minor"), AUDACITY_RELEASE);
111 gPrefs->Write(wxT("/Version/Micro"), AUDACITY_REVISION);
112
113 gPrefs->Flush();
114
116 .AS_SetSnapTo(gPrefs->ReadLong("/SnapTo", SNAP_OFF));
118 .AS_SetRate(gPrefs->ReadDouble("/DefaultProjectSampleRate", 44100.0));
119}
BoolSetting SoundActivatedRecord
Definition: AudioIO.cpp:3333
FileConfig * gPrefs
Definition: Prefs.cpp:70
void ResetPreferences()
Call this to reset preferences to an (almost)-"new" default state.
Definition: Prefs.cpp:208
#define AUDACITY_PREFS_VERSION_STRING
Definition: Prefs.h:39
void DoReloadPreferences(AudacityProject &project)
@ SNAP_OFF
BoolSetting SyncLockTracks
Definition: SyncLock.cpp:172
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
@ repeattypenone
Definition: Menus.h:60
void AS_SetSnapTo(int snap) override
static ProjectSelectionManager & Get(AudacityProject &project)
void AS_SetRate(double rate) override
static void OnResetWindow(const CommandContext &context)
bool Reset()
Reset to the default value.
Definition: Prefs.h:277
static void OnResetToolBars(const CommandContext &context)
FILES_API void UpdateDefaultPath(Operation op, const FilePath &path)
FILES_API const FilePath & DefaultTempDir()

References ProjectSelectionManager::AS_SetRate(), ProjectSelectionManager::AS_SetSnapTo(), AUDACITY_PREFS_VERSION_STRING, TempDirectory::DefaultTempDir(), DoReloadPreferences(), FileConfig::Flush(), MenuManager::Get(), ProjectSelectionManager::Get(), gPrefs, ToolManager::OnResetToolBars(), ProjectWindow::OnResetWindow(), CommandContext::project, MenuCreator::repeattypenone, Setting< T >::Reset(), ResetPreferences(), SNAP_OFF, SoundActivatedRecord, SyncLockTracks, FileNames::UpdateDefaultPath(), 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, 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 ( PluginManager pm,
wxWindow *  parent 
)

Definition at line 37 of file PluginMenus.cpp.

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

Referenced by DoManagePluginsMenu().

Here is the caller graph for this function:

◆ ToolsMenu()

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

Definition at line 467 of file PluginMenus.cpp.

468{
470
471 static BaseItemSharedPtr menu{
472 Menu( wxT("Tools"), XXO("T&ools"),
473 Section( "Manage",
474 Command( wxT("ManageTools"), XXO("Plugin Manager"),
476
477 //Separator(),
478 ),
479
480 Section( "Other",
481 Command( wxT("ConfigReset"), XXO("Reset &Configuration"),
484
485 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
486 // as they used to in 1.3.x
487 //#ifdef IS_ALPHA
488 // TODO: What should we do here? Make benchmark a plug-in?
489 // Easy enough to do. We'd call it mod-self-test.
490 Command( wxT("Benchmark"), XXO("&Run Benchmark..."),
492 //#endif
493 ),
494
495 Section( "Tools",
496 // Delayed evaluation:
497 [](AudacityProject&)
498 { return Items( wxEmptyString, MenuHelper::PopulateEffectsMenu(
502 OnEffect)
503 ); }
504 )
505
506#ifdef IS_ALPHA
507 ,
508 Section( "",
509 Command( wxT("SimulateRecordingErrors"),
510 XXO("Simulate Recording Errors"),
514 [](AudacityProject&){
515 return AudioIO::Get()->mSimulateRecordingErrors; } ) ),
516 Command( wxT("DetectUpstreamDropouts"),
517 XXO("Detect Upstream Dropouts"),
521 [](AudacityProject&){
523 .load(std::memory_order_relaxed); } ) )
524 )
525#endif
526
527#if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
528 ,
529 Section( "",
530 Command( wxT("WriteJournal"),
531 /* i18n-hint a "journal" is a text file that records
532 the user's interactions with the application */
533 XXO("Write Journal"),
537 return Journal::RecordEnabled(); } ) )
538 )
539#endif
540
541 ) };
542 return menu;
543}
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
@ EffectTypeTool
bool mSimulateRecordingErrors
Definition: AudioIO.h:403
std::atomic< bool > mDetectUpstreamDropouts
Definition: AudioIO.h:407
void OnWriteJournal(const CommandContext &)
void OnResetConfig(const CommandContext &context)
Definition: PluginMenus.cpp:69
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) &&

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

Here is the call graph for this function:

Variable Documentation

◆ sAttachment1

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment1
Initial value:

Definition at line 324 of file PluginMenus.cpp.

◆ sAttachment2

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment2
Initial value:
{
wxT(""),
}

Definition at line 398 of file PluginMenus.cpp.

◆ sAttachment3

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment3
Initial value:
{
wxT(""),
}

Definition at line 462 of file PluginMenus.cpp.

◆ sAttachment4

AttachedItem anonymous_namespace{PluginMenus.cpp}::sAttachment4
Initial value:
{
wxT(""),
}

Definition at line 545 of file PluginMenus.cpp.