34
34
#include " lv2/lv2plug.in/ns/lv2core/lv2.h"
35
35
#include " lv2/lv2plug.in/ns/extensions/ui/ui.h"
36
36
#include " lv2/lv2plug.in/ns/ext/atom/atom.h"
37
+ #include " lv2/lv2plug.in/ns/ext/buf-size/buf-size.h"
37
38
#include " lv2/lv2plug.in/ns/ext/event/event.h"
38
39
#include " lv2/lv2plug.in/ns/ext/midi/midi.h"
40
+ #include " lv2/lv2plug.in/ns/ext/options/options.h"
39
41
#include " lv2/lv2plug.in/ns/ext/resize-port/resize-port.h"
40
42
#include " lv2/lv2plug.in/ns/ext/state/state.h"
41
43
#include " lv2/lv2plug.in/ns/ext/time/time.h"
44
+ #include " lv2/lv2plug.in/ns/ext/parameters/parameters.h"
42
45
#include " lv2/lv2plug.in/ns/ext/port-props/port-props.h"
43
46
44
47
#include " lilv/lilv.h"
@@ -185,6 +188,7 @@ class LV2Parser
185
188
LilvNode* ext_causesArtifacts;
186
189
LilvNode* ext_notAutomatic;
187
190
LilvNode* lv2_enabled;
191
+ LilvNode* lv2_requiredOption;
188
192
LilvNode* lv2_InputPort;
189
193
};
190
194
@@ -237,6 +241,7 @@ LV2Parser::LV2Parser (RtkLv2Description* d, char const* const* bundles)
237
241
ext_causesArtifacts = lilv_new_uri (world, LV2_PORT_PROPS__causesArtifacts);
238
242
ext_notAutomatic = lilv_new_uri (world, LV2_PORT_PROPS__notAutomatic);
239
243
lv2_enabled = lilv_new_uri (world, LV2_CORE_PREFIX " enabled" );
244
+ lv2_requiredOption = lilv_new_uri (world, LV2_OPTIONS__requiredOption);
240
245
lv2_InputPort = lilv_new_uri (world, LILV_URI_INPUT_PORT);
241
246
}
242
247
@@ -261,6 +266,7 @@ LV2Parser::~LV2Parser ()
261
266
lilv_node_free (ext_causesArtifacts);
262
267
lilv_node_free (ext_notAutomatic);
263
268
lilv_node_free (lv2_enabled);
269
+ lilv_node_free (lv2_requiredOption);
264
270
lilv_node_free (lv2_InputPort);
265
271
lilv_world_free (world);
266
272
}
@@ -348,6 +354,29 @@ int LV2Parser::parse (const char* plugin_uri)
348
354
return err;
349
355
}
350
356
357
+ uri = lilv_new_uri (world, plugin_uri);
358
+ LilvNodes* options = lilv_world_find_nodes (world, uri, lv2_requiredOption, NULL );
359
+ if (options) {
360
+ LILV_FOREACH (nodes, i, options) {
361
+ const char * ro = lilv_node_as_uri (lilv_nodes_get (options, i));
362
+ bool ok = false ;
363
+ if (!strcmp (ro, LV2_PARAMETERS__sampleRate)) { ok = true ; }
364
+ if (!strcmp (ro, LV2_BUF_SIZE__minBlockLength)) { ok = true ; }
365
+ if (!strcmp (ro, LV2_BUF_SIZE__maxBlockLength)) { ok = true ; }
366
+ if (!strcmp (ro, LV2_BUF_SIZE__sequenceSize)) { ok = true ; }
367
+ if (!ok) {
368
+ fprintf (stderr, " Unsupported required option: '%s' in '%s'\n " , ro, plugin_uri);
369
+ err = 1 ;
370
+ }
371
+ }
372
+ }
373
+ lilv_node_free (uri);
374
+ lilv_nodes_free (options);
375
+
376
+ if (err) {
377
+ return err;
378
+ }
379
+
351
380
LilvUIs* uis = lilv_plugin_get_uis (p);
352
381
#ifdef _WIN32
353
382
static const char * suppored_ui = LV2_UI__WindowsUI;
0 commit comments