From 3af94d8f422593fc16951b7365a5c6e62708e4c0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 24 Sep 2007 01:05:07 +0000 Subject: LV2 UI interface cleanups. Documentation reorganization. Updated LV2 spec (1.0beta5). git-svn-id: http://svn.drobilla.net/lad/slv2@775 a436a847-0d15-0410-975c-d299462d15a1 --- data/lv2core.lv2/lv2.ttl | 65 +++++++++++++++++++++++++++++++++--------------- doc/mainpage.dox | 20 ++++++++++++++- doc/reference.doxygen.in | 7 ++++-- slv2/Makefile.am | 1 - slv2/lv2.h | 2 +- slv2/plugin.h | 7 +++--- slv2/pluginclasses.h | 3 +-- slv2/plugins.h | 7 +----- slv2/pluginui.h | 20 ++++++++------- slv2/pluginuiinstance.h | 24 +++++++----------- slv2/pluginuis.h | 22 +++++++--------- slv2/slv2.h | 1 - slv2/types.h | 11 ++------ slv2/ui.h | 60 -------------------------------------------- slv2/values.h | 4 +-- slv2/world.h | 2 +- src/plugin.c | 19 ++++---------- src/pluginui.c | 18 +++++++------- src/pluginuiinstance.c | 24 +++++++++--------- src/pluginuis.c | 24 +++++++++--------- src/slv2_internal.h | 17 +++++++------ utils/lv2_inspect.c | 16 ++++++------ 22 files changed, 164 insertions(+), 210 deletions(-) delete mode 100644 slv2/ui.h diff --git a/data/lv2core.lv2/lv2.ttl b/data/lv2core.lv2/lv2.ttl index 33184c6..da6fcd6 100644 --- a/data/lv2core.lv2/lv2.ttl +++ b/data/lv2core.lv2/lv2.ttl @@ -1,5 +1,5 @@ # RDF Schema for LV2 plugins -# *** PROVISIONAL Revision 1.0beta5 (2007-09-14) *** +# *** PROVISIONAL Revision 1.0beta5 (2007-09-23) *** # # This document describes the classes and properties that are defined by the # core LV2 specification. See for more information. @@ -50,7 +50,7 @@ See http://lv2plug.in/docs for more details. doap:programming-language "C" ; doap:release [ doap:revision "1.0beta5" ; - doap:created "2007-09-14" + doap:created "2007-09-23" ] ; doap:maintainer [ a foaf:Person ; @@ -489,13 +489,6 @@ A plugin MUST operate reasonably even if such a port has a non-integer input. # Plugin Categories (Classes) # ############################### -:UtilityPlugin a rdfs:Class ; - rdfs:subClassOf :Plugin ; - rdfs:label "Utility" ; - rdfs:comment """ -Includes things like mathematical functions and non-musical delays. -""" . - :GeneratorPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; rdfs:label "Generator" ; @@ -514,6 +507,34 @@ Any plugin that is intended to be played as a musical instrument. rdfs:subClassOf :GeneratorPlugin ; rdfs:label "Oscillator" . +:UtilityPlugin a rdfs:Class ; + rdfs:subClassOf :Plugin ; + rdfs:label "Utility" ; + rdfs:comment """ +Includes things like mathematical functions and non-musical delays. +""" . + +:ConverterPlugin a rdfs:Class ; + rdfs:subClassOf :UtilityPlugin ; + rdfs:label "Converter" ; + rdfs:comment """ +Any plugin that converts some form of input into a different form of output. +""" . + +:AnalyserPlugin a rdfs:Class ; + rdfs:subClassOf :UtilityPlugin ; + rdfs:label "Analyser" ; + rdfs:comment """ +Any plugin that analyses input to output some useful information. +""" . + +:MixerPlugin a rdfs:Class ; + rdfs:subClassOf :UtilityPlugin ; + rdfs:label "Mixer" ; + rdfs:comment """ +A plugin which mixes some number of inputs into some number of outputs. +""" . + :SimulatorPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; rdfs:label "Simulator" ; @@ -533,6 +554,12 @@ Plugins that intentionally delay their input signal as an effect. rdfs:subClassOf :Plugin ; rdfs:label "Modulator" . +:ReverbPlugin a rdfs:Class ; + rdfs:subClassOf :Plugin ; + rdfs:subClassOf :SimulatorPlugin ; + rdfs:subClassOf :DelayPlugin ; + rdfs:label "Reverb" . + :PhaserPlugin a rdfs:Class ; rdfs:subClassOf :ModulatorPlugin ; rdfs:label "Phaser" . @@ -545,12 +572,6 @@ Plugins that intentionally delay their input signal as an effect. rdfs:subClassOf :ModulatorPlugin ; rdfs:label "Chorus" . -:ReverbPlugin a rdfs:Class ; - rdfs:subClassOf :Plugin ; - rdfs:subClassOf :SimulatorPlugin ; - rdfs:subClassOf :DelayPlugin ; - rdfs:label "Reverb" . - :FilterPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; rdfs:label "Filter" . @@ -587,22 +608,26 @@ Plugins that intentionally delay their input signal as an effect. rdfs:subClassOf :EQPlugin ; rdfs:label "Multiband" . +:SpectralPlugin a rdfs:Class ; + rdfs:subClassOf :Plugin ; + rdfs:label "Spectral Processor" . + :PitchPlugin a rdfs:Class ; - rdfs:subClassOf :Plugin ; + rdfs:subClassOf :SpectralPlugin ; rdfs:label "Pitch Shifter" . :AmplifierPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; rdfs:label "Amplifier" . -:WaveshaperPlugin a rdfs:Class ; - rdfs:subClassOf :Plugin ; - rdfs:label "Waveshaper" . - :DistortionPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; rdfs:label "Distortion" . +:WaveshaperPlugin a rdfs:Class ; + rdfs:subClassOf :DistortionPlugin ; + rdfs:label "Waveshaper" . + :DynamicsPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; rdfs:label "Dynamics Processor" ; diff --git a/doc/mainpage.dox b/doc/mainpage.dox index 8417a4a..dd5b986 100644 --- a/doc/mainpage.dox +++ b/doc/mainpage.dox @@ -3,7 +3,25 @@ @section Overview SLV2 is a host library to simplify the discovery, loading, and use of LV2 -plugins. +plugins (http://lv2plug.in). +SLV2 is written in standard C99, and depends only on the Redland RDF library +(http://librdf.org). It should be portable to any system, and is tested on various +GNU/Linux distributions (often), and Mac OSX (occasionally). + +The public interface of SLV2 is documented in several sections. The RDF and shared +library functionality is strictly divided so it is simple to understand when each is +being used (e.g. it is possible to discover/investigate plugins and related data +without loading any shared libraries, avoiding the associated risks). + +\li \link world World \endlink - Global library initialisation, state, plugin discovery, etc. + +\li \link util Util \endlink - Generally useful utility functions + +\li \link collections Collections \endlink - Collections of values (literals and URIs) and objects + +\li \link data Data \endlink - Access to plugin RDF data + +\li \link lib Library \endlink - Access to plugin shared libraries */ diff --git a/doc/reference.doxygen.in b/doc/reference.doxygen.in index 584fb89..c08f4a1 100644 --- a/doc/reference.doxygen.in +++ b/doc/reference.doxygen.in @@ -38,7 +38,7 @@ PROJECT_NUMBER = @PACKAGE_VERSION@ # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = @abs_top_builddir@/doc +OUTPUT_DIRECTORY = @abs_top_builddir@/doc/slv2 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -474,7 +474,10 @@ INPUT = @abs_srcdir@/../doc/mainpage.dox \ @abs_srcdir@/../slv2/pluginclasses.h \ @abs_srcdir@/../slv2/plugininstance.h \ @abs_srcdir@/../slv2/plugins.h \ - @abs_srcdir@/../slv2/port.h + @abs_srcdir@/../slv2/port.h \ + @abs_srcdir@/../slv2/pluginui.h \ + @abs_srcdir@/../slv2/pluginuis.h \ + @abs_srcdir@/../slv2/pluginuiinstance.h # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default diff --git a/slv2/Makefile.am b/slv2/Makefile.am index a3f9a0d..89d0cd0 100644 --- a/slv2/Makefile.am +++ b/slv2/Makefile.am @@ -1,7 +1,6 @@ slv2includedir = $(includedir)/slv2 slv2include_HEADERS = \ - ui.h \ lv2.h \ lv2_gui.h \ plugin.h \ diff --git a/slv2/lv2.h b/slv2/lv2.h index 953c459..14c25ca 100644 --- a/slv2/lv2.h +++ b/slv2/lv2.h @@ -1,5 +1,5 @@ /* LV2 - LADSPA (Linux Audio Developer's Simple Plugin API) Version 2.0 - * *** PROVISIONAL *** + * *** PROVISIONAL Revision 1.0beta5 (2007-09-23) *** * * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, * Stefan Westerfeld. diff --git a/slv2/plugin.h b/slv2/plugin.h index 97d830f..fa82bae 100644 --- a/slv2/plugin.h +++ b/slv2/plugin.h @@ -241,8 +241,7 @@ bool slv2_plugin_has_latency(SLV2Plugin p); -/** Return the index of the plugin's latency port, or the empty string if the - * plugin has no latency. +/** Return the index of the plugin's latency port. * * It is a fatal error to call this on a plugin without checking if the port * exists by first calling slv2_plugin_has_latency. @@ -345,14 +344,14 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin plugin, /** Get a list of all UIs available for this plugin. * * Note this returns the URI of the UI, and not the path/URI to its shared - * library, use slv2_plugin_ui_get_library_uri with the values returned + * library, use slv2_ui_get_library_uri with the values returned * here for that. * * \param plugin The plugin to get the UIs for. * * Time = Query */ -SLV2PluginUIs +SLV2UIs slv2_plugin_get_uis(SLV2Plugin plugin); diff --git a/slv2/pluginclasses.h b/slv2/pluginclasses.h index b407ede..e95710b 100644 --- a/slv2/pluginclasses.h +++ b/slv2/pluginclasses.h @@ -25,8 +25,7 @@ extern "C" { #endif -/** \defgroup plugin_classes Plugin classes - * +/** \addtogroup collections * @{ */ diff --git a/slv2/plugins.h b/slv2/plugins.h index 5663d6a..1ca4cc7 100644 --- a/slv2/plugins.h +++ b/slv2/plugins.h @@ -26,12 +26,7 @@ extern "C" { #endif -/** \defgroup plugins Collections of plugins - * - * These functions work with lists of plugins which come from an - * SLV2World. These lists contain only a weak reference to an LV2 plugin - * in the Model. - * +/** \addtogroup collections * @{ */ diff --git a/slv2/pluginui.h b/slv2/pluginui.h index 7297431..cd5fd3a 100644 --- a/slv2/pluginui.h +++ b/slv2/pluginui.h @@ -23,8 +23,7 @@ extern "C" { #endif -/** \defgroup ui Plugin user interfaces - * +/** \addtogroup data * @{ */ @@ -36,27 +35,28 @@ extern "C" { * Time = O(1) */ const char* -slv2_plugin_ui_get_uri(SLV2PluginUI ui); +slv2_ui_get_uri(SLV2UI ui); -/** Get the URI of the a Plugin UI. +/** Get the types (URIs of RDF classes) of a Plugin UI. * * \param ui The Plugin UI * * Time = O(1) */ SLV2Values -slv2_plugin_ui_get_types(SLV2PluginUI ui); +slv2_ui_get_types(SLV2UI ui); /** Check whether a plugin UI is a given type. * - * \param ui The Plugin UI + * \param ui The Plugin UI + * \param type_uri The URI of the LV2 UI type to check this UI against * * Time = O(1) */ bool -slv2_plugin_ui_is_type(SLV2PluginUI ui, const char* type_uri); +slv2_ui_is_type(SLV2UI ui, const char* type_uri); /** Get the URI for a Plugin UI's bundle. @@ -66,7 +66,7 @@ slv2_plugin_ui_is_type(SLV2PluginUI ui, const char* type_uri); * Time = O(1) */ const char* -slv2_plugin_ui_get_bundle_uri(SLV2PluginUI ui); +slv2_ui_get_bundle_uri(SLV2UI ui); /** Get the URI for a Plugin UI's shared library. @@ -76,8 +76,10 @@ slv2_plugin_ui_get_bundle_uri(SLV2PluginUI ui); * Time = O(1) */ const char* -slv2_plugin_ui_get_binary_uri(SLV2PluginUI ui); +slv2_ui_get_binary_uri(SLV2UI ui); + +/** @} */ #ifdef __cplusplus } diff --git a/slv2/pluginuiinstance.h b/slv2/pluginuiinstance.h index 0a3d8d7..8a87761 100644 --- a/slv2/pluginuiinstance.h +++ b/slv2/pluginuiinstance.h @@ -28,13 +28,7 @@ extern "C" { #include #include -/** \defgroup lib Plugin UI library access - * - * An SLV2UIInstance is an instantiated UI for a SLV2Plugin. UI instances - * are loaded from dynamically loaded libraries. These functions interact - * with the UI code in the binary library only, they do not read data files - * in any way. - * +/** \addtogroup lib * @{ */ @@ -72,14 +66,14 @@ typedef struct _SLV2UIInstance { * \return NULL if instantiation failed. */ SLV2UIInstance -slv2_plugin_ui_instantiate(SLV2Plugin plugin, - SLV2PluginUI gui, - LV2UI_Write_Function write_function, - LV2UI_Command_Function command_function, - LV2UI_Program_Change_Function program_function, - LV2UI_Program_Save_Function save_function, - LV2UI_Controller controller, - const LV2_Host_Feature* const* host_features); +slv2_ui_instantiate(SLV2Plugin plugin, + SLV2UI ui, + LV2UI_Write_Function write_function, + LV2UI_Command_Function command_function, + LV2UI_Program_Change_Function program_function, + LV2UI_Program_Save_Function save_function, + LV2UI_Controller controller, + const LV2_Host_Feature* const* host_features); /** Free a plugin UI instance. diff --git a/slv2/pluginuis.h b/slv2/pluginuis.h index 06c38b7..f3eb699 100644 --- a/slv2/pluginuis.h +++ b/slv2/pluginuis.h @@ -26,11 +26,7 @@ extern "C" { #endif -/** \defgroup plugins Collections of plugins - * - * These functions work with lists of plugins which come from an - * SLV2World. These lists contain only a weak reference to an LV2 plugin - * in the Model. +/** \addtogroup collections * * @{ */ @@ -42,13 +38,13 @@ extern "C" { * are owned by the world). \a list is invalid after this call. */ void -slv2_plugin_uis_free(SLV2PluginUIs list); +slv2_uis_free(SLV2UIs list); /** Get the number of plugins in the list. */ unsigned -slv2_plugin_uis_size(SLV2PluginUIs list); +slv2_uis_size(SLV2UIs list); /** Get a plugin from the list by URI. @@ -60,9 +56,9 @@ slv2_plugin_uis_size(SLV2PluginUIs list); * * \return NULL if plugin with \a url not found in \a list. */ -SLV2PluginUI -slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, - const char* uri); +SLV2UI +slv2_uis_get_by_uri(SLV2UIs list, + const char* uri); /** Get a plugin from the list by index. @@ -76,9 +72,9 @@ slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, * * \return NULL if \a index out of range. */ -SLV2PluginUI -slv2_plugin_uis_get_at(SLV2PluginUIs list, - unsigned index); +SLV2UI +slv2_uis_get_at(SLV2UIs list, + unsigned index); /** @} */ diff --git a/slv2/slv2.h b/slv2/slv2.h index dbb98e3..8aaf958 100644 --- a/slv2/slv2.h +++ b/slv2/slv2.h @@ -24,7 +24,6 @@ extern "C" { #endif #include -#include #include #include #include diff --git a/slv2/types.h b/slv2/types.h index b906899..df818ce 100644 --- a/slv2/types.h +++ b/slv2/types.h @@ -69,13 +69,6 @@ typedef enum _SLV2URIType { } SLV2URIType; -/** A type of plugin UI (corresponding to some LV2 UI extension). - */ -typedef enum _SLV2UIType { - SLV2_UI_TYPE_GTK2 ///< http://ll-plugins.nongnu.org/lv2/ext/gui/dev/1#GtkGUI -} SLV2UIType; - - /** A port on a plugin. Opaque, but valid to compare to NULL. */ typedef struct _SLV2Port* SLV2Port; @@ -109,11 +102,11 @@ typedef void* SLV2Values; /** A plugin UI */ -typedef struct _SLV2PluginUI* SLV2PluginUI; +typedef struct _SLV2UI* SLV2UI; /** A collection of plugin UIs. */ -typedef void* SLV2PluginUIs; +typedef void* SLV2UIs; #ifdef __cplusplus diff --git a/slv2/ui.h b/slv2/ui.h deleted file mode 100644 index ff6c394..0000000 --- a/slv2/ui.h +++ /dev/null @@ -1,60 +0,0 @@ -/* SLV2 - * Copyright (C) 2007 Dave Robillard - * - * 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_GUI_H__ -#define __SLV2_GUI_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include -#include - -/** \defgroup ui Plugin GUI helpers - * - * SLV2 provides access to plugin GUIs, but does not depend on any widget sets - * itself. Paths to libraries and opaque pointers to objects are returned, but - * the GUI extension itself (the URI of which can be had with slv2_ui_get_uri) - * defines the specifics of how to use these objects/files/etc. - * - * @{ - */ - -/** Return the URI of the GUI type (ontology) this GUI corresponds to. - * - * Returned string is shared and must not be freed by the caller. - * - * Time = O(1) - */ -const char* -slv2_ui_type_get_uri(SLV2UIType type); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* __SLV2_GUI_H__ */ - diff --git a/slv2/values.h b/slv2/values.h index 3a46583..2535bdd 100644 --- a/slv2/values.h +++ b/slv2/values.h @@ -26,9 +26,9 @@ extern "C" { #endif -/** \defgroup values Collections of values +/** \defgroup collections Collections of values/objects * - * SLV2Values is an ordered collection of typed values which is fast for random + * Ordered collections of typed values which are fast for random * access by index (i.e. a fancy array). * * @{ diff --git a/slv2/world.h b/slv2/world.h index e4e135d..01e671c 100644 --- a/slv2/world.h +++ b/slv2/world.h @@ -27,7 +27,7 @@ extern "C" { #endif -/** \defgroup world Library +/** \defgroup world Global library state * * The "world" represents all library state, and the data found in bundles' * manifest.ttl (ie it is an in-memory index of all things LV2 found). diff --git a/src/plugin.c b/src/plugin.c index 758b256..055d727 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -566,7 +566,7 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin p, } -SLV2PluginUIs +SLV2UIs slv2_plugin_get_uis(SLV2Plugin plugin) { const char* const query_str = @@ -579,14 +579,14 @@ slv2_plugin_get_uis(SLV2Plugin plugin) librdf_query_results* results = slv2_plugin_query(plugin, query_str); - SLV2PluginUIs result = slv2_plugin_uis_new(); + SLV2UIs result = slv2_uis_new(); while (!librdf_query_results_finished(results)) { librdf_node* uri_node = librdf_query_results_get_binding_value(results, 0); librdf_node* type_node = librdf_query_results_get_binding_value(results, 1); librdf_node* binary_node = librdf_query_results_get_binding_value(results, 2); - SLV2PluginUI ui = slv2_plugin_ui_new(plugin->world, + SLV2UI ui = slv2_ui_new(plugin->world, librdf_node_get_uri(uri_node), librdf_node_get_uri(type_node), librdf_node_get_uri(binary_node)); @@ -602,10 +602,10 @@ slv2_plugin_get_uis(SLV2Plugin plugin) librdf_free_query_results(results); - if (slv2_plugin_uis_size(result) > 0) { + if (slv2_uis_size(result) > 0) { return result; } else { - slv2_plugin_uis_free(result); + slv2_uis_free(result); return NULL; } } @@ -641,15 +641,6 @@ slv2_plugin_get_ui_library_uri(SLV2Plugin plugin, } #endif -const char* -slv2_ui_type_get_uri(SLV2UIType type) -{ - if (type == SLV2_UI_TYPE_GTK2) - return "http://ll-plugins.nongnu.org/ext/gui/dev/1#GtkUI"; - else - return NULL; -} - void* slv2_plugin_load_ui(SLV2Plugin plugin, diff --git a/src/pluginui.c b/src/pluginui.c index ed9eec5..9237382 100644 --- a/src/pluginui.c +++ b/src/pluginui.c @@ -26,13 +26,13 @@ /* private */ -SLV2PluginUI -slv2_plugin_ui_new(SLV2World world, +SLV2UI +slv2_ui_new(SLV2World world, librdf_uri* uri, librdf_uri* type_uri, librdf_uri* binary_uri) { - struct _SLV2PluginUI* ui = malloc(sizeof(struct _SLV2PluginUI)); + struct _SLV2UI* ui = malloc(sizeof(struct _SLV2UI)); ui->uri = librdf_new_uri_from_uri(uri); ui->binary_uri = librdf_new_uri_from_uri(binary_uri); @@ -53,7 +53,7 @@ slv2_plugin_ui_new(SLV2World world, /* private */ void -slv2_plugin_ui_free(SLV2PluginUI ui) +slv2_ui_free(SLV2UI ui) { librdf_free_uri(ui->uri); ui->uri = NULL; @@ -71,7 +71,7 @@ slv2_plugin_ui_free(SLV2PluginUI ui) const char* -slv2_plugin_ui_get_uri(SLV2PluginUI ui) +slv2_ui_get_uri(SLV2UI ui) { assert(ui); assert(ui->uri); @@ -80,14 +80,14 @@ slv2_plugin_ui_get_uri(SLV2PluginUI ui) SLV2Values -slv2_plugin_ui_get_types(SLV2PluginUI ui) +slv2_ui_get_types(SLV2UI ui) { return ui->types; } bool -slv2_plugin_ui_is_type(SLV2PluginUI ui, const char* type_uri) +slv2_ui_is_type(SLV2UI ui, const char* type_uri) { SLV2Value type = slv2_value_new(SLV2_VALUE_URI, type_uri); bool ret = slv2_values_contains(ui->types, type); @@ -97,7 +97,7 @@ slv2_plugin_ui_is_type(SLV2PluginUI ui, const char* type_uri) const char* -slv2_plugin_ui_get_bundle_uri(SLV2PluginUI ui) +slv2_ui_get_bundle_uri(SLV2UI ui) { assert(ui); assert(ui->bundle_uri); @@ -106,7 +106,7 @@ slv2_plugin_ui_get_bundle_uri(SLV2PluginUI ui) const char* -slv2_plugin_ui_get_binary_uri(SLV2PluginUI ui) +slv2_ui_get_binary_uri(SLV2UI ui) { assert(ui); assert(ui->binary_uri); diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c index 60a3267..662f1b7 100644 --- a/src/pluginuiinstance.c +++ b/src/pluginuiinstance.c @@ -33,14 +33,14 @@ SLV2UIInstance -slv2_plugin_ui_instantiate(SLV2Plugin plugin, - SLV2PluginUI ui, - LV2UI_Write_Function write_function, - LV2UI_Command_Function command_function, - LV2UI_Program_Change_Function program_function, - LV2UI_Program_Save_Function save_function, - LV2UI_Controller controller, - const LV2_Host_Feature* const* host_features) +slv2_ui_instantiate(SLV2Plugin plugin, + SLV2UI ui, + LV2UI_Write_Function write_function, + LV2UI_Command_Function command_function, + LV2UI_Program_Change_Function program_function, + LV2UI_Program_Save_Function save_function, + LV2UI_Controller controller, + const LV2_Host_Feature* const* host_features) { struct _SLV2UIInstance* result = NULL; @@ -50,7 +50,7 @@ slv2_plugin_ui_instantiate(SLV2Plugin plugin, ((LV2_Host_Feature**)host_features)[0] = NULL; } - const char* const lib_uri = slv2_plugin_ui_get_binary_uri(ui); + const char* const lib_uri = slv2_ui_get_binary_uri(ui); const char* const lib_path = slv2_uri_to_path(lib_uri); if (!lib_path) @@ -72,7 +72,7 @@ slv2_plugin_ui_instantiate(SLV2Plugin plugin, return NULL; } else { - const char* bundle_path = slv2_uri_to_path(slv2_plugin_ui_get_bundle_uri(ui)); + const char* bundle_path = slv2_uri_to_path(slv2_ui_get_bundle_uri(ui)); for (uint32_t i=0; 1; ++i) { @@ -80,10 +80,10 @@ slv2_plugin_ui_instantiate(SLV2Plugin plugin, if (!ld) { fprintf(stderr, "Did not find UI %s in %s\n", - slv2_plugin_ui_get_uri(ui), lib_path); + slv2_ui_get_uri(ui), lib_path); dlclose(lib); break; // return NULL - } else if (!strcmp(ld->URI, slv2_plugin_ui_get_uri(ui))) { + } else if (!strcmp(ld->URI, slv2_ui_get_uri(ui))) { printf("Found UI %s at index %u in:\n\t%s\n\n", librdf_uri_as_string(plugin->plugin_uri), i, lib_path); diff --git a/src/pluginuis.c b/src/pluginuis.c index 6e0f77f..5d01bae 100644 --- a/src/pluginuis.c +++ b/src/pluginuis.c @@ -30,30 +30,30 @@ #include "slv2_internal.h" -SLV2PluginUIs -slv2_plugin_uis_new() +SLV2UIs +slv2_uis_new() { - return raptor_new_sequence((void (*)(void*))&slv2_plugin_ui_free, NULL); + return raptor_new_sequence((void (*)(void*))&slv2_ui_free, NULL); //return raptor_new_sequence(NULL, NULL); } void -slv2_plugin_uis_free(SLV2PluginUIs list) +slv2_uis_free(SLV2UIs list) { raptor_free_sequence(list); } unsigned -slv2_plugin_uis_size(SLV2PluginUIs list) +slv2_uis_size(SLV2UIs list) { return raptor_sequence_size(list); } -SLV2PluginUI -slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, const char* uri) +SLV2UI +slv2_uis_get_by_uri(SLV2UIs list, const char* uri) { // good old fashioned binary search @@ -64,9 +64,9 @@ slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, const char* uri) while (upper >= lower) { i = lower + ((upper - lower) / 2); - SLV2PluginUI ui = raptor_sequence_get_at(list, i); + SLV2UI ui = raptor_sequence_get_at(list, i); - int cmp = strcmp(slv2_plugin_ui_get_uri(ui), uri); + int cmp = strcmp(slv2_ui_get_uri(ui), uri); if (cmp == 0) return ui; @@ -80,12 +80,12 @@ slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, const char* uri) } -SLV2PluginUI -slv2_plugin_uis_get_at(SLV2PluginUIs list, unsigned index) +SLV2UI +slv2_uis_get_at(SLV2UIs list, unsigned index) { if (index > INT_MAX) return NULL; else - return (SLV2PluginUI)raptor_sequence_get_at(list, (int)index); + return (SLV2UI)raptor_sequence_get_at(list, (int)index); } diff --git a/src/slv2_internal.h b/src/slv2_internal.h index 57343fe..6aba9de 100644 --- a/src/slv2_internal.h +++ b/src/slv2_internal.h @@ -171,20 +171,21 @@ slv2_world_load_file(SLV2World world, librdf_uri* file_uri); /* ********* Plugin UI ********* */ -struct _SLV2PluginUI { +struct _SLV2UI { librdf_uri* uri; librdf_uri* bundle_uri; librdf_uri* binary_uri; SLV2Values types; }; -SLV2PluginUIs slv2_plugin_uis_new(); -SLV2PluginUI -slv2_plugin_ui_new(SLV2World world, - librdf_uri* uri, - librdf_uri* type_uri, - librdf_uri* binary_uri); -void slv2_plugin_ui_free(SLV2PluginUI ui); +SLV2UIs slv2_uis_new(); +SLV2UI +slv2_ui_new(SLV2World world, + librdf_uri* uri, + librdf_uri* type_uri, + librdf_uri* binary_uri); + +void slv2_ui_free(SLV2UI ui); /* ********* Value ********* */ diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c index b229c8e..feb9b58 100644 --- a/utils/lv2_inspect.c +++ b/utils/lv2_inspect.c @@ -126,16 +126,16 @@ print_plugin(SLV2Plugin p) printf("\tBundle: %s\n", slv2_plugin_get_bundle_uri(p)); printf("\tBinary: %s\n", slv2_plugin_get_library_uri(p)); - SLV2PluginUIs uis = slv2_plugin_get_uis(p); + SLV2UIs uis = slv2_plugin_get_uis(p); if (slv2_values_size(uis) > 0) { printf("\tGUI: "); - for (unsigned i=0; i < slv2_plugin_uis_size(uis); ++i) { - SLV2PluginUI ui = slv2_plugin_uis_get_at(uis, i); - printf("%s\n", slv2_plugin_ui_get_uri(ui)); + for (unsigned i=0; i < slv2_uis_size(uis); ++i) { + SLV2UI ui = slv2_uis_get_at(uis, i); + printf("%s\n", slv2_ui_get_uri(ui)); - const char* binary = slv2_plugin_ui_get_binary_uri(ui); + const char* binary = slv2_ui_get_binary_uri(ui); - SLV2Values types = slv2_plugin_ui_get_types(ui); + SLV2Values types = slv2_ui_get_types(ui); for (unsigned i=0; i < slv2_values_size(types); ++i) { printf("\t\t\tType: %s\n", slv2_value_as_uri(slv2_values_get_at(types, i))); } @@ -143,10 +143,10 @@ print_plugin(SLV2Plugin p) if (binary) printf("\t\t\tBinary: %s\n", binary); - printf("\t\t\tBundle: %s\n", slv2_plugin_ui_get_bundle_uri(ui)); + printf("\t\t\tBundle: %s\n", slv2_ui_get_bundle_uri(ui)); } } - slv2_plugin_uis_free(uis); + slv2_uis_free(uis); //SLV2Values ui = slv2_plugin_get_value_for_subject(p, // ""); -- cgit v1.2.1