#include <ModuleManager.h>
Definition at line 42 of file ModuleManager.h.
◆ Module()
Definition at line 44 of file ModuleManager.cpp.
46{
47 mLib = std::make_unique<wxDynamicLibrary>();
49}
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 79 of file ModuleManager.cpp.
80{
81 deferredErrorMessage.clear();
82
83 if (
mLib->IsLoaded()) {
85 return true;
86 }
87
88
89 return false;
90 }
91
92 auto ShortName = wxFileName(
mName).GetName();
93
94 if (!
mLib->Load(
mName, wxDL_NOW | wxDL_QUIET | wxDL_GLOBAL)) {
95
96
97
98 deferredErrorMessage = wxString(wxSysErrorMsg());
99 return false;
100 }
101
102
104 if (versionFn == NULL){
106 XO(
"The module \"%s\" does not provide a version string.\n\nIt will not be loaded.")
108 wxLogMessage(
wxT(
"The module \"%s\" does not provide a version string. It will not be loaded."),
mName);
110 return false;
111 }
112
113 wxString moduleVersion = versionFn();
114 if( moduleVersion != AUDACITY_VERSION_STRING) {
116 XO(
"The module \"%s\" is matched with Audacity version \"%s\".\n\nIt will not be loaded.")
117 .
Format(ShortName, moduleVersion));
118 wxLogMessage(
wxT(
"The module \"%s\" is matched with Audacity version \"%s\". It will not be loaded."),
mName, moduleVersion);
120 return false;
121 }
122
125
126 return true;
127 }
128
129
130
132 if (res) {
133 return true;
134 }
135
137
139 XO(
"The module \"%s\" failed to initialize.\n\nIt will not be loaded.")
141 wxLogMessage(
wxT(
"The module \"%s\" failed to initialize.\nIt will not be loaded."),
mName);
143
144 return false;
145}
#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: