mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 09:20:16 +01:00
ModuleManager doesn't specially start up mod-script-pipe...
... The standard module dispatch can do that.
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
|
||||
\file ModuleManager.cpp
|
||||
\brief Based on LoadLadspa, this code loads pluggable Audacity
|
||||
extension modules. It also has the code to (a) invoke a script
|
||||
server and (b) invoke a function returning a replacement window,
|
||||
extension modules. It also has the code to
|
||||
invoke a function returning a replacement window,
|
||||
i.e. an alternative to the usual interface, for Audacity.
|
||||
|
||||
*//*******************************************************************/
|
||||
@@ -32,8 +32,6 @@ i.e. an alternative to the usual interface, for Audacity.
|
||||
#include "FileNames.h"
|
||||
#include "PluginManager.h"
|
||||
|
||||
#include "commands/ScriptCommandRelay.h"
|
||||
|
||||
#include "audacity/PluginInterface.h"
|
||||
|
||||
#ifdef EXPERIMENTAL_MODULE_PREFS
|
||||
@@ -47,7 +45,6 @@ i.e. an alternative to the usual interface, for Audacity.
|
||||
|
||||
#define initFnName "ExtensionModuleInit"
|
||||
#define versionFnName "GetVersionString"
|
||||
#define scriptFnName "RegScriptServerFunc"
|
||||
#define mainPanelFnName "MainPanelFunc"
|
||||
|
||||
typedef wxWindow * pwxWindow;
|
||||
@@ -80,10 +77,6 @@ wxWindow * MakeHijackPanel()
|
||||
return pPanelHijack(0);
|
||||
}
|
||||
|
||||
// This variable will hold the address of a subroutine in a DLL that
|
||||
// starts a thread and reads script commands.
|
||||
static tpRegScriptServerFunc scriptFn;
|
||||
|
||||
Module::Module(const FilePath & name)
|
||||
: mName{ name }
|
||||
{
|
||||
@@ -152,8 +145,7 @@ bool Module::Load(wxString &deferredErrorMessage)
|
||||
mDispatch = (fnModuleDispatch) mLib->GetSymbol(wxT(ModuleDispatchName));
|
||||
if (!mDispatch) {
|
||||
// Module does not provide a dispatch function. Special case modules like this could be:
|
||||
// (a) for scripting (RegScriptServerFunc entry point)
|
||||
// (b) for hijacking the entire Audacity panel (MainPanelFunc entry point)
|
||||
// (a) for hijacking the entire Audacity panel (MainPanelFunc entry point)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -353,20 +345,14 @@ void ModuleManager::TryLoadModules(
|
||||
// So look for special case functions:
|
||||
wxLogNull logNo; // Don't show wxWidgets errors if we can't do these. (Was: Fix bug 544.)
|
||||
|
||||
// (a) for scripting.
|
||||
if (scriptFn == NULL)
|
||||
{
|
||||
scriptFn = (tpRegScriptServerFunc)(module->GetSymbol(wxT(scriptFnName)));
|
||||
}
|
||||
|
||||
// (b) for hijacking the entire Audacity panel.
|
||||
// (a) for hijacking the entire Audacity panel.
|
||||
if (pPanelHijack == NULL)
|
||||
{
|
||||
pPanelHijack = (tPanelFn)(module->GetSymbol(wxT(mainPanelFnName)));
|
||||
}
|
||||
}
|
||||
|
||||
if (!module->HasDispatch() && !scriptFn && !pPanelHijack)
|
||||
if (!module->HasDispatch() && !pPanelHijack)
|
||||
{
|
||||
auto ShortName = wxFileName(file).GetName();
|
||||
AudacityMessageBox(
|
||||
@@ -420,12 +406,6 @@ void ModuleManager::Initialize()
|
||||
pModule->ShowLoadFailureError(pair.second);
|
||||
ModulePrefs::SetModuleStatus( pModule->GetName(), kModuleFailed );
|
||||
}
|
||||
|
||||
// After loading all the modules, we may have a registered scripting function.
|
||||
if(scriptFn)
|
||||
{
|
||||
ScriptCommandRelay::StartScriptServer(scriptFn);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
Reference in New Issue
Block a user