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

431{
432 // All of this is a bit hacky until we can get more things connected into
433 // the plugin manager...sorry! :-(
434 static auto menu = std::shared_ptr{
435 Menu( wxT("Analyze"), XXO("&Analyze"),
436 Section( "Manage",
437 Command( wxT("ManageAnalyzers"), XXO("Plugin Manager"),
439 ),
440
441 Section("RepeatLast",
442 // Delayed evaluation:
444 {
445 const auto &lastAnalyzer =
447 TranslatableString buildMenuLabel;
448 if (!lastAnalyzer.empty())
449 buildMenuLabel =
450 XO("Repeat %s")
451 .Format(PluginManager::Get().GetName(lastAnalyzer));
452 else
453 buildMenuLabel = XO("Repeat Last Analyzer");
454
455 return Command(wxT("RepeatLastAnalyzer"), buildMenuLabel,
459 Options{}.IsGlobal());
460 }
461 ),
462
463 Section( "Analyzers",
464 Items( "Windows" ),
465
466 // Delayed evaluation:
467 [](AudacityProject &) {
468 auto result = Items("");
470 *result,
474 &OnEffect);
475 return result;
476 }
477 )
478 ) };
479 return menu;
480}
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 PluginManager & 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, PluginManager::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 45 of file PluginMenus.cpp.

46{
47 auto &window = GetProjectFrame( project );
48 auto &pm = PluginManager::Get();
49 if (ShowManager(&window, effectsCategory))
51}
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()
bool ShowManager(wxWindow *parent, int effectsCategory)
Definition: PluginMenus.cpp:39

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

