summaryrefslogtreecommitdiffstats
path: root/src/plugininstance.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-18 23:38:47 +0000
committerDavid Robillard <d@drobilla.net>2007-02-18 23:38:47 +0000
commit0153919a422e7a520c38f9cd01e9a079f73c80fd (patch)
tree2cb063c7d885be9a50da0e5f2c10880a77eb0663 /src/plugininstance.c
parentec3e2125f960aa3de9da474d175bab353745748b (diff)
downloadlilv-0153919a422e7a520c38f9cd01e9a079f73c80fd.tar.gz
lilv-0153919a422e7a520c38f9cd01e9a079f73c80fd.tar.bz2
lilv-0153919a422e7a520c38f9cd01e9a079f73c80fd.zip
Removed private_types.h (and all exposure of types that shouldn't have been exposed).
git-svn-id: http://svn.drobilla.net/lad/slv2@316 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/plugininstance.c')
-rw-r--r--src/plugininstance.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/plugininstance.c b/src/plugininstance.c
index ed8abc7..13a659a 100644
--- a/src/plugininstance.c
+++ b/src/plugininstance.c
@@ -21,11 +21,11 @@
#include <string.h>
#include <assert.h>
#include <dlfcn.h>
-#include <slv2/private_types.h>
#include <slv2/types.h>
#include <slv2/plugin.h>
#include <slv2/plugininstance.h>
#include <slv2/util.h>
+#include "private_types.h"
SLV2Instance*
@@ -81,9 +81,12 @@ slv2_plugin_instantiate(const SLV2Plugin* plugin,
result = malloc(sizeof(struct _Instance));
/*result->plugin = malloc(sizeof(struct _Plugin));
memcpy(result->plugin, plugin, sizeof(struct _Plugin));*/
- result->descriptor = ld;
- result->lib_handle = lib;
+ result->lv2_descriptor = ld;
result->lv2_handle = ld->instantiate(ld, sample_rate, (char*)bundle_path, host_features);
+ struct _InstanceImpl* impl = malloc(sizeof(struct _InstanceImpl));
+ impl->lib_handle = lib;
+ result->pimpl = impl;
+
break;
}
}
@@ -101,7 +104,7 @@ slv2_plugin_instantiate(const SLV2Plugin* plugin,
// "Connect" all ports to NULL (catches bugs)
for (uint32_t i=0; i < slv2_plugin_get_num_ports(plugin); ++i)
- result->descriptor->connect_port(result->lv2_handle, i, NULL);
+ result->lv2_descriptor->connect_port(result->lv2_handle, i, NULL);
if (local_host_features)
free(host_features);
@@ -114,10 +117,12 @@ void
slv2_instance_free(SLV2Instance* instance)
{
struct _Instance* i = (struct _Instance*)instance;
- i->descriptor->cleanup(i->lv2_handle);
- i->descriptor = NULL;
- dlclose(i->lib_handle);
- i->lib_handle = NULL;
+ i->lv2_descriptor->cleanup(i->lv2_handle);
+ i->lv2_descriptor = NULL;
+ dlclose(i->pimpl->lib_handle);
+ i->pimpl->lib_handle = NULL;
+ free(i->pimpl);
+ i->pimpl = NULL;
free(i);
}