Exemplo n.º 1
0
int
main(int argc, char** argv)
{
	if (argc != 2) {
		fprintf(stderr, "USAGE: %s BUNDLE\n", argv[0]);
		return 1;
	}

	const char* bundle_path = argv[1];
	LilvWorld*  world       = lilv_world_new();

	// Load test plugin bundle
	uint8_t*  abs_bundle = (uint8_t*)lilv_path_absolute(bundle_path);
	SerdNode  bundle     = serd_node_new_file_uri(abs_bundle, 0, 0, true);
	LilvNode* bundle_uri = lilv_new_uri(world, (const char*)bundle.buf);
	lilv_world_load_bundle(world, bundle_uri);
	free(abs_bundle);
	serd_node_free(&bundle);

	LilvNode*          plugin_uri = lilv_new_uri(world, PLUGIN_URI);
	const LilvPlugins* plugins    = lilv_world_get_all_plugins(world);
	const LilvPlugin*  plugin     = lilv_plugins_get_by_uri(plugins, plugin_uri);
	TEST_ASSERT(plugin);

	LilvInstance* instance = lilv_plugin_instantiate(plugin, 48000.0, NULL);
	TEST_ASSERT(instance);

	lilv_world_free(world);

	return 0;
}
Exemplo n.º 2
0
void LV2EffectsModule::Terminate()
{
   // Free the LilvNodes for each of the URIs we need
   #undef URI
   #define URI(n, u) lilv_node_free(LV2Effect::n);
   URILIST

   lilv_world_free(gWorld);
   gWorld = NULL;

   return;
}
Exemplo n.º 3
0
void LV2EffectsModule::Terminate()
{
   lilv_node_free(gAudioPortClass);
   gAudioPortClass = NULL;

   lilv_node_free(gControlPortClass);
   gControlPortClass = NULL;

   lilv_node_free(gMidiPortClass);
   gMidiPortClass = NULL;

   lilv_node_free(gInputPortClass);
   gInputPortClass = NULL;

   lilv_node_free(gOutputPortClass);
   gOutputPortClass = NULL;

   lilv_node_free(gPortToggled);
   gPortToggled = NULL;

   lilv_node_free(gPortIsInteger);
   gPortIsInteger = NULL;

   lilv_node_free(gPortIsSampleRate);
   gPortIsSampleRate = NULL;

   lilv_node_free(gPortIsEnumeration);
   gPortIsEnumeration = NULL;

   lilv_node_free(gPortIsLatency);
   gPortIsLatency = NULL;

   lilv_node_free(gPortIsOptional);
   gPortIsOptional = NULL;

   lilv_node_free(gName);
   gName = NULL;

   lilv_node_free(gPortGroup);
   gPortGroup = NULL;

   lilv_node_free(gSubGroupOf);
   gSubGroupOf = NULL;

   lilv_world_free(gWorld);
   gWorld = NULL;

   return;
}
Exemplo n.º 4
0
LV2World::~LV2World()
{
#define _node_free(n) lilv_node_free (const_cast<LilvNode*> (n))
    _node_free (lv2_InputPort);
    _node_free (lv2_OutputPort);
    _node_free (lv2_AudioPort);
    _node_free (lv2_AtomPort);
    _node_free (lv2_ControlPort);
    _node_free (lv2_EventPort);
    _node_free (lv2_CVPort);
    _node_free (midi_MidiEvent);
    _node_free (work_schedule);
    _node_free (work_interface);
    
    lilv_world_free (world);
    world = nullptr;
}
Exemplo n.º 5
0
/**
 * Destroy the Lv2Liv
 */
void Lv2Lib_destroy(Lv2Lib * lv2Liv) {
    lilv_world_free(lv2Liv->world);
    //lilv_plugins_free(lv2Liv->world);// LilvPlugins which is internal and thus lacks a free function
}