Audacity 3.2.0
Private Member Functions | List of all members
EffectDefinitionInterfaceEx Class Reference

Extension of EffectDefinitionInterface with old system for settings. More...

#include <EffectInterface.h>

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

Public Member Functions

settings

Default implementation of the nominally const methods call through to the old non-const interface

Settings MakeSettings () const override
 
bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const override
 Update one settings object from another. 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...
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual bool SaveSettings (const Settings &settings, CommandParameters &parms) const =0
 Store settings as keys and values. More...
 
virtual bool LoadSettings (const CommandParameters &parms, Settings &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, Settings &settings) const =0
 Change settings to a user-named preset. More...
 
virtual bool SaveUserPreset (const RegistryPath &name, const Settings &settings) const =0
 Save settings in the configuration file as a user-named preset. More...
 
virtual bool LoadFactoryPreset (int id, Settings &settings) const =0
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
virtual bool LoadFactoryDefaults (Settings &settings) const =0
 Change settings back to "factory default". 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
 

Private Member Functions

EffectDefinitionInterfaceExFindMe (const Settings &settings) const
 

Additional Inherited Members

- Public Types inherited from EffectDefinitionInterface
using Settings = EffectSettings
 
- 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

Extension of EffectDefinitionInterface with old system for settings.

(Default implementations of EffectDefinitionInterface methods for settings call through to the old interface, violating const correctness. This is meant to be transitional only.)

This interface is not used by the EffectUIHost dialog.

Definition at line 256 of file EffectInterface.h.

Member Function Documentation

◆ CopySettingsContents()

bool EffectDefinitionInterfaceEx::CopySettingsContents ( const EffectSettings src,
EffectSettings dst 
) const
overridevirtual

Update one settings object from another.

This may run in a worker thread, and should avoid memory allocations. Therefore do not copy the underlying std::any, but copy the contents of the contained objects.

Assume that src and dst were created and previously modified only by this

Parameters
srcsettings to copy from
dstsettings to copy into
Returns
success

No real copy, just a sanity check on common origin

Implements EffectDefinitionInterface.

Definition at line 92 of file EffectInterface.cpp.

94{
96 return FindMe(src) && FindMe(dst);
97}
EffectDefinitionInterfaceEx * FindMe(const Settings &settings) const

References FindMe().

Referenced by RealtimeEffectState::AccessState::FromMainSlot::Reader::Reader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindMe()

EffectDefinitionInterfaceEx * EffectDefinitionInterfaceEx::FindMe ( const Settings settings) const
private

Definition at line 100 of file EffectInterface.cpp.

101{
102 if (auto ppEffect = settings.cast<EffectDefinitionInterfaceEx*>();
103 ppEffect && *ppEffect == this)
104 return *ppEffect;
105 return nullptr;
106}
static Settings & settings()
Definition: TrackInfo.cpp:87
Extension of EffectDefinitionInterface with old system for settings.
const T * cast() const noexcept
Like pointer-valued any_cast but a non-static member function.
Definition: TypedAny.h:57

References audacity::TypedAny< Tag >::cast(), and settings().

Referenced by CopySettingsContents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeSettings()

auto EffectDefinitionInterfaceEx::MakeSettings ( ) const
overridevirtual

Produce an object holding new, independent settings

Implements EffectDefinitionInterface.

Definition at line 85 of file EffectInterface.cpp.

86{
87 // Temporary default implementation just saves self
88 // Cast away const! Capture pointer to self
89 return Settings( const_cast<EffectDefinitionInterfaceEx*>(this) );
90}

Referenced by Effect::SetBatchProcessing(), NyquistEffect::ShowHostInterface(), and Effect::UnsetBatchProcessing().

Here is the caller graph for this function:

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