summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin_manager.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-11 13:58:48 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-11 13:58:48 -0400
commit83ed3d7dcc121bb7947d7532c869ccf3e0510b86 (patch)
tree66adb4caa8b58b90d638b1086c53b0ac785e8534 /libs/ardour/plugin_manager.cc
parent058ebf98b928f735ac2dbd5026a4dcf3fba3e67b (diff)
Use glibmm for modules instead of dlfch.h
Diffstat (limited to 'libs/ardour/plugin_manager.cc')
-rw-r--r--libs/ardour/plugin_manager.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index 90522a7e06..a3a7fb48da 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -26,7 +26,6 @@
#include <sys/types.h>
#include <cstdio>
#include <lrdf.h>
-#include <dlfcn.h>
#include <cstdlib>
#include <fstream>
@@ -365,25 +364,26 @@ PluginManager::add_lrdf_data (const string &path)
int
PluginManager::ladspa_discover (string path)
{
- void *module;
+ Glib::Module module(path);
const LADSPA_Descriptor *descriptor;
LADSPA_Descriptor_Function dfunc;
- const char *errstr;
+ void* func = 0;
- if ((module = dlopen (path.c_str(), RTLD_NOW)) == 0) {
- error << string_compose(_("LADSPA: cannot load module \"%1\" (%2)"), path, dlerror()) << endmsg;
+ if (!module) {
+ error << string_compose(_("LADSPA: cannot load module \"%1\" (%2)"),
+ path, Glib::Module::get_last_error()) << endmsg;
return -1;
}
- dfunc = (LADSPA_Descriptor_Function) dlsym (module, "ladspa_descriptor");
- if ((errstr = dlerror()) != 0) {
+ if (!module.get_symbol("ladspa_descriptor", func)) {
error << string_compose(_("LADSPA: module \"%1\" has no descriptor function."), path) << endmsg;
- error << errstr << endmsg;
- dlclose (module);
+ error << Glib::Module::get_last_error() << endmsg;
return -1;
}
+ dfunc = (LADSPA_Descriptor_Function)func;
+
for (uint32_t i = 0; ; ++i) {
if ((descriptor = dfunc (i)) == 0) {
break;