diff options
author | David Robillard <d@drobilla.net> | 2006-07-26 03:25:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-07-26 03:25:08 +0000 |
commit | 2cd84e4209633e59439c445f821bed8410347bab (patch) | |
tree | ba34505505795cff5cf35c2958ed21933b822e12 /slv2 | |
parent | deca2cc89850dffc051d0a0aafc9d681af838934 (diff) | |
download | lilv-2cd84e4209633e59439c445f821bed8410347bab.tar.gz lilv-2cd84e4209633e59439c445f821bed8410347bab.tar.bz2 lilv-2cd84e4209633e59439c445f821bed8410347bab.zip |
- Removed all the unsigned char garbage from the API
- Updated types in lv2.h to be non-machine-dependant (removed unsigned long in favour of uint32_t)
- Updated schema
- Updated example plugin to work with the above (partially)
git-svn-id: http://svn.drobilla.net/lad/libslv2@101 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'slv2')
-rw-r--r-- | slv2/plugin.h | 17 | ||||
-rw-r--r-- | slv2/plugininstance.h | 6 | ||||
-rw-r--r-- | slv2/pluginlist.h | 8 | ||||
-rw-r--r-- | slv2/port.h | 33 | ||||
-rw-r--r-- | slv2/private_types.h | 15 | ||||
-rw-r--r-- | slv2/query.h | 8 | ||||
-rw-r--r-- | slv2/types.h | 7 |
7 files changed, 43 insertions, 51 deletions
diff --git a/slv2/plugin.h b/slv2/plugin.h index 6af04bc..01dfc60 100644 --- a/slv2/plugin.h +++ b/slv2/plugin.h @@ -22,7 +22,8 @@ #ifdef __cplusplus extern "C" { #endif - + +#include <stdint.h> #include <stddef.h> #include <stdbool.h> #include "types.h" @@ -82,7 +83,7 @@ slv2_plugin_duplicate(const SLV2Plugin* plugin); * * \return a shared string which must not be modified or free()'d. */ -const unsigned char* +const char* slv2_plugin_get_uri(const SLV2Plugin* plugin); @@ -93,7 +94,7 @@ slv2_plugin_get_uri(const SLV2Plugin* plugin); * \return a complete URL eg. "file:///usr/foo/SomeBundle.lv2/someplug.ttl", * which is shared and must not be modified or free()'d. */ -const unsigned char* +const char* slv2_plugin_get_data_url(const SLV2Plugin* plugin); @@ -103,7 +104,7 @@ slv2_plugin_get_data_url(const SLV2Plugin* plugin); * eg. "/usr/foo/SomeBundle.lv2/someplug.ttl" which is shared and must not * be free()'d; or NULL if URL is not a local filesystem path. */ -const unsigned char* +const char* slv2_plugin_get_data_path(const SLV2Plugin* plugin); @@ -111,7 +112,7 @@ slv2_plugin_get_data_path(const SLV2Plugin* plugin); * * \return a shared string which must not be modified or free()'d. */ -const unsigned char* +const char* slv2_plugin_get_library_url(const SLV2Plugin* plugin); @@ -121,7 +122,7 @@ slv2_plugin_get_library_url(const SLV2Plugin* plugin); * eg. "/usr/foo/SomeBundle.lv2/someplug.so" which is shared and must not * be free()'d; or NULL if URL is not a local filesystem path. */ -const unsigned char* +const char* slv2_plugin_get_library_path(const SLV2Plugin* plugin); @@ -131,7 +132,7 @@ slv2_plugin_get_library_path(const SLV2Plugin* plugin); * data file without a language tag). Returned value must be free()'d by * the caller. */ -unsigned char* +char* slv2_plugin_get_name(const SLV2Plugin* plugin); @@ -154,7 +155,7 @@ slv2_plugin_get_property(const SLV2Plugin* p, /** Get the number of ports on this plugin. */ -unsigned long +uint32_t slv2_plugin_get_num_ports(const SLV2Plugin* p); diff --git a/slv2/plugininstance.h b/slv2/plugininstance.h index 5fd9393..1867c5e 100644 --- a/slv2/plugininstance.h +++ b/slv2/plugininstance.h @@ -58,7 +58,7 @@ typedef const struct _Instance SLV2Instance; */ SLV2Instance* slv2_plugin_instantiate(const SLV2Plugin* plugin, - unsigned long sample_rate, + uint32_t sample_rate, const LV2_Host_Feature** host_features); @@ -94,7 +94,7 @@ slv2_instance_get_uri(SLV2Instance* instance) */ inline void slv2_instance_connect_port(SLV2Instance* instance, - unsigned long port_index, + uint32_t port_index, void* data_location) { assert(instance); @@ -130,7 +130,7 @@ slv2_instance_activate(SLV2Instance* instance) */ inline void slv2_instance_run(SLV2Instance* instance, - unsigned long sample_count) + uint32_t sample_count) { assert(instance); assert(instance->descriptor); diff --git a/slv2/pluginlist.h b/slv2/pluginlist.h index d29a56d..535c214 100644 --- a/slv2/pluginlist.h +++ b/slv2/pluginlist.h @@ -110,8 +110,8 @@ slv2_list_load_path(SLV2List list, * installed plugins. Use \ref slv2_list_load_all. */ void -slv2_list_load_bundle(SLV2List list, - const unsigned char* bundle_base_url); +slv2_list_load_bundle(SLV2List list, + const char* bundle_base_url); /** Get the number of plugins in the list. @@ -128,8 +128,8 @@ slv2_list_get_length(const SLV2List list); * \return NULL if plugin with \a url not found in \a list. */ const SLV2Plugin* -slv2_list_get_plugin_by_uri(const SLV2List list, - const unsigned char* uri); +slv2_list_get_plugin_by_uri(const SLV2List list, + const char* uri); /** Get a plugin from the list by index. diff --git a/slv2/port.h b/slv2/port.h index 601aa49..ee51507 100644 --- a/slv2/port.h +++ b/slv2/port.h @@ -31,27 +31,14 @@ extern "C" { */ -/** A port on a plugin. - * - * The information necessary to use the port is stored here, any extra - * information can be queried with slv2port_get_property. - */ -/*struct LV2Port { - unsigned long index; ///< Index in ports array - char* short_name; ///< Guaranteed unique identifier - char* type; ///< eg. lv2:InputControlPort - char* data_type; ///< eg. lv2:float -};*/ - - /** Get a property of a port, by port index. * * Return value must be freed by caller with slv2_property_free. */ SLV2Property slv2_port_get_property(SLV2Plugin* plugin, - unsigned long index, - const uchar* property); + uint32_t index, + const char* property); /** Get the symbol of a port given the index. @@ -61,16 +48,16 @@ slv2_port_get_property(SLV2Plugin* plugin, * * \return NULL when index is out of range */ -uchar* +char* slv2_port_get_symbol(SLV2Plugin* plugin, - unsigned long index); + uint32_t index); /** Get the class (direction and rate) of a port. */ enum SLV2PortClass slv2_port_get_class(SLV2Plugin* plugin, - unsigned long index); + uint32_t index); /** Get the data type of a port (as a URI). @@ -78,9 +65,9 @@ slv2_port_get_class(SLV2Plugin* plugin, * The only data type included in the core LV2 specification is lv2:float. * Compare this return value with @ref SLV2_DATA_TYPE_FLOAT to check for it. */ -uchar* +char* slv2_port_get_data_type(SLV2Plugin* plugin, - unsigned long index); + uint32_t index); /** Get the default value of a port. @@ -89,7 +76,7 @@ slv2_port_get_data_type(SLV2Plugin* plugin, */ float slv2_port_get_default_value(SLV2Plugin* plugin, - unsigned long index); + uint32_t index); /** Get the minimum value of a port. @@ -98,7 +85,7 @@ slv2_port_get_default_value(SLV2Plugin* plugin, */ float slv2_port_get_minimum_value(SLV2Plugin* plugin, - unsigned long index); + uint32_t index); /** Get the maximum value of a port. @@ -107,7 +94,7 @@ slv2_port_get_minimum_value(SLV2Plugin* plugin, */ float slv2_port_get_maximum_value(SLV2Plugin* plugin, - unsigned long index); + uint32_t index); /** @} */ diff --git a/slv2/private_types.h b/slv2/private_types.h index 849e5a2..a9c60bf 100644 --- a/slv2/private_types.h +++ b/slv2/private_types.h @@ -27,16 +27,23 @@ extern "C" { #include <lv2.h> +/* If you're a user of SLV2, stop reading this file 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. Don't even think + * about writing code that depends on any information here.... + */ + + /** 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 { - unsigned char* plugin_uri; - unsigned char* bundle_url; // Bundle directory plugin was loaded from - unsigned char* data_url; // rdfs::seeAlso - unsigned char* lib_url; // lv2:binary + char* plugin_uri; + char* bundle_url; // Bundle directory plugin was loaded from + char* data_url; // rdfs::seeAlso + char* lib_url; // lv2:binary }; diff --git a/slv2/query.h b/slv2/query.h index 79e7301..57d1b22 100644 --- a/slv2/query.h +++ b/slv2/query.h @@ -56,7 +56,7 @@ extern "C" { * * \return an unsigned (UTF-8) string which must be free()'d. */ -unsigned char* +char* slv2_query_header(const SLV2Plugin* p); @@ -70,8 +70,8 @@ slv2_query_header(const SLV2Plugin* p); * * eg. FILTER( LANG(?value) = "en" || LANG(?value) = "" ) */ -unsigned char* -slv2_query_lang_filter(const uchar* variable); +char* +slv2_query_lang_filter(const char* variable); /** Run a SPARQL query on a plugin's data file. @@ -85,7 +85,7 @@ slv2_query_lang_filter(const uchar* variable); */ rasqal_query_results* slv2_plugin_run_query(const SLV2Plugin* p, - const uchar* query_string, ...); + const char* query_string, ...); SLV2Property slv2_query_get_results(rasqal_query_results* results); diff --git a/slv2/types.h b/slv2/types.h index 79b1e0f..f93eea2 100644 --- a/slv2/types.h +++ b/slv2/types.h @@ -26,16 +26,13 @@ extern "C" { #include <stddef.h> -typedef unsigned char uchar; - - /* A property, resulting from a query. * * Note that properties may have many values. */ struct _Property { - size_t num_values; - unsigned char** values; + size_t num_values; + char** values; }; typedef struct _Property* SLV2Property; |