Audacity 3.2.0
Classes | Public Types | Public Member Functions | List of all members
PluginProvider Class Referenceabstract

#include <PluginProvider.h>

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

Classes

class  Validator
 

Public Types

using RegistrationCallback = std::function< const PluginID &(PluginProvider *, ComponentInterface *) >
 Further expand a path reported by FindModulePaths. More...
 

Public Member Functions

virtual ~PluginProvider ()
 
virtual bool Initialize ()=0
 Called immediately after creation. Let provider initialize. More...
 
virtual void Terminate ()=0
 Called just prior to deletion to allow releasing any resources. More...
 
virtual EffectFamilySymbol GetOptionalFamilySymbol ()=0
 A symbol identifying the family of plug-ins provided by this. More...
 
virtual const FileExtensionsGetFileExtensions ()=0
 File types associated with this protocol. More...
 
virtual FilePath InstallPath ()=0
 Where plug-in files should be copied to install them. More...
 
virtual void AutoRegisterPlugins (PluginManagerInterface &pluginManager)=0
 Called so that a provider of a static set of plug-ins can register them. More...
 
virtual PluginPaths FindModulePaths (PluginManagerInterface &pluginManager)=0
 
virtual unsigned DiscoverPluginsAtPath (const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback)=0
 
virtual bool CheckPluginExist (const PluginPath &path) const =0
 Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid loading plugins during this check. More...
 
virtual std::unique_ptr< ValidatorMakeValidator () const
 
virtual std::unique_ptr< ComponentInterfaceLoadPlugin (const PluginPath &path)=0
 Load the plug-in at a path reported by DiscoverPluginsAtPath. 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
 

Detailed Description

PluginProvider is an interface for discovering dynamically loaded libraries according to some third party protocol, but also used in registering the built-in effects and commands. Classes derived from it can handle more specific plug-in protocols. Interface for host side of one plug-in ("component") protocol that may locate shared libraries with client-side code. A factory of plug-in objects that represent those clients. One library may contain multiple plug-ins.

Definition at line 78 of file PluginProvider.h.

Member Typedef Documentation

◆ RegistrationCallback

Further expand a path reported by FindModulePaths.

Once the user selects desired paths from FindModulePaths(), a call to DiscoverPluginsAtPath() will be made to request registration of one or more plug-ins.

If the provider must create an instance of the plug-in to register it, the instance should be deleted after registration.

May discover more than one plug-in at the path, and may call-back with a ComponentInterface that reports a path not equal to the given path (perhaps appending other information to it).

Parameters
errMsgmessage does not need to mention the path and may be nonempty even if some plug-ins are also discovered successfully.
Returns
the number of plug-ins found

Definition at line 167 of file PluginProvider.h.

Constructor & Destructor Documentation

◆ ~PluginProvider()

PluginProvider::~PluginProvider ( )
virtualdefault

Member Function Documentation

◆ AutoRegisterPlugins()

virtual void PluginProvider::AutoRegisterPlugins ( PluginManagerInterface pluginManager)
pure virtual

◆ CheckPluginExist()

virtual bool PluginProvider::CheckPluginExist ( const PluginPath path) const
pure virtual

Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid loading plugins during this check.

Parameters
pathInternal plugin path/ID discovered via DiscoverPluginsAtPath or module path returned by FindModulePaths

Implemented in AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, VST3EffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

◆ DiscoverPluginsAtPath()

virtual unsigned PluginProvider::DiscoverPluginsAtPath ( const PluginPath path,
TranslatableString errMsg,
const RegistrationCallback callback 
)
pure virtual

◆ FindModulePaths()

virtual PluginPaths PluginProvider::FindModulePaths ( PluginManagerInterface pluginManager)
pure virtual

Find available "paths", which may each be presented to the user, and then reexamined (possibly loading libraries) to find one or more plug-ins

Paths are not necessarily file system paths. Only the provider reinterprets the paths.

Modules may be associated with plug-ins, one-to-many.

See also
GetFileExtensions DiscoverPluginsAtPath

Implemented in VST3EffectsModule, AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

◆ GetFileExtensions()

virtual const FileExtensions & PluginProvider::GetFileExtensions ( )
pure virtual

File types associated with this protocol.

"Paths" returned by FindModulePaths() and passed back to DiscoverPluginsAtPath() have provider-specific meaning. They are not necessarily file system paths to existent files that could be placed in any folder and queried for plug-in information.

This function returns nonempty only when that is the case, and lists the possible extensions of such files (an empty string in a nonempty array means any file is a candidate).

Implemented in AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, VST3EffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

◆ GetOptionalFamilySymbol()

virtual EffectFamilySymbol PluginProvider::GetOptionalFamilySymbol ( )
pure virtual

A symbol identifying the family of plug-ins provided by this.

If it is not empty, then the family as a whole can be enabled or disabled by the user in Preferences

Implemented in AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, VST3EffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

Referenced by PluginManager::RegisterPlugin().

Here is the caller graph for this function:

◆ Initialize()

virtual bool PluginProvider::Initialize ( )
pure virtual

Called immediately after creation. Let provider initialize.

Returns
"true" if initialization was successful

Implemented in AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, VST3EffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

◆ InstallPath()

virtual FilePath PluginProvider::InstallPath ( )
pure virtual

Where plug-in files should be copied to install them.

Returns
may be empty. Drag-and-drop is supported only if GetFileExtensions() returns nonempty and this function returns nonempty.

Implemented in AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, VST3EffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

Referenced by PluginManager::DropFile().

Here is the caller graph for this function:

◆ LoadPlugin()

virtual std::unique_ptr< ComponentInterface > PluginProvider::LoadPlugin ( const PluginPath path)
pure virtual

Load the plug-in at a path reported by DiscoverPluginsAtPath.

Returns
smart pointer managing the later unloading

Implemented in AudioUnitEffectsModule, BuiltinEffectsModule, LadspaEffectsModule, LV2EffectsModule, VSTEffectsModule, VST3EffectsModule, BuiltinCommandsModule, NyquistEffectsModule, and VampEffectsModule.

Referenced by PluginManager::Load().

Here is the caller graph for this function:

◆ MakeValidator()

std::unique_ptr< PluginProvider::Validator > PluginProvider::MakeValidator ( ) const
virtual

Implementation can provide plugin specific checks to the plugin instances. By default returns null.

Reimplemented in LV2EffectsModule, and VST3EffectsModule.

Definition at line 12 of file PluginProvider.cpp.

13{
14 return {};
15}

◆ Terminate()

virtual void PluginProvider::Terminate ( )
pure virtual

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