Audacity  2.2.2
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
EffectManager Class Reference

EffectManager is the class that handles effects and effect categories. More...

#include <EffectManager.h>

Classes

struct  UnsetBatchProcessing
 

Public Member Functions

 EffectManager ()
 
virtual ~EffectManager ()
 
const PluginIDRegisterEffect (Effect *f)
 
void UnregisterEffect (const PluginID &ID)
 
bool DoEffect (const PluginID &ID, wxWindow *parent, double projectRate, TrackList *list, TrackFactory *factory, SelectedRegion *selectedRegion, bool shouldPrompt=true)
 
wxString GetEffectFamilyName (const PluginID &ID)
 
wxString GetVendorName (const PluginID &ID)
 
bool DoAudacityCommand (const PluginID &ID, const CommandContext &, wxWindow *parent, bool shouldPrompt=true)
 
IdentInterfaceSymbol GetCommandSymbol (const PluginID &ID)
 
wxString GetCommandName (const PluginID &ID)
 
wxString GetCommandIdentifier (const PluginID &ID)
 
wxString GetCommandDescription (const PluginID &ID)
 
wxString GetCommandUrl (const PluginID &ID)
 
wxString GetCommandTip (const PluginID &ID)
 
void GetCommandDefinition (const PluginID &ID, const CommandContext &context, int flags)
 
bool IsHidden (const PluginID &ID)
 
bool SupportsAutomation (const PluginID &ID)
 
wxString GetEffectParameters (const PluginID &ID)
 
bool SetEffectParameters (const PluginID &ID, const wxString &params)
 
bool PromptUser (const PluginID &ID, wxWindow *parent)
 
bool HasPresets (const PluginID &ID)
 
wxString GetPreset (const PluginID &ID, const wxString &params, wxWindow *parent)
 
wxString GetDefaultPreset (const PluginID &ID)
 
BatchProcessingScope SetBatchProcessing (const PluginID &ID)
 
void SetSkipStateFlag (bool flag)
 
bool GetSkipStateFlag ()
 
bool RealtimeIsActive ()
 
bool RealtimeIsSuspended ()
 
void RealtimeAddEffect (Effect *effect)
 
void RealtimeRemoveEffect (Effect *effect)
 
void RealtimeSetEffects (const EffectArray &mActive)
 
void RealtimeInitialize (double rate)
 
void RealtimeAddProcessor (int group, unsigned chans, float rate)
 
void RealtimeFinalize ()
 
void RealtimeSuspend ()
 
void RealtimeResume ()
 
void RealtimeProcessStart ()
 
size_t RealtimeProcess (int group, unsigned chans, float **buffers, size_t numSamples)
 
void RealtimeProcessEnd ()
 
int GetRealtimeLatency ()
 
const PluginIDGetEffectByIdentifier (const wxString &strTarget)
 

Static Public Member Functions

static EffectManagerGet ()
 

Private Types

using BatchProcessingScope = std::unique_ptr< EffectManager, UnsetBatchProcessing >
 

Private Member Functions

void SetBatchProcessing (const PluginID &ID, bool start)
 
EffectGetEffect (const PluginID &ID)
 
AudacityCommandGetAudacityCommand (const PluginID &ID)
 

Private Attributes

EffectMap mEffects
 
AudacityCommandMap mCommands
 
EffectOwnerMap mHostEffects
 
int mNumEffects
 
wxCriticalSection mRealtimeLock
 
EffectArray mRealtimeEffects
 
int mRealtimeLatency
 
bool mRealtimeSuspended
 
bool mRealtimeActive
 
std::vector< unsigned > mRealtimeChans
 
std::vector< double > mRealtimeRates
 
bool mSkipStateFlag
 

Detailed Description

EffectManager is the class that handles effects and effect categories.

It maintains a graph of effect categories and subcategories, registers and unregisters effects and can return filtered lists of effects.

Definition at line 45 of file EffectManager.h.

Member Typedef Documentation

Definition at line 119 of file EffectManager.h.

Constructor & Destructor Documentation

EffectManager::EffectManager ( )

Definition at line 50 of file EffectManager.cpp.

References mRealtimeActive, mRealtimeLatency, mRealtimeLock, mRealtimeSuspended, and mSkipStateFlag.

51 {
52  mRealtimeLock.Enter();
53  mRealtimeActive = false;
54  mRealtimeSuspended = true;
55  mRealtimeLatency = 0;
56  mRealtimeLock.Leave();
57  mSkipStateFlag = false;
58 
59 #if defined(EXPERIMENTAL_EFFECTS_RACK)
60  mRack = NULL;
61 #endif
62 }
wxCriticalSection mRealtimeLock
bool mRealtimeSuspended
EffectManager::~EffectManager ( )
virtual

Definition at line 64 of file EffectManager.cpp.

65 {
66 #if defined(EXPERIMENTAL_EFFECTS_RACK)
67  // wxWidgets has already destroyed the rack since it was derived from wxFrame. So
68  // no need to DELETE it here.
69 #endif
70 }

Member Function Documentation

bool EffectManager::DoAudacityCommand ( const PluginID ID,
const CommandContext context,
wxWindow *  parent,
bool  shouldPrompt = true 
)

Run a command given the plugin ID

Definition at line 126 of file EffectManager.cpp.

References AudacityCommand::DoAudacityCommand(), GetAudacityCommand(), and SetSkipStateFlag().

Referenced by AudacityProject::DoAudacityCommand().

131 {
132  this->SetSkipStateFlag(false);
133  AudacityCommand *command = GetAudacityCommand(ID);
134 
135  if (!command)
136  {
137  return false;
138  }
139 
140  bool res = command->DoAudacityCommand(parent, context, shouldPrompt);
141 
142  return res;
143 }
Base class for command in Audacity.
void SetSkipStateFlag(bool flag)
AudacityCommand * GetAudacityCommand(const PluginID &ID)
bool DoAudacityCommand(wxWindow *parent, const CommandContext &context, bool shouldPrompt=true)
bool EffectManager::DoEffect ( const PluginID ID,
wxWindow *  parent,
double  projectRate,
TrackList list,
TrackFactory factory,
SelectedRegion selectedRegion,
bool  shouldPrompt = true 
)

