Audacity 3.2.0
|
Internal module to auto register all built in commands. It is closely modelled on BuiltinEffectsModule. More...
#include <LoadCommands.h>
Classes | |
struct | Entry |
struct | Registration |
Public Types | |
using | Factory = std::function< std::unique_ptr< AudacityCommand >() > |
Public Types inherited from PluginProvider | |
using | RegistrationCallback = std::function< const PluginID &(PluginProvider *, ComponentInterface *) > |
Further expand a path reported by FindModulePaths. More... | |
Public Member Functions | |
BuiltinCommandsModule () | |
virtual | ~BuiltinCommandsModule () |
PluginPath | GetPath () const override |
ComponentInterfaceSymbol | GetSymbol () const override |
VendorSymbol | GetVendor () const override |
wxString | GetVersion () const override |
TranslatableString | GetDescription () const override |
bool | Initialize () override |
Called immediately after creation. Let provider initialize. More... | |
void | Terminate () override |
Called just prior to deletion to allow releasing any resources. More... | |
EffectFamilySymbol | GetOptionalFamilySymbol () override |
A symbol identifying the family of plug-ins provided by this. More... | |
const FileExtensions & | GetFileExtensions () override |
File types associated with this protocol. More... | |
FilePath | InstallPath () override |
Where plug-in files should be copied to install them. More... | |
void | AutoRegisterPlugins (PluginManagerInterface &pm) override |
Called so that a provider of a static set of plug-ins can register them. More... | |
PluginPaths | FindModulePaths (PluginManagerInterface &pm) override |
unsigned | DiscoverPluginsAtPath (const PluginPath &path, TranslatableString &errMsg, const RegistrationCallback &callback) override |
bool | CheckPluginExist (const PluginPath &path) const override |
Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid loading plugins during this check. More... | |
std::unique_ptr< ComponentInterface > | LoadPlugin (const PluginPath &path) override |
Load the plug-in at a path reported by DiscoverPluginsAtPath. More... | |
Public Member Functions inherited from PluginProvider | |
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 FileExtensions & | GetFileExtensions ()=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 bool | SupportsCustomModulePaths () const |
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< Validator > | MakeValidator () const |
virtual std::unique_ptr< ComponentInterface > | LoadPlugin (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 |
Private Types | |
using | CommandHash = std::unordered_map< wxString, const Entry * > |
Private Member Functions | |
std::unique_ptr< AudacityCommand > | Instantiate (const PluginPath &path) |
Static Private Member Functions | |
static void | DoRegistration (const ComponentInterfaceSymbol &name, const Factory &factory) |
Private Attributes | |
CommandHash | mCommands |
Internal module to auto register all built in commands. It is closely modelled on BuiltinEffectsModule.
Definition at line 30 of file LoadCommands.h.
|
private |
Definition at line 86 of file LoadCommands.h.
using BuiltinCommandsModule::Factory = std::function< std::unique_ptr<AudacityCommand> () > |
Definition at line 36 of file LoadCommands.h.
BuiltinCommandsModule::BuiltinCommandsModule | ( | ) |
Definition at line 74 of file LoadCommands.cpp.
|
virtual |
Definition at line 78 of file LoadCommands.cpp.
|
overridevirtual |
Called so that a provider of a static set of plug-ins can register them.
Implements PluginProvider.
Definition at line 145 of file LoadCommands.cpp.
References PluginManagerInterface::AudacityCommandRegistrationCallback(), DiscoverPluginsAtPath(), PluginManagerInterface::IsPluginRegistered(), and mCommands.
|
overridevirtual |
Performs plugin/module existence check, still plugin may fail to load. Implementation should avoid loading plugins during this check.
path | Internal plugin path/ID discovered via DiscoverPluginsAtPath or module path returned by FindModulePaths |
Implements PluginProvider.
Definition at line 197 of file LoadCommands.cpp.
References mCommands.
|
overridevirtual |
Implements PluginProvider.
Definition at line 171 of file LoadCommands.cpp.
References MenuRegistry::Command, Instantiate(), and XO().
Referenced by AutoRegisterPlugins().
|
staticprivate |
Definition at line 40 of file LoadCommands.cpp.
References factory, name, BuiltinCommandsModule::Entry::Registry(), and sInitialized.
|
overridevirtual |
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.
Implements PluginProvider.
Definition at line 162 of file LoadCommands.cpp.
|
overridevirtual |
Implements ComponentInterface.
Definition at line 107 of file LoadCommands.cpp.
References XO().
|
overridevirtual |
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).
Implements PluginProvider.
Definition at line 139 of file LoadCommands.cpp.
|
overridevirtual |
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
Implements PluginProvider.
Definition at line 133 of file LoadCommands.cpp.
|
overridevirtual |
Implements ComponentInterface.
Definition at line 86 of file LoadCommands.cpp.
|
overridevirtual |
Implements ComponentInterface.
Definition at line 91 of file LoadCommands.cpp.
References XO().
|
overridevirtual |
Implements ComponentInterface.
Definition at line 96 of file LoadCommands.cpp.
References XO().
|
overridevirtual |
Implements ComponentInterface.
Definition at line 101 of file LoadCommands.cpp.
|
overridevirtual |
Called immediately after creation. Let provider initialize.
Implements PluginProvider.
Definition at line 116 of file LoadCommands.cpp.
References BUILTIN_GENERIC_COMMAND_PREFIX, entry, mCommands, BuiltinCommandsModule::Entry::Registry(), and sInitialized.
|
inlineoverridevirtual |
Where plug-in files should be copied to install them.
Implements PluginProvider.
Definition at line 61 of file LoadCommands.h.
|
private |
Definition at line 206 of file LoadCommands.cpp.
References BUILTIN_GENERIC_COMMAND_PREFIX, and mCommands.
Referenced by DiscoverPluginsAtPath(), and LoadPlugin().
|
overridevirtual |
Load the plug-in at a path reported by DiscoverPluginsAtPath.
Implements PluginProvider.
Definition at line 191 of file LoadCommands.cpp.
References Instantiate().
|
overridevirtual |
Called just prior to deletion to allow releasing any resources.
Implements PluginProvider.
Definition at line 127 of file LoadCommands.cpp.
|
private |
Definition at line 87 of file LoadCommands.h.
Referenced by AutoRegisterPlugins(), CheckPluginExist(), FindModulePaths(), Initialize(), and Instantiate().