54{
55 auto &trackFocus = TrackFocus::Get(project);
56 auto &panel = RealtimeEffectPanel::Get(project);
57 if (panel.IsShown())
58 panel.HidePanel();
59 else if (auto pTrack = dynamic_cast<SampleTrack *>(trackFocus.Get()))
60 panel.ShowPanel(pTrack, true);
61}
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 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 static auto menu = std::shared_ptr { Menu(
352 wxT("Effect"), XXO("Effe&ct"),
353 Section(
354 "Manage", Command(
355 wxT("ManageEffects"), XXO("Plugin Manager"),
357
358 Section(
359 "RealtimeEffects",
360 Command(
361 wxT("AddRealtimeEffects"), XXO("Add Realtime Effects"),
363#if defined(__WXMSW__) || defined(__WXMAC__)
364 , Command(
365 wxT("GetMoreEffects"), XXO("Get more effects..."),
366 [](const CommandContext&) {
367 OpenInDefaultBrowser("https://www.musehub.com");
368 },
370#endif
371#if defined(__WXMSW__)
372 , Command(
373 wxT("GetAIEffects"), XXO("Get AI effects..."),
374 [](const CommandContext&) {
375 OpenInDefaultBrowser("https://audacityteam.org/download/openvino");
376 },
378#endif
379 ),
380 Section(
381 "RepeatLast",
382 // Delayed evaluation:
384 const auto &lastEffect = CommandManager::Get(project).mLastEffect;
385 TranslatableString buildMenuLabel;
386 if (!lastEffect.empty())
387 buildMenuLabel =
388 XO("Repeat %s")
389 .Format(PluginManager::Get().GetName(lastEffect));
390 else
391 buildMenuLabel = XO("Repeat Last Effect");
392
393 return Command( wxT("RepeatLastEffect"), buildMenuLabel,
397 wxT("Ctrl+R") );
398 }),
399
400 Section(
401 "Effects",
402 // Delayed evaluation:
403 [](AudacityProject&) {
404 auto result = Items("");
406 *result,
410 &OnEffect);
411 return result;
412 }))
413 };
414 return menu;
415}
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
@ EffectTypeProcess
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
PluginID mLastEffect
bool OpenInDefaultBrowser(const wxString &url)
Open an URL in default browser.
Definition: BasicUI.cpp:246
void OnRepeatLastEffect(const CommandContext &context)
const ReservedCommandFlag & HasLastEffectFlag()
static const ReservedCommandFlag & HasTrackFocusFlag()
void OnManageEffects(const CommandContext &context)
void OnAddRealtimeEffects(const CommandContext &context)

References AlwaysEnabledFlag, AudioIONotBusyFlag(), MenuRegistry::Command, EffectsGroupBy, EffectTypeProcess, PluginManager::Get(), CommandManager::Get(), HasLastEffectFlag(), HasTrackFocusFlag(), MenuRegistry::Items, MenuRegistry::Menu, CommandManager::mLastEffect, OnAddRealtimeEffects(), OnEffect(), OnManageEffects(), OnRepeatLastEffect(), BasicUI::OpenInDefaultBrowser(), 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 270 of file PluginMenus.cpp.

271{
272 // All of this is a bit hacky until we can get more things connected into
273 // the plugin manager...sorry! :-(
274 static auto menu = std::shared_ptr{
275 Menu( wxT("Generate"), XXO("&Generate"),
276 Section( "Manage",
277 Command( wxT("ManageGenerators"), XXO("Plugin Manager"),
279 ),
280
281 Section("RepeatLast",
282 // Delayed evaluation:
284 {
285 const auto &lastGenerator =
287 TranslatableString buildMenuLabel;
288 if (!lastGenerator.empty())
289 buildMenuLabel =
290 XO("Repeat %s")
291 .Format(PluginManager::Get().GetName(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 auto result = Items("");
308 *result,
312 &OnEffect);
313 return result;
314 }
315 )
316 ) };
317 return menu;
318}
@ EffectTypeGenerate
PluginID mLastGenerator
void OnRepeatLastGenerator(const CommandContext &context)
const ReservedCommandFlag & HasLastGeneratorFlag()
void OnManageGenerators(const CommandContext &context)

References AudioIONotBusyFlag(), MenuRegistry::Command, EffectsGroupBy, EffectTypeGenerate, PluginManager::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 420 of file PluginMenus.cpp.

420 { static ReservedCommandFlag flag{
421 [](const AudacityProject &project) {
424 return true;
426 }
427 }; return flag;
428}
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 330 of file PluginMenus.cpp.

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

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

264 { static ReservedCommandFlag flag{
265 [](const AudacityProject &project){
266 return !CommandManager::Get( project ).mLastGenerator.empty();
267 }
268 }; 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 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, 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 321 of file PluginMenus.cpp.

321 { static ReservedCommandFlag flag{
322 [](const AudacityProject &project){
324 }
325}; 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 146 of file PluginMenus.cpp.

147{
148 auto& project = context.project;
150}
AudacityProject & project
void DoManageRealtimeEffectsSidePanel(AudacityProject &project)
Definition: PluginMenus.cpp:53

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

152{ return; }

◆ OnBenchmark()

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

Definition at line 203 of file PluginMenus.cpp.

204{
205 auto &project = context.project;
206 CommandManager::Get(project).RegisterLastTool(context); //Register Run Benchmark as Last Tool
207 auto &window = GetProjectFrame( project );
208 ::RunBenchmark( &window, project);
209}
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 222 of file PluginMenus.cpp.

223{
224 auto &project = context.project;
225 auto &commandManager = CommandManager::Get( project );
226
227 auto gAudioIO = AudioIO::Get();
228 auto &setting = gAudioIO->mDetectUpstreamDropouts;
229 auto oldValue = setting.load(std::memory_order_relaxed);
230 commandManager.Check(wxT("DetectUpstreamDropouts"), !oldValue);
231 setting.store(!oldValue, std::memory_order_relaxed);
232}
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 134 of file PluginMenus.cpp.

135{
136 // using GET to interpret parameter as a PluginID
137 EffectUI::DoEffect(context.parameter.GET(), context.project, 0);
138}
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
bool DoEffect(const PluginID &ID, AudacityProject &project, unsigned flags)
Definition: DoEffect.cpp:30

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

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

192{
193 auto &project = context.project;
195}
void DoManagePluginsMenu(AudacityProject &project, int effectsCategory)
Definition: PluginMenus.cpp:45

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

141{
142 auto &project = context.project;
144}

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

129{
130 auto &project = context.project;
132}

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

198{
199 auto &project = context.project;
201}
@ 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 172 of file PluginMenus.cpp.

173{
174 auto& commandManager = CommandManager::Get(context.project);
175 switch (commandManager.mLastAnalyzerRegistration) {
177 {
178 auto lastEffect = commandManager.mLastAnalyzer;
179 if (!lastEffect.empty())
181 lastEffect, context.project, commandManager.mRepeatAnalyzerFlags);
182 }
183 break;
186 commandManager.mLastAnalyzerRegisteredId);
187 break;
188 }
189}
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 164 of file PluginMenus.cpp.

165{
166 auto& commandManager = CommandManager::Get(context.project);
167 auto lastEffect = commandManager.mLastEffect;
168 if (!lastEffect.empty())
169 EffectUI::DoEffect(lastEffect, context.project, commandManager.mRepeatEffectFlags);
170}

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

155{
156 auto& commandManager = CommandManager::Get(context.project);
157 auto lastEffect = commandManager.mLastGenerator;
158 if (!lastEffect.empty())
160 lastEffect, context.project,
161 commandManager.mRepeatGeneratorFlags | EffectManager::kRepeatGen);
162}

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

71{
72 auto &project = context.project;
73 auto &commandManager = CommandManager::Get(project);
74 commandManager.mLastAnalyzerRegistration = CommandManager::repeattypenone;
75 commandManager.mLastToolRegistration = CommandManager::repeattypenone;
76 commandManager.mLastGenerator = "";
77 commandManager.mLastEffect = "";
78 commandManager.mLastAnalyzer = "";
79 commandManager.mLastTool = "";
80
82
83 // Directory will be reset on next restart.
85
86 // There are many more things we could reset here.
87 // Beeds discussion as to which make sense to.
88 // Maybe in future versions?
89 // - Reset Effects
90 // - Reset Recording and Playback volumes
91 // - Reset Selection formats (and for spectral too)
92 // - Reset Play-at-speed speed to x1
93 // - Stop playback/recording and unapply pause.
94 // - Set Zoom sensibly.
98
101
102 gPrefs->Flush();
103
105
108
109 // These are necessary to preserve the newly correctly laid out toolbars.
110 // In particular the Device Toolbar ends up short on next restart,
111 // if they are left out.
112 gPrefs->Write(wxT("/PrefsVersion"), wxString(wxT(AUDACITY_PREFS_VERSION_STRING)));
113
114 // write out the version numbers to the prefs file for future checking
115 gPrefs->Write(wxT("/Version/Major"), AUDACITY_VERSION);
116 gPrefs->Write(wxT("/Version/Minor"), AUDACITY_RELEASE);
117 gPrefs->Write(wxT("/Version/Micro"), AUDACITY_REVISION);
118
119 gPrefs->Flush();
120
123
125 .SetRate(gPrefs->ReadDouble("/DefaultProjectSampleRate", 44100.0));
126}
BoolSetting SoundActivatedRecord
Definition: AudioIO.cpp:3370
BoolSetting & ShowRMSPref()
Definition: GUIPrefs.cpp:190
BoolSetting & ShowClippingPref()
Definition: GUIPrefs.cpp:196
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:765
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(), ShowClippingPref(), ShowRMSPref(), 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 211 of file PluginMenus.cpp.

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

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

235{
236 auto OnMessage =
237 /* i18n-hint a "journal" is a text file that records
238 the user's interactions with the application */
239 XO("A journal will be recorded after Audacity restarts.");
240 auto OffMessage =
241 /* i18n-hint a "journal" is a text file that records
242 the user's interactions with the application */
243 XO("No journal will be recorded after Audacity restarts.");
244
245 using namespace Journal;
246 bool enabled = RecordEnabled();
247 if ( SetRecordEnabled(!enabled) )
248 enabled = !enabled;
249 if ( enabled )
250 AudacityMessageBox( OnMessage );
251 else
252 AudacityMessageBox( OffMessage );
253}
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 39 of file PluginMenus.cpp.

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

Referenced by DoManagePluginsMenu().

Here is the caller graph for this function:

◆ ToolsMenu()

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

Definition at line 484 of file PluginMenus.cpp.

485{
486 static auto menu = std::shared_ptr{
487 Menu( wxT("Tools"), XXO("T&ools"),
488 Section( "Manage",
489 Command( wxT("ManageTools"), XXO("Plugin Manager"),
491
492 //Separator(),
493 ),
494
495 Section( "Other",
496 Command( wxT("ConfigReset"), XXO("Reset &Configuration"),
499
500 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
501 // as they used to in 1.3.x
502 //#ifdef IS_ALPHA
503 // TODO: What should we do here? Make benchmark a plug-in?
504 // Easy enough to do. We'd call it mod-self-test.
505 Command( wxT("Benchmark"), XXO("&Run Benchmark..."),
507 //#endif
508 ),
509
510 Section( "Tools",
511 // Delayed evaluation:
512 [](AudacityProject &) {
513 auto result = Items("");
515 *result,
519 &OnEffect);
520 return result;
521 }
522 )
523
524#ifdef IS_ALPHA
525 ,
526 Section( "",
527 Command( wxT("SimulateRecordingErrors"),
528 XXO("Simulate Recording Errors"),
532 [](AudacityProject&){
533 return AudioIO::Get()->mSimulateRecordingErrors; } ) ),
534 Command( wxT("DetectUpstreamDropouts"),
535 XXO("Detect Upstream Dropouts"),
539 [](AudacityProject&){
541 .load(std::memory_order_relaxed); } ) )
542 )
543#endif
544
545#if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
546 ,
547 Section( "",
548 Command( wxT("WriteJournal"),
549 /* i18n-hint a "journal" is a text file that records
550 the user's interactions with the application */
551 XXO("Write Journal"),
555 return Journal::RecordEnabled(); } ) )
556 )
557#endif
558
559 ) };
560 return menu;
561}
bool mSimulateRecordingErrors
Definition: AudioIO.h:388
std::atomic< bool > mDetectUpstreamDropouts
Definition: AudioIO.h:392
void OnWriteJournal(const CommandContext &)
void OnResetConfig(const CommandContext &context)
Definition: PluginMenus.cpp:70
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 327 of file PluginMenus.cpp.

◆ sAttachment2

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

Definition at line 417 of file PluginMenus.cpp.

◆ sAttachment3

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

Definition at line 482 of file PluginMenus.cpp.

◆ sAttachment4

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

Definition at line 563 of file PluginMenus.cpp.