diff options
-rw-r--r-- | data/lv2core.lv2/lv2.ttl | 201 | ||||
-rw-r--r-- | slv2/lv2.h | 27 | ||||
-rw-r--r-- | slv2/lv2_gui.h | 2 | ||||
-rw-r--r-- | slv2/plugin.h | 73 | ||||
-rw-r--r-- | slv2/plugininstance.h | 6 | ||||
-rw-r--r-- | slv2/pluginuiinstance.h | 2 | ||||
-rw-r--r-- | slv2/port.h | 21 | ||||
-rw-r--r-- | src/plugin.c | 24 | ||||
-rw-r--r-- | src/plugininstance.c | 20 | ||||
-rw-r--r-- | src/pluginuiinstance.c | 16 | ||||
-rw-r--r-- | src/port.c | 14 | ||||
-rw-r--r-- | utils/lv2_inspect.c | 51 |
12 files changed, 173 insertions, 284 deletions
diff --git a/data/lv2core.lv2/lv2.ttl b/data/lv2core.lv2/lv2.ttl index da6fcd6..f499428 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-23) *** +# *** PROVISIONAL Revision 1.0beta6 (2007-10-03) *** # # This document describes the classes and properties that are defined by the # core LV2 specification. See <http://lv2plug.in> for more information. @@ -49,8 +49,8 @@ See http://lv2plug.in/docs for more details. doap:shortdesc "An audio processing plugin specification" ; doap:programming-language "C" ; doap:release [ - doap:revision "1.0beta5" ; - doap:created "2007-09-23" + doap:revision "1.0beta6" ; + doap:created "2007-10-03" ] ; doap:maintainer [ a foaf:Person ; @@ -110,7 +110,7 @@ at least one other rdf:type property which more specifically describes type of the port (e.g. :AudioPort). Hosts that do not support a specific port class MUST NOT instantiate the -plugin, unless that port has the connectionOptional hint set (in which case +plugin, unless that port has the connectionOptional property set (in which case the host can simply "connect" that port to NULL). If a host is interested in plugins to insert in a certain signal path (e.g. stereo audio), it SHOULD consider all the classes of a port to determine which ports are most suitable @@ -151,9 +151,9 @@ conforming to the 32bit IEEE-754 floating point specification. """ . -################################### -# Mandatory Plugin RDF:Properties # -################################### +##################################### +## Mandatory Plugin RDF Properties ## +##################################### :port a rdf:Property ; rdfs:domain :Plugin ; @@ -162,9 +162,9 @@ conforming to the 32bit IEEE-754 floating point specification. rdfs:comment "Relates a Plugin to the Ports it contains" . -################################## -# Optional Plugin RDF:Properties # -################################## +#################################### +## Optional Plugin RDF Properties ## +#################################### :documentation a rdf:Property ; rdfs:domain :Plugin ; @@ -173,9 +173,9 @@ conforming to the 32bit IEEE-754 floating point specification. -################################# -# Mandatory Port RDF:Properties # -################################# +################################### +## Mandatory Port RDF Properties ## +################################### :index a rdf:Property ; rdfs:domain :Port ; @@ -213,9 +213,9 @@ property without changing the Plugin URI. -################################ -# Optional Port RDF:Properties # -################################ +################################## +## Optional Port RDF Properties ## +################################## :Point a rdfs:Class ; rdfs:label "Port value point" ; @@ -265,117 +265,65 @@ values in the range of :float. -################### -## Host Features ## -################### +############## +## Features ## +############## -:HostFeature a rdfs:Class ; - rdfs:label "Host feature" ; - rdfs:comment "A host feature which a plugin may use (possibly require).". +:Feature a rdfs:Class ; + rdfs:label "Feature" ; + rdfs:comment "An additional feature which a plugin may use (possibly require).". -:optionalHostFeature a rdf:Property ; +:optionalFeature a rdf:Property ; rdfs:domain :Plugin ; - rdfs:range :HostFeature ; - rdfs:label "Optional host feature" ; + rdfs:range :Feature ; + rdfs:label "Optional feature" ; rdfs:comment """ -Signifies that a plugin is able to make use of a certain host feature. -The plugin MUST NOT fail to instantiate if an optional host feature is -not present.""" . +Signifies that a plugin is able to make use of or provide a certain feature. +If the host supports this feature, it MUST pass its URI and any additional +data to the plugin in the instantiate() function. The plugin MUST NOT fail to +instantiate if an optional feature is not supported by the host.""" . -:requiredHostFeature a rdf:Property ; +:requiredFeature a rdf:Property ; rdfs:domain :Plugin ; - rdfs:range :HostFeature ; - rdfs:label "Required host feature" ; + rdfs:range :Feature ; + rdfs:label "Required feature" ; rdfs:comment """ -Signifies that a plugin requires a certain host feature to function. -The plugin MUST fail to instantiate if a required host feature is not present; -hosts SHOULD always check this before attempting to instantiate a plugin -(eg discovery by attempting to instantiate is strongly discouraged). +Signifies that a plugin requires a certain feature in order to function. +If the host supports this feature, it MUST pass its URI and any additional +data to the plugin in the instantiate() function. The plugin MUST fail to +instantiate if a required feature is not present; hosts SHOULD always check +this before attempting to instantiate a plugin (i.e. discovery by attempting +to instantiate is strongly discouraged). """ . - #################### -## LV2 Properties ## +## PortProperties ## #################### -:Property a rdfs:Class ; - rdfs:subClassOf rdf:Property ; - rdfs:label "Property" ; +:PortProperty a rdfs:Class ; + rdfs:label "Port property" ; rdfs:comment """ -An LV2 Property. A host MUST NOT ignore the presence of a Property -(eg if it does, something catastrophic will happen and the plugin will not -function). If a piece of information can be ignored by the host and the -plugin can still function correctly, it is NOT a Property, it is a Hint. +A port propety - a useful piece of information that allows a host to make more +sensible decisions (e.g. to provide a better interface). """ . - -:PluginProperty a rdfs:Class ; - rdfs:label "Plugin property" ; - rdfs:subClassOf :Property ; - rdfs:comment "Property of a Plugin." . - -:PortProperty a rdfs:Class ; - rdfs:label "Port property" ; - rdfs:subClassOf :Property ; - rdfs:comment "Property of a Port." . - -:pluginProperty a rdf:Property ; - rdfs:domain :Plugin ; - rdfs:range :PluginProperty ; - rdfs:label "Plugin property" ; - rdfs:comment "Relates Plugins to PluginProperties." . :portProperty a rdf:Property ; rdfs:domain :Port ; rdfs:range :PortProperty ; - rdfs:label "hint" ; - rdfs:comment "Relates Ports to PortProperties." . - - - -############### -## LV2 Hints ## -############### - -:Hint a rdfs:Class ; - rdfs:label "Hint" ; + rdfs:label "Port property" ; rdfs:comment """ -An LV2 Hint - a useful piece of information that allows a host to make more -sensible decisions (eg to provide a better interface). Unlike a Property -a Hint may be ignored without catastrophic effects (though this doesn't mean -a Hint is less "important" than a Property, whether or not it can be safely -ignored and have the plugin still function correctly is the sole distinction). -""" . - -:PluginHint a rdfs:Class ; - rdfs:label "Plugin hint" ; - rdfs:subClassOf :Hint ; - rdfs:comment "Hint for a Plugin." . - -:PortHint a rdfs:Class ; - rdfs:label "Port hint" ; - rdfs:subClassOf :Hint ; - rdfs:comment "Hint for a Port." . - -:pluginHint a rdf:Property ; - rdfs:domain :Plugin ; - rdfs:range :PluginHint ; - rdfs:label "Plugin hint" ; - rdfs:comment "Relates Plugins to PluginHints." . - -:portHint a rdf:Property ; - rdfs:domain :Port ; - rdfs:range :PortHint ; - rdfs:label "Port hint" ; - rdfs:comment "Relates Ports to PortHints." . - +Relates Ports to PortProperties. The PortProperty may be ignored without +catastrophic effects, though it may be useful e.g. for providing a sensible +interface for the port. +""". -############################# -# Standard PluginProperties # -############################# +####################### +## Standard Features ## +####################### -:isLive a :PluginProperty ; +:isLive a :Feature ; rdfs:label "Has a live (realtime) dependency" ; rdfs:comment """ Indicates that the plugin has a real-time dependency (e.g. queues data from a @@ -383,24 +331,18 @@ socket) and so its output must not be cached or subject to significant latency, and calls to the run method should be done in rapid succession. """ . -:inPlaceBroken a :PluginProperty ; +:inPlaceBroken a :Feature ; rdfs:label "in-place broken" ; rdfs:comment """ Indicates that the plugin may cease to work correctly if the host elects to use the same data location for both input and output. Plugins that will fail to work correctly if ANY input buffer is set to the same location as ANY output -buffer (with connect_port()) MUST set this property. Doing so should be -avoided as enabling this flag makes it impossible for hosts to use the plugin -to process audio "in-place". +buffer (with connect_port()) MUST require this Feature. Doing so should be +avoided as it makes it impossible for hosts to use the plugin to process audio +"in-place". """ . - - -######################## -# Standard PluginHints # -######################## - -:hardRTCapable a :PluginHint ; +:hardRTCapable a :Feature ; rdfs:label "Hard realtime capable" ; rdfs:comment """ Indicates that the plugin is capable of running not only in a conventional host @@ -430,12 +372,11 @@ satisfy all of the following: """ . +############################# +## Standard PortProperties ## +############################# -###################### -# Standard PortHints # -###################### - -:connectionOptional a :PortHint ; +:connectionOptional a :PortProperty ; rdfs:label "Optionally connected port" ; rdfs:comment """ Indicates that this port does not have to be connected to valid data by the @@ -443,7 +384,7 @@ host. If it is to be disconnected then the port MUST set to NULL with a call to the connectPort method. """ . -:reportsLatency a :PortHint ; +:reportsLatency a :PortProperty ; rdfs:label "Latency reporting port" ; rdfs:comment """ Indicates that the port is used to express the processing latency incurred by @@ -451,13 +392,13 @@ the plugin, expressed in samples. The latency may be affected by the current sample rate, plugin settings, or other factors, and may be changed by the plugin at any time. Where the latency is frequency dependent the plugin may choose any appropriate value. If a plugin introduces latency it MUST provide -EXACTLY ONE port with this hint set which informs the host of the "correct" +EXACTLY ONE port with this property set which informs the host of the "correct" latency. In "fuzzy" cases the value output should be the most reasonable based on user expectation of input/output alignment (eg. musical delay/echo plugins should not report their delay as latency, as it is an intentional effect). """. -:toggled a :PortHint ; +:toggled a :PortProperty ; rdfs:label "Toggled" ; rdfs:comment """ Indicates that the data item should be considered a Boolean toggle. Data less @@ -465,17 +406,17 @@ than or equal to zero should be considered "off" or "false", and data above zero should be considered "on" or "true". """ . -:sampleRate a :PortHint ; +:sampleRate a :PortProperty ; rdfs:label "Sample rate" ; rdfs:comment """ Indicates that any bounds specified should be interpreted as multiples of the sample rate. For instance, a frequency range from 0Hz to the Nyquist frequency -(half the sample rate) could be requested by this hint in conjunction with +(half the sample rate) could be requested by this property in conjunction with :minimum 0.0 and :maximum 0.5. Hosts that support bounds at all must support -this hint to retain meaning. +this property to retain meaning. """ . -:integer a :PortHint ; +:integer a :PortProperty ; rdfs:label "Integer" ; rdfs:comment """ Indicates that a port's reasonable values are integers (eg. a user interface @@ -485,9 +426,9 @@ A plugin MUST operate reasonably even if such a port has a non-integer input. -############################### -# Plugin Categories (Classes) # -############################### +#################### +## Plugin Classes ## +#################### :GeneratorPlugin a rdfs:Class ; rdfs:subClassOf :Plugin ; @@ -1,5 +1,5 @@ /* LV2 - LADSPA (Linux Audio Developer's Simple Plugin API) Version 2.0 - * *** PROVISIONAL Revision 1.0beta5 (2007-09-23) *** + * *** PROVISIONAL Revision 1.0beta6 (2007-10-03) *** * * Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, * Stefan Westerfeld. @@ -36,7 +36,7 @@ extern "C" { /** @file lv2.h * - * Revision: 1.0beta5 + * Revision: 1.0beta6 * * == Overview == * @@ -121,14 +121,15 @@ typedef void * LV2_Handle; /* ************************************************************************* */ -/** Host feature. +/** Feature data. * * These are passed to a plugin's instantiate method to represent a special * feature the host has which the plugin may depend on. This is to allow - * extensions to the LV2 specification without causing any breakage. The base - * LV2 specification does not define any host features; hosts are not required + * extensions to the LV2 specification without causing any breakage. + * Extensions may specify what data needs to be passed here. The base + * LV2 specification does not define any features; hosts are not required * to use this facility. */ -typedef struct _LV2_Host_Feature { +typedef struct _LV2_Feature { /** A globally unique, case-sensitive identifier for this feature. * * This MUST be defined in the specification of any LV2 extension which @@ -144,7 +145,7 @@ typedef struct _LV2_Host_Feature { * this feature. * If no data is required, this may be set to NULL. */ void * data; -} LV2_Host_Feature; +} LV2_Feature; /* ************************************************************************* */ @@ -192,10 +193,10 @@ typedef struct _LV2_Descriptor { * Note that instance initialisation should generally occur in * activate() rather than here. If a host calls instantiate, it MUST * call cleanup() at some point in the future. */ - LV2_Handle (*instantiate)(const struct _LV2_Descriptor * descriptor, - double sample_rate, - const char * bundle_path, - const LV2_Host_Feature *const * host_features); + LV2_Handle (*instantiate)(const struct _LV2_Descriptor * descriptor, + double sample_rate, + const char * bundle_path, + const LV2_Feature *const * features); /** Function pointer that connects a port on a plugin instance to a memory * location where the block of data for the port will be read/written. @@ -229,7 +230,7 @@ typedef struct _LV2_Descriptor { * However, overlapped buffers or use of a single buffer for both * audio and control data may result in unexpected behaviour. * - * If the plugin has the property lv2:hardRTCapable then there are + * If the plugin has the feature lv2:hardRTCapable then there are * various things that the plugin MUST NOT do within the connect_port() * function (see lv2.ttl). */ void (*connect_port)(LV2_Handle instance, @@ -271,7 +272,7 @@ typedef struct _LV2_Descriptor { * the plugin instance may not be reused until activate() has been * called again. * - * If the plugin has the property lv2:hardRTCapable then there are + * If the plugin has the feature lv2:hardRTCapable then there are * various things that the plugin MUST NOT do within the run() * function (see lv2.ttl). */ void (*run)(LV2_Handle instance, diff --git a/slv2/lv2_gui.h b/slv2/lv2_gui.h index 696f20b..7b108b3 100644 --- a/slv2/lv2_gui.h +++ b/slv2/lv2_gui.h @@ -210,7 +210,7 @@ typedef struct _LV2UI_Descriptor { LV2UI_Program_Save_Function save_function, LV2UI_Controller controller, LV2UI_Widget* widget, - const LV2_Host_Feature* const* host_features); + const LV2_Feature* const* features); /** Destroy the GUI object and the associated widget. diff --git a/slv2/plugin.h b/slv2/plugin.h index 94b5a93..c22fda5 100644 --- a/slv2/plugin.h +++ b/slv2/plugin.h @@ -153,7 +153,7 @@ slv2_plugin_get_class(SLV2Plugin plugin); * * <code><plugin-uri> predicate ?object</code> * - * May return NULL if the property was not found, or if object is not + * May return NULL if the property was not found, or if object(s) is not * sensibly represented as an SLV2Values (e.g. blank nodes). * * Return value must be freed by caller with slv2_values_free. @@ -195,31 +195,51 @@ slv2_plugin_get_value_for_subject(SLV2Plugin p, const char* predicate); -/** Get the LV2 Properties of a plugin. +/** Get the LV2 Features supported (required or optionally) by a plugin. + * + * A feature is "supported" by a plugin if it is required OR optional. + * + * Since required features have special rules the host must obey, this function + * probably shouldn't be used by normal hosts. Using slv2_plugin_get_optional_features + * and slv2_plugin_get_required_features separately is best in most cases. * - * LV2 Properties are mandatory. Hosts MUST NOT use a plugin if they do not - * understand all the LV2 Properties associated with that plugin (if this is - * not what you want, see slv2_plugin_get_hints). + * Returned value must be freed by caller with slv2_values_free. + * + * Time = Query + */ +SLV2Values +slv2_plugin_get_supported_features(SLV2Plugin p); + + +/** Get the LV2 Features required by a plugin. + * + * If a feature is required by a plugin, hosts MUST NOT use the plugin if they do not + * understand (or are unable to support) that feature. + * + * All values returned here MUST be passed to the plugin's instantiate method + * (along with data, if necessary, as defined by the feature specification) + * or plugin instantiation will fail. * * Return value must be freed by caller with slv2_values_free. * * Time = Query */ SLV2Values -slv2_plugin_get_properties(SLV2Plugin p); +slv2_plugin_get_required_features(SLV2Plugin p); -/** Get the LV2 Hints of a plugin. +/** Get the LV2 Features optionally supported by a plugin. * - * LV2 Hints are suggestions that may be useful for a host. LV2 Hints may be - * ignored and the plugin will still function correctly. + * Hosts MAY ignore optional plugin features for whatever reasons. Plugins + * MUST operate (at least somewhat) if they are instantiated without being + * passed optional features. * * Return value must be freed by caller with slv2_values_free. * * Time = Query */ SLV2Values -slv2_plugin_get_hints(SLV2Plugin p); +slv2_plugin_get_optional_features(SLV2Plugin p); /** Get the number of ports on this plugin. @@ -256,39 +276,6 @@ uint32_t slv2_plugin_get_latency_port(SLV2Plugin p); -/** Get a plugin's supported host features / extensions. - * - * This returns a list of all supported features (both required and optional). - * - * Time = Query - */ -SLV2Values -slv2_plugin_get_supported_features(SLV2Plugin p); - - -/** Get a plugin's requires host features / extensions. - * - * All feature URI's returned by this call MUST be passed to the plugin's - * instantiate method for the plugin to instantiate successfully. - * - * Time = Query - */ -SLV2Values -slv2_plugin_get_required_features(SLV2Plugin p); - - -/** Get a plugin's optional host features / extensions. - * - * If the feature URI's returned by this method are passed to the plugin's - * instantiate method, those features will be used by the function, otherwise - * the plugin will act as it would if it did not support that feature at all. - * - * Time = Query - */ -SLV2Values -slv2_plugin_get_optional_features(SLV2Plugin p); - - /** Query a plugin for a single variable. * * \param plugin The plugin to query. diff --git a/slv2/plugininstance.h b/slv2/plugininstance.h index ecaa509..982f536 100644 --- a/slv2/plugininstance.h +++ b/slv2/plugininstance.h @@ -72,9 +72,9 @@ typedef struct _Instance { * \return NULL if instantiation failed. */ SLV2Instance -slv2_plugin_instantiate(SLV2Plugin plugin, - double sample_rate, - const LV2_Host_Feature** host_features); +slv2_plugin_instantiate(SLV2Plugin plugin, + double sample_rate, + const LV2_Feature** features); /** Free a plugin instance. diff --git a/slv2/pluginuiinstance.h b/slv2/pluginuiinstance.h index 0ebae99..ba2ada6 100644 --- a/slv2/pluginuiinstance.h +++ b/slv2/pluginuiinstance.h @@ -71,7 +71,7 @@ slv2_ui_instantiate(SLV2Plugin plugin, LV2UI_Program_Change_Function program_function, LV2UI_Program_Save_Function save_function, LV2UI_Controller controller, - const LV2_Host_Feature* const* host_features); + const LV2_Feature* const* features); /** Free a plugin UI instance. diff --git a/slv2/port.h b/slv2/port.h index 3eef680..dc477cd 100644 --- a/slv2/port.h +++ b/slv2/port.h @@ -33,7 +33,7 @@ extern "C" { */ -/** Port equivalent to slv2_plugin_get_value. +/** Port analog of slv2_plugin_get_value. * * Time = Query */ @@ -43,7 +43,7 @@ slv2_port_get_value(SLV2Plugin plugin, const char* property); -/** Port equivalent to slv2_plugin_get_properties. +/** Return the LV2 port properties of a port. * * Time = Query */ @@ -52,25 +52,18 @@ slv2_port_get_properties(SLV2Plugin plugin, SLV2Port port); -/** Port equivalent to slv2_plugin_get_hints. - * - * Time = Query - */ -SLV2Values -slv2_port_get_hints(SLV2Plugin plugin, - SLV2Port port); - #if 0 -/** Return whether a port has a certain hint. +/** Return whether a port has a certain property. * * Time = Query */ bool -slv2_port_has_hint(SLV2Plugin p, - SLV2Port port, - SLV2Value hint) +slv2_port_has_property(SLV2Plugin p, + SLV2Port port, + SLV2Value hint) #endif + /** Get the symbol of a port given the index. * * The 'symbol' is a short string, a valid C identifier. diff --git a/src/plugin.c b/src/plugin.c index 055d727..20c8c5f 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -498,9 +498,9 @@ slv2_plugin_get_supported_features(SLV2Plugin p) { const char* const query = "SELECT DISTINCT ?feature WHERE {\n" - " { <> lv2:optionalHostFeature ?feature }\n" - " UNION\n" - " { <> lv2:requiredHostFeature ?feature }\n" + " { <> lv2:optionalFeature ?feature }\n" + " UNION\n" + " { <> lv2:requiredFeature ?feature }\n" "}\n"; SLV2Values result = slv2_plugin_simple_query(p, query, 0); @@ -512,28 +512,14 @@ slv2_plugin_get_supported_features(SLV2Plugin p) SLV2Values slv2_plugin_get_optional_features(SLV2Plugin p) { - const char* const query = - "SELECT DISTINCT ?feature WHERE {\n" - " <> lv2:optionalHostFeature ?feature\n" - "}\n"; - - SLV2Values result = slv2_plugin_simple_query(p, query, 0); - - return result; + return slv2_plugin_get_value(p, SLV2_QNAME, "lv2:optionalFeature"); } SLV2Values slv2_plugin_get_required_features(SLV2Plugin p) { - const char* const query = - "SELECT DISTINCT ?feature WHERE {\n" - " <> lv2:requiredHostFeature ?feature\n" - "}\n"; - - SLV2Values result = slv2_plugin_simple_query(p, query, 0); - - return result; + return slv2_plugin_get_value(p, SLV2_QNAME, "lv2:requiredFeature"); } diff --git a/src/plugininstance.c b/src/plugininstance.c index a125e0d..f57de33 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -31,16 +31,16 @@ SLV2Instance -slv2_plugin_instantiate(SLV2Plugin plugin, - double sample_rate, - const LV2_Host_Feature** host_features) +slv2_plugin_instantiate(SLV2Plugin plugin, + double sample_rate, + const LV2_Feature** features) { struct _Instance* result = NULL; - bool local_host_features = (host_features == NULL); - if (local_host_features) { - host_features = malloc(sizeof(LV2_Host_Feature)); - host_features[0] = NULL; + bool local_features = (features == NULL); + if (local_features) { + features = malloc(sizeof(LV2_Feature)); + features[0] = NULL; } const char* const lib_uri = slv2_plugin_get_library_uri(plugin); @@ -89,7 +89,7 @@ slv2_plugin_instantiate(SLV2Plugin plugin, // Create SLV2Instance to return result = malloc(sizeof(struct _Instance)); result->lv2_descriptor = ld; - result->lv2_handle = ld->instantiate(ld, sample_rate, (char*)bundle_path, host_features); + result->lv2_handle = ld->instantiate(ld, sample_rate, (char*)bundle_path, features); struct _InstanceImpl* impl = malloc(sizeof(struct _InstanceImpl)); impl->lib_handle = lib; result->pimpl = impl; @@ -114,8 +114,8 @@ slv2_plugin_instantiate(SLV2Plugin plugin, result->lv2_descriptor->connect_port(result->lv2_handle, i, NULL); } - if (local_host_features) - free(host_features); + if (local_features) + free(features); return result; } diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c index 31c2252..3fe98e6 100644 --- a/src/pluginuiinstance.c +++ b/src/pluginuiinstance.c @@ -40,14 +40,14 @@ slv2_ui_instantiate(SLV2Plugin plugin, LV2UI_Program_Change_Function program_function, LV2UI_Program_Save_Function save_function, LV2UI_Controller controller, - const LV2_Host_Feature* const* host_features) + const LV2_Feature* const* features) { struct _SLV2UIInstance* result = NULL; - bool local_host_features = (host_features == NULL); - if (local_host_features) { - host_features = malloc(sizeof(LV2_Host_Feature)); - ((LV2_Host_Feature**)host_features)[0] = NULL; + bool local_features = (features == NULL); + if (local_features) { + features = malloc(sizeof(LV2_Feature)); + ((LV2_Feature**)features)[0] = NULL; } const char* const lib_uri = slv2_ui_get_binary_uri(ui); @@ -103,7 +103,7 @@ slv2_ui_instantiate(SLV2Plugin plugin, save_function, controller, &impl->widget, - host_features); + features); impl->lib_handle = lib; result->pimpl = impl; break; @@ -128,8 +128,8 @@ slv2_ui_instantiate(SLV2Plugin plugin, return NULL; } - if (local_host_features) - free((LV2_Host_Feature**)host_features); + if (local_features) + free((LV2_Feature**)features); return result; } @@ -124,9 +124,9 @@ slv2_port_get_data_type(SLV2Plugin p, #if 0 bool -slv2_port_has_hint(SLV2Plugin p, - SLV2Port port, - SLV2Value hint) +slv2_port_has_property(SLV2Plugin p, + SLV2Port port, + SLV2Value hint) { /* FIXME: Add SLV2Value QName stuff to make this not suck to use */ @@ -271,11 +271,3 @@ slv2_port_get_properties(SLV2Plugin p, return slv2_port_get_value(p, port, "lv2:portProperty"); } - -SLV2Values -slv2_port_get_hints(SLV2Plugin p, - SLV2Port port) -{ - return slv2_port_get_value(p, port, "lv2:portHint"); -} - diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c index feb9b58..046ff73 100644 --- a/utils/lv2_inspect.c +++ b/utils/lv2_inspect.c @@ -88,18 +88,6 @@ print_port(SLV2Plugin p, uint32_t index) } printf("\n"); slv2_values_free(properties); - - SLV2Values hints = slv2_port_get_hints(p, port); - printf("\t\tHints: "); - for (unsigned i=0; i < slv2_values_size(hints); ++i) { - if (i > 0) { - printf("\n\t\t "); - } - printf("%s\n", slv2_value_as_uri(slv2_values_get_at(hints, i))); - } - printf("\n"); - - slv2_values_free(hints); } void @@ -107,7 +95,7 @@ print_plugin(SLV2Plugin p) { char* str = NULL; - printf("<%s>\n\n", slv2_plugin_get_uri(p)); + printf("%s\n\n", slv2_plugin_get_uri(p)); str = slv2_plugin_get_name(p); printf("\tName: %s\n", str); @@ -137,7 +125,7 @@ print_plugin(SLV2Plugin p) 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))); + printf("\t\t\tType: %s\n", slv2_value_as_uri(slv2_values_get_at(types, i))); } if (binary) @@ -161,37 +149,38 @@ print_plugin(SLV2Plugin p) } printf("\n"); - /* Properties */ - SLV2Values properties = slv2_plugin_get_properties(p); - printf("\tProperties: "); - for (unsigned i=0; i < slv2_values_size(properties); ++i) { + /* Required Features */ + + SLV2Values features = slv2_plugin_get_required_features(p); + printf("\tRequired Features: "); + for (unsigned i=0; i < slv2_values_size(features); ++i) { if (i > 0) { printf("\n\t "); } - printf("%s\n", slv2_value_as_uri(slv2_values_get_at(properties, i))); + printf("%s\n", slv2_value_as_uri(slv2_values_get_at(features, i))); } printf("\n"); - slv2_values_free(properties); - - - /* Hints */ + slv2_values_free(features); + + + /* Optional Features */ - SLV2Values hints = slv2_plugin_get_hints(p); - printf("\tHints: "); - for (unsigned i=0; i < slv2_values_size(hints); ++i) { + features = slv2_plugin_get_optional_features(p); + printf("\tOptional Features: "); + for (unsigned i=0; i < slv2_values_size(features); ++i) { if (i > 0) { printf("\n\t "); } - printf("%s\n", slv2_value_as_uri(slv2_values_get_at(hints, i))); + printf("%s\n", slv2_value_as_uri(slv2_values_get_at(features, i))); } printf("\n"); - slv2_values_free(hints); - - + slv2_values_free(features); + + /* Ports */ - uint32_t num_ports = slv2_plugin_get_num_ports(p); + const uint32_t num_ports = slv2_plugin_get_num_ports(p); //printf("\n\t# Ports: %d\n", num_ports); |