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.

741 lines
25KB

  1. diff --git a/source/modules/lilv/lilv-0.21.3/lilv/lilv.h b/source/modules/lilv/lilv-0.21.3/lilv/lilv.h
  2. index e907789..84223c5 100644
  3. --- a/source/modules/lilv/lilv-0.21.3/lilv/lilv.h
  4. +++ b/source/modules/lilv/lilv-0.21.3/lilv/lilv.h
  5. @@ -26,8 +26,9 @@
  6. #include <stdint.h>
  7. #include <stdio.h>
  8. -#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
  9. -#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
  10. +#include "lv2/lv2.h"
  11. +#include "lv2/state.h"
  12. +#include "lv2/urid.h"
  13. #ifdef LILV_SHARED
  14. # ifdef _WIN32
  15. @@ -552,7 +553,7 @@ lilv_world_free(LilvWorld* world);
  16. with special plugin bundles which are installed to a known location).
  17. */
  18. LILV_API void
  19. -lilv_world_load_all(LilvWorld* world);
  20. +lilv_world_load_all(LilvWorld* world, const char* lv2_path);
  21. /**
  22. Load a specific bundle.
  23. @@ -1199,9 +1200,9 @@ lilv_port_get_scale_points(const LilvPlugin* plugin,
  24. @return A new LilvState which must be freed with lilv_state_free(), or NULL.
  25. */
  26. LILV_API LilvState*
  27. -lilv_state_new_from_world(LilvWorld* world,
  28. - LV2_URID_Map* map,
  29. - const LilvNode* subject);
  30. +lilv_state_new_from_world(LilvWorld* world,
  31. + const LV2_URID_Map* map,
  32. + const LilvNode* subject);
  33. /**
  34. Load a state snapshot from a file.
  35. @@ -1219,18 +1220,18 @@ lilv_state_new_from_world(LilvWorld* world,
  36. new memory consumed once this function returns.
  37. */
  38. LILV_API LilvState*
  39. -lilv_state_new_from_file(LilvWorld* world,
  40. - LV2_URID_Map* map,
  41. - const LilvNode* subject,
  42. - const char* path);
  43. +lilv_state_new_from_file(LilvWorld* world,
  44. + const LV2_URID_Map* map,
  45. + const LilvNode* subject,
  46. + const char* path);
  47. /**
  48. Load a state snapshot from a string made by lilv_state_to_string().
  49. */
  50. LILV_API LilvState*
  51. -lilv_state_new_from_string(LilvWorld* world,
  52. - LV2_URID_Map* map,
  53. - const char* str);
  54. +lilv_state_new_from_string(LilvWorld* world,
  55. + const LV2_URID_Map* map,
  56. + const char* str);
  57. /**
  58. Function to get a port value.
  59. @@ -1425,7 +1426,8 @@ lilv_state_emit_port_values(const LilvState* state,
  60. */
  61. LILV_API void
  62. lilv_state_restore(const LilvState* state,
  63. - LilvInstance* instance,
  64. + const LV2_State_Interface* iface,
  65. + LV2_Handle handle,
  66. LilvSetPortValueFunc set_value,
  67. void* user_data,
  68. uint32_t flags,
  69. @@ -1786,6 +1788,42 @@ LILV_API const LilvNode*
  70. lilv_ui_get_binary_uri(const LilvUI* ui);
  71. /**
  72. + Custom calls
  73. +*/
  74. +LILV_API LilvNode*
  75. +lilv_plugin_get_modgui_resources_directory(const LilvPlugin* plugin);
  76. +
  77. +LILV_API LilvNode*
  78. +lilv_plugin_get_modgui_stylesheet(const LilvPlugin* plugin);
  79. +
  80. +LILV_API LilvNode*
  81. +lilv_plugin_get_modgui_icon_template(const LilvPlugin* plugin);
  82. +
  83. +LILV_API LilvNode*
  84. +lilv_plugin_get_modgui_settings_template(const LilvPlugin* plugin);
  85. +
  86. +LILV_API LilvNode*
  87. +lilv_plugin_get_modgui_template_data(const LilvPlugin* plugin);
  88. +
  89. +LILV_API LilvNode*
  90. +lilv_plugin_get_modgui_screenshot(const LilvPlugin* plugin);
  91. +
  92. +LILV_API LilvNode*
  93. +lilv_plugin_get_modgui_thumbnail(const LilvPlugin* plugin);
  94. +
  95. +LILV_API const LilvNodes*
  96. +lilv_ui_get_supported_features(const LilvUI* ui);
  97. +
  98. +LILV_API const LilvNodes*
  99. +lilv_ui_get_required_features(const LilvUI* ui);
  100. +
  101. +LILV_API const LilvNodes*
  102. +lilv_ui_get_optional_features(const LilvUI* ui);
  103. +
  104. +LILV_API const LilvNodes*
  105. +lilv_ui_get_extension_data(const LilvUI* ui);
  106. +
  107. +/**
  108. @}
  109. @}
  110. */
  111. diff --git a/source/modules/lilv/lilv-0.21.3/lilv/lilvmm.hpp b/source/modules/lilv/lilv-0.21.3/lilv/lilvmm.hpp
  112. index b9b3a69..367b8d8 100644
  113. --- a/source/modules/lilv/lilv-0.21.3/lilv/lilvmm.hpp
  114. +++ b/source/modules/lilv/lilv-0.21.3/lilv/lilvmm.hpp
  115. @@ -17,6 +17,8 @@
  116. #ifndef LILV_LILVMM_HPP
  117. #define LILV_LILVMM_HPP
  118. +#include "CarlaDefines.h"
  119. +
  120. #include "lilv/lilv.h"
  121. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
  122. @@ -35,6 +37,9 @@ uri_to_path(const char* uri) {
  123. #define LILV_WRAP0(RT, prefix, name) \
  124. inline RT name() { return lilv_ ## prefix ## _ ## name (me); }
  125. +#define LILV_WRAP0_CONST(RT, prefix, name) \
  126. + inline RT name() const { return lilv_ ## prefix ## _ ## name (me); }
  127. +
  128. #define LILV_WRAP0_VOID(prefix, name) \
  129. inline void name() { lilv_ ## prefix ## _ ## name(me); }
  130. @@ -65,6 +70,7 @@ uri_to_path(const char* uri) {
  131. #endif
  132. struct Node {
  133. + inline Node(LilvNode* node) : me(node) {}
  134. inline Node(const LilvNode* node) : me(lilv_node_duplicate(node)) {}
  135. inline Node(const Node& copy) : me(lilv_node_duplicate(copy.me)) {}
  136. @@ -78,20 +84,26 @@ struct Node {
  137. LILV_WRAP_CONVERSION(LilvNode);
  138. - LILV_WRAP0(char*, node, get_turtle_token);
  139. - LILV_WRAP0(bool, node, is_uri);
  140. - LILV_WRAP0(const char*, node, as_uri);
  141. - LILV_WRAP0(bool, node, is_blank);
  142. - LILV_WRAP0(const char*, node, as_blank);
  143. - LILV_WRAP0(bool, node, is_literal);
  144. - LILV_WRAP0(bool, node, is_string);
  145. - LILV_WRAP0(const char*, node, as_string);
  146. - LILV_WRAP0(bool, node, is_float);
  147. - LILV_WRAP0(float, node, as_float);
  148. - LILV_WRAP0(bool, node, is_int);
  149. - LILV_WRAP0(int, node, as_int);
  150. - LILV_WRAP0(bool, node, is_bool);
  151. - LILV_WRAP0(bool, node, as_bool);
  152. + LILV_WRAP0_CONST(char*, node, get_turtle_token);
  153. + LILV_WRAP0_CONST(bool, node, is_uri);
  154. + LILV_WRAP0_CONST(const char*, node, as_uri);
  155. + LILV_WRAP0_CONST(bool, node, is_blank);
  156. + LILV_WRAP0_CONST(const char*, node, as_blank);
  157. + LILV_WRAP0_CONST(bool, node, is_literal);
  158. + LILV_WRAP0_CONST(bool, node, is_string);
  159. + LILV_WRAP0_CONST(const char*, node, as_string);
  160. + LILV_WRAP0_CONST(bool, node, is_float);
  161. + LILV_WRAP0_CONST(float, node, as_float);
  162. + LILV_WRAP0_CONST(bool, node, is_int);
  163. + LILV_WRAP0_CONST(int, node, as_int);
  164. + LILV_WRAP0_CONST(bool, node, is_bool);
  165. + LILV_WRAP0_CONST(bool, node, as_bool);
  166. +
  167. + Node& operator=(const Node& copy) {
  168. + lilv_node_free(me);
  169. + me = lilv_node_duplicate(copy.me);
  170. + return *this;
  171. + }
  172. LilvNode* me;
  173. };
  174. @@ -126,7 +138,7 @@ struct PluginClass {
  175. LILV_WRAP0(LilvIter*, prefix, begin); \
  176. LILV_WRAP1(LilvIter*, prefix, next, LilvIter*, i); \
  177. LILV_WRAP1(bool, prefix, is_end, LilvIter*, i); \
  178. - const Lilv ## CT* me; \
  179. + const Lilv ## CT* me
  180. struct PluginClasses {
  181. LILV_WRAP_COLL(PluginClasses, PluginClass, plugin_classes);
  182. @@ -141,22 +153,24 @@ struct ScalePoints {
  183. struct Nodes {
  184. LILV_WRAP_COLL(Nodes, Node, nodes);
  185. LILV_WRAP1(bool, nodes, contains, const Node, node);
  186. - LILV_WRAP0(Node, nodes, get_first);
  187. +
  188. + inline Node get_first() const {
  189. + return Node((const LilvNode*)lilv_nodes_get_first(me));
  190. + }
  191. };
  192. struct UI {
  193. inline UI(const LilvUI* c_obj) : me(c_obj) {}
  194. LILV_WRAP_CONVERSION(const LilvUI);
  195. - LILV_WRAP0(const LilvNode*, ui, get_uri);
  196. - LILV_WRAP0(const LilvNode*, ui, get_bundle_uri);
  197. - LILV_WRAP0(const LilvNode*, ui, get_binary_uri);
  198. - LILV_WRAP0(const LilvNodes*, ui, get_classes);
  199. - /*LILV_WRAP3(bool, ui, is_supported,
  200. - LilvUISupportedFunc, supported_func,
  201. - const LilvNode*, container_type,
  202. - const LilvNode**, ui_type);*/
  203. - LILV_WRAP1(bool, ui, is_a, const LilvNode*, class_uri);
  204. + LILV_WRAP0(Node, ui, get_uri);
  205. + LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
  206. + LILV_WRAP0(Node, ui, get_bundle_uri);
  207. + LILV_WRAP0(Node, ui, get_binary_uri);
  208. + LILV_WRAP0(Nodes, ui, get_supported_features);
  209. + LILV_WRAP0(Nodes, ui, get_required_features);
  210. + LILV_WRAP0(Nodes, ui, get_optional_features);
  211. + LILV_WRAP0(Nodes, ui, get_extension_data);
  212. const LilvUI* me;
  213. };
  214. @@ -220,6 +234,13 @@ struct Plugin {
  215. LILV_WRAP0(Nodes, plugin, get_extension_data);
  216. LILV_WRAP0(UIs, plugin, get_uis);
  217. LILV_WRAP1(Nodes, plugin, get_related, Node, type);
  218. + LILV_WRAP0(Node, plugin, get_modgui_resources_directory);
  219. + LILV_WRAP0(Node, plugin, get_modgui_stylesheet);
  220. + LILV_WRAP0(Node, plugin, get_modgui_icon_template);
  221. + LILV_WRAP0(Node, plugin, get_modgui_settings_template);
  222. + LILV_WRAP0(Node, plugin, get_modgui_template_data);
  223. + LILV_WRAP0(Node, plugin, get_modgui_screenshot);
  224. + LILV_WRAP0(Node, plugin, get_modgui_thumbnail);
  225. inline Port get_port_by_index(unsigned index) {
  226. return Port(me, lilv_plugin_get_port_by_index(me, index));
  227. @@ -258,16 +279,14 @@ struct Plugins {
  228. struct Instance {
  229. inline Instance(LilvInstance* instance) : me(instance) {}
  230. - LILV_DEPRECATED
  231. - inline Instance(Plugin plugin, double sample_rate) {
  232. - me = lilv_plugin_instantiate(plugin, sample_rate, NULL);
  233. - }
  234. + LILV_DEPRECATED
  235. + inline Instance(Plugin plugin, double sample_rate)
  236. + : me(lilv_plugin_instantiate(plugin, sample_rate, NULL)) {}
  237. - LILV_DEPRECATED inline Instance(Plugin plugin,
  238. - double sample_rate,
  239. - LV2_Feature* const* features) {
  240. - me = lilv_plugin_instantiate(plugin, sample_rate, features);
  241. - }
  242. + LILV_DEPRECATED inline Instance(Plugin plugin,
  243. + double sample_rate,
  244. + LV2_Feature* const* features)
  245. + : me(lilv_plugin_instantiate(plugin, sample_rate, features)) {}
  246. static inline Instance* create(Plugin plugin,
  247. double sample_rate,
  248. @@ -304,22 +323,22 @@ struct Instance {
  249. };
  250. struct World {
  251. - inline World() : me(lilv_world_new()) {}
  252. - inline ~World() { lilv_world_free(me); }
  253. + inline World() : me(lilv_world_new()) {}
  254. + inline virtual ~World() { lilv_world_free(me); }
  255. - inline LilvNode* new_uri(const char* uri) {
  256. + inline LilvNode* new_uri(const char* uri) const {
  257. return lilv_new_uri(me, uri);
  258. }
  259. - inline LilvNode* new_string(const char* str) {
  260. + inline LilvNode* new_string(const char* str) const {
  261. return lilv_new_string(me, str);
  262. }
  263. - inline LilvNode* new_int(int val) {
  264. + inline LilvNode* new_int(int val) const {
  265. return lilv_new_int(me, val);
  266. }
  267. - inline LilvNode* new_float(float val) {
  268. + inline LilvNode* new_float(float val) const {
  269. return lilv_new_float(me, val);
  270. }
  271. - inline LilvNode* new_bool(bool val) {
  272. + inline LilvNode* new_bool(bool val) const {
  273. return lilv_new_bool(me, val);
  274. }
  275. inline Nodes find_nodes(const LilvNode* subject,
  276. @@ -329,7 +348,7 @@ struct World {
  277. }
  278. LILV_WRAP2_VOID(world, set_option, const char*, uri, LilvNode*, value);
  279. - LILV_WRAP0_VOID(world, load_all);
  280. + LILV_WRAP1_VOID(world, load_all, const char*, lv2_path);
  281. LILV_WRAP1_VOID(world, load_bundle, LilvNode*, bundle_uri);
  282. LILV_WRAP0(const LilvPluginClass*, world, get_plugin_class);
  283. LILV_WRAP0(const LilvPluginClasses*, world, get_plugin_classes);
  284. @@ -337,6 +356,8 @@ struct World {
  285. LILV_WRAP1(int, world, load_resource, const LilvNode*, resource);
  286. LilvWorld* me;
  287. +
  288. + CARLA_DECLARE_NON_COPY_STRUCT(World)
  289. };
  290. } /* namespace Lilv */
  291. diff --git a/source/modules/lilv/lilv-0.21.3/src/lilv_internal.h b/source/modules/lilv/lilv-0.21.3/src/lilv_internal.h
  292. index e2444d3..4d0a8e5 100644
  293. --- a/source/modules/lilv/lilv-0.21.3/src/lilv_internal.h
  294. +++ b/source/modules/lilv/lilv-0.21.3/src/lilv_internal.h
  295. @@ -53,7 +53,7 @@ static inline char* dlerror(void) { return "Unknown error"; }
  296. #include "lilv/lilv.h"
  297. #ifdef LILV_DYN_MANIFEST
  298. -# include "lv2/lv2plug.in/ns/ext/dynmanifest/dynmanifest.h"
  299. +# include "lv2/dynmanifest.h"
  300. #endif
  301. /*
  302. diff --git a/source/modules/lilv/lilv-0.21.3/src/plugin.c b/source/modules/lilv/lilv-0.21.3/src/plugin.c
  303. index bf0843b..c711990 100644
  304. --- a/source/modules/lilv/lilv-0.21.3/src/plugin.c
  305. +++ b/source/modules/lilv/lilv-0.21.3/src/plugin.c
  306. @@ -27,10 +27,11 @@
  307. #include "lilv_config.h"
  308. #include "lilv_internal.h"
  309. -#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
  310. +#include "lv2/ui.h"
  311. #define NS_DOAP (const uint8_t*)"http://usefulinc.com/ns/doap#"
  312. #define NS_FOAF (const uint8_t*)"http://xmlns.com/foaf/0.1/"
  313. +#define NS_MOD (const uint8_t*)"http://portalmod.com/ns/modgui#"
  314. /** Ownership of `uri` is taken */
  315. LilvPlugin*
  316. @@ -908,6 +909,131 @@ lilv_plugin_get_author_homepage(const LilvPlugin* plugin)
  317. return NULL;
  318. }
  319. +static const SordNode*
  320. +lilv_plugin_get_modgui(const LilvPlugin* p)
  321. +{
  322. + lilv_plugin_load_if_necessary(p);
  323. +
  324. + SordNode* mod_gui = sord_new_uri(
  325. + p->world->world, NS_MOD "gui");
  326. +
  327. + SordIter* gui = lilv_world_query_internal(
  328. + p->world,
  329. + p->plugin_uri->node,
  330. + mod_gui,
  331. + NULL);
  332. +
  333. + sord_node_free(p->world->world, mod_gui);
  334. +
  335. + if (sord_iter_end(gui)) {
  336. + sord_iter_free(gui);
  337. + return NULL;
  338. + }
  339. +
  340. + const SordNode* Gui = sord_iter_get_node(gui, SORD_OBJECT);
  341. +
  342. + sord_iter_free(gui);
  343. + return Gui;
  344. +}
  345. +
  346. +LILV_API LilvNode*
  347. +lilv_plugin_get_modgui_resources_directory(const LilvPlugin* plugin)
  348. +{
  349. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  350. + if (modgui) {
  351. + SordWorld* sworld = plugin->world->world;
  352. + SordNode* modgui_res = sord_new_uri(sworld, NS_MOD "resourcesDirectory");
  353. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_res);
  354. + sord_node_free(sworld, modgui_res);
  355. + return ret;
  356. + }
  357. + return NULL;
  358. +}
  359. +
  360. +LILV_API LilvNode*
  361. +lilv_plugin_get_modgui_stylesheet(const LilvPlugin* plugin)
  362. +{
  363. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  364. + if (modgui) {
  365. + SordWorld* sworld = plugin->world->world;
  366. + SordNode* modgui_style = sord_new_uri(sworld, NS_MOD "stylesheet");
  367. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_style);
  368. + sord_node_free(sworld, modgui_style);
  369. + return ret;
  370. + }
  371. + return NULL;
  372. +}
  373. +
  374. +LILV_API LilvNode*
  375. +lilv_plugin_get_modgui_icon_template(const LilvPlugin* plugin)
  376. +{
  377. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  378. + if (modgui) {
  379. + SordWorld* sworld = plugin->world->world;
  380. + SordNode* modgui_tmpl = sord_new_uri(sworld, NS_MOD "iconTemplate");
  381. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_tmpl);
  382. + sord_node_free(sworld, modgui_tmpl);
  383. + return ret;
  384. + }
  385. + return NULL;
  386. +}
  387. +
  388. +LILV_API LilvNode*
  389. +lilv_plugin_get_modgui_settings_template(const LilvPlugin* plugin)
  390. +{
  391. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  392. + if (modgui) {
  393. + SordWorld* sworld = plugin->world->world;
  394. + SordNode* modgui_tmpl = sord_new_uri(sworld, NS_MOD "settingsTemplate");
  395. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_tmpl);
  396. + sord_node_free(sworld, modgui_tmpl);
  397. + return ret;
  398. + }
  399. + return NULL;
  400. +}
  401. +
  402. +LILV_API LilvNode*
  403. +lilv_plugin_get_modgui_template_data(const LilvPlugin* plugin)
  404. +{
  405. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  406. + if (modgui) {
  407. + SordWorld* sworld = plugin->world->world;
  408. + SordNode* modgui_tmpl = sord_new_uri(sworld, NS_MOD "templateData");
  409. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_tmpl);
  410. + sord_node_free(sworld, modgui_tmpl);
  411. + return ret;
  412. + }
  413. + return NULL;
  414. +}
  415. +
  416. +LILV_API LilvNode*
  417. +lilv_plugin_get_modgui_screenshot(const LilvPlugin* plugin)
  418. +{
  419. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  420. + if (modgui) {
  421. + SordWorld* sworld = plugin->world->world;
  422. + SordNode* modgui_scr = sord_new_uri(sworld, NS_MOD "screenshot");
  423. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_scr);
  424. + sord_node_free(sworld, modgui_scr);
  425. + return ret;
  426. + }
  427. + return NULL;
  428. +}
  429. +
  430. +LILV_API LilvNode*
  431. +lilv_plugin_get_modgui_thumbnail(const LilvPlugin* plugin)
  432. +{
  433. + const SordNode* modgui = lilv_plugin_get_modgui(plugin);
  434. + if (modgui) {
  435. + SordWorld* sworld = plugin->world->world;
  436. + SordNode* modgui_thumb = sord_new_uri(sworld, NS_MOD "thumbnail");
  437. + LilvNode* ret = lilv_plugin_get_one(plugin, modgui, modgui_thumb);
  438. + sord_node_free(sworld, modgui_thumb);
  439. + return ret;
  440. + }
  441. + return NULL;
  442. +}
  443. +
  444. LILV_API bool
  445. lilv_plugin_is_replaced(const LilvPlugin* plugin)
  446. {
  447. diff --git a/source/modules/lilv/lilv-0.21.3/src/port.c b/source/modules/lilv/lilv-0.21.3/src/port.c
  448. index 6bf8fc7..0a50891 100644
  449. --- a/source/modules/lilv/lilv-0.21.3/src/port.c
  450. +++ b/source/modules/lilv/lilv-0.21.3/src/port.c
  451. @@ -20,8 +20,8 @@
  452. #include <stdlib.h>
  453. #include <string.h>
  454. -#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
  455. -#include "lv2/lv2plug.in/ns/ext/event/event.h"
  456. +#include "lv2/atom.h"
  457. +#include "lv2/event.h"
  458. #include "lilv_internal.h"
  459. diff --git a/source/modules/lilv/lilv-0.21.3/src/state.c b/source/modules/lilv/lilv-0.21.3/src/state.c
  460. index 79199e4..119dcee 100644
  461. --- a/source/modules/lilv/lilv-0.21.3/src/state.c
  462. +++ b/source/modules/lilv/lilv-0.21.3/src/state.c
  463. @@ -18,10 +18,10 @@
  464. #include <stdio.h>
  465. #include <string.h>
  466. -#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
  467. -#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
  468. -#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
  469. -#include "lv2/lv2plug.in/ns/ext/state/state.h"
  470. +#include "lv2/atom.h"
  471. +#include "lv2/atom-forge.h"
  472. +#include "lv2/presets.h"
  473. +#include "lv2/state.h"
  474. #include "lilv_config.h"
  475. #include "lilv_internal.h"
  476. @@ -411,35 +411,18 @@ lilv_state_emit_port_values(const LilvState* state,
  477. LILV_API void
  478. lilv_state_restore(const LilvState* state,
  479. - LilvInstance* instance,
  480. + const LV2_State_Interface* iface,
  481. + LV2_Handle handle,
  482. LilvSetPortValueFunc set_value,
  483. void* user_data,
  484. uint32_t flags,
  485. const LV2_Feature *const * features)
  486. {
  487. - if (!state) {
  488. - LILV_ERROR("lilv_state_restore() called on NULL state\n");
  489. - return;
  490. - }
  491. -
  492. - LV2_State_Map_Path map_path = {
  493. - (LilvState*)state, abstract_path, absolute_path };
  494. - LV2_Feature map_feature = { LV2_STATE__mapPath, &map_path };
  495. -
  496. - const LV2_Feature** sfeatures = add_features(features, &map_feature, NULL);
  497. -
  498. - const LV2_Descriptor* desc = instance ? instance->lv2_descriptor : NULL;
  499. - const LV2_State_Interface* iface = (desc && desc->extension_data)
  500. - ? (const LV2_State_Interface*)desc->extension_data(LV2_STATE__interface)
  501. - : NULL;
  502. -
  503. if (iface) {
  504. - iface->restore(instance->lv2_handle, retrieve_callback,
  505. - (LV2_State_Handle)state, flags, sfeatures);
  506. + iface->restore(handle, retrieve_callback,
  507. + (LV2_State_Handle)state, flags, features);
  508. }
  509. - free(sfeatures);
  510. -
  511. if (set_value) {
  512. lilv_state_emit_port_values(state, set_value, user_data);
  513. }
  514. @@ -586,9 +569,9 @@ new_state_from_model(LilvWorld* world,
  515. }
  516. LILV_API LilvState*
  517. -lilv_state_new_from_world(LilvWorld* world,
  518. - LV2_URID_Map* map,
  519. - const LilvNode* node)
  520. +lilv_state_new_from_world(LilvWorld* world,
  521. + const LV2_URID_Map* map,
  522. + const LilvNode* node)
  523. {
  524. if (!lilv_node_is_uri(node) && !lilv_node_is_blank(node)) {
  525. LILV_ERRORF("Subject `%s' is not a URI or blank node.\n",
  526. @@ -600,10 +583,10 @@ lilv_state_new_from_world(LilvWorld* world,
  527. }
  528. LILV_API LilvState*
  529. -lilv_state_new_from_file(LilvWorld* world,
  530. - LV2_URID_Map* map,
  531. - const LilvNode* subject,
  532. - const char* path)
  533. +lilv_state_new_from_file(LilvWorld* world,
  534. + const LV2_URID_Map* map,
  535. + const LilvNode* subject,
  536. + const char* path)
  537. {
  538. if (subject && !lilv_node_is_uri(subject)
  539. && !lilv_node_is_blank(subject)) {
  540. @@ -653,9 +636,9 @@ set_prefixes(SerdEnv* env)
  541. }
  542. LILV_API LilvState*
  543. -lilv_state_new_from_string(LilvWorld* world,
  544. - LV2_URID_Map* map,
  545. - const char* str)
  546. +lilv_state_new_from_string(LilvWorld* world,
  547. + const LV2_URID_Map* map,
  548. + const char* str)
  549. {
  550. if (!str) {
  551. return NULL;
  552. diff --git a/source/modules/lilv/lilv-0.21.3/src/ui.c b/source/modules/lilv/lilv-0.21.3/src/ui.c
  553. index 0f4f2f6..a0dd567 100644
  554. --- a/source/modules/lilv/lilv-0.21.3/src/ui.c
  555. +++ b/source/modules/lilv/lilv-0.21.3/src/ui.c
  556. @@ -109,3 +109,54 @@ lilv_ui_get_binary_uri(const LilvUI* ui)
  557. {
  558. return ui->binary_uri;
  559. }
  560. +
  561. +static LilvNodes*
  562. +lilv_ui_get_value_internal(const LilvUI* ui, const SordNode* predicate)
  563. +{
  564. + assert(ui);
  565. + return lilv_world_find_nodes_internal(ui->world, ui->uri->node, predicate, NULL);
  566. +}
  567. +
  568. +LILV_API const LilvNodes*
  569. +lilv_ui_get_supported_features(const LilvUI* ui)
  570. +{
  571. + assert(ui);
  572. + LilvNodes* optional = lilv_ui_get_optional_features(ui);
  573. + LilvNodes* required = lilv_ui_get_required_features(ui);
  574. + LilvNodes* result = lilv_nodes_new();
  575. +
  576. + LILV_FOREACH(nodes, i, optional)
  577. + zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(optional, i)), NULL);
  578. +
  579. + LILV_FOREACH(nodes, i, required)
  580. + zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(required, i)), NULL);
  581. +
  582. + lilv_nodes_free(optional);
  583. + lilv_nodes_free(required);
  584. +
  585. + return result;
  586. +}
  587. +
  588. +LILV_API const LilvNodes*
  589. +lilv_ui_get_required_features(const LilvUI* ui)
  590. +{
  591. + assert(ui);
  592. + assert(ui->world);
  593. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_requiredFeature);
  594. +}
  595. +
  596. +LILV_API const LilvNodes*
  597. +lilv_ui_get_optional_features(const LilvUI* ui)
  598. +{
  599. + assert(ui);
  600. + assert(ui->world);
  601. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_optionalFeature);
  602. +}
  603. +
  604. +LILV_API const LilvNodes*
  605. +lilv_ui_get_extension_data(const LilvUI* ui)
  606. +{
  607. + assert(ui);
  608. + assert(ui->world);
  609. + return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
  610. +}
  611. diff --git a/source/modules/lilv/lilv-0.21.3/src/util.c b/source/modules/lilv/lilv-0.21.3/src/util.c
  612. index 31c9238..5bcdb7e 100644
  613. --- a/source/modules/lilv/lilv-0.21.3/src/util.c
  614. +++ b/source/modules/lilv/lilv-0.21.3/src/util.c
  615. @@ -30,7 +30,6 @@
  616. #include <string.h>
  617. #ifdef _WIN32
  618. -# define _WIN32_WINNT 0x0600 /* for CreateSymbolicLink */
  619. # include <windows.h>
  620. # include <direct.h>
  621. # include <io.h>
  622. @@ -446,10 +445,7 @@ lilv_symlink(const char* oldpath, const char* newpath)
  623. int ret = 0;
  624. if (strcmp(oldpath, newpath)) {
  625. #ifdef _WIN32
  626. - ret = !CreateSymbolicLink(newpath, oldpath, 0);
  627. - if (ret) {
  628. - ret = !CreateHardLink(newpath, oldpath, 0);
  629. - }
  630. + ret = 1;
  631. #else
  632. ret = symlink(oldpath, newpath);
  633. #endif
  634. diff --git a/source/modules/lilv/lilv-0.21.3/src/world.c b/source/modules/lilv/lilv-0.21.3/src/world.c
  635. index 02dbeec..8b2db95 100644
  636. --- a/source/modules/lilv/lilv-0.21.3/src/world.c
  637. +++ b/source/modules/lilv/lilv-0.21.3/src/world.c
  638. @@ -19,7 +19,7 @@
  639. #include <stdlib.h>
  640. #include <string.h>
  641. -#include "lv2/lv2plug.in/ns/ext/presets/presets.h"
  642. +#include "lv2/presets.h"
  643. #include "lilv_internal.h"
  644. @@ -797,12 +797,8 @@ lilv_world_load_plugin_classes(LilvWorld* world)
  645. }
  646. LILV_API void
  647. -lilv_world_load_all(LilvWorld* world)
  648. +lilv_world_load_all(LilvWorld* world, const char* lv2_path)
  649. {
  650. - const char* lv2_path = getenv("LV2_PATH");
  651. - if (!lv2_path)
  652. - lv2_path = LILV_DEFAULT_LV2_PATH;
  653. -
  654. // Discover bundles and read all manifest files into model
  655. lilv_world_load_path(world, lv2_path);
  656. diff --git a/source/modules/lilv/sratom-0.4.7/sratom/sratom.h b/source/modules/lilv/sratom-0.4.7/sratom/sratom.h
  657. index a86f67e..f0c12b9 100644
  658. --- a/source/modules/lilv/sratom-0.4.7/sratom/sratom.h
  659. +++ b/source/modules/lilv/sratom-0.4.7/sratom/sratom.h
  660. @@ -23,9 +23,9 @@
  661. #include <stdint.h>
  662. -#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
  663. -#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
  664. -#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
  665. +#include "lv2/atom.h"
  666. +#include "lv2/atom-forge.h"
  667. +#include "lv2/urid.h"
  668. #include "serd/serd.h"
  669. #include "sord/sord.h"
  670. diff --git a/source/modules/lilv/sratom-0.4.7/src/sratom.c b/source/modules/lilv/sratom-0.4.7/src/sratom.c
  671. index 272e6e3..4f9d136 100644
  672. --- a/source/modules/lilv/sratom-0.4.7/src/sratom.c
  673. +++ b/source/modules/lilv/sratom-0.4.7/src/sratom.c
  674. @@ -20,9 +20,9 @@
  675. #include <stdlib.h>
  676. #include <string.h>
  677. -#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
  678. -#include "lv2/lv2plug.in/ns/ext/atom/util.h"
  679. -#include "lv2/lv2plug.in/ns/ext/midi/midi.h"
  680. +#include "lv2/atom-forge.h"
  681. +#include "lv2/atom-util.h"
  682. +#include "lv2/midi.h"
  683. #include "sratom/sratom.h"