Browse Source

1 more

tags/1.9.7
falkTX 9 years ago
parent
commit
a82233becf
1 changed files with 51 additions and 0 deletions
  1. +51
    -0
      source/modules/lilv/lilv-0.21.3/src/ui.c

+ 51
- 0
source/modules/lilv/lilv-0.21.3/src/ui.c View File

@@ -160,3 +160,54 @@ lilv_ui_get_extension_data(const LilvUI* ui)
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
}

static LilvNodes*
lilv_ui_get_value_internal(const LilvUI* ui, const SordNode* predicate)
{
assert(ui);
return lilv_world_find_nodes_internal(ui->world, ui->uri->node, predicate, NULL);
}

LILV_API const LilvNodes*
lilv_ui_get_supported_features(const LilvUI* ui)
{
assert(ui);
LilvNodes* optional = lilv_ui_get_optional_features(ui);
LilvNodes* required = lilv_ui_get_required_features(ui);
LilvNodes* result = lilv_nodes_new();

LILV_FOREACH(nodes, i, optional)
zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(optional, i)), NULL);

LILV_FOREACH(nodes, i, required)
zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(required, i)), NULL);

lilv_nodes_free(optional);
lilv_nodes_free(required);

return result;
}

LILV_API const LilvNodes*
lilv_ui_get_required_features(const LilvUI* ui)
{
assert(ui);
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_requiredFeature);
}

LILV_API const LilvNodes*
lilv_ui_get_optional_features(const LilvUI* ui)
{
assert(ui);
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_optionalFeature);
}

LILV_API const LilvNodes*
lilv_ui_get_extension_data(const LilvUI* ui)
{
assert(ui);
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
}

Loading…
Cancel
Save