Run an effect given the plugin ID

Definition at line 92 of file EffectManager.cpp.

References Effect::DoEffect(), GetEffect(), SetSkipStateFlag(), and Effect::SupportsRealtime().

Referenced by AudacityProject::DoEffect().

100 {
101  this->SetSkipStateFlag(false);
102  Effect *effect = GetEffect(ID);
103 
104  if (!effect)
105  {
106  return false;
107  }
108 
109 #if defined(EXPERIMENTAL_EFFECTS_RACK)
110  if (effect->SupportsRealtime())
111  {
112  GetRack()->Add(effect);
113  }
114 #endif
115 
116  bool res = effect->DoEffect(parent,
117  projectRate,
118  list,
119  factory,
120  selectedRegion,
121  shouldPrompt);
122 
123  return res;
124 }
bool DoEffect(wxWindow *parent, double projectRate, TrackList *list, TrackFactory *factory, SelectedRegion *selectedRegion, bool shouldPrompt=true)
Definition: Effect.cpp:1156
Base class for many of the effects in Audacity.
Definition: Effect.h:62
Effect * GetEffect(const PluginID &ID)
void SetSkipStateFlag(bool flag)
bool SupportsRealtime() override
Definition: Effect.cpp:250
EffectManager & EffectManager::Get ( )
static

Get the singleton instance of the EffectManager. Probably not safe for multi-thread use.

Definition at line 44 of file EffectManager.cpp.

Referenced by AudacityProject::AddEffectMenuItems(), HelpCommand::Apply(), MacroCommands::ApplyCommand(), MacroCommands::ApplyEffectCommand(), audacityAudioCallback(), EffectUIHost::CleanupRealtime(), AudacityProject::CreateMenusAndCommands(), AudacityProject::DoAudacityCommand(), AudacityProject::DoEffect(), MacroCommands::GetCurrentParamsFor(), PluginManager::GetFirstPluginForEffectType(), PluginManager::GetNextPluginForEffectType(), AudacityProject::GetUpdateFlags(), CommandManager::HandleTextualCommand(), AudacityProject::Import(), EffectUIHost::InitializeRealtime(), WaveTrackMenuTable::InitMenu(), MacroCommandsCatalog::MacroCommandsCatalog(), AudacityProject::OnAudacityCommand(), EffectNoiseReduction::Dialog::OnGetProfile(), MacroCommandDialog::OnItemSelected(), AudacityProject::OnStereoToMono(), NyquistEffect::Process(), MacroCommands::PromptForParamsFor(), MacroCommands::PromptForPresetFor(), GetInfoCommand::SendCommands(), MacroCommandDialog::SetCommandAndParams(), AudioIO::SetPaused(), SortEffectsByPublisher(), SortEffectsByPublisherAndName(), SortEffectsByType(), SortEffectsByTypeAndName(), AudioIO::StartStream(), AudioIO::StartStreamCleanup(), and AudioIO::StopStream().

45 {
46  static EffectManager em;
47  return em;
48 }
EffectManager is the class that handles effects and effect categories.
Definition: EffectManager.h:45
AudacityCommand * EffectManager::GetAudacityCommand ( const PluginID ID)
private

Definition at line 890 of file EffectManager.cpp.

References _(), AudacityMessageBox(), PluginManager::Get(), GetCommandName(), PluginManager::GetInstance(), AudacityCommand::Init(), and mCommands.

Referenced by DoAudacityCommand(), GetCommandDefinition(), GetCommandDescription(), GetCommandTip(), GetCommandUrl(), GetEffectParameters(), PromptUser(), SetBatchProcessing(), and SetEffectParameters().

891 {
892  // Must have a "valid" ID
893  if (ID.IsEmpty())
894  {
895  return NULL;
896  }
897 
898  // TODO: This is temporary and should be redone when all effects are converted
899  if (mCommands.find(ID) == mCommands.end())
900  {
901 
902  // This will instantiate the effect client if it hasn't already been done
903  auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
904  if (command )//&& command->Startup(NULL))
905  {
906  command->Init();
907  mCommands[ID] = command;
908  return command;
909  }
910 
911  /*
912  if (ident && ident->IsLegacy())
913  {
914  auto command = dynamic_cast<AudacityCommand *>(ident);
915  if (commandt && command->Startup(NULL))
916  {
917  mCommands[ID] = command;
918  return command;
919  }
920  }
921 
922 
923  auto command = std::make_shared<AudacityCommand>(); // TODO: use make_unique and store in std::unordered_map
924  if (command)
925  {
926  AudacityCommand *client = dynamic_cast<AudacityCommand *>(ident);
927  if (client && command->Startup(client))
928  {
929  auto pCommand = command.get();
930  mEffects[ID] = pCommand;
931  mHostEffects[ID] = std::move(effect);
932  return pEffect;
933  }
934  }
935 */
936  AudacityMessageBox(wxString::Format(_("Attempting to initialize the following command failed:\n\n%s\n\nMore information may be available in Help->Show Log"),
937  GetCommandName(ID)),
938  _("Command failed to initialize"));
939 
940  return NULL;
941  }
942 
943  return mCommands[ID];
944 }
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
AudacityCommandMap mCommands
virtual bool Init()
Base class for command in Audacity.
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxString GetCommandName(const PluginID &ID)
IdentInterface * GetInstance(const PluginID &ID)
static PluginManager & Get()
void EffectManager::GetCommandDefinition ( const PluginID ID,
const CommandContext context,
int  flags 
)

Definition at line 232 of file EffectManager.cpp.

References ParamsInterface::DefineParams(), GetAudacityCommand(), GetCommandIdentifier(), GetCommandName(), GetCommandTip(), GetCommandUrl(), GetEffect(), CommandContext::pOutput, and CommandMessageTargetDecorator::StartStruct().

Referenced by HelpCommand::Apply(), and GetInfoCommand::SendCommands().

