Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.3KB

  1. diff --git a/source/libs/lilv/lilv-0.16.0/lilv/lilv.h b/source/libs/lilv/lilv-0.16.0/lilv/lilv.h
  2. index ff1839f..c780326 100644
  3. --- a/source/libs/lilv/lilv-0.16.0/lilv/lilv.h
  4. +++ b/source/libs/lilv/lilv-0.16.0/lilv/lilv.h
  5. @@ -1769,6 +1769,25 @@ const LilvNode*
  6. lilv_ui_get_binary_uri(const LilvUI* ui);
  7. /**
  8. + Custom calls
  9. +*/
  10. +LILV_API
  11. +const LilvNodes*
  12. +lilv_ui_get_supported_features(const LilvUI* ui);
  13. +
  14. +LILV_API
  15. +const LilvNodes*
  16. +lilv_ui_get_required_features(const LilvUI* ui);
  17. +
  18. +LILV_API
  19. +const LilvNodes*
  20. +lilv_ui_get_optional_features(const LilvUI* ui);
  21. +
  22. +LILV_API
  23. +const LilvNodes*
  24. +lilv_ui_get_extension_data(const LilvUI* ui);
  25. +
  26. +/**
  27. @}
  28. @}
  29. */
  30. diff --git a/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp b/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
  31. index 4215ab8..3047930 100644
  32. --- a/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
  33. +++ b/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
  34. @@ -169,6 +169,26 @@ struct Port {
  35. const LilvPort* me;
  36. };
  37. +struct UI {
  38. + inline UI(const LilvUI* c_obj) : me(c_obj) {}
  39. + LILV_WRAP_CONVERSION(const LilvUI);
  40. +
  41. + LILV_WRAP0(Node, ui, get_uri);
  42. + LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
  43. + LILV_WRAP0(Node, ui, get_bundle_uri);
  44. + LILV_WRAP0(Node, ui, get_binary_uri);
  45. + LILV_WRAP0(Nodes, ui, get_supported_features);
  46. + LILV_WRAP0(Nodes, ui, get_required_features);
  47. + LILV_WRAP0(Nodes, ui, get_optional_features);
  48. + LILV_WRAP0(Nodes, ui, get_extension_data);
  49. +
  50. + const LilvUI* me;
  51. +};
  52. +
  53. +struct UIs {
  54. + LILV_WRAP_COLL(UIs, UI, uis);
  55. +};
  56. +
  57. struct Plugin {
  58. inline Plugin(const LilvPlugin* c_obj) : me(c_obj) {}
  59. LILV_WRAP_CONVERSION(const LilvPlugin);
  60. diff --git a/source/libs/lilv/lilv-0.16.0/src/ui.c b/source/libs/lilv/lilv-0.16.0/src/ui.c
  61. index 5d2f066..c2780e0 100644
  62. --- a/source/libs/lilv/lilv-0.16.0/src/ui.c
  63. +++ b/source/libs/lilv/lilv-0.16.0/src/ui.c
  64. @@ -128,3 +128,59 @@ lilv_ui_get_binary_uri(const LilvUI* ui)
  65. assert(ui->binary_uri);
  66. return ui->binary_uri;
  67. }
  68. +
  69. +static LilvNodes*
  70. +lilv_ui_get_value_internal(const LilvUI* ui,
  71. + const SordNode* predicate)
  72. +{
  73. + assert(ui);
  74. + return lilv_world_find_nodes_internal(ui->world, ui->uri->node, predicate, NULL);
  75. +}
  76. +
  77. +LILV_API
  78. +const LilvNodes*
  79. +lilv_ui_get_supported_features(const LilvUI* ui)
  80. +{
  81. + assert(ui);
  82. + LilvNodes* optional = lilv_ui_get_optional_features(ui);
  83. + LilvNodes* required = lilv_ui_get_required_features(ui);
  84. + LilvNodes* result = lilv_nodes_new();
  85. +
  86. + LILV_FOREACH(nodes, i, optional)
  87. + zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(optional, i)), NULL);
  88. +
  89. + LILV_FOREACH(nodes, i, required)
  90. + zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(required, i)), NULL);
  91. +
  92. + lilv_nodes_free(optional);
  93. + lilv_nodes_free(required);
  94. +
  95. + return result;
  96. +}
  97. +
  98. +LILV_API
  99. +const LilvNodes*
  100. +lilv_ui_get_required_features(const LilvUI* ui)
  101. +{
  102. + assert(ui);
  103. + assert(ui->world);
  104. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_requiredFeature);
  105. +}
  106. +
  107. +LILV_API
  108. +const LilvNodes*
  109. +lilv_ui_get_optional_features(const LilvUI* ui)
  110. +{
  111. + assert(ui);
  112. + assert(ui->world);
  113. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_optionalFeature);
  114. +}
  115. +
  116. +LILV_API
  117. +const LilvNodes*
  118. +lilv_ui_get_extension_data(const LilvUI* ui)
  119. +{
  120. + assert(ui);
  121. + assert(ui->world);
  122. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
  123. +}