summaryrefslogtreecommitdiffstats
path: root/slv2/port.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-02-07 01:45:53 +0000
committerDavid Robillard <d@drobilla.net>2007-02-07 01:45:53 +0000
commit17ec1c5594772a89a5284449754b56ccb705ebe4 (patch)
treed3ee843acc698345b3760818b1a09f55a18517bb /slv2/port.h
parent87e016baff11bd74d905b68e48577461b36b992c (diff)
downloadlilv-17ec1c5594772a89a5284449754b56ccb705ebe4.tar.gz
lilv-17ec1c5594772a89a5284449754b56ccb705ebe4.tar.bz2
lilv-17ec1c5594772a89a5284449754b56ccb705ebe4.zip
Added lv2.ttl installation, lv2.ttl added as source by default to queries.
Changed port API to work by referring to either index or symbol. Plugged some leaks. Added access to plugin/port hints/properties. Updated lv2.ttl. git-svn-id: http://svn.drobilla.net/lad/slv2@285 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'slv2/port.h')
-rw-r--r--slv2/port.h72
1 files changed, 53 insertions, 19 deletions
diff --git a/slv2/port.h b/slv2/port.h
index 4e352a8..8e5b006 100644
--- a/slv2/port.h
+++ b/slv2/port.h
@@ -31,14 +31,38 @@ extern "C" {
*/
-/** Get a property of a port, by port index.
- *
- * Return value must be freed by caller with slv2_property_free.
+/** Create an ID to reference a port by index.
*/
-SLV2Property
-slv2_port_get_property(SLV2Plugin* plugin,
- uint32_t index,
- const char* property);
+SLV2PortID
+slv2_port_by_index(uint32_t index);
+
+
+/** Create an ID to reference a port by symbol.
+ */
+SLV2PortID
+slv2_port_by_symbol(const char* symbol);
+
+
+/** Port equivalent to slv2_plugin_get_value.
+ */
+SLV2Value
+slv2_port_get_value(SLV2Plugin* plugin,
+ SLV2PortID id,
+ const char* property);
+
+
+/** Port equivalent to slv2_plugin_get_properties.
+ */
+SLV2Value
+slv2_port_get_properties(const SLV2Plugin* p,
+ SLV2PortID id);
+
+
+/** Port equivalent to slv2_plugin_get_hints.
+ */
+SLV2Value
+slv2_port_get_hints(const SLV2Plugin* p,
+ SLV2PortID id);
/** Get the symbol of a port given the index.
@@ -49,15 +73,25 @@ slv2_port_get_property(SLV2Plugin* plugin,
* \return NULL when index is out of range
*/
char*
-slv2_port_get_symbol(SLV2Plugin* plugin,
- uint32_t index);
+slv2_port_get_symbol(SLV2Plugin* plugin,
+ SLV2PortID id);
+
+/** Get the name of a port.
+ *
+ * This is guaranteed to return the untranslated name (the doap:name in the
+ * data file without a language tag). Returned value must be free()'d by
+ * the caller.
+ */
+char*
+slv2_port_get_name(SLV2Plugin* plugin,
+ SLV2PortID id);
/** Get the class (direction and rate) of a port.
*/
enum SLV2PortClass
-slv2_port_get_class(SLV2Plugin* plugin,
- uint32_t index);
+slv2_port_get_class(SLV2Plugin* plugin,
+ SLV2PortID id);
/** Get the data type of a port (as a URI).
@@ -68,8 +102,8 @@ slv2_port_get_class(SLV2Plugin* plugin,
* Returned string must be free()'d by caller.
*/
char*
-slv2_port_get_data_type(SLV2Plugin* plugin,
- uint32_t index);
+slv2_port_get_data_type(SLV2Plugin* plugin,
+ SLV2PortID id);
/** Get the default value of a port.
@@ -77,8 +111,8 @@ slv2_port_get_data_type(SLV2Plugin* plugin,
* Only valid for ports with a data type of lv2:float.
*/
float
-slv2_port_get_default_value(SLV2Plugin* plugin,
- uint32_t index);
+slv2_port_get_default_value(SLV2Plugin* plugin,
+ SLV2PortID id);
/** Get the minimum value of a port.
@@ -86,8 +120,8 @@ slv2_port_get_default_value(SLV2Plugin* plugin,
* Only valid for ports with a data type of lv2:float.
*/
float
-slv2_port_get_minimum_value(SLV2Plugin* plugin,
- uint32_t index);
+slv2_port_get_minimum_value(SLV2Plugin* plugin,
+ SLV2PortID id);
/** Get the maximum value of a port.
@@ -95,8 +129,8 @@ slv2_port_get_minimum_value(SLV2Plugin* plugin,
* Only valid for ports with a data type of lv2:float.
*/
float
-slv2_port_get_maximum_value(SLV2Plugin* plugin,
- uint32_t index);
+slv2_port_get_maximum_value(SLV2Plugin* plugin,
+ SLV2PortID id);
/** @} */