1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-20 17:41:13 +02:00

Cleaner class hierarchy

This commit is contained in:
James Crook
2018-02-08 21:12:49 +00:00
committed by Paul Licameli
parent b1b1a362ed
commit 8ebf502cd6
11 changed files with 56 additions and 76 deletions

View File

@@ -62,17 +62,30 @@ class ShuttleParams;
/*************************************************************************************//**
\class ParamsInterface
\brief ParamsInterface provides a DefineParameters virtual function,
that defines the parameters of the command.
*******************************************************************************************/
class AUDACITY_DLL_API ParamsInterface /* not final */
{
public:
virtual ~ParamsInterface() {};
// returns true if implemented.
virtual bool DefineParams( ShuttleParams & WXUNUSED(S) ){ return false;};
};
/*************************************************************************************//**
\class CommandDefinitionInterface
\brief CommandDefinitionInterface is an IdentInterface (to name the command) along with a
DefineParameters virtual function, that defines the parameters of the command.
*******************************************************************************************/
class AUDACITY_DLL_API CommandDefinitionInterface /* not final */ : public IdentInterface
class AUDACITY_DLL_API CommandDefinitionInterface /* not final */ : public IdentInterface, public ParamsInterface
{
public:
virtual ~CommandDefinitionInterface() {};
// returns true if implemented.
virtual bool DefineParams( ShuttleParams & WXUNUSED(S) ){ return false;};
};
/*************************************************************************************//**
@@ -83,7 +96,7 @@ public:
flag-functions for interactivity, play-preview and whether the effect can run without a GUI.
*******************************************************************************************/
class AUDACITY_DLL_API EffectDefinitionInterface /* not final */ : public CommandDefinitionInterface
class AUDACITY_DLL_API EffectDefinitionInterface /* not final */ : public IdentInterface, public ParamsInterface
{
public:
virtual ~EffectDefinitionInterface() {};

View File

@@ -120,7 +120,7 @@ public:
// Return value is the number of plugins found.
using RegistrationCallback =
std::function<
const PluginID &(ModuleInterface *, CommandDefinitionInterface *) >;
const PluginID &(ModuleInterface *, IdentInterface *) >;
virtual unsigned DiscoverPluginsAtPath(
const wxString & path, wxString &errMsg,
const RegistrationCallback &callback )

View File

@@ -57,9 +57,9 @@ class PluginManagerInterface /* not final */
public:
static const PluginID &DefaultRegistrationCallback(
ModuleInterface *provider, CommandDefinitionInterface *ident );
static const PluginID &GenericRegistrationCallback(
ModuleInterface *provider, CommandDefinitionInterface *ident );
ModuleInterface *provider, IdentInterface *ident );
static const PluginID &AudacityCommandRegistrationCallback(
ModuleInterface *provider, IdentInterface *ident );
virtual bool IsPluginRegistered(const wxString & path) = 0;