Audacity 3.2.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
EffectPlugin Class Referenceabstract

Factory of instances of an effect and of dialogs to control them. More...

#include <EffectPlugin.h>

Inheritance diagram for EffectPlugin:
[legend]
Collaboration diagram for EffectPlugin:
[legend]

Public Types

using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 

Public Member Functions

EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, EffectInstance &instance, EffectSettingsAccess &access, bool forceModal=false)=0
 Usually applies factory to self and given access. More...
 
virtual void Preview (EffectSettingsAccess &access, bool dryOnly)=0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={}, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 Unfortunately complicated dual-use function. More...
 
virtual bool TransferDataToWindow (const EffectSettings &settings)=0
 Update controls for the settings. More...
 
virtual bool TransferDataFromWindow (EffectSettings &settings)=0
 Update the given settings from controls. More...
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
virtual unsigned GetAudioInCount () const =0
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const =0
 How many output buffers to allocate at once. More...
 
virtual int GetMidiInCount () const
 Function that has not yet found a use. More...
 
virtual int GetMidiOutCount () const
 Function that has not yet found a use. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
virtual bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const =0
 Store settings as keys and values. More...
 
virtual bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const =0
 Restore settings from keys and values. More...
 
virtual RegistryPaths GetFactoryPresets () const =0
 Report names of factory presets. More...
 
virtual bool LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const =0
 Change settings to a user-named preset. More...
 
virtual bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const =0
 Save settings in the configuration file as a user-named preset. More...
 
virtual bool LoadFactoryPreset (int id, EffectSettings &settings) const =0
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
virtual bool LoadFactoryDefaults (EffectSettings &settings) const =0
 Change settings back to "factory default". More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual bool SupportsRealtime () const =0
 Whether the effect supports realtime previewing (while audio is playing). More...
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Static Public Attributes

static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Additional Inherited Members

- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 

Detailed Description

Factory of instances of an effect and of dialogs to control them.

Definition at line 45 of file EffectPlugin.h.

Member Typedef Documentation

◆ EffectSettingsAccessPtr

Definition at line 49 of file EffectPlugin.h.

Constructor & Destructor Documentation

◆ ~EffectPlugin()

EffectPlugin::~EffectPlugin ( )
virtualdefault

Member Function Documentation

◆ DoEffect()

virtual bool EffectPlugin::DoEffect ( EffectSettings settings,
double  projectRate,
TrackList list,
WaveTrackFactory factory,
NotifyingSelectedRegion selectedRegion,
unsigned  flags,
wxWindow *  pParent = nullptr,
const EffectDialogFactory dialogFactory = {},
const EffectSettingsAccessPtr pAccess = nullptr 
)
pure virtual

Unfortunately complicated dual-use function.

Sometimes this is invoked only to do effect processing, as a delegate for another effect, but sometimes also to put up a dialog prompting the user for settings first.

Create a user interface only if the supplied factory is not null. Factory may be null because we "Repeat last effect" or apply a macro

Will only operate on tracks that have the "selected" flag set to true, which is consistent with Audacity's standard UI.

Returns
true on success
Parameters
settingsAlways given; only for processing
pAccessSometimes given; only for UI

Implemented in EffectBase.

◆ GetDefinition()

virtual const EffectSettingsManager & EffectPlugin::GetDefinition ( ) const
pure virtual

◆ IsBatchProcessing()

virtual bool EffectPlugin::IsBatchProcessing ( ) const
pure virtual

Implemented in Effect.

Referenced by EffectUIHost::BuildButtonBar(), and EffectBase::DoEffect().

Here is the caller graph for this function:

◆ LoadSettingsFromString()

virtual bool EffectPlugin::LoadSettingsFromString ( const wxString &  parms,
EffectSettings settings 
) const
pure virtual

Implemented in Effect.

◆ operator=()

EffectPlugin & EffectPlugin::operator= ( EffectPlugin )
delete

◆ Preview()

virtual void EffectPlugin::Preview ( EffectSettingsAccess access,
bool  dryOnly 
)
pure virtual

Implemented in EffectAmplify, EffectBase, and EffectTimeScale.

Referenced by EffectUIHost::OnPlay().

Here is the caller graph for this function:

◆ SaveSettingsAsString()

virtual bool EffectPlugin::SaveSettingsAsString ( const EffectSettings settings,
wxString &  parms 
) const
pure virtual

Implemented in Effect.

◆ SetBatchProcessing()

virtual void EffectPlugin::SetBatchProcessing ( )
pure virtual

Implemented in Effect.

◆ ShowHostInterface()

virtual int EffectPlugin::ShowHostInterface ( wxWindow &  parent,
const EffectDialogFactory factory,
EffectInstance instance,
EffectSettingsAccess access,
bool  forceModal = false 
)
pure virtual

Usually applies factory to self and given access.

But there are a few unusual overrides for historical reasons

Parameters
instanceis only guaranteed to have lifetime suitable for a modal dialog, unless the dialog stores instance.shared_from_this()
accessis only guaranteed to have lifetime suitable for a modal dialog, unless the dialog stores access.shared_from_this()
Returns
0 if destructive effect processing should not proceed (and there may be a non-modal dialog still opened); otherwise, modal dialog return code

Implemented in Effect, EffectNoiseReduction, EffectNoiseRemoval, and NyquistEffect.

Referenced by EffectBase::DoEffect().

Here is the caller graph for this function:

◆ TransferDataFromWindow()

virtual bool EffectPlugin::TransferDataFromWindow ( EffectSettings settings)
pure virtual

Update the given settings from controls.

Implemented in EffectAmplify, EffectChangeSpeed, EffectCompressor, EffectDistortion, Effect, EffectFindClipping, EffectNoise, NyquistEffect, EffectPhaser, EffectRepeat, EffectScienFilter, EffectSilence, EffectToneGen, and EffectTruncSilence.

Referenced by EffectUIHost::TransferDataFromWindow().

Here is the caller graph for this function:

◆ TransferDataToWindow()

virtual bool EffectPlugin::TransferDataToWindow ( const EffectSettings settings)
pure virtual

Update controls for the settings.

Implemented in EffectAmplify, EffectAutoDuck, EffectBassTreble, EffectChangeSpeed, EffectCompressor, EffectDistortion, Effect, EffectEqualization, EffectFindClipping, EffectLoudness, EffectNoise, EffectNormalize, NyquistEffect, EffectPhaser, EffectRepeat, EffectScienFilter, EffectSilence, EffectTimeScale, EffectToneGen, and VampEffect.

Referenced by EffectUIHost::TransferDataToWindow().

Here is the caller graph for this function:

◆ UnsetBatchProcessing()

virtual void EffectPlugin::UnsetBatchProcessing ( )
pure virtual

Implemented in Effect.

Member Data Documentation

◆ kCurrentSettingsIdent

const wxString EffectPlugin::kCurrentSettingsIdent = wxT("<Current Settings>")
static

◆ kFactoryDefaultsIdent

const wxString EffectPlugin::kFactoryDefaultsIdent = wxT("<Factory Defaults>")
static

◆ kFactoryPresetIdent

const wxString EffectPlugin::kFactoryPresetIdent = wxT("Factory Preset:")
static

◆ kUserPresetIdent

const wxString EffectPlugin::kUserPresetIdent = wxT("User Preset:")
static

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