233 {
234  ParamsInterface *command;
235  command = GetEffect(ID);
236  if( !command )
237  command = GetAudacityCommand( ID );
238  if( !command )
239  return;
240 
241  ShuttleParams NullShuttle;
242  // Test if it defines any parameters at all.
243  bool bHasParams = command->DefineParams( NullShuttle );
244  if( (flags ==0) && !bHasParams )
245  return;
246 
247  // This is capturing the output context into the shuttle.
248  ShuttleGetDefinition S( *context.pOutput.get()->mStatusTarget.get() );
249  S.StartStruct();
250  S.AddItem( GetCommandIdentifier( ID ), "id" );
251  S.AddItem( GetCommandName( ID ), "name" );
252  if( bHasParams ){
253  S.StartField( "params" );
254  S.StartArray();
255  command->DefineParams( S );
256  S.EndArray();
257  S.EndField();
258  }
259  S.AddItem( GetCommandUrl( ID ), "url" );
260  S.AddItem( GetCommandTip( ID ), "tip" );
261  S.EndStruct();
262 }
std::unique_ptr< CommandOutputTargets > pOutput
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:60
Shuttle that retrieves a JSON format definition of a command's parameters.
Definition: Shuttle.h:129
Effect * GetEffect(const PluginID &ID)
wxString GetCommandUrl(const PluginID &ID)
ParamsInterface provides a DefineParameters virtual function, that defines the parameters of the comm...
virtual bool DefineParams(ShuttleParams &WXUNUSED(S))
wxString GetCommandName(const PluginID &ID)
wxString GetCommandIdentifier(const PluginID &ID)
wxString GetCommandTip(const PluginID &ID)
AudacityCommand * GetAudacityCommand(const PluginID &ID)
wxString EffectManager::GetCommandDescription ( const PluginID ID)

Definition at line 197 of file EffectManager.cpp.

References _(), GetAudacityCommand(), GetCommandName(), and GetEffect().

Referenced by AudacityProject::DoEffect().

198 {
199  if (GetEffect(ID))
200  return wxString::Format(_("Applied effect: %s"), GetCommandName(ID));
201  if (GetAudacityCommand(ID))
202  return wxString::Format(_("Applied command: %s"), GetCommandName(ID));
203 
204  return wxEmptyString;
205 }
Effect * GetEffect(const PluginID &ID)
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxString GetCommandName(const PluginID &ID)
AudacityCommand * GetAudacityCommand(const PluginID &ID)
wxString EffectManager::GetCommandIdentifier ( const PluginID ID)

Definition at line 171 of file EffectManager.cpp.

References PluginManager::Get(), PluginManager::GetSymbol(), IdentInterfaceSymbol::Internal(), and name.

Referenced by GetCommandDefinition(), GetEffectByIdentifier(), CommandManager::HandleTextualCommand(), MacroCommandsCatalog::MacroCommandsCatalog(), and GetInfoCommand::SendCommands().

172 {
173  wxString name = PluginManager::Get().GetSymbol(ID).Internal();
174 
175  // Get rid of leading and trailing white space
176  name.Trim(true).Trim(false);
177 
178  if (name == wxEmptyString)
179  {
180  return name;
181  }
182 
183  wxStringTokenizer st(name, wxT(" "));
184  wxString id;
185 
186  // CamelCase the name
187  while (st.HasMoreTokens())
188  {
189  wxString tok = st.GetNextToken();
190 
191  id += tok.Left(1).MakeUpper() + tok.Mid(1).MakeLower();
192  }
193 
194  return id;
195 }
const IdentInterfaceSymbol & GetSymbol(const PluginID &ID)
const wxChar * name
Definition: Distortion.cpp:94
const wxString & Internal() const
static PluginManager & Get()
wxString EffectManager::GetCommandName ( const PluginID ID)

Definition at line 150 of file EffectManager.cpp.

References GetCommandSymbol(), and IdentInterfaceSymbol::Translation().

Referenced by AudacityProject::DoEffect(), GetAudacityCommand(), GetCommandDefinition(), GetCommandDescription(), and GetEffect().

151 {
152  return GetCommandSymbol(ID).Translation();
153 }
IdentInterfaceSymbol GetCommandSymbol(const PluginID &ID)
const wxString & Translation() const
IdentInterfaceSymbol EffectManager::GetCommandSymbol ( const PluginID ID)

Definition at line 145 of file EffectManager.cpp.

References PluginManager::Get(), and PluginManager::GetSymbol().

Referenced by GetCommandName().

146 {
147  return PluginManager::Get().GetSymbol(ID);
148 }
const IdentInterfaceSymbol & GetSymbol(const PluginID &ID)
static PluginManager & Get()
wxString EffectManager::GetCommandTip ( const PluginID ID)

Definition at line 219 of file EffectManager.cpp.

References GetAudacityCommand(), AudacityCommand::GetDescription(), Effect::GetDescription(), and GetEffect().

Referenced by GetCommandDefinition().

220 {
221  Effect* pEff = GetEffect(ID);
222  if( pEff )
223  return pEff->GetDescription();
224  AudacityCommand * pCom = GetAudacityCommand(ID);
225  if( pCom )
226  return pCom->GetDescription();
227 
228  return wxEmptyString;
229 }
virtual wxString GetDescription() override
Base class for many of the effects in Audacity.
Definition: Effect.h:62
wxString GetDescription() override
Definition: Effect.cpp:198
Effect * GetEffect(const PluginID &ID)
Base class for command in Audacity.
AudacityCommand * GetAudacityCommand(const PluginID &ID)
wxString EffectManager::GetCommandUrl ( const PluginID ID)

Definition at line 207 of file EffectManager.cpp.

References GetAudacityCommand(), GetEffect(), AudacityCommand::ManualPage(), and Effect::ManualPage().

Referenced by GetCommandDefinition().

208 {
209  Effect* pEff = GetEffect(ID);
210  if( pEff )
211  return pEff->ManualPage();
212  AudacityCommand * pCom = GetAudacityCommand(ID);
213  if( pCom )
214  return pCom->ManualPage();
215 
216  return wxEmptyString;
217 }
virtual wxString ManualPage()
Definition: Effect.cpp:1127
Base class for many of the effects in Audacity.
Definition: Effect.h:62
Effect * GetEffect(const PluginID &ID)
Base class for command in Audacity.
virtual wxString ManualPage()
AudacityCommand * GetAudacityCommand(const PluginID &ID)
wxString EffectManager::GetDefaultPreset ( const PluginID ID)

