Audacity 3.2.0
Namespaces | Macros | Typedefs | Functions
ModuleManager.cpp File Reference

Based on LoadLadspa, this code loads pluggable Audacity 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. More...

#include "ModuleManager.h"
#include "PluginProvider.h"
#include "BasicUI.h"
#include <wx/dynlib.h>
#include <wx/log.h>
#include <wx/filename.h>
#include "FileNames.h"
#include "MemoryX.h"
#include "PluginInterface.h"
#include "Prefs.h"
#include "ModuleSettings.h"
Include dependency graph for ModuleManager.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{ModuleManager.cpp}
 

Macros

#define initFnName   "ExtensionModuleInit"
 
#define versionFnName   "GetVersionString"
 

Typedefs

typedef wxChar *(* tVersionFn) ()
 
using BuiltinProviderList = std::vector< PluginProviderFactory >
 

Functions

static BasicUI::MessageBoxResult DoMessageBox (const TranslatableString &msg)
 
BuiltinProviderListanonymous_namespace{ModuleManager.cpp}::builtinProviderList ()
 
void RegisterProviderFactory (PluginProviderFactory pluginProviderFactory)
 
void UnregisterProviderFactory (PluginProviderFactory pluginProviderFactory)
 

Detailed Description

Based on LoadLadspa, this code loads pluggable Audacity 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.

Definition in file ModuleManager.cpp.

Macro Definition Documentation

◆ initFnName

#define initFnName   "ExtensionModuleInit"

Definition at line 38 of file ModuleManager.cpp.

◆ versionFnName

#define versionFnName   "GetVersionString"

Definition at line 39 of file ModuleManager.cpp.

Typedef Documentation

◆ BuiltinProviderList

Definition at line 182 of file ModuleManager.cpp.

◆ tVersionFn

typedef wxChar *(* tVersionFn) ()

Definition at line 42 of file ModuleManager.cpp.

Function Documentation

◆ DoMessageBox()

static BasicUI::MessageBoxResult DoMessageBox ( const TranslatableString msg)
static

Definition at line 63 of file ModuleManager.cpp.

64{
65 using namespace BasicUI;
66 return ShowMessageBox(msg,
67 MessageBoxOptions{}.Caption(XO("Module Unsuitable")));
68}
XO("Cut/Copy/Paste")
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:287
MessageBoxOptions && Caption(TranslatableString caption_) &&
Definition: BasicUI.h:101

References BasicUI::MessageBoxOptions::Caption(), BasicUI::ShowMessageBox(), and XO().

Referenced by Module::Load(), Module::ShowLoadFailureError(), and ModuleManager::TryLoadModules().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterProviderFactory()

void RegisterProviderFactory ( PluginProviderFactory  pluginProviderFactory)

Definition at line 191 of file ModuleManager.cpp.

192{
193 auto &list = builtinProviderList();
194 if(pluginProviderFactory)
195 list.push_back(std::move(pluginProviderFactory));
196}
BuiltinProviderList & builtinProviderList()

References anonymous_namespace{ModuleManager.cpp}::builtinProviderList().

Referenced by Init::Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnregisterProviderFactory()

void UnregisterProviderFactory ( PluginProviderFactory  pluginProviderFactory)

Definition at line 198 of file ModuleManager.cpp.

199{
200 auto &list = builtinProviderList();
201 auto end = list.end(), iter = std::find(list.begin(), end, pluginProviderFactory);
202 if (iter != end)
203 list.erase(iter);
204}
const char * end(const char *str) noexcept
Definition: StringUtils.h:106

References anonymous_namespace{ModuleManager.cpp}::builtinProviderList(), and details::end().

Here is the call graph for this function: