moduleMain functions were never called but with nullptr; so simplify
This commit is contained in:
parent
6242be0a8e
commit
bd6fb75886
|
@ -140,7 +140,7 @@ public:
|
|||
// be declared static so as not to interfere with other modules during link.
|
||||
// ----------------------------------------------------------------------------
|
||||
#define DECLARE_MODULE_ENTRY(name) \
|
||||
static ModuleInterface * name(const wxString *path)
|
||||
static ModuleInterface * name()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// This will create a class and instance that will register the module entry
|
||||
|
|
|
@ -458,7 +458,7 @@ void ModuleManager::InitializeBuiltins()
|
|||
for (auto moduleMain : builtinModuleList())
|
||||
{
|
||||
ModuleInterfaceHandle module {
|
||||
moduleMain(nullptr), ModuleInterfaceDeleter{}
|
||||
moduleMain(), ModuleInterfaceDeleter{}
|
||||
};
|
||||
|
||||
if (module && module->Initialize())
|
||||
|
|
|
@ -130,9 +130,9 @@ private:
|
|||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// The module entry point prototype
|
||||
// The module entry point prototype (a factory of ModuleInterface objects)
|
||||
// ----------------------------------------------------------------------------
|
||||
using ModuleMain = ModuleInterface *(*)(const wxString *path);
|
||||
using ModuleMain = ModuleInterface *(*)();
|
||||
|
||||
AUDACITY_DLL_API
|
||||
void RegisterProvider(ModuleMain rtn);
|
||||
|
|
|
@ -56,7 +56,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew BuiltinCommandsModule(path);
|
||||
return safenew BuiltinCommandsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -70,17 +70,12 @@ DECLARE_BUILTIN_MODULE(BuiltinsCommandBuiltin);
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BuiltinCommandsModule::BuiltinCommandsModule(const wxString *path)
|
||||
BuiltinCommandsModule::BuiltinCommandsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
BuiltinCommandsModule::~BuiltinCommandsModule()
|
||||
{
|
||||
mPath.clear();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -89,7 +84,7 @@ BuiltinCommandsModule::~BuiltinCommandsModule()
|
|||
|
||||
PluginPath BuiltinCommandsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol BuiltinCommandsModule::GetSymbol()
|
||||
|
|
|
@ -30,7 +30,7 @@ class AudacityCommand;
|
|||
class AUDACITY_DLL_API BuiltinCommandsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
BuiltinCommandsModule(const wxString *path);
|
||||
BuiltinCommandsModule();
|
||||
virtual ~BuiltinCommandsModule();
|
||||
|
||||
using Factory = std::function< std::unique_ptr<AudacityCommand> () >;
|
||||
|
@ -83,8 +83,6 @@ private:
|
|||
static void DoRegistration(
|
||||
const ComponentInterfaceSymbol &name, const Factory &factory );
|
||||
|
||||
wxString mPath;
|
||||
|
||||
using CommandHash = std::unordered_map< wxString, const Entry* > ;
|
||||
CommandHash mCommands;
|
||||
};
|
||||
|
|
|
@ -54,7 +54,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew BuiltinEffectsModule(path);
|
||||
return safenew BuiltinEffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -68,17 +68,12 @@ DECLARE_BUILTIN_MODULE(BuiltinsEffectBuiltin);
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BuiltinEffectsModule::BuiltinEffectsModule(const wxString *path)
|
||||
BuiltinEffectsModule::BuiltinEffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
BuiltinEffectsModule::~BuiltinEffectsModule()
|
||||
{
|
||||
mPath.clear();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -87,7 +82,7 @@ BuiltinEffectsModule::~BuiltinEffectsModule()
|
|||
|
||||
PluginPath BuiltinEffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol BuiltinEffectsModule::GetSymbol()
|
||||
|
|
|
@ -29,7 +29,7 @@ class Effect;
|
|||
class AUDACITY_DLL_API BuiltinEffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
BuiltinEffectsModule(const wxString *path);
|
||||
BuiltinEffectsModule();
|
||||
virtual ~BuiltinEffectsModule();
|
||||
|
||||
using Factory = std::function< std::unique_ptr<Effect> () >;
|
||||
|
@ -82,8 +82,6 @@ private:
|
|||
const ComponentInterfaceSymbol &name, const Factory &factory,
|
||||
bool excluded );
|
||||
|
||||
PluginPath mPath;
|
||||
|
||||
struct Entry;
|
||||
using EffectHash = std::unordered_map< wxString, const Entry* > ;
|
||||
EffectHash mEffects;
|
||||
|
|
|
@ -143,7 +143,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create our effects module and register
|
||||
// Trust the module manager not to leak this
|
||||
return safenew VSTEffectsModule(path);
|
||||
return safenew VSTEffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -306,17 +306,12 @@ public:
|
|||
// VSTEffectsModule
|
||||
//
|
||||
// ============================================================================
|
||||
VSTEffectsModule::VSTEffectsModule(const wxString *path)
|
||||
VSTEffectsModule::VSTEffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
VSTEffectsModule::~VSTEffectsModule()
|
||||
{
|
||||
mPath = wxEmptyString;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -325,7 +320,7 @@ VSTEffectsModule::~VSTEffectsModule()
|
|||
|
||||
PluginPath VSTEffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol VSTEffectsModule::GetSymbol()
|
||||
|
|
|
@ -403,7 +403,7 @@ private:
|
|||
class VSTEffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
VSTEffectsModule(const wxString *path);
|
||||
VSTEffectsModule();
|
||||
virtual ~VSTEffectsModule();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
@ -438,9 +438,6 @@ public:
|
|||
// VSTEffectModule implementation
|
||||
|
||||
static void Check(const wxChar *path);
|
||||
|
||||
private:
|
||||
PluginPath mPath;
|
||||
};
|
||||
|
||||
#endif // USE_VST
|
||||
|
|
|
@ -233,7 +233,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew AudioUnitEffectsModule(path);
|
||||
return safenew AudioUnitEffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -247,17 +247,12 @@ DECLARE_BUILTIN_MODULE(AudioUnitEffectsBuiltin);
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
AudioUnitEffectsModule::AudioUnitEffectsModule(const wxString *path)
|
||||
AudioUnitEffectsModule::AudioUnitEffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
AudioUnitEffectsModule::~AudioUnitEffectsModule()
|
||||
{
|
||||
mPath.clear();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -266,7 +261,7 @@ AudioUnitEffectsModule::~AudioUnitEffectsModule()
|
|||
|
||||
PluginPath AudioUnitEffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol AudioUnitEffectsModule::GetSymbol()
|
||||
|
|
|
@ -232,7 +232,7 @@ private:
|
|||
class AudioUnitEffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
AudioUnitEffectsModule(const wxString *path);
|
||||
AudioUnitEffectsModule();
|
||||
virtual ~AudioUnitEffectsModule();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
@ -271,9 +271,6 @@ public:
|
|||
|
||||
wxString FromOSType(OSType type);
|
||||
OSType ToOSType(const wxString & type);
|
||||
|
||||
private:
|
||||
wxString mPath;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -85,7 +85,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew LadspaEffectsModule(path);
|
||||
return safenew LadspaEffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -99,12 +99,8 @@ DECLARE_BUILTIN_MODULE(LadspaBuiltin);
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LadspaEffectsModule::LadspaEffectsModule(const wxString *path)
|
||||
LadspaEffectsModule::LadspaEffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
LadspaEffectsModule::~LadspaEffectsModule()
|
||||
|
@ -117,7 +113,7 @@ LadspaEffectsModule::~LadspaEffectsModule()
|
|||
|
||||
PluginPath LadspaEffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol LadspaEffectsModule::GetSymbol()
|
||||
|
|
|
@ -208,7 +208,7 @@ private:
|
|||
class LadspaEffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
LadspaEffectsModule(const wxString *path);
|
||||
LadspaEffectsModule();
|
||||
virtual ~LadspaEffectsModule();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
@ -243,8 +243,5 @@ public:
|
|||
// LadspaEffectModule implementation
|
||||
|
||||
FilePaths GetSearchPaths();
|
||||
|
||||
private:
|
||||
wxString mPath;
|
||||
};
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew LV2EffectsModule(path);
|
||||
return safenew LV2EffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -77,12 +77,8 @@ using UriHash = std::unordered_map<wxString, LilvNode*>;
|
|||
|
||||
LilvWorld *gWorld = NULL;
|
||||
|
||||
LV2EffectsModule::LV2EffectsModule(const wxString *path)
|
||||
LV2EffectsModule::LV2EffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
LV2EffectsModule::~LV2EffectsModule()
|
||||
|
@ -95,7 +91,7 @@ LV2EffectsModule::~LV2EffectsModule()
|
|||
|
||||
PluginPath LV2EffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol LV2EffectsModule::GetSymbol()
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
class LV2EffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
LV2EffectsModule(const wxString *path);
|
||||
LV2EffectsModule();
|
||||
virtual ~LV2EffectsModule();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
@ -199,9 +199,6 @@ public:
|
|||
|
||||
private:
|
||||
const LilvPlugin *GetPlugin(const PluginPath & path);
|
||||
|
||||
private:
|
||||
PluginPath mPath;
|
||||
};
|
||||
|
||||
extern LilvWorld *gWorld;
|
||||
|
|
|
@ -67,7 +67,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew NyquistEffectsModule(path);
|
||||
return safenew NyquistEffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -81,17 +81,12 @@ DECLARE_BUILTIN_MODULE(NyquistsEffectBuiltin);
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NyquistEffectsModule::NyquistEffectsModule(const wxString *path)
|
||||
NyquistEffectsModule::NyquistEffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
NyquistEffectsModule::~NyquistEffectsModule()
|
||||
{
|
||||
mPath.clear();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -100,7 +95,7 @@ NyquistEffectsModule::~NyquistEffectsModule()
|
|||
|
||||
PluginPath NyquistEffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol NyquistEffectsModule::GetSymbol()
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
class NyquistEffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
NyquistEffectsModule(const wxString *path);
|
||||
NyquistEffectsModule();
|
||||
virtual ~NyquistEffectsModule();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
@ -53,9 +53,4 @@ public:
|
|||
|
||||
ComponentInterface *CreateInstance(const PluginPath & path) override;
|
||||
void DeleteInstance(ComponentInterface *instance) override;
|
||||
|
||||
// NyquistEffectModule implementation
|
||||
|
||||
private:
|
||||
PluginPath mPath;
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ DECLARE_MODULE_ENTRY(AudacityModule)
|
|||
{
|
||||
// Create and register the importer
|
||||
// Trust the module manager not to leak this
|
||||
return safenew VampEffectsModule(path);
|
||||
return safenew VampEffectsModule();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
@ -52,12 +52,8 @@ DECLARE_BUILTIN_MODULE(VampsEffectBuiltin);
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
VampEffectsModule::VampEffectsModule(const wxString *path)
|
||||
VampEffectsModule::VampEffectsModule()
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
mPath = *path;
|
||||
}
|
||||
}
|
||||
|
||||
VampEffectsModule::~VampEffectsModule()
|
||||
|
@ -70,7 +66,7 @@ VampEffectsModule::~VampEffectsModule()
|
|||
|
||||
PluginPath VampEffectsModule::GetPath()
|
||||
{
|
||||
return mPath;
|
||||
return {};
|
||||
}
|
||||
|
||||
ComponentInterfaceSymbol VampEffectsModule::GetSymbol()
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
class VampEffectsModule final : public ModuleInterface
|
||||
{
|
||||
public:
|
||||
VampEffectsModule(const wxString *path);
|
||||
VampEffectsModule();
|
||||
virtual ~VampEffectsModule();
|
||||
|
||||
// ComponentInterface implementation
|
||||
|
@ -67,9 +67,6 @@ private:
|
|||
std::unique_ptr<Vamp::Plugin> FindPlugin(const PluginPath & wpath,
|
||||
int & output,
|
||||
bool & hasParameters);
|
||||
|
||||
private:
|
||||
PluginPath mPath;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue