Audacity  3.0.3
EffectManager.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  EffectManager.cpp
6 
7  Audacity(R) is copyright (c) 1999-2008 Audacity Team.
8  License: GPL v2. See License.txt.
9 
10 ******************************************************************//*******************************************************************/
20 
21 
22 #include "EffectManager.h"
23 
24 #include "Effect.h"
25 
26 #include <algorithm>
27 #include <wx/tokenzr.h>
28 
29 #include "../widgets/AudacityMessageBox.h"
30 
31 #include "../ShuttleGetDefinition.h"
32 #include "../commands/CommandContext.h"
33 #include "../commands/AudacityCommand.h"
34 #include "../PluginManager.h"
35 
36 
37 /*******************************************************************************
38 Creates a singleton and returns reference
39 
40  (Thread-safe...no active threading during construction or after destruction)
41 *******************************************************************************/
43 {
44  static EffectManager em;
45  return em;
46 }
47 
49 {
50  mSkipStateFlag = false;
51 }
52 
54 {
55 }
56 
57 // Here solely for the purpose of Nyquist Workbench until
58 // a better solution is devised.
60 {
62 
63  mEffects[ID] = f;
64 
65  return ID;
66 }
67 
68 // Here solely for the purpose of Nyquist Workbench until
69 // a better solution is devised.
71 {
72  PluginID id = ID;
74  mEffects.erase(id);
75 }
76 
78  const CommandContext &context,
79  wxWindow *parent,
80  bool shouldPrompt /* = true */)
81 
82 {
83  this->SetSkipStateFlag(false);
84  AudacityCommand *command = GetAudacityCommand(ID);
85 
86  if (!command)
87  {
88  return false;
89  }
90 
91  bool res = command->DoAudacityCommand(parent, context, shouldPrompt);
92 
93  return res;
94 }
95 
97 {
98  return PluginManager::Get().GetSymbol(ID);
99 }
100 
102 {
103  return GetCommandSymbol(ID).Msgid();
104 }
105 
107 {
108  auto effect = GetEffect(ID);
109  if (effect)
110  return effect->GetFamily().Msgid();
111  return {};
112 }
113 
115 {
116  auto effect = GetEffect(ID);
117  if (effect)
118  return effect->GetVendor().Msgid();
119  return {};
120 }
121 
123 {
124  wxString name = PluginManager::Get().GetSymbol(ID).Internal();
126 }
127 
129 {
130  if (GetEffect(ID))
131  return XO("Applied effect: %s").Format( GetCommandName(ID) );
132  if (GetAudacityCommand(ID))
133  return XO("Applied command: %s").Format( GetCommandName(ID) );
134 
135  return {};
136 }
137 
139 {
140  Effect* pEff = GetEffect(ID);
141  if( pEff )
142  return pEff->ManualPage();
143  AudacityCommand * pCom = GetAudacityCommand(ID);
144  if( pCom )
145  return pCom->ManualPage();
146 
147  return wxEmptyString;
148 }
149 
151 {
152  Effect* pEff = GetEffect(ID);
153  if( pEff )
154  return pEff->GetDescription();
155  AudacityCommand * pCom = GetAudacityCommand(ID);
156  if( pCom )
157  return pCom->GetDescription();
158 
159  return {};
160 }
161 
162 
163 void EffectManager::GetCommandDefinition(const PluginID & ID, const CommandContext & context, int flags)
164 {
165  ComponentInterface *command;
166  command = GetEffect(ID);
167  if( !command )
168  command = GetAudacityCommand( ID );
169  if( !command )
170  return;
171 
172  ShuttleParams NullShuttle;
173  // Test if it defines any parameters at all.
174  bool bHasParams = command->DefineParams( NullShuttle );
175  if( (flags ==0) && !bHasParams )
176  return;
177 
178  // This is capturing the output context into the shuttle.
179  ShuttleGetDefinition S( *context.pOutput.get()->mStatusTarget.get() );
180  S.StartStruct();
181  // using GET to expose a CommandID to the user!
182  // Macro command details are one place that we do expose Identifier
183  // to (more sophisticated) users
184  S.AddItem( GetCommandIdentifier( ID ).GET(), "id" );
185  S.AddItem( GetCommandName( ID ).Translation(), "name" );
186  if( bHasParams ){
187  S.StartField( "params" );
188  S.StartArray();
189  command->DefineParams( S );
190  S.EndArray();
191  S.EndField();
192  }
193  S.AddItem( GetCommandUrl( ID ), "url" );
194  // The tip is a translated string!
195  S.AddItem( GetCommandTip( ID ).Translation(), "tip" );
196  S.EndStruct();
197 }
198 
199 
200 
202 {
203  Effect *effect = GetEffect(ID);
204 
205  if (effect)
206  {
207  return effect->IsHidden();
208  }
209 
210  return false;
211 }
212 
214 {
216 }
217 
219 {
220  return mSkipStateFlag;
221 }
222 
224 {
225  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
226  if (plug)
227  {
228  return plug->IsEffectAutomatable();
229  }
230 
231  return false;
232 }
233 
235 {
236  Effect *effect = GetEffect(ID);
237 
238  if (effect)
239  {
240  wxString parms;
241 
242  effect->GetAutomationParameters(parms);
243 
244  // Some effects don't have automatable parameters and will not return
245  // anything, so try to get the active preset (current or factory).
246  if (parms.empty())
247  {
248  parms = GetDefaultPreset(ID);
249  }
250 
251  return parms;
252  }
253 
254  AudacityCommand *command = GetAudacityCommand(ID);
255 
256  if (command)
257  {
258  wxString parms;
259 
260  command->GetAutomationParameters(parms);
261 
262  // Some effects don't have automatable parameters and will not return
263  // anything, so try to get the active preset (current or factory).
264  if (parms.empty())
265  {
266  parms = GetDefaultPreset(ID);
267  }
268 
269  return parms;
270  }
271  return wxEmptyString;
272 }
273 
274 bool EffectManager::SetEffectParameters(const PluginID & ID, const wxString & params)
275 {
276  Effect *effect = GetEffect(ID);
277 
278  if (effect)
279  {
281 
282  if (eap.HasEntry(wxT("Use Preset")))
283  {
284  return effect->SetAutomationParameters(eap.Read(wxT("Use Preset")));
285  }
286 
287  return effect->SetAutomationParameters(params);
288  }
289  AudacityCommand *command = GetAudacityCommand(ID);
290 
291  if (command)
292  {
293  // Set defaults (if not initialised) before setting values.
294  command->Init();
296 
297  if (eap.HasEntry(wxT("Use Preset")))
298  {
299  return command->SetAutomationParameters(eap.Read(wxT("Use Preset")));
300  }
301 
302  return command->SetAutomationParameters(params);
303  }
304  return false;
305 }
306 
308  const PluginID & ID,
309  const EffectClientInterface::EffectDialogFactory &factory, wxWindow &parent)
310 {
311  bool result = false;
312  Effect *effect = GetEffect(ID);
313 
314  if (effect)
315  {
316  result = effect->ShowInterface(
317  parent, factory, effect->IsBatchProcessing() );
318  return result;
319  }
320 
321  AudacityCommand *command = GetAudacityCommand(ID);
322 
323  if (command)
324  {
325  result = command->PromptUser(&parent);
326  return result;
327  }
328 
329  return result;
330 }
331 
333 {
334  Effect *effect = GetEffect(ID);
335 
336  if (!effect)
337  {
338  return false;
339  }
340 
341  return effect->GetUserPresets().size() > 0 ||
342  effect->GetFactoryPresets().size() > 0 ||
343  effect->HasCurrentSettings() ||
344  effect->HasFactoryDefaults();
345 }
346 
347 #include <wx/choice.h>
348 #include <wx/listbox.h>
349 #include "../ShuttleGui.h"
350 
351 namespace {
352 
354 //
355 // EffectPresetsDialog
356 //
358 
360 {
361 public:
362  EffectPresetsDialog(wxWindow *parent, Effect *effect);
363  virtual ~EffectPresetsDialog();
364 
365  wxString GetSelected() const;
366  void SetSelected(const wxString & parms);
367 
368 private:
369  void SetPrefix(const TranslatableString & type, const wxString & prefix);
370  void UpdateUI();
371 
372  void OnType(wxCommandEvent & evt);
373  void OnOk(wxCommandEvent & evt);
374  void OnCancel(wxCommandEvent & evt);
375 
376 private:
377  wxChoice *mType;
378  wxListBox *mPresets;
379 
382  wxString mSelection;
383 
384  DECLARE_EVENT_TABLE()
385 };
386 
387 enum
388 {
389  ID_Type = 10000
390 };
391 
392 BEGIN_EVENT_TABLE(EffectPresetsDialog, wxDialogWrapper)
393  EVT_CHOICE(ID_Type, EffectPresetsDialog::OnType)
394  EVT_LISTBOX_DCLICK(wxID_ANY, EffectPresetsDialog::OnOk)
395  EVT_BUTTON(wxID_OK, EffectPresetsDialog::OnOk)
396  EVT_BUTTON(wxID_CANCEL, EffectPresetsDialog::OnCancel)
398 
399 EffectPresetsDialog::EffectPresetsDialog(wxWindow *parent, Effect *effect)
400 : wxDialogWrapper(parent, wxID_ANY, XO("Select Preset"))
401 {
402  ShuttleGui S(this, eIsCreating);
403  S.StartVerticalLay();
404  {
405  S.StartTwoColumn();
406  S.SetStretchyCol(1);
407  {
408  S.AddPrompt(XXO("Type:"));
409  mType = S.Id(ID_Type).AddChoice( {}, {}, 0 );
410 
411  S.AddPrompt(XXO("&Preset:"));
412  mPresets = S
413  .Style( wxLB_SINGLE | wxLB_NEEDED_SB )
414  .AddListBox( {} );
415  }
416  S.EndTwoColumn();
417 
418  S.AddStandardButtons();
419  }
420  S.EndVerticalLay();
421 
422  mUserPresets = effect->GetUserPresets();
423  mFactoryPresets = effect->GetFactoryPresets();
424 
425  if (mUserPresets.size() > 0)
426  {
427  mType->Append(_("User Presets"));
428  }
429 
430  if (mFactoryPresets.size() > 0)
431  {
432  mType->Append(_("Factory Presets"));
433  }
434 
435  if (effect->HasCurrentSettings())
436  {
437  mType->Append(_("Current Settings"));
438  }
439 
440  if (effect->HasFactoryDefaults())
441  {
442  mType->Append(_("Factory Defaults"));
443  }
444 
445  UpdateUI();
446 }
447 
448 EffectPresetsDialog::~EffectPresetsDialog()
449 {
450 }
451 
452 wxString EffectPresetsDialog::GetSelected() const
453 {
454  return mSelection;
455 }
456 
457 void EffectPresetsDialog::SetSelected(const wxString & parms)
458 {
459  wxString preset = parms;
460  if (preset.StartsWith(Effect::kUserPresetIdent))
461  {
462  preset.Replace(Effect::kUserPresetIdent, wxEmptyString, false);
463  SetPrefix(XO("User Presets"), preset);
464  }
465  else if (preset.StartsWith(Effect::kFactoryPresetIdent))
466  {
467  preset.Replace(Effect::kFactoryPresetIdent, wxEmptyString, false);
468  SetPrefix(XO("Factory Presets"), preset);
469  }
470  else if (preset.StartsWith(Effect::kCurrentSettingsIdent))
471  {
472  SetPrefix(XO("Current Settings"), wxEmptyString);
473  }
474  else if (preset.StartsWith(Effect::kFactoryDefaultsIdent))
475  {
476  SetPrefix(XO("Factory Defaults"), wxEmptyString);
477  }
478 }
479 
480 void EffectPresetsDialog::SetPrefix(
481  const TranslatableString & type, const wxString & prefix)
482 {
483  mType->SetStringSelection(type.Translation());
484 
485  if (type == XO("User Presets"))
486  {
487  mPresets->Clear();
488  for (const auto &preset : mUserPresets)
489  mPresets->Append(preset);
490  mPresets->Enable(true);
491  mPresets->SetStringSelection(prefix);
492  if (mPresets->GetSelection() == wxNOT_FOUND)
493  {
494  mPresets->SetSelection(0);
495  }
496  mSelection = Effect::kUserPresetIdent + mPresets->GetStringSelection();
497  }
498  else if (type == XO("Factory Presets"))
499  {
500  mPresets->Clear();
501  for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++)
502  {
503  auto label = mFactoryPresets[i];
504  if (label.empty())
505  {
506  label = _("None");
507  }
508  mPresets->Append(label);
509  }
510  mPresets->Enable(true);
511  mPresets->SetStringSelection(prefix);
512  if (mPresets->GetSelection() == wxNOT_FOUND)
513  {
514  mPresets->SetSelection(0);
515  }
516  mSelection = Effect::kFactoryPresetIdent + mPresets->GetStringSelection();
517  }
518  else if (type == XO("Current Settings"))
519  {
520  mPresets->Clear();
521  mPresets->Enable(false);
522  mSelection = Effect::kCurrentSettingsIdent;
523  }
524  else if (type == XO("Factory Defaults"))
525  {
526  mPresets->Clear();
527  mPresets->Enable(false);
528  mSelection = Effect::kFactoryDefaultsIdent;
529  }
530 }
531 
532 void EffectPresetsDialog::UpdateUI()
533 {
534  int selected = mType->GetSelection();
535  if (selected == wxNOT_FOUND)
536  {
537  selected = 0;
538  mType->SetSelection(selected);
539  }
540  wxString type = mType->GetString(selected);
541 
542  if (type == _("User Presets"))
543  {
544  selected = mPresets->GetSelection();
545  if (selected == wxNOT_FOUND)
546  {
547  selected = 0;
548  }
549 
550  mPresets->Clear();
551  for (const auto &preset : mUserPresets)
552  mPresets->Append(preset);
553  mPresets->Enable(true);
554  mPresets->SetSelection(selected);
555  mSelection = Effect::kUserPresetIdent + mPresets->GetString(selected);
556  }
557  else if (type == _("Factory Presets"))
558  {
559  selected = mPresets->GetSelection();
560  if (selected == wxNOT_FOUND)
561  {
562  selected = 0;
563  }
564 
565  mPresets->Clear();
566  for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++)
567  {
568  auto label = mFactoryPresets[i];
569  if (label.empty())
570  {
571  label = _("None");
572  }
573  mPresets->Append(label);
574  }
575  mPresets->Enable(true);
576  mPresets->SetSelection(selected);
577  mSelection = Effect::kFactoryPresetIdent + mPresets->GetString(selected);
578  }
579  else if (type == _("Current Settings"))
580  {
581  mPresets->Clear();
582  mPresets->Enable(false);
583  mSelection = Effect::kCurrentSettingsIdent;
584  }
585  else if (type == _("Factory Defaults"))
586  {
587  mPresets->Clear();
588  mPresets->Enable(false);
589  mSelection = Effect::kFactoryDefaultsIdent;
590  }
591 }
592 
593 void EffectPresetsDialog::OnType(wxCommandEvent & WXUNUSED(evt))
594 {
595  UpdateUI();
596 }
597 
598 void EffectPresetsDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
599 {
600  UpdateUI();
601 
602  EndModal(true);
603 }
604 
605 void EffectPresetsDialog::OnCancel(wxCommandEvent & WXUNUSED(evt))
606 {
607  mSelection = wxEmptyString;
608 
609  EndModal(false);
610 }
611 
612 }
613 
614 wxString EffectManager::GetPreset(const PluginID & ID, const wxString & params, wxWindow * parent)
615 {
616  Effect *effect = GetEffect(ID);
617 
618  if (!effect)
619  {
620  return wxEmptyString;
621  }
622 
624 
625  wxString preset;
626  if (eap.HasEntry(wxT("Use Preset")))
627  {
628  preset = eap.Read(wxT("Use Preset"));
629  }
630 
631  {
632  EffectPresetsDialog dlg(parent, effect);
633  dlg.Layout();
634  dlg.Fit();
635  dlg.SetSize(dlg.GetMinSize());
636  dlg.CenterOnParent();
637  dlg.SetSelected(preset);
638 
639  if (dlg.ShowModal())
640  preset = dlg.GetSelected();
641  else
642  preset = wxEmptyString;
643  }
644 
645  if (preset.empty())
646  {
647  return preset;
648  }
649 
650  eap.DeleteAll();
651 
652  eap.Write(wxT("Use Preset"), preset);
653  eap.GetParameters(preset);
654 
655  return preset;
656 }
657 
659 {
660  Effect *effect = GetEffect(ID);
661 
662  if (!effect)
663  {
664  return wxEmptyString;
665  }
666 
667  wxString preset;
668  if (effect->HasCurrentSettings())
669  {
671  }
672  else if (effect->HasFactoryDefaults())
673  {
675  }
676 
677  if (!preset.empty())
678  {
679  CommandParameters eap;
680 
681  eap.Write(wxT("Use Preset"), preset);
682  eap.GetParameters(preset);
683  }
684 
685  return preset;
686 }
687 
688 void EffectManager::SetBatchProcessing(const PluginID & ID, bool start)
689 {
690  Effect *effect = GetEffect(ID);
691  if (effect)
692  {
693  effect->SetBatchProcessing(start);
694  return;
695  }
696 
697  AudacityCommand *command = GetAudacityCommand(ID);
698  if (command)
699  {
700  command->SetBatchProcessing(start);
701  return;
702  }
703 
704 }
705 
707 {
708  // Must have a "valid" ID
709  if (ID.empty())
710  {
711  return NULL;
712  }
713 
714  // If it is actually a command then refuse it (as an effect).
715  if( mCommands.find( ID ) != mCommands.end() )
716  return NULL;
717 
718  // TODO: This is temporary and should be redone when all effects are converted
719  if (mEffects.find(ID) == mEffects.end())
720  {
721  // This will instantiate the effect client if it hasn't already been done
723  if (ident && ident->IsLegacy())
724  {
725  auto effect = dynamic_cast<Effect *>(ident);
726  if (effect && effect->Startup(NULL))
727  {
728  mEffects[ID] = effect;
729  return effect;
730  }
731  }
732 
733  auto effect = std::make_shared<Effect>(); // TODO: use make_unique and store in std::unordered_map
734  if (effect)
735  {
736  EffectClientInterface *client = dynamic_cast<EffectClientInterface *>(ident);
737  if (client && effect->Startup(client))
738  {
739  auto pEffect = effect.get();
740  mEffects[ID] = pEffect;
741  mHostEffects[ID] = std::move(effect);
742  return pEffect;
743  }
744  }
745 
746  auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
747  if( !command )
749  XO(
750 "Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'")
751  .Format( GetCommandName(ID) ),
752  XO("Effect failed to initialize"));
753 
754  return NULL;
755  }
756 
757  return mEffects[ID];
758 }
759 
761 {
762  // Must have a "valid" ID
763  if (ID.empty())
764  {
765  return NULL;
766  }
767 
768  // TODO: This is temporary and should be redone when all effects are converted
769  if (mCommands.find(ID) == mCommands.end())
770  {
771 
772  // This will instantiate the effect client if it hasn't already been done
773  auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
774  if (command )//&& command->Startup(NULL))
775  {
776  command->Init();
777  mCommands[ID] = command;
778  return command;
779  }
780 
781  /*
782  if (ident && ident->IsLegacy())
783  {
784  auto command = dynamic_cast<AudacityCommand *>(ident);
785  if (commandt && command->Startup(NULL))
786  {
787  mCommands[ID] = command;
788  return command;
789  }
790  }
791 
792 
793  auto command = std::make_shared<AudacityCommand>(); // TODO: use make_unique and store in std::unordered_map
794  if (command)
795  {
796  AudacityCommand *client = dynamic_cast<AudacityCommand *>(ident);
797  if (client && command->Startup(client))
798  {
799  auto pCommand = command.get();
800  mEffects[ID] = pCommand;
801  mHostEffects[ID] = std::move(effect);
802  return pEffect;
803  }
804  }
805 */
807  XO(
808 "Attempting to initialize the following command failed:\n\n%s\n\nMore information may be available in 'Help > Diagnostics > Show Log'")
809  .Format( GetCommandName(ID) ),
810  XO("Command failed to initialize"));
811 
812  return NULL;
813  }
814 
815  return mCommands[ID];
816 }
817 
818 
820 {
821  static PluginID empty;
822  if (strTarget.empty()) // set GetCommandIdentifier to wxT("") to not show an effect in Batch mode
823  {
824  return empty;
825  }
826 
828  // Effects OR Generic commands...
830  while (plug)
831  {
832  if (GetCommandIdentifier(plug->GetID()) == strTarget)
833  {
834  return plug->GetID();
835  }
837  }
838  return empty;;
839 }
840 
EffectManager::GetSkipStateFlag
bool GetSkipStateFlag()
Definition: EffectManager.cpp:218
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
RegistryPaths
std::vector< RegistryPath > RegistryPaths
Definition: Types.h:262
Effect::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Effect.cpp:533
ID_Type
@ ID_Type
Definition: ScienFilter.cpp:81
TranslatableString
Definition: Types.h:290
anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::mFactoryPresets
RegistryPaths mFactoryPresets
Definition: EffectManager.cpp:380
PluginManager::GetInstance
ComponentInterface * GetInstance(const PluginID &ID)
Definition: PluginManager.cpp:2664
anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::mPresets
wxListBox * mPresets
Definition: EffectManager.cpp:378
Effect::GetSquashedName
static CommandID GetSquashedName(wxString name)
Definition: Effect.cpp:775
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:36
TranslatableString::empty
bool empty() const
Definition: Types.h:329
AudacityCommand::DoAudacityCommand
bool DoAudacityCommand(wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
Definition: AudacityCommand.cpp:182
ShuttleGuiBase::AddChoice
wxChoice * AddChoice(const TranslatableString &Prompt, const TranslatableStrings &choices, int Selected=-1)
Definition: ShuttleGui.cpp:391
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1177
anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog
Definition: EffectManager.cpp:360
EffectManager::GetEffectParameters
wxString GetEffectParameters(const PluginID &ID)
Definition: EffectManager.cpp:234
AudacityCommand::PromptUser
virtual bool PromptUser(wxWindow *parent)
Definition: AudacityCommand.cpp:222
EffectManager::mHostEffects
EffectOwnerMap mHostEffects
Definition: EffectManager.h:146
EffectManager::mCommands
AudacityCommandMap mCommands
Definition: EffectManager.h:145
Effect.h
Effect::HasFactoryDefaults
virtual bool HasFactoryDefaults()
Definition: Effect.cpp:1166
CommandMessageTargetDecorator::StartField
void StartField(const wxString &name={}) override
Definition: CommandTargets.h:109
flag
static std::once_flag flag
Definition: WaveformView.cpp:1113
Effect::GetUserPresets
virtual RegistryPaths GetUserPresets()
Definition: Effect.cpp:1150
AudacityCommand::GetDescription
virtual TranslatableString GetDescription() override
Definition: AudacityCommand.h:64
EffectManager::mSkipStateFlag
bool mSkipStateFlag
Definition: EffectManager.h:152
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
EffectManager::SetBatchProcessing
void SetBatchProcessing(const PluginID &ID, bool start)
Definition: EffectManager.cpp:688
EffectManager::~EffectManager
virtual ~EffectManager()
Definition: EffectManager.cpp:53
Effect
Base class for many of the effects in Audacity.
Definition: Effect.h:71
PluginManager::GetSymbol
const ComponentInterfaceSymbol & GetSymbol(const PluginID &ID)
Definition: PluginManager.cpp:2653
EffectManager::UnregisterEffect
void UnregisterEffect(const PluginID &ID)
Definition: EffectManager.cpp:70
Format
Abstract base class used in importing a file.
anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::mType
wxChoice * mType
Definition: EffectManager.cpp:377
CommandMessageTargetDecorator::EndStruct
void EndStruct() override
Definition: CommandTargets.h:102
anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::mUserPresets
RegistryPaths mUserPresets
Definition: EffectManager.cpp:381
EffectManager::GetCommandName
TranslatableString GetCommandName(const PluginID &ID)
Definition: EffectManager.cpp:101
PluginManager::RegisterPlugin
const PluginID & RegisterPlugin(ModuleInterface *module) override
Definition: PluginManager.cpp:1451
XO
#define XO(s)
Definition: Internat.h:32
Effect::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Effect.cpp:543
Effect::IsHidden
virtual bool IsHidden()
Definition: Effect.cpp:2289
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:61
CommandParameters::GetParameters
bool GetParameters(wxString &parms)
Definition: EffectAutomationParameters.h:259
EffectManager::GetCommandSymbol
ComponentInterfaceSymbol GetCommandSymbol(const PluginID &ID)
Definition: EffectManager.cpp:96
Effect::IsBatchProcessing
virtual bool IsBatchProcessing()
Definition: Effect.cpp:1189
PluginDescriptor::IsEffectAutomatable
bool IsEffectAutomatable() const
Definition: PluginManager.cpp:1272
EffectManager::Get
static EffectManager & Get()
Definition: EffectManager.cpp:42
CommandMessageTargetDecorator::AddItem
void AddItem(const wxString &value, const wxString &name={}) override
Definition: CommandTargets.h:103
ComponentInterfaceSymbol::Msgid
const TranslatableString & Msgid() const
Definition: ComponentInterface.h:89
EffectManager::mEffects
EffectMap mEffects
Definition: EffectManager.h:144
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
EffectManager::SetSkipStateFlag
void SetSkipStateFlag(bool flag)
Definition: EffectManager.cpp:213
EffectManager::SetEffectParameters
bool SetEffectParameters(const PluginID &ID, const wxString &params)
Definition: EffectManager.cpp:274
CommandMessageTargetDecorator::EndField
void EndField() override
Definition: CommandTargets.h:111
EffectManager::GetCommandUrl
wxString GetCommandUrl(const PluginID &ID)
Definition: EffectManager.cpp:138
ShuttleGui::Style
ShuttleGui & Style(long iStyle)
Definition: ShuttleGui.h:734
EffectManager::GetCommandIdentifier
CommandID GetCommandIdentifier(const PluginID &ID)
Definition: EffectManager.cpp:122
EffectManager::RegisterEffect
const PluginID & RegisterEffect(Effect *f)
Definition: EffectManager.cpp:59
XXO
#define XXO(s)
Definition: Internat.h:45
EffectManager
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:46
factory
static RegisteredToolbarFactory factory
Definition: ControlToolBar.cpp:804
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:22
EffectManager::GetCommandTip
TranslatableString GetCommandTip(const PluginID &ID)
Definition: EffectManager.cpp:150
EffectManager::GetEffect
Effect * GetEffect(const PluginID &ID)
Definition: EffectManager.cpp:706
label
TranslatableString label
Definition: Tags.cpp:755
CommandMessageTargetDecorator::EndArray
void EndArray() override
Definition: CommandTargets.h:100
Effect::GetFactoryPresets
RegistryPaths GetFactoryPresets() override
Definition: Effect.cpp:585
EffectManager::GetEffectFamilyName
TranslatableString GetEffectFamilyName(const PluginID &ID)
Definition: EffectManager.cpp:106
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1196
anonymous_namespace{EffectManager.cpp}::EffectPresetsDialog::mSelection
wxString mSelection
Definition: EffectManager.cpp:382
EffectManager::IsHidden
bool IsHidden(const PluginID &ID)
Definition: EffectManager.cpp:201
PluginID
wxString PluginID
Definition: EffectManager.h:30
AudacityCommand::GetAutomationParameters
virtual bool GetAutomationParameters(wxString &parms)
Definition: AudacityCommand.cpp:139
AudacityCommand
Base class for command in Audacity.
Definition: AudacityCommand.h:41
Effect::kCurrentSettingsIdent
static const wxString kCurrentSettingsIdent
Definition: Effect.h:538
name
const TranslatableString name
Definition: Distortion.cpp:98
AudacityCommand::SetBatchProcessing
virtual void SetBatchProcessing(bool start)
Definition: AudacityCommand.h:70
ShuttleGuiBase::StartTwoColumn
void StartTwoColumn()
Definition: ShuttleGui.h:374
Effect::ManualPage
virtual wxString ManualPage()
Definition: Effect.cpp:1171
Effect::kUserPresetIdent
static const wxString kUserPresetIdent
Definition: Effect.h:536
EffectManager::EffectManager
EffectManager()
Definition: EffectManager.cpp:48
PluginDescriptor
Definition: PluginManager.h:45
EffectClientInterface::EffectDialogFactory
std::function< wxDialog *(wxWindow &parent, EffectHostInterface *, EffectUIClientInterface *) > EffectDialogFactory
Definition: EffectInterface.h:149
CommandMessageTargetDecorator::StartArray
void StartArray() override
Definition: CommandTargets.h:99
PluginManager::UnregisterPlugin
void UnregisterPlugin(const PluginID &ID)
Definition: PluginManager.cpp:2509
EffectManager::HasPresets
bool HasPresets(const PluginID &ID)
Definition: EffectManager.cpp:332
EffectManager::GetDefaultPreset
wxString GetDefaultPreset(const PluginID &ID)
Definition: EffectManager.cpp:658
EffectManager::PromptUser
bool PromptUser(const PluginID &ID, const EffectClientInterface::EffectDialogFactory &factory, wxWindow &parent)
Definition: EffectManager.cpp:307
EffectClientInterface
EffectClientInterface provides the ident interface to Effect, and is what makes Effect into a plug-in...
Definition: EffectInterface.h:144
CommandMessageTargetDecorator::StartStruct
void StartStruct() override
Definition: CommandTargets.h:101
AudacityCommand::Init
virtual bool Init()
Definition: AudacityCommand.cpp:89
PluginDescriptor::GetID
const wxString & GetID() const
Definition: PluginManager.cpp:1155
wxDialogWrapper
Definition: wxPanelWrapper.h:81
PluginManager::Get
static PluginManager & Get()
Definition: PluginManager.cpp:1761
EffectDefinitionInterface
EffectDefinitionInterface is a ComponentInterface that additionally tracks flag-functions for interac...
Definition: EffectInterface.h:74
AudacityCommand::SetAutomationParameters
virtual bool SetAutomationParameters(const wxString &parms)
Definition: AudacityCommand.cpp:157
PluginManager
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:172
CommandParameters::HasEntry
virtual bool HasEntry(const wxString &strName) const override
Definition: EffectAutomationParameters.h:89
TaggedIdentifier< CommandIdTag, false >
_
#define _(s)
Definition: Internat.h:76
Effect::GetDescription
TranslatableString GetDescription() override
Definition: Effect.cpp:182
Effect::HasCurrentSettings
virtual bool HasCurrentSettings()
Definition: Effect.cpp:1161
EffectManager::GetVendorName
TranslatableString GetVendorName(const PluginID &ID)
Definition: EffectManager.cpp:114
ComponentInterfaceSymbol::Internal
const wxString & Internal() const
Definition: ComponentInterface.h:88
AudacityCommand::ManualPage
virtual wxString ManualPage()
Definition: AudacityCommand.h:68
PluginManager::GetFirstPlugin
const PluginDescriptor * GetFirstPlugin(int type)
Definition: PluginManager.cpp:2544
EffectManager::GetEffectByIdentifier
const PluginID & GetEffectByIdentifier(const CommandID &strTarget)
Definition: EffectManager.cpp:819
EffectDefinitionInterface::IsLegacy
virtual bool IsLegacy()=0
ComponentInterface
ComponentInterface provides name / vendor / version functions to identify plugins....
Definition: ComponentInterface.h:121
EffectManager::GetCommandDefinition
void GetCommandDefinition(const PluginID &ID, const CommandContext &context, int flags)
Definition: EffectManager.cpp:163
EffectManager::GetCommandDescription
TranslatableString GetCommandDescription(const PluginID &ID)
Definition: EffectManager.cpp:128
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2406
params
EffectDistortion::Params params
Definition: Distortion.cpp:99
ShuttleGetDefinition
Shuttle that retrieves a JSON format definition of a command's parameters.
Definition: ShuttleGetDefinition.h:22
ShuttleGuiBase::AddPrompt
void AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
Definition: ShuttleGui.cpp:231
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
Effect::kFactoryDefaultsIdent
static const wxString kFactoryDefaultsIdent
Definition: Effect.h:539
EffectManager::GetAudacityCommand
AudacityCommand * GetAudacityCommand(const PluginID &ID)
Definition: EffectManager.cpp:760
ShuttleGuiBase::EndTwoColumn
void EndTwoColumn()
Definition: ShuttleGui.h:375
PluginTypeAudacityCommand
@ PluginTypeAudacityCommand
Definition: PluginManager.h:37
EffectManager.h
PluginManager::GetNextPlugin
const PluginDescriptor * GetNextPlugin(int type)
Definition: PluginManager.cpp:2568
Effect::kFactoryPresetIdent
static const wxString kFactoryPresetIdent
Definition: Effect.h:537
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:195
EffectManager::GetPreset
wxString GetPreset(const PluginID &ID, const wxString &params, wxWindow *parent)
Definition: EffectManager.cpp:614
Effect::ShowInterface
bool ShowInterface(wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
Definition: Effect.cpp:480
ComponentInterface::DefineParams
virtual bool DefineParams(ShuttleParams &WXUNUSED(S))
Definition: ComponentInterface.h:144
ShuttleGuiBase::AddListBox
wxListBox * AddListBox(const wxArrayStringEx &choices)
Definition: ShuttleGui.cpp:746
EffectManager::DoAudacityCommand
bool DoAudacityCommand(const PluginID &ID, const CommandContext &, wxWindow *parent, bool shouldPrompt=true)
Definition: EffectManager.cpp:77
EffectManager::SupportsAutomation
bool SupportsAutomation(const PluginID &ID)
Definition: EffectManager.cpp:223
END_EVENT_TABLE
END_EVENT_TABLE()
PluginTypeEffect
@ PluginTypeEffect
Definition: PluginManager.h:36
PluginManager::GetPlugin
const PluginDescriptor * GetPlugin(const PluginID &ID)
Definition: PluginManager.cpp:2534
Identifier::empty
bool empty() const
Definition: Types.h:104
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:638
Effect::SetBatchProcessing
virtual void SetBatchProcessing(bool start)
Definition: Effect.cpp:1194
CommandContext::pOutput
std::unique_ptr< CommandOutputTargets > pOutput
Definition: CommandContext.h:53