diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lilv_internal.h | 2 | ||||
-rw-r--r-- | src/plugin.c | 15 | ||||
-rw-r--r-- | src/world.c | 4 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/lilv_internal.h b/src/lilv_internal.h index a6d53f7..f292d2a 100644 --- a/src/lilv_internal.h +++ b/src/lilv_internal.h @@ -150,11 +150,11 @@ struct LilvWorldImpl { SordNode* lv2_Plugin; SordNode* lv2_port; SordNode* lv2_portProperty; - SordNode* lv2_relation; SordNode* lv2_reportsLatency; SordNode* lv2_requiredFeature; SordNode* lv2_Specification; SordNode* lv2_symbol; + SordNode* lv2_isParameter; SordNode* pset_value; SordNode* rdf_a; SordNode* rdf_value; diff --git a/src/plugin.c b/src/plugin.c index df113a0..fb396df 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -611,19 +611,22 @@ lilv_plugin_get_port_by_property(const LilvPlugin* plugin, LILV_API LilvPort* -lilv_plugin_get_port_by_relation(const LilvPlugin* plugin, - const LilvNode* relation) +lilv_plugin_get_port_by_parameter(const LilvPlugin* plugin, + const LilvNode* port_class, + const LilvNode* parameter) { + LilvWorld* world = plugin->world; lilv_plugin_load_ports_if_necessary(plugin); for (uint32_t i = 0; i < plugin->num_ports; ++i) { LilvPort* port = plugin->ports[i]; SordIter* iter = lilv_world_query_internal( - plugin->world, + world, port->node, - plugin->world->uris.lv2_relation, - relation->val.uri_val); + world->uris.lv2_isParameter, + parameter->val.uri_val); - const bool found = !lilv_matches_end(iter); + const bool found = !lilv_matches_end(iter) && + lilv_port_is_a(plugin, port, port_class); lilv_match_end(iter); if (found) { diff --git a/src/world.c b/src/world.c index 198a02a..0dc8dee 100644 --- a/src/world.c +++ b/src/world.c @@ -45,7 +45,7 @@ lilv_world_new(void) #define NS_DYNMAN "http://lv2plug.in/ns/ext/dynmanifest#" #define NS_PSET "http://lv2plug.in/ns/ext/presets#" -#define NEW_URI(uri) sord_new_uri(world->world, (const uint8_t*)uri) +#define NEW_URI(uri) sord_new_uri(world->world, (const uint8_t*)uri) world->uris.dc_replaces = NEW_URI(NS_DCTERMS "replaces"); world->uris.doap_name = NEW_URI(LILV_NS_DOAP "name"); @@ -62,11 +62,11 @@ lilv_world_new(void) world->uris.lv2_Plugin = NEW_URI(LILV_NS_LV2 "Plugin"); world->uris.lv2_port = NEW_URI(LILV_NS_LV2 "port"); world->uris.lv2_portProperty = NEW_URI(LILV_NS_LV2 "portProperty"); - world->uris.lv2_relation = NEW_URI(LILV_NS_LV2 "relation"); world->uris.lv2_reportsLatency = NEW_URI(LILV_NS_LV2 "reportsLatency"); world->uris.lv2_requiredFeature = NEW_URI(LILV_NS_LV2 "requiredFeature"); world->uris.lv2_Specification = NEW_URI(LILV_NS_LV2 "Specification"); world->uris.lv2_symbol = NEW_URI(LILV_NS_LV2 "symbol"); + world->uris.lv2_isParameter = NEW_URI(LILV_NS_LV2 "isParameter"); world->uris.pset_value = NEW_URI(NS_PSET "value"); world->uris.rdf_a = NEW_URI(LILV_NS_RDF "type"); world->uris.rdf_value = NEW_URI(LILV_NS_RDF "value"); |