Definition at line 440 of file EffectManager.cpp.

References GetEffect(), CommandParameters::GetParameters(), Effect::HasCurrentSettings(), Effect::HasFactoryDefaults(), Effect::kCurrentSettingsIdent, and Effect::kFactoryDefaultsIdent.

Referenced by GetEffectParameters(), and MacroCommandDialog::OnItemSelected().

441 {
442  Effect *effect = GetEffect(ID);
443 
444  if (!effect)
445  {
446  return wxEmptyString;
447  }
448 
449  wxString preset;
450  if (effect->HasCurrentSettings())
451  {
453  }
454  else if (effect->HasFactoryDefaults())
455  {
457  }
458 
459  if (!preset.IsEmpty())
460  {
461  CommandParameters eap;
462 
463  eap.Write(wxT("Use Preset"), preset);
464  eap.GetParameters(preset);
465  }
466 
467  return preset;
468 }
Base class for many of the effects in Audacity.
Definition: Effect.h:62
virtual bool HasCurrentSettings()
Definition: Effect.cpp:1100
virtual bool HasFactoryDefaults()
Definition: Effect.cpp:1105
Effect * GetEffect(const PluginID &ID)
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
bool GetParameters(wxString &parms)
static const wxString kCurrentSettingsIdent
Definition: Effect.h:543
static const wxString kFactoryDefaultsIdent
Definition: Effect.h:544
Effect * EffectManager::GetEffect ( const PluginID ID)
private

Return an effect by its ID.

Definition at line 838 of file EffectManager.cpp.

References _(), AudacityMessageBox(), PluginManager::Get(), GetCommandName(), PluginManager::GetInstance(), ident(), EffectDefinitionInterface::IsLegacy(), mCommands, mEffects, and mHostEffects.

Referenced by DoEffect(), GetCommandDefinition(), GetCommandDescription(), GetCommandTip(), GetCommandUrl(), GetDefaultPreset(), GetEffectFamilyName(), GetEffectParameters(), GetPreset(), GetVendorName(), HasPresets(), IsHidden(), PromptUser(), SetBatchProcessing(), and SetEffectParameters().

