diff options
Diffstat (limited to 'slv2')
-rw-r--r-- | slv2/Makefile.am | 1 | ||||
-rw-r--r-- | slv2/plugininstance.h | 57 | ||||
-rw-r--r-- | slv2/private_types.h | 81 | ||||
-rw-r--r-- | slv2/types.h | 1 |
4 files changed, 31 insertions, 109 deletions
diff --git a/slv2/Makefile.am b/slv2/Makefile.am index 8ce74f2..d2b863e 100644 --- a/slv2/Makefile.am +++ b/slv2/Makefile.am @@ -3,7 +3,6 @@ slv2includedir = $(includedir)/slv2 slv2include_HEADERS = \ lv2.h \ types.h \ - private_types.h \ slv2.h \ library.h \ plugin.h \ diff --git a/slv2/plugininstance.h b/slv2/plugininstance.h index 1b475c2..e704383 100644 --- a/slv2/plugininstance.h +++ b/slv2/plugininstance.h @@ -26,12 +26,17 @@ extern "C" { #include <assert.h> #include <dlfcn.h> #include <slv2/lv2.h> -#include <slv2/private_types.h> #include <slv2/plugin.h> #include <slv2/port.h> +typedef struct _InstanceImpl* SLV2InstanceImpl; -typedef const struct _Instance SLV2Instance; +/** Instance of a plugin */ +typedef struct _Instance { + const LV2_Descriptor* lv2_descriptor; + LV2_Handle lv2_handle; + SLV2InstanceImpl pimpl; ///< Opaque +} SLV2Instance; /** \defgroup lib Plugin Instance - Shared library access @@ -47,7 +52,7 @@ typedef const struct _Instance SLV2Instance; /** Instantiate a plugin. * * The returned object represents shared library objects loaded into memory, - * it must be cleaned up with slv2instance_free when no longer + * it must be cleaned up with slv2_instance_free when no longer * needed. * * \a plugin is not modified or directly referenced by the returned object @@ -84,9 +89,9 @@ static inline const char* slv2_instance_get_uri(SLV2Instance* instance) { assert(instance); - assert(instance->descriptor); + assert(instance->lv2_descriptor); - return instance->descriptor->URI; + return instance->lv2_descriptor->URI; } @@ -101,10 +106,10 @@ slv2_instance_connect_port(SLV2Instance* instance, void* data_location) { assert(instance); - assert(instance->descriptor); - assert(instance->descriptor->connect_port); + assert(instance->lv2_descriptor); + assert(instance->lv2_descriptor->connect_port); - instance->descriptor->connect_port + instance->lv2_descriptor->connect_port (instance->lv2_handle, port_index, data_location); } @@ -112,23 +117,23 @@ slv2_instance_connect_port(SLV2Instance* instance, /** Activate a plugin instance. * * This resets all state information in the plugin, except for port data - * locations (as set by slv2instance_connect_port). This MUST be called - * before calling slv2instance_run. + * locations (as set by slv2_instance_connect_port). This MUST be called + * before calling slv2_instance_run. */ static inline void slv2_instance_activate(SLV2Instance* instance) { assert(instance); - assert(instance->descriptor); + assert(instance->lv2_descriptor); - if (instance->descriptor->activate) - instance->descriptor->activate(instance->lv2_handle); + if (instance->lv2_descriptor->activate) + instance->lv2_descriptor->activate(instance->lv2_handle); } -/** Run \a instance for \a sample_count frames. +/** Run @a instance for @a sample_count frames. * - * If the hint lv2:realtimeSafe is set for this plugin, this function is + * If the hint lv2:hardRtCapable is set for this plugin, this function is * guaranteed not to block. */ static inline void @@ -136,11 +141,11 @@ slv2_instance_run(SLV2Instance* instance, uint32_t sample_count) { assert(instance); - assert(instance->descriptor); + assert(instance->lv2_descriptor); assert(instance->lv2_handle), - assert(instance->descriptor->run); + assert(instance->lv2_descriptor->run); - instance->descriptor->run(instance->lv2_handle, sample_count); + instance->lv2_descriptor->run(instance->lv2_handle, sample_count); } @@ -153,18 +158,18 @@ static inline void slv2_instance_deactivate(SLV2Instance* instance) { assert(instance); - assert(instance->descriptor); + assert(instance->lv2_descriptor); assert(instance->lv2_handle); - if (instance->descriptor->deactivate) - instance->descriptor->deactivate(instance->lv2_handle); + if (instance->lv2_descriptor->deactivate) + instance->lv2_descriptor->deactivate(instance->lv2_handle); } /** Get the LV2_Descriptor of the plugin instance. * * Normally hosts should not need to access the LV2_Descriptor directly, - * use the slv2instance_* functions. + * use the slv2_instance_* functions. * * The returned descriptor is shared and must not be deleted. */ @@ -172,16 +177,16 @@ static inline const LV2_Descriptor* slv2_instance_get_descriptor(SLV2Instance* instance) { assert(instance); - assert(instance->descriptor); + assert(instance->lv2_descriptor); - return instance->descriptor; + return instance->lv2_descriptor; } /** Get the LV2_Handle of the plugin instance. * * Normally hosts should not need to access the LV2_Handle directly, - * use the slv2instance_* functions. + * use the slv2_instance_* functions. * * The returned handle is shared and must not be deleted. */ @@ -189,7 +194,7 @@ static inline LV2_Handle slv2_instance_get_handle(SLV2Instance* instance) { assert(instance); - assert(instance->descriptor); + assert(instance->lv2_descriptor); return instance->lv2_handle; } diff --git a/slv2/private_types.h b/slv2/private_types.h deleted file mode 100644 index 906d89c..0000000 --- a/slv2/private_types.h +++ /dev/null @@ -1,81 +0,0 @@ -/* SLV2 - * Copyright (C) 2007 Dave Robillard <http://drobilla.net> - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __SLV2_PRIVATE_TYPES_H__ -#define __SLV2_PRIVATE_TYPES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <stdbool.h> -#include <stddef.h> -#include <raptor.h> -#include <slv2/lv2.h> - - -/* @file private_types.h - * - * If you're a user of SLV2, stop reading this RIGHT NOW :) - * Unfortunately it needs to be exposed to allow inlining of some things that - * really need to be inlined, but these are opaque types. - * - * DO NOT WRITE CODE THAT DEPENDS ON DEFINITIONS IN THIS FILE - */ - - -/** Record of an installed/available plugin. - * - * A simple reference to a plugin somewhere on the system. This just holds - * paths of relevant files, the actual data therein isn't loaded into memory. - */ -struct _Plugin { - char* plugin_uri; - char* bundle_url; // Bundle directory plugin was loaded from - raptor_sequence* data_uris; // rdfs::seeAlso - char* lib_uri; // lv2:binary -}; - - -/** Instance of a plugin (private type) */ -struct _Instance { - // FIXME: copy plugin here for convenience? - //struct LV2Plugin* plugin; - const LV2_Descriptor* descriptor; - void* lib_handle; - LV2_Handle lv2_handle; -}; - - -/** List of references to plugins available for loading (private type) */ -struct _PluginList { - size_t num_plugins; - struct _Plugin** plugins; -}; - - -/** An ordered, indexable collection of strings. */ -//typedef raptor_sequence* SLV2Strings; - - -#ifdef __cplusplus -} -#endif - -#endif /* __SLV2_PRIVATE_TYPES_H__ */ - diff --git a/slv2/types.h b/slv2/types.h index b1b115c..dd7480c 100644 --- a/slv2/types.h +++ b/slv2/types.h @@ -22,7 +22,6 @@ #include <stddef.h> #include <stdbool.h> #include <stdint.h> -//#include <slv2/private_types.h> #ifdef __cplusplus extern "C" { |