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.

424 lines
13KB

  1. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/lilv/lilv.h lilv-0.18.0/lilv/lilv.h
  2. --- lilv-0.18.0.orig/lilv/lilv.h 2014-01-04 04:17:29.000000000 +0000
  3. +++ lilv-0.18.0/lilv/lilv.h 2014-04-14 20:49:45.340264688 +0000
  4. @@ -26,8 +26,9 @@
  5. #include <stdint.h>
  6. #include <stdio.h>
  7. -#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
  8. -#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
  9. +#include "lv2/lv2.h"
  10. +#include "lv2/state.h"
  11. +#include "lv2/urid.h"
  12. #ifdef LILV_SHARED
  13. # ifdef _WIN32
  14. @@ -1228,7 +1229,7 @@
  15. LILV_API
  16. LilvState*
  17. lilv_state_new_from_world(LilvWorld* world,
  18. - LV2_URID_Map* map,
  19. + const LV2_URID_Map* map,
  20. const LilvNode* subject);
  21. /**
  22. @@ -1247,7 +1248,7 @@
  23. LILV_API
  24. LilvState*
  25. lilv_state_new_from_file(LilvWorld* world,
  26. - LV2_URID_Map* map,
  27. + const LV2_URID_Map* map,
  28. const LilvNode* subject,
  29. const char* path);
  30. @@ -1257,7 +1258,7 @@
  31. LILV_API
  32. LilvState*
  33. lilv_state_new_from_string(LilvWorld* world,
  34. - LV2_URID_Map* map,
  35. + const LV2_URID_Map* map,
  36. const char* str);
  37. /**
  38. @@ -1428,7 +1429,8 @@
  39. LILV_API
  40. void
  41. lilv_state_restore(const LilvState* state,
  42. - LilvInstance* instance,
  43. + const LV2_State_Interface* iface,
  44. + LV2_Handle handle,
  45. LilvSetPortValueFunc set_value,
  46. void* user_data,
  47. uint32_t flags,
  48. @@ -1782,6 +1784,25 @@
  49. lilv_ui_get_binary_uri(const LilvUI* ui);
  50. /**
  51. + Custom calls
  52. +*/
  53. +LILV_API
  54. +const LilvNodes*
  55. +lilv_ui_get_supported_features(const LilvUI* ui);
  56. +
  57. +LILV_API
  58. +const LilvNodes*
  59. +lilv_ui_get_required_features(const LilvUI* ui);
  60. +
  61. +LILV_API
  62. +const LilvNodes*
  63. +lilv_ui_get_optional_features(const LilvUI* ui);
  64. +
  65. +LILV_API
  66. +const LilvNodes*
  67. +lilv_ui_get_extension_data(const LilvUI* ui);
  68. +
  69. +/**
  70. @}
  71. @}
  72. */
  73. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/lilv/lilvmm.hpp lilv-0.18.0/lilv/lilvmm.hpp
  74. --- lilv-0.18.0.orig/lilv/lilvmm.hpp 2013-03-19 04:05:10.000000000 +0000
  75. +++ lilv-0.18.0/lilv/lilvmm.hpp 2014-04-14 20:55:29.312713841 +0000
  76. @@ -35,6 +35,9 @@
  77. #define LILV_WRAP0(RT, prefix, name) \
  78. inline RT name() { return lilv_ ## prefix ## _ ## name (me); }
  79. +#define LILV_WRAP0_CONST(RT, prefix, name) \
  80. + inline RT name() const { return lilv_ ## prefix ## _ ## name (me); }
  81. +
  82. #define LILV_WRAP0_VOID(prefix, name) \
  83. inline void name() { lilv_ ## prefix ## _ ## name(me); }
  84. @@ -65,6 +68,7 @@
  85. #endif
  86. struct Node {
  87. + inline Node(LilvNode* node) : me(node) {}
  88. inline Node(const LilvNode* node) : me(lilv_node_duplicate(node)) {}
  89. inline Node(const Node& copy) : me(lilv_node_duplicate(copy.me)) {}
  90. @@ -78,20 +82,20 @@
  91. LILV_WRAP_CONVERSION(LilvNode);
  92. - LILV_WRAP0(char*, node, get_turtle_token);
  93. - LILV_WRAP0(bool, node, is_uri);
  94. - LILV_WRAP0(const char*, node, as_uri);
  95. - LILV_WRAP0(bool, node, is_blank);
  96. - LILV_WRAP0(const char*, node, as_blank);
  97. - LILV_WRAP0(bool, node, is_literal);
  98. - LILV_WRAP0(bool, node, is_string);
  99. - LILV_WRAP0(const char*, node, as_string);
  100. - LILV_WRAP0(bool, node, is_float);
  101. - LILV_WRAP0(float, node, as_float);
  102. - LILV_WRAP0(bool, node, is_int);
  103. - LILV_WRAP0(int, node, as_int);
  104. - LILV_WRAP0(bool, node, is_bool);
  105. - LILV_WRAP0(bool, node, as_bool);
  106. + LILV_WRAP0_CONST(char*, node, get_turtle_token);
  107. + LILV_WRAP0_CONST(bool, node, is_uri);
  108. + LILV_WRAP0_CONST(const char*, node, as_uri);
  109. + LILV_WRAP0_CONST(bool, node, is_blank);
  110. + LILV_WRAP0_CONST(const char*, node, as_blank);
  111. + LILV_WRAP0_CONST(bool, node, is_literal);
  112. + LILV_WRAP0_CONST(bool, node, is_string);
  113. + LILV_WRAP0_CONST(const char*, node, as_string);
  114. + LILV_WRAP0_CONST(bool, node, is_float);
  115. + LILV_WRAP0_CONST(float, node, as_float);
  116. + LILV_WRAP0_CONST(bool, node, is_int);
  117. + LILV_WRAP0_CONST(int, node, as_int);
  118. + LILV_WRAP0_CONST(bool, node, is_bool);
  119. + LILV_WRAP0_CONST(bool, node, as_bool);
  120. LilvNode* me;
  121. };
  122. @@ -126,7 +130,7 @@
  123. LILV_WRAP0(LilvIter*, prefix, begin); \
  124. LILV_WRAP1(LilvIter*, prefix, next, LilvIter*, i); \
  125. LILV_WRAP1(bool, prefix, is_end, LilvIter*, i); \
  126. - const Lilv ## CT* me; \
  127. + const Lilv ## CT* me
  128. struct PluginClasses {
  129. LILV_WRAP_COLL(PluginClasses, PluginClass, plugin_classes);
  130. @@ -148,15 +152,14 @@
  131. inline UI(const LilvUI* c_obj) : me(c_obj) {}
  132. LILV_WRAP_CONVERSION(const LilvUI);
  133. - LILV_WRAP0(const LilvNode*, ui, get_uri);
  134. - LILV_WRAP0(const LilvNode*, ui, get_bundle_uri);
  135. - LILV_WRAP0(const LilvNode*, ui, get_binary_uri);
  136. - LILV_WRAP0(const LilvNodes*, ui, get_classes);
  137. - /*LILV_WRAP3(bool, ui, is_supported,
  138. - LilvUISupportedFunc, supported_func,
  139. - const LilvNode*, container_type,
  140. - const LilvNode**, ui_type);*/
  141. - LILV_WRAP1(bool, ui, is_a, const LilvNode*, class_uri);
  142. + LILV_WRAP0(Node, ui, get_uri);
  143. + LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
  144. + LILV_WRAP0(Node, ui, get_bundle_uri);
  145. + LILV_WRAP0(Node, ui, get_binary_uri);
  146. + LILV_WRAP0(Nodes, ui, get_supported_features);
  147. + LILV_WRAP0(Nodes, ui, get_required_features);
  148. + LILV_WRAP0(Nodes, ui, get_optional_features);
  149. + LILV_WRAP0(Nodes, ui, get_extension_data);
  150. const LilvUI* me;
  151. };
  152. @@ -260,7 +263,7 @@
  153. LILV_DEPRECATED
  154. inline Instance(Plugin plugin, double sample_rate) {
  155. - me = lilv_plugin_instantiate(plugin, sample_rate, NULL);
  156. + me = lilv_plugin_instantiate(plugin, sample_rate, nullptr);
  157. }
  158. LILV_DEPRECATED inline Instance(Plugin plugin,
  159. @@ -275,7 +278,7 @@
  160. LilvInstance* me = lilv_plugin_instantiate(
  161. plugin, sample_rate, features);
  162. - return me ? new Instance(me) : NULL;
  163. + return me ? new Instance(me) : nullptr;
  164. }
  165. LILV_WRAP_CONVERSION(LilvInstance);
  166. @@ -307,19 +310,19 @@
  167. inline World() : me(lilv_world_new()) {}
  168. inline ~World() { lilv_world_free(me); }
  169. - inline LilvNode* new_uri(const char* uri) {
  170. + inline LilvNode* new_uri(const char* uri) const {
  171. return lilv_new_uri(me, uri);
  172. }
  173. - inline LilvNode* new_string(const char* str) {
  174. + inline LilvNode* new_string(const char* str) const {
  175. return lilv_new_string(me, str);
  176. }
  177. - inline LilvNode* new_int(int val) {
  178. + inline LilvNode* new_int(int val) const {
  179. return lilv_new_int(me, val);
  180. }
  181. - inline LilvNode* new_float(float val) {
  182. + inline LilvNode* new_float(float val) const {
  183. return lilv_new_float(me, val);
  184. }
  185. - inline LilvNode* new_bool(bool val) {
  186. + inline LilvNode* new_bool(bool val) const {
  187. return lilv_new_bool(me, val);
  188. }
  189. inline Nodes find_nodes(const LilvNode* subject,
  190. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/lilv_internal.h lilv-0.18.0/src/lilv_internal.h
  191. --- lilv-0.18.0.orig/src/lilv_internal.h 2014-01-04 04:02:22.000000000 +0000
  192. +++ lilv-0.18.0/src/lilv_internal.h 2014-04-14 20:31:23.028483446 +0000
  193. @@ -50,7 +50,7 @@
  194. #include "lilv/lilv.h"
  195. #ifdef LILV_DYN_MANIFEST
  196. -# include "lv2/lv2plug.in/ns/ext/dynmanifest/dynmanifest.h"
  197. +# include "lv2/dynmanifest.h"
  198. #endif
  199. /*
  200. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/plugin.c lilv-0.18.0/src/plugin.c
  201. --- lilv-0.18.0.orig/src/plugin.c 2014-01-04 21:23:47.000000000 +0000
  202. +++ lilv-0.18.0/src/plugin.c 2014-04-14 20:44:13.939913922 +0000
  203. @@ -27,7 +27,7 @@
  204. #include "lilv_config.h"
  205. #include "lilv_internal.h"
  206. -#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
  207. +#include "lv2/ui.h"
  208. #define NS_DOAP (const uint8_t*)"http://usefulinc.com/ns/doap#"
  209. #define NS_FOAF (const uint8_t*)"http://xmlns.com/foaf/0.1/"
  210. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/port.c lilv-0.18.0/src/port.c
  211. --- lilv-0.18.0.orig/src/port.c 2014-01-04 04:04:20.000000000 +0000
  212. +++ lilv-0.18.0/src/port.c 2014-04-14 20:33:03.708189391 +0000
  213. @@ -20,8 +20,8 @@
  214. #include <stdlib.h>
  215. #include <string.h>
  216. -#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
  217. -#include "lv2/lv2plug.in/ns/ext/event/event.h"
  218. +#include "lv2/atom.h"
  219. +#include "lv2/event.h"
  220. #include "lilv_internal.h"
  221. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/state.c lilv-0.18.0/src/state.c
  222. --- lilv-0.18.0.orig/src/state.c 2013-12-16 03:17:00.000000000 +0000
  223. +++ lilv-0.18.0/src/state.c 2014-04-14 20:39:02.307711987 +0000
  224. @@ -18,10 +18,10 @@
  225. #include <stdio.h>
  226. #include <string.h>
  227. -#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
  228. -#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
  229. -#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
  230. -#include "lv2/lv2plug.in/ns/ext/state/state.h"
  231. +#include "lv2/atom.h"
  232. +#include "lv2/atom-forge.h"
  233. +#include "lv2/presets.h"
  234. +#include "lv2/state.h"
  235. #include "lilv_config.h"
  236. #include "lilv_internal.h"
  237. @@ -399,30 +399,18 @@
  238. LILV_API
  239. void
  240. lilv_state_restore(const LilvState* state,
  241. - LilvInstance* instance,
  242. + const LV2_State_Interface* iface,
  243. + LV2_Handle handle,
  244. LilvSetPortValueFunc set_value,
  245. void* user_data,
  246. uint32_t flags,
  247. const LV2_Feature *const * features)
  248. {
  249. - LV2_State_Map_Path map_path = {
  250. - (LilvState*)state, abstract_path, absolute_path };
  251. - LV2_Feature map_feature = { LV2_STATE__mapPath, &map_path };
  252. -
  253. - const LV2_Feature** sfeatures = add_features(features, &map_feature, NULL);
  254. -
  255. - const LV2_Descriptor* desc = instance ? instance->lv2_descriptor : NULL;
  256. - const LV2_State_Interface* iface = (desc && desc->extension_data)
  257. - ? (const LV2_State_Interface*)desc->extension_data(LV2_STATE__interface)
  258. - : NULL;
  259. -
  260. if (iface) {
  261. - iface->restore(instance->lv2_handle, retrieve_callback,
  262. - (LV2_State_Handle)state, flags, sfeatures);
  263. + iface->restore(handle, retrieve_callback,
  264. + (LV2_State_Handle)state, flags, features);
  265. }
  266. - free(sfeatures);
  267. -
  268. if (set_value) {
  269. for (uint32_t i = 0; i < state->num_values; ++i) {
  270. const PortValue* val = &state->values[i];
  271. @@ -569,7 +557,7 @@
  272. LILV_API
  273. LilvState*
  274. lilv_state_new_from_world(LilvWorld* world,
  275. - LV2_URID_Map* map,
  276. + const LV2_URID_Map* map,
  277. const LilvNode* node)
  278. {
  279. if (!lilv_node_is_uri(node) && !lilv_node_is_blank(node)) {
  280. @@ -587,7 +575,7 @@
  281. LILV_API
  282. LilvState*
  283. lilv_state_new_from_file(LilvWorld* world,
  284. - LV2_URID_Map* map,
  285. + const LV2_URID_Map* map,
  286. const LilvNode* subject,
  287. const char* path)
  288. {
  289. @@ -641,7 +629,7 @@
  290. LILV_API
  291. LilvState*
  292. lilv_state_new_from_string(LilvWorld* world,
  293. - LV2_URID_Map* map,
  294. + const LV2_URID_Map* map,
  295. const char* str)
  296. {
  297. if (!str) {
  298. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/ui.c lilv-0.18.0/src/ui.c
  299. --- lilv-0.18.0.orig/src/ui.c 2012-03-27 03:41:41.000000000 +0000
  300. +++ lilv-0.18.0/src/ui.c 2014-04-14 20:46:20.491810535 +0000
  301. @@ -128,3 +128,59 @@
  302. assert(ui->binary_uri);
  303. return ui->binary_uri;
  304. }
  305. +
  306. +static LilvNodes*
  307. +lilv_ui_get_value_internal(const LilvUI* ui,
  308. + const SordNode* predicate)
  309. +{
  310. + assert(ui);
  311. + return lilv_world_find_nodes_internal(ui->world, ui->uri->node, predicate, NULL);
  312. +}
  313. +
  314. +LILV_API
  315. +const LilvNodes*
  316. +lilv_ui_get_supported_features(const LilvUI* ui)
  317. +{
  318. + assert(ui);
  319. + LilvNodes* optional = lilv_ui_get_optional_features(ui);
  320. + LilvNodes* required = lilv_ui_get_required_features(ui);
  321. + LilvNodes* result = lilv_nodes_new();
  322. +
  323. + LILV_FOREACH(nodes, i, optional)
  324. + zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(optional, i)), NULL);
  325. +
  326. + LILV_FOREACH(nodes, i, required)
  327. + zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(required, i)), NULL);
  328. +
  329. + lilv_nodes_free(optional);
  330. + lilv_nodes_free(required);
  331. +
  332. + return result;
  333. +}
  334. +
  335. +LILV_API
  336. +const LilvNodes*
  337. +lilv_ui_get_required_features(const LilvUI* ui)
  338. +{
  339. + assert(ui);
  340. + assert(ui->world);
  341. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_requiredFeature);
  342. +}
  343. +
  344. +LILV_API
  345. +const LilvNodes*
  346. +lilv_ui_get_optional_features(const LilvUI* ui)
  347. +{
  348. + assert(ui);
  349. + assert(ui->world);
  350. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_optionalFeature);
  351. +}
  352. +
  353. +LILV_API
  354. +const LilvNodes*
  355. +lilv_ui_get_extension_data(const LilvUI* ui)
  356. +{
  357. + assert(ui);
  358. + assert(ui->world);
  359. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
  360. +}
  361. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/util.c lilv-0.18.0/src/util.c
  362. --- lilv-0.18.0.orig/src/util.c 2012-08-09 20:51:00.000000000 +0000
  363. +++ lilv-0.18.0/src/util.c 2014-04-14 20:43:49.832743279 +0000
  364. @@ -29,7 +29,6 @@
  365. #include <string.h>
  366. #ifdef _WIN32
  367. -# define _WIN32_WINNT 0x0600 /* for CreateSymbolicLink */
  368. # include <windows.h>
  369. # include <direct.h>
  370. # include <io.h>
  371. @@ -426,7 +425,7 @@
  372. int ret = 0;
  373. if (strcmp(oldpath, newpath)) {
  374. #ifdef _WIN32
  375. - ret = !CreateSymbolicLink(newpath, oldpath, 0);
  376. + ret = 0;
  377. #else
  378. ret = symlink(oldpath, newpath);
  379. #endif
  380. diff -U 3 -H -w -E -d -r -N -- lilv-0.18.0.orig/src/world.c lilv-0.18.0/src/world.c
  381. --- lilv-0.18.0.orig/src/world.c 2013-12-27 19:45:19.000000000 +0000
  382. +++ lilv-0.18.0/src/world.c 2014-04-14 20:45:37.828508116 +0000
  383. @@ -19,7 +19,7 @@
  384. #include <stdlib.h>
  385. #include <string.h>
  386. -#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
  387. +#include "lv2/presets.h"
  388. #include "lilv_internal.h"