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.

lilv_ui-features+lilvmm.patch 3.8KB

12 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. diff -U 3 -H -d -r -N -- lilv-0.14.4.old/lilv/lilv.h lilv-0.14.4/lilv/lilv.h
  2. --- lilv-0.14.4.old/lilv/lilv.h 2012-09-07 19:00:48.464571333 +0100
  3. +++ lilv-0.14.4/lilv/lilv.h 2012-09-07 18:54:00.626548936 +0100
  4. @@ -1693,6 +1693,25 @@
  5. lilv_ui_get_binary_uri(const LilvUI* ui);
  6. /**
  7. + Custom calls
  8. +*/
  9. +LILV_API
  10. +LilvNodes*
  11. +lilv_ui_get_supported_features(const LilvUI* ui);
  12. +
  13. +LILV_API
  14. +LilvNodes*
  15. +lilv_ui_get_required_features(const LilvUI* ui);
  16. +
  17. +LILV_API
  18. +LilvNodes*
  19. +lilv_ui_get_optional_features(const LilvUI* ui);
  20. +
  21. +LILV_API
  22. +LilvNodes*
  23. +lilv_ui_get_extension_data(const LilvUI* ui);
  24. +
  25. +/**
  26. @}
  27. @}
  28. */
  29. diff -U 3 -H -d -r -N -- lilv-0.14.4.old/lilv/lilvmm.hpp lilv-0.14.4/lilv/lilvmm.hpp
  30. --- lilv-0.14.4.old/lilv/lilvmm.hpp 2012-07-18 02:42:43.000000000 +0100
  31. +++ lilv-0.14.4/lilv/lilvmm.hpp 2012-09-07 18:53:14.134318379 +0100
  32. @@ -136,6 +136,7 @@
  33. struct Nodes {
  34. LILV_WRAP_COLL(Nodes, Node, nodes);
  35. LILV_WRAP1(bool, nodes, contains, const Node, node);
  36. + LILV_WRAP0(Node, nodes, get_first);
  37. };
  38. struct Port {
  39. @@ -167,6 +168,26 @@
  40. const LilvPort* me;
  41. };
  42. +struct UI {
  43. + inline UI(const LilvUI* c_obj) : me(c_obj) {}
  44. + LILV_WRAP_CONVERSION(const LilvUI);
  45. +
  46. + LILV_WRAP0(Node, ui, get_uri);
  47. + LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
  48. + LILV_WRAP0(Node, ui, get_bundle_uri);
  49. + LILV_WRAP0(Node, ui, get_binary_uri);
  50. + LILV_WRAP0(Nodes, ui, get_supported_features);
  51. + LILV_WRAP0(Nodes, ui, get_required_features);
  52. + LILV_WRAP0(Nodes, ui, get_optional_features);
  53. + LILV_WRAP0(Nodes, ui, get_extension_data);
  54. +
  55. + const LilvUI* me;
  56. +};
  57. +
  58. +struct UIs {
  59. + LILV_WRAP_COLL(UIs, UI, uis);
  60. +};
  61. +
  62. struct Plugin {
  63. inline Plugin(const LilvPlugin* c_obj) : me(c_obj) {}
  64. LILV_WRAP_CONVERSION(const LilvPlugin);
  65. @@ -190,6 +211,8 @@
  66. LILV_WRAP0(Node, plugin, get_author_email);
  67. LILV_WRAP0(Node, plugin, get_author_homepage);
  68. LILV_WRAP0(bool, plugin, is_replaced);
  69. + LILV_WRAP0(Nodes, plugin, get_extension_data);
  70. + LILV_WRAP0(UIs, plugin, get_uis);
  71. inline Port get_port_by_index(unsigned index) {
  72. return Port(me, lilv_plugin_get_port_by_index(me, index));
  73. diff -U 3 -H -d -r -N -- lilv-0.14.4.old/src/ui.c lilv-0.14.4/src/ui.c
  74. --- lilv-0.14.4.old/src/ui.c 2012-09-07 19:00:48.464571333 +0100
  75. +++ lilv-0.14.4/src/ui.c 2012-09-07 18:59:51.652289664 +0100
  76. @@ -128,3 +128,57 @@
  77. assert(ui->binary_uri);
  78. return ui->binary_uri;
  79. }
  80. +
  81. +static LilvNodes*
  82. +lilv_ui_get_value_internal(const LilvUI* ui,
  83. + const SordNode* predicate)
  84. +{
  85. + return lilv_world_query_values_internal(
  86. + ui->world, ui->uri->node, predicate, NULL);
  87. +}
  88. +
  89. +LILV_API
  90. +LilvNodes*
  91. +lilv_ui_get_supported_features(const LilvUI* ui)
  92. +{
  93. + LilvNodes* optional = lilv_ui_get_optional_features(ui);
  94. + LilvNodes* required = lilv_ui_get_required_features(ui);
  95. + LilvNodes* result = lilv_nodes_new();
  96. +
  97. + LILV_FOREACH(nodes, i, optional)
  98. + zix_tree_insert((ZixTree*)result,
  99. + lilv_node_duplicate(lilv_nodes_get(optional, i)),
  100. + NULL);
  101. + LILV_FOREACH(nodes, i, required)
  102. + zix_tree_insert((ZixTree*)result,
  103. + lilv_node_duplicate(lilv_nodes_get(required, i)),
  104. + NULL);
  105. +
  106. + lilv_nodes_free(optional);
  107. + lilv_nodes_free(required);
  108. +
  109. + return result;
  110. +}
  111. +
  112. +LILV_API
  113. +LilvNodes*
  114. +lilv_ui_get_required_features(const LilvUI* ui)
  115. +{
  116. + return lilv_ui_get_value_internal(
  117. + ui, ui->world->uris.lv2_requiredFeature);
  118. +}
  119. +
  120. +LILV_API
  121. +LilvNodes*
  122. +lilv_ui_get_optional_features(const LilvUI* ui)
  123. +{
  124. + return lilv_ui_get_value_internal(
  125. + ui, ui->world->uris.lv2_optionalFeature);
  126. +}
  127. +
  128. +LILV_API
  129. +LilvNodes*
  130. +lilv_ui_get_extension_data(const LilvUI* ui)
  131. +{
  132. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
  133. +}