From 72e3c06d3a6b2558e5e156f917e1c28441819417 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 26 Feb 2012 22:20:40 +0000 Subject: Add lilv_plugin_get_port_by_property() and lilv_port_get_index() as an improved generic alternative to lilv_plugin_get_latency_port_index(). git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4001 a436a847-0d15-0410-975c-d299462d15a1 --- lilv/lilv.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lilv/lilv.h') diff --git a/lilv/lilv.h b/lilv/lilv.h index f392b6f..f41a4a9 100644 --- a/lilv/lilv.h +++ b/lilv/lilv.h @@ -898,6 +898,17 @@ const LilvPort* lilv_plugin_get_port_by_symbol(const LilvPlugin* plugin, const LilvNode* symbol); +/** + Get a port on @c plugin by an lv2:PortProperty. + This function only makes sense for port properties which apply to a single + port per plugin (like lv2:reportsLatency). Otherwise, the matching port + with the lowest index will be returned. +*/ +LILV_API +LilvPort* +lilv_plugin_get_port_by_property(const LilvPlugin* plugin, + const LilvNode* port_property); + /** Get the full name of the plugin's author. Returns NULL if author name is not present. @@ -1020,6 +1031,16 @@ lilv_port_supports_event(const LilvPlugin* p, const LilvPort* port, const LilvNode* event_uri); +/** + Get the index of a port. + The index is only valid for the life of the plugin and may change between + versions. For a stable identifier, use the symbol. +*/ +LILV_API +uint32_t +lilv_port_get_index(const LilvPlugin* plugin, + const LilvPort* port); + /** Get the symbol of a port. The 'symbol' is a short string, a valid C identifier. -- cgit v1.2.1