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 ()
 
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 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 static auto menu = std::shared_ptr{
417 Menu( wxT("Analyze"), XXO("&Analyze"),
418 Section( "Manage",
419 Command( wxT("ManageAnalyzers"), XXO("Plugin Manager"),
421 ),
422
423 Section("RepeatLast",
424 // Delayed evaluation:
426 {
427 const auto &lastAnalyzer =
429 TranslatableString buildMenuLabel;
430 if (!lastAnalyzer.empty())
431 buildMenuLabel = XO("Repeat %s")
432 .Format(EffectManager::Get().GetCommandName(lastAnalyzer));
433 else
434 buildMenuLabel = XO("Repeat Last Analyzer");
435
436 return Command(wxT("RepeatLastAnalyzer"), buildMenuLabel,
440 Options{}.IsGlobal());
441 }
442 ),
443
444 Section( "Analyzers",
445 Items( "Windows" ),
446
447 // Delayed evaluation:
448 [](AudacityProject &) {
449 auto result = Items("");
451 *result,
455 &OnEffect);
456 return result;
457 }
458 )
459 ) };
460 return menu;
461}
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:369
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:571
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)

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()
static PluginManager & Get()
bool ShowManager(PluginManager &pm, wxWindow *parent)
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 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 if (auto pTrack = dynamic_cast<SampleTrack *>(trackFocus.Get()))
59 panel.ShowPanel(pTrack, true);
60}
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 346 of file PluginMenus.cpp.

347{
348 // All of this is a bit hacky until we can get more things connected into
349 // the plugin manager...sorry! :-(
350 static auto menu = std::shared_ptr{
351 Menu( wxT("Effect"), XXO("Effe&ct"),
352 Section( "Manage",
353 Command( wxT("ManageEffects"), XXO("Plugin Manager"),
355 ),
356
357 Section( "RealtimeEffects",
358 Command ( wxT("AddRealtimeEffects"), XXO("Add Realtime Effects"),
360 ),
361
362 Section( "RepeatLast",
363 // Delayed evaluation:
365 {
366 const auto &lastEffect = CommandManager::Get(project).mLastEffect;
367 TranslatableString buildMenuLabel;
368 if (!lastEffect.empty())
369 buildMenuLabel = XO("Repeat %s")
370 .Format( EffectManager::Get().GetCommandName(lastEffect) );
371 else
372 buildMenuLabel = XO("Repeat Last Effect");
373
374 return Command( wxT("RepeatLastEffect"), buildMenuLabel,
378 wxT("Ctrl+R") );
379 }
380 ),
381
382 Section( "Effects",
383 // Delayed evaluation:
384 [](AudacityProject &) {
385 auto result = Items("");
387 *result,
391 &OnEffect);
392 return result;
393 }
394 )
395 ) };
396 return menu;
397}
@ 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 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 = XO("Repeat %s")
290 .Format(EffectManager::Get().GetCommandName(lastGenerator));
291 else
292 buildMenuLabel = XO("Repeat Last Generator");
293
294 return Command(wxT("RepeatLastGenerator"), buildMenuLabel,
298 Options{}.IsGlobal());
299 }
300 ),
301
302 Section( "Generators",
303 // Delayed evaluation:
304 [](AudacityProject &) {
305 auto result = Items("");
307 *result,
311 &OnEffect);
312 return result;
313 }
314 )
315 ) };
316 return menu;
317}
@ 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 402 of file PluginMenus.cpp.

402 { static ReservedCommandFlag flag{
403 [](const AudacityProject &project) {
406 return true;
408 }
409 }; return flag;
410}
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 329 of file PluginMenus.cpp.

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

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

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

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

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

141{
142 auto& project = context.project;
144}
AudacityProject & project
void DoManageRealtimeEffectsSidePanel(AudacityProject &project)
Definition: PluginMenus.cpp:52

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

146{ 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:89
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 128 of file PluginMenus.cpp.

129{
130 // using GET to interpret parameter as a PluginID
131 EffectUI::DoEffect(context.parameter.GET(), context, 0);
132}
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:1146

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

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

References DoManagePluginsMenu(), 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 134 of file PluginMenus.cpp.

135{
136 auto &project = context.project;
138}

References DoManagePluginsMenu(), 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 122 of file PluginMenus.cpp.

123{
124 auto &project = context.project;
126}

References DoManagePluginsMenu(), 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}

References DoManagePluginsMenu(), 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 170 of file PluginMenus.cpp.

171{
172 auto& commandManager = CommandManager::Get(context.project);
173 switch (commandManager.mLastAnalyzerRegistration) {
175 {
176 auto lastEffect = commandManager.mLastAnalyzer;
177 if (!lastEffect.empty())
178 {
180 lastEffect, context, commandManager.mRepeatAnalyzerFlags);
181 }
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 159 of file PluginMenus.cpp.

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

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

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

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

70{
71 auto &project = context.project;
72 auto &commandManager = CommandManager::Get(project);
73 commandManager.mLastAnalyzerRegistration = CommandManager::repeattypenone;
74 commandManager.mLastToolRegistration = CommandManager::repeattypenone;
75 commandManager.mLastGenerator = "";
76 commandManager.mLastEffect = "";
77 commandManager.mLastAnalyzer = "";
78 commandManager.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.
97 gPrefs->Flush();
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
117
119 .SetRate(gPrefs->ReadDouble("/DefaultProjectSampleRate", 44100.0));
120}
BoolSetting SoundActivatedRecord
Definition: AudioIO.cpp:3356
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
void ResetPreferences()
Call this to reset preferences to an (almost)-"new" default state.
Definition: Prefs.cpp:224
#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:173
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:282
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:205
static void OnResetToolBars(const CommandContext &context)
void SetToDefaultSize()
Send a message to the main window PARENT of the viewport, to resize.
Definition: Viewport.cpp:788
static Viewport & Get(AudacityProject &project)
Definition: Viewport.cpp:32
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 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 ( 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()

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

Definition at line 465 of file PluginMenus.cpp.

466{
467 static auto menu = std::shared_ptr{
468 Menu( wxT("Tools"), XXO("T&ools"),
469 Section( "Manage",
470 Command( wxT("ManageTools"), XXO("Plugin Manager"),
472
473 //Separator(),
474 ),
475
476 Section( "Other",
477 Command( wxT("ConfigReset"), XXO("Reset &Configuration"),
480
481 // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
482 // as they used to in 1.3.x
483 //#ifdef IS_ALPHA
484 // TODO: What should we do here? Make benchmark a plug-in?
485 // Easy enough to do. We'd call it mod-self-test.
486 Command( wxT("Benchmark"), XXO("&Run Benchmark..."),
488 //#endif
489 ),
490
491 Section( "Tools",
492 // Delayed evaluation:
493 [](AudacityProject &) {
494 auto result = Items("");
496 *result,
500 &OnEffect);
501 return result;
502 }
503 )
504
505#ifdef IS_ALPHA
506 ,
507 Section( "",
508 Command( wxT("SimulateRecordingErrors"),
509 XXO("Simulate Recording Errors"),
513 [](AudacityProject&){
514 return AudioIO::Get()->mSimulateRecordingErrors; } ) ),
515 Command( wxT("DetectUpstreamDropouts"),
516 XXO("Detect Upstream Dropouts"),
520 [](AudacityProject&){
522 .load(std::memory_order_relaxed); } ) )
523 )
524#endif
525
526#if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
527 ,
528 Section( "",
529 Command( wxT("WriteJournal"),
530 /* i18n-hint a "journal" is a text file that records
531 the user's interactions with the application */
532 XXO("Write Journal"),
536 return Journal::RecordEnabled(); } ) )
537 )
538#endif
539
540 ) };
541 return menu;
542}
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:34
@ EffectTypeTool
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: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) &&
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 326 of file PluginMenus.cpp.

◆ sAttachment2

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

Definition at line 399 of file PluginMenus.cpp.

◆ sAttachment3

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

Definition at line 463 of file PluginMenus.cpp.

◆ sAttachment4

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

Definition at line 544 of file PluginMenus.cpp.