summaryrefslogtreecommitdiffstats
path: root/slv2/port.h
diff options
context:
space:
mode:
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);
/** @} */