839 {
840  // Must have a "valid" ID
841  if (ID.IsEmpty())
842  {
843  return NULL;
844  }
845 
846  // If it is actually a command then refuse it (as an effect).
847  if( mCommands.find( ID ) != mCommands.end() )
848  return NULL;
849 
850  // TODO: This is temporary and should be redone when all effects are converted
851  if (mEffects.find(ID) == mEffects.end())
852  {
853  // This will instantiate the effect client if it hasn't already been done
855  if (ident && ident->IsLegacy())
856  {
857  auto effect = dynamic_cast<Effect *>(ident);
858  if (effect && effect->Startup(NULL))
859  {
860  mEffects[ID] = effect;
861  return effect;
862  }
863  }
864 
865  auto effect = std::make_shared<Effect>(); // TODO: use make_unique and store in std::unordered_map
866  if (effect)
867  {
868  EffectClientInterface *client = dynamic_cast<EffectClientInterface *>(ident);
869  if (client && effect->Startup(client))
870  {
871  auto pEffect = effect.get();
872  mEffects[ID] = pEffect;
873  mHostEffects[ID] = std::move(effect);
874  return pEffect;
875  }
876  }
877 
878  auto command = dynamic_cast<AudacityCommand *>(PluginManager::Get().GetInstance(ID));
879  if( !command )
880  AudacityMessageBox(wxString::Format(_("Attempting to initialize the following effect failed:\n\n%s\n\nMore information may be available in Help->Show Log"),
881  GetCommandName(ID)),
882  _("Effect failed to initialize"));
883 
884  return NULL;
885  }
886 
887  return mEffects[ID];
888 }
static CommandHandlerObject & ident(AudacityProject &project)
Definition: Menus.cpp:298
EffectMap mEffects
Base class for many of the effects in Audacity.
Definition: Effect.h:62
int AudacityMessageBox(const wxString &message, const wxString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: ErrorDialog.h:92
AudacityCommandMap mCommands
EffectDefinitionInterface is a CommandDefinitionInterface that additionally tracks flag-functions for...
Base class for command in Audacity.
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxString GetCommandName(const PluginID &ID)
EffectClientInterface provides the ident interface to Effect, and is what makes Effect into a plug-in...
EffectOwnerMap mHostEffects
IdentInterface * GetInstance(const PluginID &ID)
static PluginManager & Get()
virtual bool IsLegacy()=0
const PluginID & EffectManager::GetEffectByIdentifier ( const wxString &  strTarget)

Definition at line 947 of file EffectManager.cpp.

References PluginManager::Get(), GetCommandIdentifier(), PluginManager::GetFirstPlugin(), PluginDescriptor::GetID(), PluginManager::GetNextPlugin(), PluginTypeAudacityCommand, and PluginTypeEffect.

Referenced by HelpCommand::Apply(), MacroCommands::ApplyCommand(), AudacityProject::CreateMenusAndCommands(), MacroCommands::GetCurrentParamsFor(), MacroCommandDialog::OnItemSelected(), MacroCommands::PromptForParamsFor(), MacroCommands::PromptForPresetFor(), and MacroCommandDialog::SetCommandAndParams().

948 {
949  static PluginID empty;
950  if (strTarget == wxEmptyString) // set GetCommandIdentifier to wxT("") to not show an effect in Batch mode
951  {
952  return empty;
953  }
954 
956  // Effects OR Generic commands...
958  while (plug)
959  {
960  if (GetCommandIdentifier(plug->GetID()).IsSameAs(strTarget, false))
961  {
962  return plug->GetID();
963  }
965  }
966  return empty;;
967 }
const PluginDescriptor * GetFirstPlugin(int type)
wxString PluginID
Definition: Types.h:209
const PluginDescriptor * GetNextPlugin(int type)
PluginManager maintains a list of all plug ins. That covers modules, effects, generators, analysis-effects, commands. It also has functions for shared and private configs - which need to move out.
const wxString & GetID() const
wxString GetCommandIdentifier(const PluginID &ID)
static PluginManager & Get()
wxString EffectManager::GetEffectFamilyName ( const PluginID ID)

Definition at line 155 of file EffectManager.cpp.

References GetEffect().

Referenced by AudacityProject::AddEffectMenuItems().

156 {
157  auto effect = GetEffect(ID);
158  if (effect)
159  return effect->GetFamilyId().Translation();
160  return {};
161 }
Effect * GetEffect(const PluginID &ID)
wxString EffectManager::GetEffectParameters ( const PluginID ID)

Definition at line 299 of file EffectManager.cpp.

References GetAudacityCommand(), AudacityCommand::GetAutomationParameters(), Effect::GetAutomationParameters(), GetDefaultPreset(), and GetEffect().

Referenced by MacroCommands::GetCurrentParamsFor(), and MacroCommands::PromptForParamsFor().

300 {
301  Effect *effect = GetEffect(ID);
302 
303  if (effect)
304  {
305  wxString parms;
306 
307  effect->GetAutomationParameters(parms);
308 
309  // Some effects don't have automatable parameters and will not return
310  // anything, so try to get the active preset (current or factory).
311  if (parms.IsEmpty())
312  {
313  parms = GetDefaultPreset(ID);
314  }
315 
316  return parms;
317  }
318 
319  AudacityCommand *command = GetAudacityCommand(ID);
320 
321  if (command)
322  {
323  wxString parms;
324 
325  command->GetAutomationParameters(parms);
326 
327  // Some effects don't have automatable parameters and will not return
328  // anything, so try to get the active preset (current or factory).
329  if (parms.IsEmpty())
330  {
331  parms = GetDefaultPreset(ID);
332  }
333 
334  return parms;
335  }
336  return wxEmptyString;
337 }
wxString GetDefaultPreset(const PluginID &ID)
Base class for many of the effects in Audacity.
Definition: Effect.h:62
virtual bool GetAutomationParameters(wxString &parms)
Effect * GetEffect(const PluginID &ID)
Base class for command in Audacity.
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Effect.cpp:564
AudacityCommand * GetAudacityCommand(const PluginID &ID)
wxString EffectManager::GetPreset ( const PluginID ID,
const wxString &  params,
wxWindow *  parent 
)

Definition at line 409 of file EffectManager.cpp.

References GetEffect(), CommandParameters::GetParameters(), Effect::GetPreset(), and CommandParameters::HasEntry().

Referenced by MacroCommands::PromptForPresetFor().

410 {
411  Effect *effect = GetEffect(ID);
412 
413  if (!effect)
414  {
415  return wxEmptyString;
416  }
417 
419 
420  wxString preset;
421  if (eap.HasEntry(wxT("Use Preset")))
422  {
423  preset = eap.Read(wxT("Use Preset"));
424  }
425 
426  preset = effect->GetPreset(parent, preset);
427  if (preset.IsEmpty())
428  {
429  return preset;
430  }
431 
432  eap.DeleteAll();
433 
434  eap.Write(wxT("Use Preset"), preset);
435  eap.GetParameters(preset);
436 
437  return preset;
438 }
virtual wxString GetPreset(wxWindow *parent, const wxString &parms)
Definition: Effect.cpp:1110
Base class for many of the effects in Audacity.
Definition: Effect.h:62
Effect * GetEffect(const PluginID &ID)
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
EffectDistortion::Params params
Definition: Distortion.cpp:95
int EffectManager::GetRealtimeLatency ( )

Definition at line 833 of file EffectManager.cpp.

References mRealtimeLatency.

834 {
835  return mRealtimeLatency;
836 }
bool EffectManager::GetSkipStateFlag ( )

Definition at line 283 of file EffectManager.cpp.

References mSkipStateFlag.

Referenced by AudacityProject::DoEffect().

284 {
285  return mSkipStateFlag;
286 }
wxString EffectManager::GetVendorName ( const PluginID ID)

Definition at line 163 of file EffectManager.cpp.

References GetEffect().

Referenced by AudacityProject::AddEffectMenuItems().

164 {
165  auto effect = GetEffect(ID);
166  if (effect)
167  return effect->GetVendor().Translation();
168  return {};
169 }
Effect * GetEffect(const PluginID &ID)
bool EffectManager::HasPresets ( const PluginID ID)

Definition at line 394 of file EffectManager.cpp.

References GetEffect(), Effect::GetFactoryPresets(), Effect::GetUserPresets(), Effect::HasCurrentSettings(), and Effect::HasFactoryDefaults().

Referenced by MacroCommandDialog::OnItemSelected(), and MacroCommandDialog::SetCommandAndParams().

395 {
396  Effect *effect = GetEffect(ID);
397 
398  if (!effect)
399  {
400  return false;
401  }
402 
403  return effect->GetUserPresets().GetCount() > 0 ||
404  effect->GetFactoryPresets().GetCount() > 0 ||
405  effect->HasCurrentSettings() ||
406  effect->HasFactoryDefaults();
407 }
Base class for many of the effects in Audacity.
Definition: Effect.h:62
virtual bool HasCurrentSettings()
Definition: Effect.cpp:1100
virtual bool HasFactoryDefaults()
Definition: Effect.cpp:1105
wxArrayString GetFactoryPresets() override
Definition: Effect.cpp:616
Effect * GetEffect(const PluginID &ID)
virtual wxArrayString GetUserPresets()
Definition: Effect.cpp:1089
bool EffectManager::IsHidden ( const PluginID ID)

Definition at line 266 of file EffectManager.cpp.

References GetEffect(), and Effect::IsHidden().

Referenced by PluginManager::GetFirstPluginForEffectType(), and PluginManager::GetNextPluginForEffectType().

267 {
268  Effect *effect = GetEffect(ID);
269 
270  if (effect)
271  {
272  return effect->IsHidden();
273  }
274 
275  return false;
276 }
Base class for many of the effects in Audacity.
Definition: Effect.h:62
Effect * GetEffect(const PluginID &ID)
virtual bool IsHidden()
Definition: Effect.cpp:2467
bool EffectManager::PromptUser ( const PluginID ID,
wxWindow *  parent 
)

Definition at line 372 of file EffectManager.cpp.

References GetAudacityCommand(), GetEffect(), AudacityCommand::PromptUser(), and Effect::PromptUser().

373 {
374  bool result = false;
375  Effect *effect = GetEffect(ID);
376 
377  if (effect)
378  {
379  result = effect->PromptUser(parent);
380  return result;
381  }
382 
383  AudacityCommand *command = GetAudacityCommand(ID);
384 
385  if (command)
386  {
387  result = command->PromptUser(parent);
388  return result;
389  }
390 
391  return result;
392 }
virtual bool PromptUser(wxWindow *parent)
Base class for many of the effects in Audacity.
Definition: Effect.h:62
Effect * GetEffect(const PluginID &ID)
Base class for command in Audacity.
virtual bool PromptUser(wxWindow *parent)
Definition: Effect.cpp:1270
AudacityCommand * GetAudacityCommand(const PluginID &ID)
void EffectManager::RealtimeAddEffect ( Effect effect)

Definition at line 574 of file EffectManager.cpp.

References mRealtimeActive, mRealtimeChans, mRealtimeRates, Effect::RealtimeAddProcessor(), Effect::RealtimeInitialize(), RealtimeResume(), and RealtimeSuspend().

Referenced by EffectUIHost::InitializeRealtime().

575 {
576  // Block RealtimeProcess()
577  RealtimeSuspend();
578 
579  // Initialize effect if realtime is already active
580  if (mRealtimeActive)
581  {
582  // Initialize realtime processing
583  effect->RealtimeInitialize();
584 
585  // Add the required processors
586  for (size_t i = 0, cnt = mRealtimeChans.size(); i < cnt; i++)
587  {
589  }
590  }
591 
592  // Add to list of active effects
593  mRealtimeEffects.push_back(effect);
594 
595  // Allow RealtimeProcess() to, well, process
596  RealtimeResume();
597 }
EffectArray mRealtimeEffects
std::vector< double > mRealtimeRates
bool RealtimeAddProcessor(unsigned numChannels, float sampleRate) override
Definition: Effect.cpp:417
bool RealtimeInitialize() override
Definition: Effect.cpp:404
void RealtimeSuspend()
std::vector< unsigned > mRealtimeChans
void EffectManager::RealtimeAddProcessor ( int  group,
unsigned  chans,
float  rate 
)

Definition at line 643 of file EffectManager.cpp.

References mRealtimeChans, and mRealtimeRates.

Referenced by AudioIO::StartStream().

644 {
645  for (auto e : mRealtimeEffects)
646  e->RealtimeAddProcessor(group, chans, rate);
647 
648  mRealtimeChans.push_back(chans);
649  mRealtimeRates.push_back(rate);
650 }
EffectArray mRealtimeEffects
std::vector< double > mRealtimeRates
std::vector< unsigned > mRealtimeChans
void EffectManager::RealtimeFinalize ( )

Definition at line 652 of file EffectManager.cpp.

References mRealtimeActive, mRealtimeChans, mRealtimeLatency, mRealtimeRates, and RealtimeSuspend().

Referenced by AudioIO::StartStreamCleanup(), and AudioIO::StopStream().

653 {
654  // Make sure nothing is going on
655  RealtimeSuspend();
656 
657  // It is now safe to clean up
658  mRealtimeLatency = 0;
659 
660  // Tell each effect to clean up as well
661  for (auto e : mRealtimeEffects)
662  e->RealtimeFinalize();
663 
664  // Reset processor parameters
665  mRealtimeChans.clear();
666  mRealtimeRates.clear();
667 
668  // No longer active
669  mRealtimeActive = false;
670 }
EffectArray mRealtimeEffects
std::vector< double > mRealtimeRates
void RealtimeSuspend()
std::vector< unsigned > mRealtimeChans
void EffectManager::RealtimeInitialize ( double  rate)

Definition at line 620 of file EffectManager.cpp.

References mRealtimeActive, mRealtimeChans, mRealtimeRates, RealtimeResume(), and RealtimeSuspend().

Referenced by AudioIO::StartStream().

621 {
622  // The audio thread should not be running yet, but protect anyway
623  RealtimeSuspend();
624 
625  // (Re)Set processor parameters
626  mRealtimeChans.clear();
627  mRealtimeRates.clear();
628 
629  // RealtimeAdd/RemoveEffect() needs to know when we're active so it can
630  // initialize newly added effects
631  mRealtimeActive = true;
632 
633  // Tell each effect to get ready for action
634  for (auto e : mRealtimeEffects) {
635  e->SetSampleRate(rate);
636  e->RealtimeInitialize();
637  }
638 
639  // Get things moving
640  RealtimeResume();
641 }
EffectArray mRealtimeEffects
std::vector< double > mRealtimeRates
void RealtimeSuspend()
std::vector< unsigned > mRealtimeChans
bool EffectManager::RealtimeIsActive ( )

Definition at line 564 of file EffectManager.cpp.

Referenced by WaveTrackMenuTable::InitMenu().

565 {
566  return mRealtimeEffects.size() != 0;
567 }
EffectArray mRealtimeEffects
bool EffectManager::RealtimeIsSuspended ( )

Definition at line 569 of file EffectManager.cpp.

References mRealtimeSuspended.

570 {
571  return mRealtimeSuspended;
572 }
bool mRealtimeSuspended
size_t EffectManager::RealtimeProcess ( int  group,
unsigned  chans,
float **  buffers,
size_t  numSamples 
)

Definition at line 739 of file EffectManager.cpp.

References mRealtimeLatency, mRealtimeLock, and mRealtimeSuspended.

Referenced by audacityAudioCallback().

740 {
741  // Protect ourselves from the main thread
742  mRealtimeLock.Enter();
743 
744  // Can be suspended because of the audio stream being paused or because effects
745  // have been suspended, so allow the samples to pass as-is.
746  if (mRealtimeSuspended || mRealtimeEffects.empty())
747  {
748  mRealtimeLock.Leave();
749  return numSamples;
750  }
751 
752  // Remember when we started so we can calculate the amount of latency we
753  // are introducing
754  wxMilliClock_t start = wxGetLocalTimeMillis();
755 
756  // Allocate the in/out buffer arrays
757  float **ibuf = (float **) alloca(chans * sizeof(float *));
758  float **obuf = (float **) alloca(chans * sizeof(float *));
759 
760  // And populate the input with the buffers we've been given while allocating
761  // NEW output buffers
762  for (unsigned int i = 0; i < chans; i++)
763  {
764  ibuf[i] = buffers[i];
765  obuf[i] = (float *) alloca(numSamples * sizeof(float));
766  }
767 
768  // Now call each effect in the chain while swapping buffer pointers to feed the
769  // output of one effect as the input to the next effect
770  size_t called = 0;
771  for (auto e : mRealtimeEffects)
772  {
773  if (e->IsRealtimeActive())
774  {
775  e->RealtimeProcess(group, chans, ibuf, obuf, numSamples);
776  called++;
777  }
778 
779  for (unsigned int j = 0; j < chans; j++)
780  {
781  float *temp;
782  temp = ibuf[j];
783  ibuf[j] = obuf[j];
784  obuf[j] = temp;
785  }
786  }
787 
788  // Once we're done, we might wind up with the last effect storing its results
789  // in the temporary buffers. If that's the case, we need to copy it over to
790  // the caller's buffers. This happens when the number of effects proccessed
791  // is odd.
792  if (called & 1)
793  {
794  for (unsigned int i = 0; i < chans; i++)
795  {
796  memcpy(buffers[i], ibuf[i], numSamples * sizeof(float));
797  }
798  }
799 
800  // Remember the latency
801  mRealtimeLatency = (int) (wxGetLocalTimeMillis() - start).GetValue();
802 
803  mRealtimeLock.Leave();
804 
805  //
806  // This is wrong...needs to handle tails
807  //
808  return numSamples;
809 }
EffectArray mRealtimeEffects
wxCriticalSection mRealtimeLock
bool mRealtimeSuspended
void EffectManager::RealtimeProcessEnd ( )

Definition at line 814 of file EffectManager.cpp.

References mRealtimeLock, and mRealtimeSuspended.

Referenced by audacityAudioCallback().

815 {
816  // Protect ourselves from the main thread
817  mRealtimeLock.Enter();
818 
819  // Can be suspended because of the audio stream being paused or because effects
820  // have been suspended.
821  if (!mRealtimeSuspended)
822  {
823  for (auto e : mRealtimeEffects)
824  {
825  if (e->IsRealtimeActive())
826  e->RealtimeProcessEnd();
827  }
828  }
829 
830  mRealtimeLock.Leave();
831 }
EffectArray mRealtimeEffects
wxCriticalSection mRealtimeLock
bool mRealtimeSuspended
void EffectManager::RealtimeProcessStart ( )

Definition at line 717 of file EffectManager.cpp.

References mRealtimeLock, and mRealtimeSuspended.

Referenced by audacityAudioCallback().

718 {
719  // Protect ourselves from the main thread
720  mRealtimeLock.Enter();
721 
722  // Can be suspended because of the audio stream being paused or because effects
723  // have been suspended.
724  if (!mRealtimeSuspended)
725  {
726  for (auto e : mRealtimeEffects)
727  {
728  if (e->IsRealtimeActive())
729  e->RealtimeProcessStart();
730  }
731  }
732 
733  mRealtimeLock.Leave();
734 }
EffectArray mRealtimeEffects
wxCriticalSection mRealtimeLock
bool mRealtimeSuspended
void EffectManager::RealtimeRemoveEffect ( Effect effect)

Definition at line 599 of file EffectManager.cpp.

References mRealtimeActive, Effect::RealtimeFinalize(), RealtimeResume(), and RealtimeSuspend().

Referenced by EffectUIHost::CleanupRealtime().

600 {
601  // Block RealtimeProcess()
602  RealtimeSuspend();
603 
604  if (mRealtimeActive)
605  {
606  // Cleanup realtime processing
607  effect->RealtimeFinalize();
608  }
609 
610  // Remove from list of active effects
611  auto end = mRealtimeEffects.end();
612  auto found = std::find(mRealtimeEffects.begin(), end, effect);
613  if (found != end)
614  mRealtimeEffects.erase(found);
615 
616  // Allow RealtimeProcess() to, well, process
617  RealtimeResume();
618 }
EffectArray mRealtimeEffects
bool RealtimeFinalize() override
Definition: Effect.cpp:427
void RealtimeSuspend()
void EffectManager::RealtimeResume ( )

Definition at line 693 of file EffectManager.cpp.

References mRealtimeLock, and mRealtimeSuspended.

Referenced by RealtimeAddEffect(), RealtimeInitialize(), RealtimeRemoveEffect(), and AudioIO::SetPaused().

694 {
695  mRealtimeLock.Enter();
696 
697  // Already running...bail
698  if (!mRealtimeSuspended)
699  {
700  mRealtimeLock.Leave();
701  return;
702  }
703 
704  // Tell the effects to get ready for more action
705  for (auto e : mRealtimeEffects)
706  e->RealtimeResume();
707 
708  // And we should too
709  mRealtimeSuspended = false;
710 
711  mRealtimeLock.Leave();
712 }
EffectArray mRealtimeEffects
wxCriticalSection mRealtimeLock
bool mRealtimeSuspended
void EffectManager::RealtimeSetEffects ( const EffectArray mActive)
void EffectManager::RealtimeSuspend ( )

Definition at line 672 of file EffectManager.cpp.

References mRealtimeLock, and mRealtimeSuspended.

Referenced by RealtimeAddEffect(), RealtimeFinalize(), RealtimeInitialize(), RealtimeRemoveEffect(), and AudioIO::SetPaused().

673 {
674  mRealtimeLock.Enter();
675 
676  // Already suspended...bail
677  if (mRealtimeSuspended)
678  {
679  mRealtimeLock.Leave();
680  return;
681  }
682 
683  // Show that we aren't going to be doing anything
684  mRealtimeSuspended = true;
685 
686  // And make sure the effects don't either
687  for (auto e : mRealtimeEffects)
688  e->RealtimeSuspend();
689 
690  mRealtimeLock.Leave();
691 }
EffectArray mRealtimeEffects
wxCriticalSection mRealtimeLock
bool mRealtimeSuspended
const PluginID & EffectManager::RegisterEffect ( Effect f)

(Un)Register an effect so it can be executed.

Definition at line 74 of file EffectManager.cpp.

References PluginManager::Get(), mEffects, PluginTypeEffect, and PluginManager::RegisterPlugin().

75 {
77 
78  mEffects[ID] = f;
79 
80  return ID;
81 }
EffectMap mEffects
wxString PluginID
Definition: Types.h:209
const PluginID & RegisterPlugin(ModuleInterface *module) override
static PluginManager & Get()
void EffectManager::SetBatchProcessing ( const PluginID ID,
bool  start 
)
private

Definition at line 470 of file EffectManager.cpp.

References GetAudacityCommand(), GetEffect(), AudacityCommand::SetBatchProcessing(), and Effect::SetBatchProcessing().

Referenced by MacroCommands::ApplyEffectCommand(), EffectManager::UnsetBatchProcessing::operator()(), and MacroCommands::PromptForParamsFor().

471 {
472  Effect *effect = GetEffect(ID);
473  if (effect)
474  {
475  effect->SetBatchProcessing(start);
476  return;
477  }
478 
479  AudacityCommand *command = GetAudacityCommand(ID);
480  if (command)
481  {
482  command->SetBatchProcessing(start);
483  return;
484  }
485 
486 }
virtual void SetBatchProcessing(bool start)
Definition: Effect.cpp:1142
Base class for many of the effects in Audacity.
Definition: Effect.h:62
virtual void SetBatchProcessing(bool start)
Effect * GetEffect(const PluginID &ID)
Base class for command in Audacity.
AudacityCommand * GetAudacityCommand(const PluginID &ID)
BatchProcessingScope EffectManager::SetBatchProcessing ( const PluginID ID)
inline

Definition at line 122 of file EffectManager.h.

123  {
124  SetBatchProcessing(ID, true); return BatchProcessingScope{ this, {ID} };
125  }
std::unique_ptr< EffectManager, UnsetBatchProcessing > BatchProcessingScope
void SetBatchProcessing(const PluginID &ID, bool start)
bool EffectManager::SetEffectParameters ( const PluginID ID,
const wxString &  params 
)

Definition at line 339 of file EffectManager.cpp.

References GetAudacityCommand(), GetEffect(), CommandParameters::HasEntry(), AudacityCommand::Init(), AudacityCommand::SetAutomationParameters(), and Effect::SetAutomationParameters().

340 {
341  Effect *effect = GetEffect(ID);
342 
343  if (effect)
344  {
346 
347  if (eap.HasEntry(wxT("Use Preset")))
348  {
349  return effect->SetAutomationParameters(eap.Read(wxT("Use Preset")));
350  }
351 
352  return effect->SetAutomationParameters(params);
353  }
354  AudacityCommand *command = GetAudacityCommand(ID);
355 
356  if (command)
357  {
358  // Set defaults (if not initialised) before setting values.
359  command->Init();
361 
362  if (eap.HasEntry(wxT("Use Preset")))
363  {
364  return command->SetAutomationParameters(eap.Read(wxT("Use Preset")));
365  }
366 
367  return command->SetAutomationParameters(params);
368  }
369  return false;
370 }
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Effect.cpp:574
Base class for many of the effects in Audacity.
Definition: Effect.h:62
virtual bool Init()
Effect * GetEffect(const PluginID &ID)
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Base class for command in Audacity.
virtual bool SetAutomationParameters(const wxString &parms)
EffectDistortion::Params params
Definition: Distortion.cpp:95
AudacityCommand * GetAudacityCommand(const PluginID &ID)
void EffectManager::SetSkipStateFlag ( bool  flag)

Allow effects to disable saving the state at run time

Definition at line 278 of file EffectManager.cpp.

References mSkipStateFlag.

Referenced by DoAudacityCommand(), DoEffect(), EffectNoiseReduction::Dialog::OnGetProfile(), and NyquistEffect::Process().

279 {
280  mSkipStateFlag = flag;
281 }
bool EffectManager::SupportsAutomation ( const PluginID ID)

Support for batch commands

Definition at line 288 of file EffectManager.cpp.

References PluginManager::Get(), PluginManager::GetPlugin(), and PluginDescriptor::IsEffectAutomatable().

289 {
290  const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
291  if (plug)
292  {
293  return plug->IsEffectAutomatable();
294  }
295 
296  return false;
297 }
bool IsEffectAutomatable() const
static PluginManager & Get()
const PluginDescriptor * GetPlugin(const PluginID &ID)
void EffectManager::UnregisterEffect ( const PluginID ID)

Definition at line 85 of file EffectManager.cpp.

References PluginManager::Get(), mEffects, and PluginManager::UnregisterPlugin().

86 {
87  PluginID id = ID;
89  mEffects.erase(id);
90 }
EffectMap mEffects
wxString PluginID
Definition: Types.h:209
void UnregisterPlugin(const PluginID &ID)
static PluginManager & Get()

Member Data Documentation

AudacityCommandMap EffectManager::mCommands
private

Definition at line 164 of file EffectManager.h.

Referenced by GetAudacityCommand(), and GetEffect().

EffectMap EffectManager::mEffects
private

Definition at line 163 of file EffectManager.h.

Referenced by GetEffect(), RegisterEffect(), and UnregisterEffect().

EffectOwnerMap EffectManager::mHostEffects
private

Definition at line 165 of file EffectManager.h.

Referenced by GetEffect().

int EffectManager::mNumEffects
private

Definition at line 167 of file EffectManager.h.

bool EffectManager::mRealtimeActive
private
std::vector<unsigned> EffectManager::mRealtimeChans
private
EffectArray EffectManager::mRealtimeEffects
private

Definition at line 170 of file EffectManager.h.

int EffectManager::mRealtimeLatency
private
wxCriticalSection EffectManager::mRealtimeLock
private
std::vector<double> EffectManager::mRealtimeRates
private
bool EffectManager::mRealtimeSuspended
private
bool EffectManager::mSkipStateFlag
private

Definition at line 179 of file EffectManager.h.

Referenced by EffectManager(), GetSkipStateFlag(), and SetSkipStateFlag().


The documentation for this class was generated from the following files: