Audacity  3.0.3
PluginMenus.cpp
Go to the documentation of this file.
1 
2 
3 #include "../AudioIO.h"
4 #include "../BatchProcessDialog.h"
5 #include "../Benchmark.h"
6 #include "../CommonCommandFlags.h"
7 #include "../Journal.h"
8 #include "../Menus.h"
9 #include "../PluginManager.h"
10 #include "../PluginRegistrationDialog.h"
11 #include "Prefs.h"
12 #include "Project.h"
13 #include "../ProjectSettings.h"
14 #include "../ProjectWindow.h"
15 #include "../ProjectWindows.h"
16 #include "../ProjectSelectionManager.h"
17 #include "../toolbars/ToolManager.h"
18 #include "../Screenshot.h"
19 #include "TempDirectory.h"
20 #include "../UndoManager.h"
21 #include "../commands/CommandContext.h"
22 #include "../commands/CommandManager.h"
23 #include "../commands/ScreenshotCommand.h"
24 #include "../effects/EffectManager.h"
25 #include "../effects/EffectUI.h"
26 #include "../effects/RealtimeEffectManager.h"
27 #include "../prefs/EffectsPrefs.h"
28 #include "../prefs/PrefsDialog.h"
29 #include "../widgets/AudacityMessageBox.h"
30 
31 #include <wx/log.h>
32 
33 // private helper classes and functions
34 namespace {
35 
36 AttachedWindows::RegisteredFactory sMacrosWindowKey{
37  []( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
38  auto &window = ProjectWindow::Get( parent );
39  return safenew MacrosWindow(
40  &window, parent, true
41  );
42  }
43 };
44 
46  PluginManager &pm, wxWindow *parent, EffectType type)
47 {
48  pm.CheckForUpdates();
49 
50  PluginRegistrationDialog dlg(parent, type);
51  return dlg.ShowModal() == wxID_OK;
52 }
53 
55 {
56  auto &window = GetProjectFrame( project );
57  auto &pm = PluginManager::Get();
58  if (ShowManager(pm, &window, type))
60 }
61 
63 {
64  return
65  std::make_pair( a->GetSymbol().Translation(), a->GetPath() ) <
66  std::make_pair( b->GetSymbol().Translation(), b->GetPath() );
67 }
68 
70  const PluginDescriptor *a, const PluginDescriptor *b)
71 {
72  auto &em = EffectManager::Get();
73 
74  auto akey = em.GetVendorName(a->GetID());
75  auto bkey = em.GetVendorName(b->GetID());
76 
77  if (akey.empty())
78  akey = XO("Uncategorized");
79  if (bkey.empty())
80  bkey = XO("Uncategorized");
81 
82  return
83  std::make_tuple(
84  akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
85  std::make_tuple(
86  bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
87 }
88 
90  const PluginDescriptor *a, const PluginDescriptor *b)
91 {
92  auto &em = EffectManager::Get();
93  auto akey = em.GetVendorName(a->GetID());
94  auto bkey = em.GetVendorName(b->GetID());
95 
96  if (a->IsEffectDefault())
97  akey = {};
98  if (b->IsEffectDefault())
99  bkey = {};
100 
101  return
102  std::make_tuple(
103  akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
104  std::make_tuple(
105  bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
106 }
107 
109  const PluginDescriptor *a, const PluginDescriptor *b)
110 {
111  auto &em = EffectManager::Get();
112  auto akey = em.GetEffectFamilyName(a->GetID());
113  auto bkey = em.GetEffectFamilyName(b->GetID());
114 
115  if (akey.empty())
116  akey = XO("Uncategorized");
117  if (bkey.empty())
118  bkey = XO("Uncategorized");
119 
120  if (a->IsEffectDefault())
121  akey = {};
122  if (b->IsEffectDefault())
123  bkey = {};
124 
125  return
126  std::make_tuple(
127  akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
128  std::make_tuple(
129  bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
130 }
131 
133 {
134  auto &em = EffectManager::Get();
135  auto akey = em.GetEffectFamilyName(a->GetID());
136  auto bkey = em.GetEffectFamilyName(b->GetID());
137 
138  if (akey.empty())
139  akey = XO("Uncategorized");
140  if (bkey.empty())
141  bkey = XO("Uncategorized");
142 
143  return
144  std::make_tuple(
145  akey.Translation(), a->GetSymbol().Translation(), a->GetPath() ) <
146  std::make_tuple(
147  bkey.Translation(), b->GetSymbol().Translation(), b->GetPath() );
148 }
149 
150 // Forward-declared function has its definition below with OnEffect in view
153  const TranslatableStrings & names,
154  const PluginIDs & plugs,
155  const std::vector<CommandFlag> & flags,
156  bool isDefault);
157 
160  std::vector<const PluginDescriptor*> & plugs,
161  CommandFlag batchflags,
162  CommandFlag realflags,
163  bool isDefault)
164 {
165  size_t pluginCnt = plugs.size();
166 
167  auto groupBy = EffectsGroupBy.Read();
168 
169  bool grouped = false;
170  if (groupBy.StartsWith(wxT("groupby")))
171  {
172  grouped = true;
173  }
174 
175  // Some weird special case stuff just for Noise Reduction so that there is
176  // more informative help
177  const auto getBatchFlags = [&]( const PluginDescriptor *plug ){
178  if ( plug->GetSymbol().Msgid() == XO( "Noise Reduction" ) )
179  return
180  ( batchflags | NoiseReductionTimeSelectedFlag() ) & ~TimeSelectedFlag();
181  return batchflags;
182  };
183 
184  TranslatableStrings groupNames;
185  PluginIDs groupPlugs;
186  std::vector<CommandFlag> groupFlags;
187  if (grouped)
188  {
189  TranslatableString last;
190  TranslatableString current;
191 
192  for (size_t i = 0; i < pluginCnt; i++)
193  {
194  const PluginDescriptor *plug = plugs[i];
195 
196  auto name = plug->GetSymbol().Msgid();
197 
198  if (plug->IsEffectInteractive())
199  name += XO("...");
200 
201  if (groupBy == wxT("groupby:publisher"))
202  {
203  current = EffectManager::Get().GetVendorName(plug->GetID());
204  if (current.empty())
205  {
206  current = XO("Unknown");
207  }
208  }
209  else if (groupBy == wxT("groupby:type"))
210  {
211  current = EffectManager::Get().GetEffectFamilyName(plug->GetID());
212  if (current.empty())
213  {
214  current = XO("Unknown");
215  }
216  }
217 
218  if (current != last)
219  {
220  using namespace MenuTable;
221  BaseItemPtrs temp;
222  bool bInSubmenu = !last.empty() && (groupNames.size() > 1);
223 
225  groupNames,
226  groupPlugs, groupFlags, isDefault);
227 
228  table.push_back( MenuOrItems( wxEmptyString,
229  ( bInSubmenu ? last : TranslatableString{} ), std::move( temp )
230  ) );
231 
232  groupNames.clear();
233  groupPlugs.clear();
234  groupFlags.clear();
235  last = current;
236  }
237 
238  groupNames.push_back( name );
239  groupPlugs.push_back(plug->GetID());
240  groupFlags.push_back(
241  plug->IsEffectRealtime() ? realflags : getBatchFlags( plug ) );
242  }
243 
244  if (groupNames.size() > 0)
245  {
246  using namespace MenuTable;
247  BaseItemPtrs temp;
248  bool bInSubmenu = groupNames.size() > 1;
249 
251  groupNames, groupPlugs, groupFlags, isDefault);
252 
253  table.push_back( MenuOrItems( wxEmptyString,
254  ( bInSubmenu ? current : TranslatableString{} ), std::move( temp )
255  ) );
256  }
257  }
258  else
259  {
260  for (size_t i = 0; i < pluginCnt; i++)
261  {
262  const PluginDescriptor *plug = plugs[i];
263 
264  auto name = plug->GetSymbol().Msgid();
265 
266  if (plug->IsEffectInteractive())
267  name += XO("...");
268 
269  TranslatableString group;
270  if (groupBy == wxT("sortby:publisher:name"))
271  {
272  group = EffectManager::Get().GetVendorName(plug->GetID());
273  }
274  else if (groupBy == wxT("sortby:type:name"))
275  {
276  group = EffectManager::Get().GetEffectFamilyName(plug->GetID());
277  }
278 
279  if (plug->IsEffectDefault())
280  {
281  group = {};
282  }
283 
284  groupNames.push_back(
285  group.empty()
286  ? name
287  : XO("%s: %s").Format( group, name )
288  );
289 
290  groupPlugs.push_back(plug->GetID());
291  groupFlags.push_back(
292  plug->IsEffectRealtime() ? realflags : getBatchFlags( plug ) );
293  }
294 
295  if (groupNames.size() > 0)
296  {
298  table, groupNames, groupPlugs, groupFlags, isDefault);
299  }
300 
301  }
302 
303  return;
304 }
305 
310  EffectType type,
311  CommandFlag batchflags,
312  CommandFlag realflags)
313 {
316 
317  std::vector<const PluginDescriptor*> defplugs;
318  std::vector<const PluginDescriptor*> optplugs;
319 
321  for (auto &plugin : pm.EffectsOfType(type)) {
322  auto plug = &plugin;
323  if( plug->IsInstantiated() && em.IsHidden(plug->GetID()) )
324  continue;
325  if ( !plug->IsEnabled() ){
326  ;// don't add to menus!
327  }
328  else if (plug->IsEffectDefault()
329 #ifdef EXPERIMENTAL_DA
330  // Move Nyquist prompt into nyquist group.
331  && (plug->GetSymbol() !=
332  ComponentInterfaceSymbol("Nyquist Effects Prompt"))
333  && (plug->GetSymbol() != ComponentInterfaceSymbol("Nyquist Tools Prompt"))
334  && (plug->GetSymbol() != ComponentInterfaceSymbol(NYQUIST_PROMPT_ID))
335 #endif
336  )
337  defplugs.push_back(plug);
338  else
339  optplugs.push_back(plug);
340  }
341 
342  wxString groupby = EffectsGroupBy.Read();
343 
344  using Comparator = bool(*)(const PluginDescriptor*, const PluginDescriptor*);
345  Comparator comp1, comp2;
346  if (groupby == wxT("sortby:name"))
347  comp1 = comp2 = CompareEffectsByName;
348  else if (groupby == wxT("sortby:publisher:name"))
350  else if (groupby == wxT("sortby:type:name"))
352  else if (groupby == wxT("groupby:publisher"))
353  comp1 = comp2 = CompareEffectsByPublisher;
354  else if (groupby == wxT("groupby:type"))
355  comp1 = comp2 = CompareEffectsByType;
356  else // name
357  comp1 = comp2 = CompareEffectsByName;
358 
359  std::sort( defplugs.begin(), defplugs.end(), comp1 );
360  std::sort( optplugs.begin(), optplugs.end(), comp2 );
361 
362  MenuTable::BaseItemPtrs section1;
363  AddEffectMenuItems( section1, defplugs, batchflags, realflags, true );
364 
365  MenuTable::BaseItemPtrs section2;
366  AddEffectMenuItems( section2, optplugs, batchflags, realflags, false );
367 
368  bool section = !section1.empty() && !section2.empty();
369  result.push_back( MenuTable::Items( "", std::move( section1 ) ) );
370  if ( section )
371  result.push_back( MenuTable::Section( "", std::move( section2 ) ) );
372  else
373  result.push_back( MenuTable::Items( "", std::move( section2 ) ) );
374 
375  return result;
376 }
377 
378 // Forward-declared function has its definition below with OnApplyMacroDirectly
379 // in view
381 
382 }
383 
384 namespace PluginActions {
385 
386 // Menu handler functions
387 
389 
390 void OnResetConfig(const CommandContext &context)
391 {
392  auto &project = context.project;
393  auto &menuManager = MenuManager::Get(project);
394  menuManager.mLastAnalyzerRegistration = MenuCreator::repeattypenone;
395  menuManager.mLastToolRegistration = MenuCreator::repeattypenone;
396  menuManager.mLastGenerator = "";
397  menuManager.mLastEffect = "";
398  menuManager.mLastAnalyzer = "";
399  menuManager.mLastTool = "";
400 
402 
403  // Directory will be reset on next restart.
404  FileNames::UpdateDefaultPath(FileNames::Operation::Temp, TempDirectory::DefaultTempDir());
405 
406  // There are many more things we could reset here.
407  // Beeds discussion as to which make sense to.
408  // Maybe in future versions?
409  // - Reset Effects
410  // - Reset Recording and Playback volumes
411  // - Reset Selection formats (and for spectral too)
412  // - Reset Play-at-speed speed to x1
413  // - Stop playback/recording and unapply pause.
414  // - Set Zoom sensibly.
415  gPrefs->Write("/GUI/SyncLockTracks", 0);
416  gPrefs->Write("/AudioIO/SoundActivatedRecord", 0);
417  gPrefs->Write("/SelectionToolbarMode", 0);
418  gPrefs->Flush();
419  DoReloadPreferences(project);
421 
422  // These are necessary to preserve the newly correctly laid out toolbars.
423  // In particular the Device Toolbar ends up short on next restart,
424  // if they are left out.
425  gPrefs->Write(wxT("/PrefsVersion"), wxString(wxT(AUDACITY_PREFS_VERSION_STRING)));
426 
427  // write out the version numbers to the prefs file for future checking
428  gPrefs->Write(wxT("/Version/Major"), AUDACITY_VERSION);
429  gPrefs->Write(wxT("/Version/Minor"), AUDACITY_RELEASE);
430  gPrefs->Write(wxT("/Version/Micro"), AUDACITY_REVISION);
431 
432  gPrefs->Flush();
433 
435  .AS_SetSnapTo(gPrefs->ReadLong("/SnapTo", SNAP_OFF));
437  .AS_SetRate(gPrefs->ReadDouble("/DefaultProjectSampleRate", 44100.0));
438 }
439 
440 void OnManageGenerators(const CommandContext &context)
441 {
442  auto &project = context.project;
444 }
445 
446 void OnEffect(const CommandContext &context)
447 {
448  // using GET to interpret parameter as a PluginID
449  EffectUI::DoEffect(context.parameter.GET(), context, 0);
450 }
451 
452 void OnManageEffects(const CommandContext &context)
453 {
454  auto &project = context.project;
456 }
457 
458 void OnAnalyzer2(wxCommandEvent& evt) { return; }
459 
461 {
462  auto& menuManager = MenuManager::Get(context.project);
463  auto lastEffect = menuManager.mLastGenerator;
464  if (!lastEffect.empty())
465  {
467  lastEffect, context, menuManager.mRepeatGeneratorFlags | EffectManager::kRepeatGen);
468  }
469 }
470 
471 void OnRepeatLastEffect(const CommandContext &context)
472 {
473  auto& menuManager = MenuManager::Get(context.project);
474  auto lastEffect = menuManager.mLastEffect;
475  if (!lastEffect.empty())
476  {
478  lastEffect, context, menuManager.mRepeatEffectFlags);
479  }
480 }
481 
483 {
484  auto& menuManager = MenuManager::Get(context.project);
485  switch (menuManager.mLastAnalyzerRegistration) {
487  {
488  auto lastEffect = menuManager.mLastAnalyzer;
489  if (!lastEffect.empty())
490  {
492  lastEffect, context, menuManager.mRepeatAnalyzerFlags);
493  }
494  }
495  break;
498  menuManager.mLastAnalyzerRegisteredId);
499  break;
500  }
501 }
502 
503 void OnRepeatLastTool(const CommandContext& context)
504 {
505  auto& menuManager = MenuManager::Get(context.project);
506  switch (menuManager.mLastToolRegistration) {
508  {
509  auto lastEffect = menuManager.mLastTool;
510  if (!lastEffect.empty())
511  {
513  lastEffect, context, menuManager.mRepeatToolFlags);
514  }
515  }
516  break;
519  menuManager.mLastToolRegisteredId);
520  break;
522  OnApplyMacroDirectlyByName(context, menuManager.mLastTool);
523  break;
524  }
525 }
526 
527 
528 void OnManageAnalyzers(const CommandContext &context)
529 {
530  auto &project = context.project;
532 }
533 
534 void OnManageTools(const CommandContext &context )
535 {
536  auto &project = context.project;
538 }
539 
540 void OnManageMacros(const CommandContext &context )
541 {
542  auto &project = context.project;
543  CommandManager::Get(project).RegisterLastTool(context); //Register Macros as Last Tool
544  auto macrosWindow = &GetAttachedWindows(project)
545  .AttachedWindows::Get< MacrosWindow >( sMacrosWindowKey );
546  if (macrosWindow) {
547  macrosWindow->Show();
548  macrosWindow->Raise();
549  macrosWindow->UpdateDisplay( true );
550  }
551 }
552 
554 {
555  auto &project = context.project;
556  CommandManager::Get(project).RegisterLastTool(context); //Register Palette as Last Tool
557  auto macrosWindow = &GetAttachedWindows(project)
558  .AttachedWindows::Get< MacrosWindow >( sMacrosWindowKey );
559  if (macrosWindow) {
560  macrosWindow->Show();
561  macrosWindow->Raise();
562  macrosWindow->UpdateDisplay( false );
563  }
564 }
565 
566 void OnScreenshot(const CommandContext &context )
567 {
568  CommandManager::Get(context.project).RegisterLastTool(context); //Register Screenshot as Last Tool
569  ::OpenScreenshotTools( context.project );
570 }
571 
572 void OnBenchmark(const CommandContext &context)
573 {
574  auto &project = context.project;
575  CommandManager::Get(project).RegisterLastTool(context); //Register Run Benchmark as Last Tool
576  auto &window = GetProjectFrame( project );
577  ::RunBenchmark( &window, project);
578 }
579 
581 {
582  auto &project = context.project;
583  auto &commandManager = CommandManager::Get( project );
584 
585  auto gAudioIO = AudioIO::Get();
586  bool &setting = gAudioIO->mSimulateRecordingErrors;
587  commandManager.Check(wxT("SimulateRecordingErrors"), !setting);
588  setting = !setting;
589 }
590 
592 {
593  auto &project = context.project;
594  auto &commandManager = CommandManager::Get( project );
595 
596  auto gAudioIO = AudioIO::Get();
597  bool &setting = gAudioIO->mDetectUpstreamDropouts;
598  commandManager.Check(wxT("DetectUpstreamDropouts"), !setting);
599  setting = !setting;
600 }
601 
603 {
604  auto OnMessage =
605  /* i18n-hint a "journal" is a text file that records
606  the user's interactions with the application */
607  XO("A journal will be recorded after Audacity restarts.");
608  auto OffMessage =
609  /* i18n-hint a "journal" is a text file that records
610  the user's interactions with the application */
611  XO("No journal will be recorded after Audacity restarts.");
612 
613  using namespace Journal;
614  bool enabled = RecordEnabled();
615  if ( SetRecordEnabled(!enabled) )
616  enabled = !enabled;
617  if ( enabled )
618  AudacityMessageBox( OnMessage );
619  else
620  AudacityMessageBox( OffMessage );
621 }
622 
624 {
625  const MacroID& Name = context.parameter.GET();
626  OnApplyMacroDirectlyByName(context, Name);
627 }
628 void OnApplyMacroDirectlyByName(const CommandContext& context, const MacroID& Name)
629 {
630  auto &project = context.project;
631  auto &window = ProjectWindow::Get( project );
632  //wxLogDebug( "Macro was: %s", context.parameter);
633  ApplyMacroDialog dlg( &window, project );
634  //const auto &Name = context.parameter;
635 
636 // We used numbers previously, but macros could get renumbered, making
637 // macros containing macros unpredictable.
638 #ifdef MACROS_BY_NUMBERS
639  long item=0;
640  // Take last three letters (of e.g. Macro007) and convert to a number.
641  Name.Mid( Name.length() - 3 ).ToLong( &item, 10 );
642  dlg.ApplyMacroToProject( item, false );
643 #else
644  dlg.ApplyMacroToProject( Name, false );
645 #endif
646  /* i18n-hint: %s will be the name of the macro which will be
647  * repeated if this menu item is chosen */
649 
652  auto shortDesc = em.GetCommandName(Name);
653  auto& undoManager = UndoManager::Get(project);
654  auto& commandManager = CommandManager::Get(project);
655  int cur = undoManager.GetCurrentState();
656  if (undoManager.UndoAvailable()) {
657  undoManager.GetShortDescription(cur, &desc);
658  commandManager.Modify(wxT("RepeatLastTool"), XXO("&Repeat %s")
659  .Format(desc));
660  auto& menuManager = MenuManager::Get(project);
661  menuManager.mLastTool = Name;
662  menuManager.mLastToolRegistration = MenuCreator::repeattypeapplymacro;
663  }
664 
665 }
666 
668 {
669  // using GET in a log message for devs' eyes only
670  wxLogDebug( "Command was: %s", ctx.parameter.GET());
671  // Not configured, so prompt user.
673  EffectManager::Get().GetEffectByIdentifier(ctx.parameter),
674  ctx, EffectManager::kNone);
675 }
676 
677 }; // struct Handler
678 
679 } // namespace
680 
682  // Handler is not stateful. Doesn't need a factory registered with
683  // AudacityProject.
684  static PluginActions::Handler instance;
685  return instance;
686 };
687 
688 // Menu definitions? ...
689 
690 #define FN(X) (& PluginActions::Handler :: X)
691 
692 // ... buf first some more helper definitions, which use FN
693 namespace {
694 
697  const TranslatableStrings & names,
698  const PluginIDs & plugs,
699  const std::vector<CommandFlag> & flags,
700  bool isDefault)
701 {
702  const int namesCnt = (int) names.size();
703  int perGroup;
704 
705 #if defined(__WXGTK__)
706  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 15);
707 #else
708  gPrefs->Read(wxT("/Effects/MaxPerGroup"), &perGroup, 0);
709 #endif
710 
711  int groupCnt = namesCnt;
712  for (int i = 0; i < namesCnt; i++)
713  {
714  // compare full translations not msgids!
715  while (i + 1 < namesCnt && names[i].Translation() == names[i + 1].Translation())
716  {
717  i++;
718  groupCnt--;
719  }
720  }
721 
722  // The "default" effects shouldn't be broken into subgroups
723  if (namesCnt > 0 && isDefault)
724  {
725  perGroup = 0;
726  }
727 
728  int max = perGroup;
729  int items = perGroup;
730 
731  if (max > groupCnt)
732  {
733  max = 0;
734  }
735 
736  using namespace MenuTable;
737  // This finder scope may be redundant, but harmless
738  auto scope = FinderScope( findCommandHandler );
739  auto pTable = &table;
740  BaseItemPtrs temp1;
741 
742  int groupNdx = 0;
743  for (int i = 0; i < namesCnt; i++)
744  {
745  if (max > 0 && items == max)
746  {
747  // start collecting items for the next submenu
748  pTable = &temp1;
749  }
750 
751  // compare full translations not msgids!
752  if (i + 1 < namesCnt && names[i].Translation() == names[i + 1].Translation())
753  {
754  // collect a sub-menu for like-named items
755  const auto name = names[i];
756  const auto translation = name.Translation();
757  BaseItemPtrs temp2;
758  // compare full translations not msgids!
759  while (i < namesCnt && names[i].Translation() == translation)
760  {
761  const PluginDescriptor *plug =
762  PluginManager::Get().GetPlugin(plugs[i]);
763  wxString item = plug->GetPath();
764  if( plug->GetPluginType() == PluginTypeEffect )
765  temp2.push_back( Command( item,
766  Verbatim( item ),
767  FN(OnEffect),
768  flags[i],
770  .IsEffect()
771  .AllowInMacros()
772  .Parameter( plugs[i] ) ) );
773 
774  i++;
775  }
776  pTable->push_back( Menu( wxEmptyString, name, std::move( temp2 ) ) );
777  i--;
778  }
779  else
780  {
781  // collect one item
782  const PluginDescriptor *plug =
783  PluginManager::Get().GetPlugin(plugs[i]);
784  if( plug->GetPluginType() == PluginTypeEffect )
785  pTable->push_back( Command(
786  // Call Debug() not MSGID() so that any concatenated "..." is
787  // included in the identifier, preserving old behavior, and
788  // avoiding the collision of the "Silence" command and the
789  // "Silence..." generator
790  names[i].Debug(), // names[i].MSGID(),
791  names[i],
792  FN(OnEffect),
793  flags[i],
795  .IsEffect()
796  .AllowInMacros()
797  .Parameter( plugs[i] ) ) );
798  }
799 
800  if (max > 0)
801  {
802  items--;
803  if (items == 0 || i + 1 == namesCnt)
804  {
805  int end = groupNdx + max;
806  if (end + 1 > groupCnt)
807  {
808  end = groupCnt;
809  }
810  // Done collecting
811  table.push_back( Menu( wxEmptyString,
812  XXO("Plug-in %d to %d").Format( groupNdx + 1, end ),
813  std::move( temp1 )
814  ) );
815  items = max;
816  pTable = &table;
817  groupNdx += max;
818  }
819  }
820  }
821 
822  return;
823 }
824 
826 {
828  auto names = MacroCommands::GetNames(); // these names come from filenames
829  int i;
830 
831  // This finder scope may be redundant, but harmless
833  for (i = 0; i < (int)names.size(); i++) {
834  auto MacroID = ApplyMacroDialog::MacroIdOfName( names[i] );
835  result.push_back( MenuTable::Command( MacroID,
836  Verbatim( names[i] ), // file name verbatim
837  FN(OnApplyMacroDirectly),
838  flags,
840  ) );
841  }
842 
843  return result;
844 }
845 
846 }
847 
848 // Menu definitions
849 
850 // Under /MenuBar
851 namespace {
852 using namespace MenuTable;
853 
854 const ReservedCommandFlag&
856  [](const AudacityProject &project){
857  return !MenuManager::Get( project ).mLastGenerator.empty();
858  }
859  }; return flag; }
860 
862 {
863  // All of this is a bit hacky until we can get more things connected into
864  // the plugin manager...sorry! :-(
865 
867 
868  static BaseItemSharedPtr menu{
870  Menu( wxT("Generate"), XXO("&Generate"),
871 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
872  Section( "Manage",
873  Command( wxT("ManageGenerators"), XXO("Add / Remove Plug-ins..."),
874  FN(OnManageGenerators), AudioIONotBusyFlag() )
875  ),
876 #endif
877 
878  Section("RepeatLast",
879  // Delayed evaluation:
880  [](AudacityProject &project)
881  {
882  const auto &lastGenerator = MenuManager::Get(project).mLastGenerator;
883  TranslatableString buildMenuLabel;
884  if (!lastGenerator.empty())
885  buildMenuLabel = XO("Repeat %s")
886  .Format(EffectManager::Get().GetCommandName(lastGenerator));
887  else
888  buildMenuLabel = XO("Repeat Last Generator");
889 
890  return Command(wxT("RepeatLastGenerator"), buildMenuLabel,
891  FN(OnRepeatLastGenerator),
894  Options{}.IsGlobal(), findCommandHandler);
895  }
896  ),
897 
898  Section( "Generators",
899  // Delayed evaluation:
900  [](AudacityProject &)
901  { return Items( wxEmptyString, PopulateEffectsMenu(
905  ); }
906  )
907  ) ) };
908  return menu;
909 }
910 
911 static const ReservedCommandFlag
913  [](const AudacityProject &){
915  }
916 }; return flag; } //lll
917 
919  wxT(""),
920  Shared( GenerateMenu() )
921 };
922 
923 const ReservedCommandFlag&
925  [](const AudacityProject &project) {
926  return !MenuManager::Get(project).mLastEffect.empty();
927  }
928  }; return flag;
929 }
930 
932 {
933  // All of this is a bit hacky until we can get more things connected into
934  // the plugin manager...sorry! :-(
935 
936  static BaseItemSharedPtr menu{
938  Menu( wxT("Effect"), XXO("Effe&ct"),
939 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
940  Section( "Manage",
941  Command( wxT("ManageEffects"), XXO("Add / Remove Plug-ins..."),
942  FN(OnManageEffects), AudioIONotBusyFlag() )
943  ),
944 #endif
945 
946  Section( "RepeatLast",
947  // Delayed evaluation:
948  [](AudacityProject &project)
949  {
950  const auto &lastEffect = MenuManager::Get(project).mLastEffect;
951  TranslatableString buildMenuLabel;
952  if (!lastEffect.empty())
953  buildMenuLabel = XO("Repeat %s")
954  .Format( EffectManager::Get().GetCommandName(lastEffect) );
955  else
956  buildMenuLabel = XO("Repeat Last Effect");
957 
958  return Command( wxT("RepeatLastEffect"), buildMenuLabel,
959  FN(OnRepeatLastEffect),
962  wxT("Ctrl+R"), findCommandHandler );
963  }
964  ),
965 
966  Section( "Effects",
967  // Delayed evaluation:
968  [](AudacityProject &)
969  { return Items( wxEmptyString, PopulateEffectsMenu(
973  ); }
974  )
975  ) ) };
976  return menu;
977 }
978 
980  wxT(""),
981  Shared( EffectMenu() )
982 };
983 
984 const ReservedCommandFlag&
986  [](const AudacityProject &project) {
988  return !MenuManager::Get(project).mLastAnalyzer.empty();
989  }
990  }; return flag;
991 }
992 
994 {
995  // All of this is a bit hacky until we can get more things connected into
996  // the plugin manager...sorry! :-(
997 
999 
1000  static BaseItemSharedPtr menu{
1002  Menu( wxT("Analyze"), XXO("&Analyze"),
1003 #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1004  Section( "Manage",
1005  Command( wxT("ManageAnalyzers"), XXO("Add / Remove Plug-ins..."),
1006  FN(OnManageAnalyzers), AudioIONotBusyFlag() )
1007  ),
1008 #endif
1009 
1010  Section("RepeatLast",
1011  // Delayed evaluation:
1012  [](AudacityProject &project)
1013  {
1014  const auto &lastAnalyzer = MenuManager::Get(project).mLastAnalyzer;
1015  TranslatableString buildMenuLabel;
1016  if (!lastAnalyzer.empty())
1017  buildMenuLabel = XO("Repeat %s")
1018  .Format(EffectManager::Get().GetCommandName(lastAnalyzer));
1019  else
1020  buildMenuLabel = XO("Repeat Last Analyzer");
1021 
1022  return Command(wxT("RepeatLastAnalyzer"), buildMenuLabel,
1023  FN(OnRepeatLastAnalyzer),
1026  Options{}.IsGlobal(), findCommandHandler);
1027  }
1028  ),
1029 
1030  Section( "Analyzers",
1031  Items( "Windows" ),
1032 
1033  // Delayed evaluation:
1034  [](AudacityProject&)
1035  { return Items( wxEmptyString, PopulateEffectsMenu(
1039  ); }
1040  )
1041  ) ) };
1042  return menu;
1043 }
1044 
1046  wxT(""),
1047  Shared( AnalyzeMenu() )
1048 };
1049 
1050 const ReservedCommandFlag&
1052  [](const AudacityProject &project) {
1053  auto& menuManager = MenuManager::Get(project);
1054  if (menuManager.mLastToolRegistration == MenuCreator::repeattypeunique) return true;
1055  return !menuManager.mLastTool.empty();
1056  }
1057  }; return flag;
1058 }
1059 
1061 {
1063 
1064  static BaseItemSharedPtr menu{
1066  Menu( wxT("Tools"), XXO("T&ools"),
1067  Section( "Manage",
1068  #ifdef EXPERIMENTAL_EFFECT_MANAGEMENT
1069  Command( wxT("ManageTools"), XXO("Add / Remove Plug-ins..."),
1070  FN(OnManageTools), AudioIONotBusyFlag() ),
1071 
1072  //Separator(),
1073 
1074  #endif
1075 
1076  Section( "RepeatLast",
1077  // Delayed evaluation:
1078  [](AudacityProject &project)
1079  {
1080  const auto &lastTool = MenuManager::Get(project).mLastTool;
1081  TranslatableString buildMenuLabel;
1082  if (!lastTool.empty())
1083  buildMenuLabel = XO("Repeat %s")
1084  .Format( EffectManager::Get().GetCommandName(lastTool) );
1085  else
1086  buildMenuLabel = XO("Repeat Last Tool");
1087 
1088  return Command( wxT("RepeatLastTool"), buildMenuLabel,
1089  FN(OnRepeatLastTool),
1090  AudioIONotBusyFlag() |
1091  HasLastToolFlag(),
1092  Options{}.IsGlobal(), findCommandHandler );
1093  }
1094  ),
1095 
1096  Command( wxT("ManageMacros"), XXO("&Macros..."),
1097  FN(OnManageMacros), AudioIONotBusyFlag() ),
1098 
1099  Menu( wxT("Macros"), XXO("&Apply Macro"),
1100  // Palette has no access key to ensure first letter navigation of
1101  // sub menu
1102  Section( "",
1103  Command( wxT("ApplyMacrosPalette"), XXO("Palette..."),
1104  FN(OnApplyMacrosPalette), AudioIONotBusyFlag() )
1105  ),
1106 
1107  Section( "",
1108  // Delayed evaluation:
1109  [](AudacityProject&)
1110  { return Items( wxEmptyString, PopulateMacrosMenu( AudioIONotBusyFlag() ) ); }
1111  )
1112  )
1113  ),
1114 
1115  Section( "Other",
1116  Command( wxT("ConfigReset"), XXO("Reset &Configuration"),
1117  FN(OnResetConfig),
1118  AudioIONotBusyFlag() ),
1119 
1120  Command( wxT("FancyScreenshot"), XXO("&Screenshot..."),
1121  FN(OnScreenshot), AudioIONotBusyFlag() ),
1122 
1123  // PRL: team consensus for 2.2.0 was, we let end users have this diagnostic,
1124  // as they used to in 1.3.x
1125  //#ifdef IS_ALPHA
1126  // TODO: What should we do here? Make benchmark a plug-in?
1127  // Easy enough to do. We'd call it mod-self-test.
1128  Command( wxT("Benchmark"), XXO("&Run Benchmark..."),
1129  FN(OnBenchmark), AudioIONotBusyFlag() )
1130  //#endif
1131  ),
1132 
1133  Section( "Tools",
1134  // Delayed evaluation:
1135  [](AudacityProject&)
1136  { return Items( wxEmptyString, PopulateEffectsMenu(
1139  AudioIONotBusyFlag() )
1140  ); }
1141  )
1142 
1143 #ifdef IS_ALPHA
1144  ,
1145  Section( "",
1146  Command( wxT("SimulateRecordingErrors"),
1147  XXO("Simulate Recording Errors"),
1148  FN(OnSimulateRecordingErrors),
1150  Options{}.CheckTest(
1151  [](AudacityProject&){
1152  return AudioIO::Get()->mSimulateRecordingErrors; } ) ),
1153  Command( wxT("DetectUpstreamDropouts"),
1154  XXO("Detect Upstream Dropouts"),
1155  FN(OnDetectUpstreamDropouts),
1157  Options{}.CheckTest(
1158  [](AudacityProject&){
1159  return AudioIO::Get()->mDetectUpstreamDropouts; } ) )
1160  )
1161 #endif
1162 
1163 #if defined(IS_ALPHA) || defined(END_USER_JOURNALLING)
1164  ,
1165  Section( "",
1166  Command( wxT("WriteJournal"),
1167  /* i18n-hint a "journal" is a text file that records
1168  the user's interactions with the application */
1169  XXO("Write Journal"),
1170  FN(OnWriteJournal),
1172  Options{}.CheckTest( [](AudacityProject&){
1173  return Journal::RecordEnabled(); } ) )
1174  )
1175 #endif
1176 
1177  ) ) };
1178  return menu;
1179 }
1180 
1182  wxT(""),
1183  Shared( ToolsMenu() )
1184 };
1185 
1187 {
1188  // These are the more useful to VI user Scriptables.
1189  static BaseItemSharedPtr menu{
1191  // i18n-hint: Scriptables are commands normally used from Python, Perl etc.
1192  Menu( wxT("Scriptables1"), XXO("Script&ables I"),
1193  // Note that the PLUGIN_SYMBOL must have a space between words,
1194  // whereas the short-form used here must not.
1195  // (So if you did write "CompareAudio" for the PLUGIN_SYMBOL name, then
1196  // you would have to use "Compareaudio" here.)
1197  Command( wxT("SelectTime"), XXO("Select Time..."), FN(OnAudacityCommand),
1198  AudioIONotBusyFlag() ),
1199  Command( wxT("SelectFrequencies"), XXO("Select Frequencies..."),
1200  FN(OnAudacityCommand),
1201  AudioIONotBusyFlag() ),
1202  Command( wxT("SelectTracks"), XXO("Select Tracks..."),
1203  FN(OnAudacityCommand),
1204  AudioIONotBusyFlag() ),
1205  Command( wxT("SetTrackStatus"), XXO("Set Track Status..."),
1206  FN(OnAudacityCommand),
1207  AudioIONotBusyFlag() ),
1208  Command( wxT("SetTrackAudio"), XXO("Set Track Audio..."),
1209  FN(OnAudacityCommand),
1210  AudioIONotBusyFlag() ),
1211  Command( wxT("SetTrackVisuals"), XXO("Set Track Visuals..."),
1212  FN(OnAudacityCommand),
1213  AudioIONotBusyFlag() ),
1214  Command( wxT("GetPreference"), XXO("Get Preference..."),
1215  FN(OnAudacityCommand),
1216  AudioIONotBusyFlag() ),
1217  Command( wxT("SetPreference"), XXO("Set Preference..."),
1218  FN(OnAudacityCommand),
1219  AudioIONotBusyFlag() ),
1220  Command( wxT("SetClip"), XXO("Set Clip..."), FN(OnAudacityCommand),
1221  AudioIONotBusyFlag() ),
1222  Command( wxT("SetEnvelope"), XXO("Set Envelope..."),
1223  FN(OnAudacityCommand),
1224  AudioIONotBusyFlag() ),
1225  Command( wxT("SetLabel"), XXO("Set Label..."), FN(OnAudacityCommand),
1226  AudioIONotBusyFlag() ),
1227  Command( wxT("SetProject"), XXO("Set Project..."), FN(OnAudacityCommand),
1228  AudioIONotBusyFlag() )
1229  ) ) };
1230  return menu;
1231 }
1232 
1234  wxT("Optional/Extra/Part2"),
1236 };
1237 
1239 {
1240  // Less useful to VI users.
1241  static BaseItemSharedPtr menu{
1243  // i18n-hint: Scriptables are commands normally used from Python, Perl etc.
1244  Menu( wxT("Scriptables2"), XXO("Scripta&bles II"),
1245  Command( wxT("Select"), XXO("Select..."), FN(OnAudacityCommand),
1246  AudioIONotBusyFlag() ),
1247  Command( wxT("SetTrack"), XXO("Set Track..."), FN(OnAudacityCommand),
1248  AudioIONotBusyFlag() ),
1249  Command( wxT("GetInfo"), XXO("Get Info..."), FN(OnAudacityCommand),
1250  AudioIONotBusyFlag() ),
1251  Command( wxT("Message"), XXO("Message..."), FN(OnAudacityCommand),
1252  AudioIONotBusyFlag() ),
1253  Command( wxT("Help"), XXO("Help..."), FN(OnAudacityCommand),
1254  AudioIONotBusyFlag() ),
1255  Command( wxT("Import2"), XXO("Import..."), FN(OnAudacityCommand),
1256  AudioIONotBusyFlag() ),
1257  Command( wxT("Export2"), XXO("Export..."), FN(OnAudacityCommand),
1258  AudioIONotBusyFlag() ),
1259  Command( wxT("OpenProject2"), XXO("Open Project..."),
1260  FN(OnAudacityCommand),
1261  AudioIONotBusyFlag() ),
1262  Command( wxT("SaveProject2"), XXO("Save Project..."),
1263  FN(OnAudacityCommand),
1264  AudioIONotBusyFlag() ),
1265  Command( wxT("Drag"), XXO("Move Mouse..."), FN(OnAudacityCommand),
1266  AudioIONotBusyFlag() ),
1267  Command( wxT("CompareAudio"), XXO("Compare Audio..."),
1268  FN(OnAudacityCommand),
1269  AudioIONotBusyFlag() ),
1270  // i18n-hint: Screenshot in the help menu has a much bigger dialog.
1271  Command( wxT("Screenshot"), XXO("Screenshot (short format)..."),
1272  FN(OnAudacityCommand),
1273  AudioIONotBusyFlag() )
1274  ) ) };
1275  return menu;
1276 }
1277 
1279  wxT("Optional/Extra/Part2"),
1281 };
1282 
1283 }
1284 
1285 #undef FN
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
DoReloadPreferences
void DoReloadPreferences(AudacityProject &project)
Definition: PrefsDialog.cpp:846
PluginActions::Handler::OnRepeatLastGenerator
void OnRepeatLastGenerator(const CommandContext &context)
Definition: PluginMenus.cpp:460
anonymous_namespace{PluginMenus.cpp}::CompareEffectsByPublisherAndName
bool CompareEffectsByPublisherAndName(const PluginDescriptor *a, const PluginDescriptor *b)
Definition: PluginMenus.cpp:89
anonymous_namespace{PluginMenus.cpp}::PopulateEffectsMenu
MenuTable::BaseItemPtrs PopulateEffectsMenu(EffectType type, CommandFlag batchflags, CommandFlag realflags)
Definition: PluginMenus.cpp:309
NYQUIST_PROMPT_ID
#define NYQUIST_PROMPT_ID
Definition: PluginManager.h:360
PluginActions::Handler::OnAudacityCommand
void OnAudacityCommand(const CommandContext &ctx)
Definition: PluginMenus.cpp:667
TranslatableString::empty
bool empty() const
Definition: TranslatableString.h:72
TempDirectory::DefaultTempDir
FILES_API const FilePath & DefaultTempDir()
Definition: TempDirectory.cpp:58
PluginTypeEffect
@ PluginTypeEffect
Definition: PluginManager.h:35
SNAP_OFF
@ SNAP_OFF
Definition: ProjectSettings.h:29
Journal
Facilities for recording and playback of sequences of user interaction.
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
PluginDescriptor::IsEffectInteractive
bool IsEffectInteractive() const
Definition: PluginManager.cpp:197
PluginActions::Handler::OnSimulateRecordingErrors
void OnSimulateRecordingErrors(const CommandContext &context)
Definition: PluginMenus.cpp:580
anonymous_namespace{PluginMenus.cpp}::sAttachment5
AttachedItem sAttachment5
Definition: PluginMenus.cpp:1233
anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItemGroup
void AddEffectMenuItemGroup(MenuTable::BaseItemPtrs &table, const TranslatableStrings &names, const PluginIDs &plugs, const std::vector< CommandFlag > &flags, bool isDefault)
Definition: PluginMenus.cpp:695
OpenScreenshotTools
void OpenScreenshotTools(AudacityProject &project)
Definition: Screenshot.cpp:135
PluginDescriptor::IsEffectRealtime
bool IsEffectRealtime() const
Definition: PluginManager.cpp:212
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
ComponentInterfaceSymbol::Translation
const wxString Translation() const
Definition: ComponentInterfaceSymbol.h:58
MenuTable::FinderScope
Definition: CommandManager.h:485
anonymous_namespace{PluginMenus.cpp}::PopulateMacrosMenu
MenuTable::BaseItemPtrs PopulateMacrosMenu(CommandFlag flags)
Definition: PluginMenus.cpp:825
flag
static std::once_flag flag
Definition: WaveformView.cpp:1124
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
anonymous_namespace{PluginMenus.cpp}::HasLastGeneratorFlag
const ReservedCommandFlag & HasLastGeneratorFlag()
Definition: PluginMenus.cpp:855
EffectManager::kRepeatGen
@ kRepeatGen
Definition: EffectManager.h:59
TranslatableStrings
std::vector< TranslatableString > TranslatableStrings
Definition: TranslatableString.h:295
anonymous_namespace{PluginMenus.cpp}::ExtraScriptablesIMenu
BaseItemSharedPtr ExtraScriptablesIMenu()
Definition: PluginMenus.cpp:1186
Project.h
anonymous_namespace{PluginMenus.cpp}::ToolsMenu
BaseItemSharedPtr ToolsMenu()
Definition: PluginMenus.cpp:1060
anonymous_namespace{PluginMenus.cpp}::CompareEffectsByType
bool CompareEffectsByType(const PluginDescriptor *a, const PluginDescriptor *b)
Definition: PluginMenus.cpp:132
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:58
anonymous_namespace{PluginMenus.cpp}::HasLastAnalyzerFlag
const ReservedCommandFlag & HasLastAnalyzerFlag()
Definition: PluginMenus.cpp:985
PluginDescriptor::GetPluginType
PluginType GetPluginType() const
Definition: PluginManager.cpp:95
AudioIONotBusyFlag
const ReservedCommandFlag & AudioIONotBusyFlag()
Definition: CommonCommandFlags.cpp:128
CommandManager::Options
Definition: CommandManager.h:98
FileNames::UpdateDefaultPath
FILES_API void UpdateDefaultPath(Operation op, const FilePath &path)
anonymous_namespace{PluginMenus.cpp}::CompareEffectsByName
bool CompareEffectsByName(const PluginDescriptor *a, const PluginDescriptor *b)
Definition: PluginMenus.cpp:62
Format
Abstract base class used in importing a file.
ProjectSelectionManager::AS_SetRate
void AS_SetRate(double rate) override
Definition: ProjectSelectionManager.cpp:94
ReservedCommandFlag
Definition: CommandFlag.h:89
Registry::Shared
std::unique_ptr< SharedItem > Shared(const BaseItemSharedPtr &ptr)
Definition: Registry.h:93
EffectManager::GetCommandName
TranslatableString GetCommandName(const PluginID &ID)
Definition: EffectManager.cpp:101
RunBenchmark
void RunBenchmark(wxWindow *parent, AudacityProject &project)
Definition: Benchmark.cpp:95
PluginActions::Handler::OnScreenshot
void OnScreenshot(const CommandContext &context)
Definition: PluginMenus.cpp:566
XO
#define XO(s)
Definition: Internat.h:31
PluginActions::Handler::OnWriteJournal
void OnWriteJournal(const CommandContext &)
Definition: PluginMenus.cpp:602
anonymous_namespace{PluginMenus.cpp}::sAttachment6
AttachedItem sAttachment6
Definition: PluginMenus.cpp:1278
MenuCreator::mLastTool
PluginID mLastTool
Definition: Menus.h:56
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
AlwaysEnabledFlag
constexpr CommandFlag AlwaysEnabledFlag
Definition: CommandFlag.h:35
MenuTable::AttachedItem
Definition: CommandManager.h:708
CommandFlag
std::bitset< NCommandFlags > CommandFlag
Definition: CommandFlag.h:31
EffectManager::Get
static EffectManager & Get()
Definition: EffectManager.cpp:42
PluginActions::Handler::OnApplyMacroDirectlyByName
void OnApplyMacroDirectlyByName(const CommandContext &context, const MacroID &Name)
Definition: PluginMenus.cpp:628
PluginRegistrationDialog
Definition: PluginRegistrationDialog.h:25
PluginActions::Handler::OnDetectUpstreamDropouts
void OnDetectUpstreamDropouts(const CommandContext &context)
Definition: PluginMenus.cpp:591
AudioIoCallback::mSimulateRecordingErrors
bool mSimulateRecordingErrors
Definition: AudioIO.h:553
ComponentInterfaceSymbol::Msgid
const TranslatableString & Msgid() const
Definition: ComponentInterfaceSymbol.h:56
MenuCreator::repeattypeplugin
@ repeattypeplugin
Definition: Menus.h:61
WaveTracksSelectedFlag
const ReservedCommandFlag & WaveTracksSelectedFlag()
Definition: CommonCommandFlags.cpp:165
desc
const TranslatableString desc
Definition: ExportPCM.cpp:58
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
MenuCreator::RebuildAllMenuBars
static void RebuildAllMenuBars()
Definition: Menus.cpp:679
PluginActions::Handler::OnApplyMacrosPalette
void OnApplyMacrosPalette(const CommandContext &context)
Definition: PluginMenus.cpp:553
PluginIDs
wxArrayString PluginIDs
Definition: PluginManager.h:169
MenuCreator::mLastAnalyzer
PluginID mLastAnalyzer
Definition: Menus.h:53
PluginActions::Handler::OnManageAnalyzers
void OnManageAnalyzers(const CommandContext &context)
Definition: PluginMenus.cpp:528
ApplyMacroDialog::ApplyMacroToProject
void ApplyMacroToProject(int iMacro, bool bHasGui=true)
Definition: BatchProcessDialog.cpp:265
ResetPreferences
void ResetPreferences()
Call this to reset preferences to an (almost)-"new" default state.
Definition: Prefs.cpp:209
anonymous_namespace{PluginMenus.cpp}::IsRealtimeNotActiveFlag
static const ReservedCommandFlag & IsRealtimeNotActiveFlag()
Definition: PluginMenus.cpp:912
AudioIoCallback::mDetectUpstreamDropouts
bool mDetectUpstreamDropouts
Definition: AudioIO.h:557
PluginActions::Handler::OnEffect
void OnEffect(const CommandContext &context)
Definition: PluginMenus.cpp:446
PluginActions::Handler
Definition: PluginMenus.cpp:388
MacroCommands::DoAudacityCommand
static bool DoAudacityCommand(const PluginID &ID, const CommandContext &context, unsigned flags)
Definition: BatchCommands.cpp:497
XXO
#define XXO(s)
Definition: Internat.h:44
ApplyMacroDialog
Shows progress in executing commands in MacroCommands.
Definition: BatchProcessDialog.h:29
EffectManager
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:46
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:34
ProjectSelectionManager::AS_SetSnapTo
void AS_SetSnapTo(int snap) override
Definition: ProjectSelectionManager.cpp:108
ProjectSelectionManager::Get
static ProjectSelectionManager & Get(AudacityProject &project)
Definition: ProjectSelectionManager.cpp:36
EffectManager::GetEffectFamilyName
TranslatableString GetEffectFamilyName(const PluginID &ID)
Definition: EffectManager.cpp:106
Registry::BaseItemSharedPtr
std::shared_ptr< BaseItem > BaseItemSharedPtr
Definition: Registry.h:72
PluginActions::Handler::OnManageEffects
void OnManageEffects(const CommandContext &context)
Definition: PluginMenus.cpp:452
GetAttachedWindows
AUDACITY_DLL_API AttachedWindows & GetAttachedWindows(AudacityProject &project)
Definition: ProjectWindows.cpp:114
MenuCreator::mLastAnalyzerRegistration
int mLastAnalyzerRegistration
Definition: Menus.h:54
findCommandHandler
static CommandHandlerObject & findCommandHandler(AudacityProject &)
Definition: PluginMenus.cpp:681
EffectManager::IsHidden
bool IsHidden(const PluginID &ID)
Definition: EffectManager.cpp:202
CommandManager::DoRepeatProcess
void DoRepeatProcess(const CommandContext &context, int)
Definition: CommandManager.cpp:1313
anonymous_namespace{PluginMenus.cpp}::sAttachment2
AttachedItem sAttachment2
Definition: PluginMenus.cpp:979
anonymous_namespace{PluginMenus.cpp}::ShowManager
bool ShowManager(PluginManager &pm, wxWindow *parent, EffectType type)
Definition: PluginMenus.cpp:45
name
const TranslatableString name
Definition: Distortion.cpp:98
PluginActions::Handler::OnAnalyzer2
void OnAnalyzer2(wxCommandEvent &evt)
Definition: PluginMenus.cpp:458
MacrosWindow
Definition: BatchProcessDialog.h:74
EffectTypeTool
@ EffectTypeTool
Definition: EffectInterface.h:61
PluginManager::EffectsOfType
Range EffectsOfType(EffectType type)
Definition: PluginManager.h:282
PluginActions::Handler::OnApplyMacroDirectly
void OnApplyMacroDirectly(const CommandContext &context)
Definition: PluginMenus.cpp:623
PluginActions::Handler::OnManageGenerators
void OnManageGenerators(const CommandContext &context)
Definition: PluginMenus.cpp:440
MenuTable::Items
std::unique_ptr< MenuItems > Items(const Identifier &internalName, Args &&... args)
Definition: CommandManager.h:600
PluginManager::GetPlugin
const PluginDescriptor * GetPlugin(const PluginID &ID) const
Definition: PluginManager.cpp:1445
PluginDescriptor
Definition: PluginManager.h:44
anonymous_namespace{PluginMenus.cpp}::HasLastToolFlag
const ReservedCommandFlag & HasLastToolFlag()
Definition: PluginMenus.cpp:1051
FN
#define FN(X)
Definition: PluginMenus.cpp:690
TempDirectory.h
Journal::RecordEnabled
bool RecordEnabled()
Definition: Journal.cpp:120
RealtimeEffectManager::RealtimeIsActive
bool RealtimeIsActive()
Definition: RealtimeEffectManager.cpp:103
anonymous_namespace{PluginMenus.cpp}::HasLastEffectFlag
const ReservedCommandFlag & HasLastEffectFlag()
Definition: PluginMenus.cpp:924
anonymous_namespace{PluginMenus.cpp}::sAttachment4
AttachedItem sAttachment4
Definition: PluginMenus.cpp:1181
MacroCommands::GetNames
static wxArrayString GetNames()
Definition: BatchCommands.cpp:911
RealtimeEffectManager::Get
static RealtimeEffectManager & Get()
Definition: RealtimeEffectManager.cpp:43
PluginActions::Handler::OnRepeatLastAnalyzer
void OnRepeatLastAnalyzer(const CommandContext &context)
Definition: PluginMenus.cpp:482
AUDACITY_PREFS_VERSION_STRING
#define AUDACITY_PREFS_VERSION_STRING
Definition: Prefs.h:35
anonymous_namespace{PluginMenus.cpp}::GenerateMenu
BaseItemSharedPtr GenerateMenu()
Definition: PluginMenus.cpp:861
Identifier::GET
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
PluginActions::Handler::OnBenchmark
void OnBenchmark(const CommandContext &context)
Definition: PluginMenus.cpp:572
MenuCreator::mLastGenerator
PluginID mLastGenerator
Definition: Menus.h:51
CommandManager::Options::IsEffect
Options && IsEffect(bool value=true) &&
Definition: CommandManager.h:111
ChoiceSetting::Read
wxString Read() const
Definition: Prefs.cpp:282
PluginDescriptor::GetID
const wxString & GetID() const
Definition: PluginManager.cpp:100
CommandContext::parameter
CommandParameter parameter
Definition: CommandContext.h:68
PluginManager::Get
static PluginManager & Get()
Definition: PluginManager.cpp:695
anonymous_namespace{PluginMenus.cpp}::DoManagePluginsMenu
void DoManagePluginsMenu(AudacityProject &project, EffectType type)
Definition: PluginMenus.cpp:54
CommandManager::RegisterLastTool
void RegisterLastTool(const CommandContext &context)
Definition: CommandManager.cpp:1301
PluginManager::CheckForUpdates
void CheckForUpdates(bool bFast=false)
Definition: PluginManager.cpp:1327
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
Registry::BaseItemPtrs
std::vector< BaseItemPtr > BaseItemPtrs
Definition: Registry.h:73
anonymous_namespace{PluginMenus.cpp}::sAttachment1
AttachedItem sAttachment1
Definition: PluginMenus.cpp:918
PluginActions::Handler::OnResetConfig
void OnResetConfig(const CommandContext &context)
Definition: PluginMenus.cpp:390
anonymous_namespace{PluginMenus.cpp}::CompareEffectsByTypeAndName
bool CompareEffectsByTypeAndName(const PluginDescriptor *a, const PluginDescriptor *b)
Definition: PluginMenus.cpp:108
PluginManager
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:174
names
static TranslatableStrings names
Definition: Tags.cpp:744
UndoManager::Get
static UndoManager & Get(AudacityProject &project)
Definition: UndoManager.cpp:57
MenuTable::Command
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())
Definition: CommandManager.h:675
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:60
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
MenuCreator::mLastEffect
PluginID mLastEffect
Definition: Menus.h:52
PluginActions::Handler::OnManageMacros
void OnManageMacros(const CommandContext &context)
Definition: PluginMenus.cpp:540
TimeSelectedFlag
const ReservedCommandFlag & TimeSelectedFlag()
Definition: CommonCommandFlags.cpp:160
PluginActions::Handler::OnRepeatLastTool
void OnRepeatLastTool(const CommandContext &context)
Definition: PluginMenus.cpp:503
anonymous_namespace{PluginMenus.cpp}::sMacrosWindowKey
AttachedWindows::RegisteredFactory sMacrosWindowKey
Definition: PluginMenus.cpp:36
GetProjectFrame
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 ...
Definition: ProjectWindows.cpp:72
MenuManager::Get
static MenuManager & Get(AudacityProject &project)
Definition: Menus.cpp:70
EffectManager::GetVendorName
TranslatableString GetVendorName(const PluginID &ID)
Definition: EffectManager.cpp:114
PluginDescriptor::GetSymbol
const ComponentInterfaceSymbol & GetSymbol() const
Definition: PluginManager.cpp:115
Journal::SetRecordEnabled
bool SetRecordEnabled(bool value)
Definition: Journal.cpp:125
CommandHandlerObject
wxEvtHandler CommandHandlerObject
Definition: CommandFunctors.h:28
PluginActions::Handler::OnManageTools
void OnManageTools(const CommandContext &context)
Definition: PluginMenus.cpp:534
ToolManager::OnResetToolBars
static void OnResetToolBars(const CommandContext &context)
Definition: ToolManager.cpp:562
MenuTable::Menu
std::unique_ptr< MenuItem > Menu(const Identifier &internalName, const TranslatableString &title, Args &&... args)
Definition: CommandManager.h:623
Verbatim
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Definition: TranslatableString.h:321
ToolCodes::lastTool
@ lastTool
Definition: ProjectSettings.h:51
EffectUI::DoEffect
AUDACITY_DLL_API bool DoEffect(const PluginID &ID, const CommandContext &context, unsigned flags)
'Repeat Last Effect'.
Definition: EffectUI.cpp:1860
anonymous_namespace{PluginMenus.cpp}::CompareEffectsByPublisher
bool CompareEffectsByPublisher(const PluginDescriptor *a, const PluginDescriptor *b)
Definition: PluginMenus.cpp:69
anonymous_namespace{PluginMenus.cpp}::AnalyzeMenu
BaseItemSharedPtr AnalyzeMenu()
Definition: PluginMenus.cpp:993
PluginDescriptor::IsEffectDefault
bool IsEffectDefault() const
Definition: PluginManager.cpp:202
MenuTable::MenuOrItems
BaseItemPtr MenuOrItems(const Identifier &internalName, const TranslatableString &title, Args &&... args)
Definition: CommandManager.h:658
MenuTable::Section
std::unique_ptr< MenuPart > Section(const Identifier &internalName, Args &&... args)
Definition: CommandManager.h:611
PluginDescriptor::GetPath
const PluginPath & GetPath() const
Definition: PluginManager.cpp:110
Prefs.h
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
MenuTable
Definition: CommandManager.h:416
NoiseReductionTimeSelectedFlag
const ReservedCommandFlag & NoiseReductionTimeSelectedFlag()
Definition: CommonCommandFlags.cpp:155
CommandManager::Get
static CommandManager & Get(AudacityProject &project)
Definition: CommandManager.cpp:207
MenuManager::ModifyUndoMenuItems
static void ModifyUndoMenuItems(AudacityProject &project)
Definition: Menus.cpp:444
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:606
EffectType
EffectType
Definition: EffectInterface.h:55
safenew
#define safenew
Definition: MemoryX.h:10
MacrosWindow::UpdateDisplay
void UpdateDisplay(bool bExpanded)
Definition: BatchProcessDialog.cpp:776
PluginActions::Handler::OnRepeatLastEffect
void OnRepeatLastEffect(const CommandContext &context)
Definition: PluginMenus.cpp:471
CommandManager::Options::AllowInMacros
Options && AllowInMacros(int value=1) &&
Definition: CommandManager.h:130
MenuCreator::repeattypeapplymacro
@ repeattypeapplymacro
Definition: Menus.h:63
CommandContext::project
AudacityProject & project
Definition: CommandContext.h:64
anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItems
void AddEffectMenuItems(MenuTable::BaseItemPtrs &table, std::vector< const PluginDescriptor * > &plugs, CommandFlag batchflags, CommandFlag realflags, bool isDefault)
Definition: PluginMenus.cpp:158
anonymous_namespace{Menus.cpp}::Options
std::vector< CommandFlagOptions > & Options()
Definition: Menus.cpp:527
MenuCreator::repeattypenone
@ repeattypenone
Definition: Menus.h:60
EffectManager::kNone
@ kNone
Definition: EffectManager.h:51
anonymous_namespace{PluginMenus.cpp}::sAttachment3
AttachedItem sAttachment3
Definition: PluginMenus.cpp:1045
anonymous_namespace{PluginMenus.cpp}::EffectMenu
BaseItemSharedPtr EffectMenu()
Definition: PluginMenus.cpp:931
PluginActions
Definition: PluginMenus.cpp:384
ApplyMacroDialog::MacroIdOfName
static CommandID MacroIdOfName(const wxString &MacroName)
Definition: BatchProcessDialog.cpp:243
EffectsGroupBy
ChoiceSetting EffectsGroupBy
Definition: EffectsPrefs.cpp:67
MenuCreator::repeattypeunique
@ repeattypeunique
Definition: Menus.h:62
anonymous_namespace{PluginMenus.cpp}::ExtraScriptablesIIMenu
BaseItemSharedPtr ExtraScriptablesIIMenu()
Definition: PluginMenus.cpp:1238