#include <ModuleManager.h>
Definition at line 41 of file ModuleManager.h.
◆ Module()
Definition at line 46 of file ModuleManager.cpp.
48{
49 mLib = std::make_unique<wxDynamicLibrary>();
51}
const TranslatableString name
fnModuleDispatch mDispatch
std::unique_ptr< wxDynamicLibrary > mLib
References mDispatch, and mLib.
◆ ~Module()
◆ Dispatch()
◆ GetName()
const FilePath & Module::GetName |
( |
| ) |
const |
|
inline |
◆ GetSymbol()
void * Module::GetSymbol |
( |
const wxString & |
name | ) |
|
◆ HasDispatch()
bool Module::HasDispatch |
( |
| ) |
|
|
inline |
◆ Load()
bool Module::Load |
( |
wxString & |
deferredErrorMessage | ) |
|
Definition at line 73 of file ModuleManager.cpp.
74{
75 deferredErrorMessage.clear();
76
77 if (
mLib->IsLoaded()) {
79 return true;
80 }
81
82
83 return false;
84 }
85
86 auto ShortName = wxFileName(
mName).GetName();
87
88 if (!
mLib->Load(
mName, wxDL_NOW | wxDL_QUIET | wxDL_GLOBAL)) {
89
90
91
92 deferredErrorMessage = wxString(wxSysErrorMsg());
93 return false;
94 }
95
96
98 if (versionFn == NULL){
100 XO(
"The module \"%s\" does not provide a version string.\n\nIt will not be loaded.")
102 wxLogMessage(
wxT(
"The module \"%s\" does not provide a version string. It will not be loaded."),
mName);
104 return false;
105 }
106
107 wxString moduleVersion = versionFn();
108 if( moduleVersion != AUDACITY_VERSION_STRING) {
110 XO(
"The module \"%s\" is matched with Audacity version \"%s\".\n\nIt will not be loaded.")
111 .
Format(ShortName, moduleVersion));
112 wxLogMessage(
wxT(
"The module \"%s\" is matched with Audacity version \"%s\". It will not be loaded."),
mName, moduleVersion);
114 return false;
115 }
116
119
120 return true;
121 }
122
123
124
126 if (res) {
127 return true;
128 }
129
131
133 XO(
"The module \"%s\" failed to initialize.\n\nIt will not be loaded.")
135 wxLogMessage(
wxT(
"The module \"%s\" failed to initialize.\nIt will not be loaded."),
mName);
137
138 return false;
139}
#define ModuleDispatchName
static BasicUI::MessageBoxResult DoMessageBox(const TranslatableString &msg)
int(* fnModuleDispatch)(ModuleDispatchTypes type)
References DoMessageBox(), mDispatch, mLib, mName, ModuleDispatchName, ModuleInitialize, versionFnName, wxT(), and XO().
◆ ShowLoadFailureError()
void Module::ShowLoadFailureError |
( |
const wxString & |
Error | ) |
|
◆ Unload()
◆ mDispatch
◆ mLib
std::unique_ptr<wxDynamicLibrary> Module::mLib |
|
private |
◆ mName
The documentation for this class was generated from the following files: