1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-20 09:31:15 +02:00

Use type aliases PluginPath, PluginPaths...

... for wxString and vector thereof, when holding plugin paths (which may or
may not be interpreted as file paths, depending on the module); to be replaced
later with different types
This commit is contained in:
Paul Licameli
2019-02-27 19:58:02 -05:00
parent 06b3b42794
commit dcd211affa
34 changed files with 179 additions and 169 deletions

View File

@@ -113,7 +113,7 @@ public:
virtual ~ComponentInterface() {};
// These should return an untranslated value
virtual wxString GetPath() = 0;
virtual PluginPath GetPath() = 0;
// The internal string persists in configuration files
// So config compatibility will break if it is changed across Audacity versions

View File

@@ -98,7 +98,7 @@ public:
// For modules providing an interface to other dynamically loaded plugins,
// the module returns a list of path names that will be presented to the
// user as "New" for enablement.
virtual wxArrayString FindPluginPaths(PluginManagerInterface & pluginManager) = 0;
virtual PluginPaths FindPluginPaths(PluginManagerInterface & pluginManager) = 0;
// Once the user selects desired paths from FindPluginPaths(),
// a call to DiscoverPluginsAtPath()
@@ -115,16 +115,16 @@ public:
std::function<
const PluginID &(ModuleInterface *, ComponentInterface *) >;
virtual unsigned DiscoverPluginsAtPath(
const wxString & path, wxString &errMsg,
const PluginPath & path, wxString &errMsg,
const RegistrationCallback &callback )
= 0;
// For modules providing an interface to other dynamically loaded plugins,
// the module returns true if the plugin is still valid, otherwise false.
virtual bool IsPluginValid(const wxString & path, bool bFast) = 0;
virtual bool IsPluginValid(const PluginPath & path, bool bFast) = 0;
// When appropriate, CreateInstance() will be called to instantiate the plugin.
virtual ComponentInterface *CreateInstance(const wxString & path) = 0;
virtual ComponentInterface *CreateInstance(const PluginPath & path) = 0;
// When appropriate, DeleteInstance() will be called to delete the plugin.
virtual void DeleteInstance(ComponentInterface *instance) = 0;

View File

@@ -61,7 +61,7 @@ public:
static const PluginID &AudacityCommandRegistrationCallback(
ModuleInterface *provider, ComponentInterface *ident );
virtual bool IsPluginRegistered(const wxString & path) = 0;
virtual bool IsPluginRegistered(const PluginPath & path) = 0;
virtual const PluginID & RegisterPlugin(ModuleInterface *module) = 0;
virtual const PluginID & RegisterPlugin(ModuleInterface *provider, EffectDefinitionInterface *effect, int type) = 0;

View File

@@ -46,6 +46,7 @@
#include <wx/string.h>
#include <wx/arrstr.h>
#include <type_traits>
#include <vector>
// ----------------------------------------------------------------------------
// TODO: I'd imagine this header may be replaced by other public headers. But,
@@ -53,6 +54,15 @@
// until proper public headers are created for the stuff in here.
// ----------------------------------------------------------------------------
/**************************************************************************//**
\brief type alias for identifying a Plugin supplied by a module, each module
defining its own interpretation of the strings, which may or may not be as a
file system path
********************************************************************************/
using PluginPath = wxString;
using PluginPaths = std::vector< PluginPath >;
// ----------------------------------------------------------------------------
// A native 64-bit integer...used when referring to any number of samples
// ----------------------------------------------------------------------------