Example #1
0
	LILV_FOREACH(plugins, i, list) {
		const LilvPlugin* p = lilv_plugins_get(list, i);
		if (show_names) {
			LilvNode* n = lilv_plugin_get_name(p);
			printf("%s\n", lilv_node_as_string(n));
			lilv_node_free(n);
		} else {
			printf("%s\n", lilv_node_as_uri(lilv_plugin_get_uri(p)));
		}
	}
Example #2
0
bool LV2EffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
{
   EffectManager& em = EffectManager::Get();

#ifdef EFFECT_CATEGORIES

   // Add all LV2 categories and their relationships
   LilvPluginClasses classes = Lilv_world_get_plugin_classes(gWorld);
   for (unsigned index = 0; index < Lilv_plugin_classes_size(classes);++index){
      LilvPluginClass c = Lilv_plugin_classes_get_at(classes, index);
      em.AddCategory(wxString::FromUTF8(lilv_node_as_uri(Lilv_plugin_class_get_uri(c))),
                     wxString::FromUTF8(lilv_node_as_string(Lilv_plugin_class_get_label(c))));
   }
   for (unsigned index = 0; index < Lilv_plugin_classes_size(classes);++index){
      LilvPluginClass c = Lilv_plugin_classes_get_at(classes, index);
      LilvPluginClasses ch = Lilv_plugin_class_get_children(c);
      EffectCategory* pCat = em.LookupCategory(wxString::FromUTF8(lilv_node_as_uri(Lilv_plugin_class_get_uri(c))));
      for (unsigned j = 0; j < Lilv_plugin_classes_size(ch); ++j) {
         EffectCategory* chCat = em.LookupCategory(wxString::FromUTF8(lilv_node_as_uri(Lilv_plugin_class_get_uri(Lilv_plugin_classes_get_at(ch, j)))));
         if (chCat && pCat) {
            em.AddCategoryParent(chCat, pCat);
         }
      }
   }

#endif

   // Retrieve data about all plugins
   const LilvPlugins *plugs = lilv_world_get_all_plugins(gWorld);

   // Iterate over all plugins and register them with the EffectManager
   LILV_FOREACH(plugins, i, plugs)
   {
      const LilvPlugin *plug = lilv_plugins_get(plugs, i);
      std::set<wxString> cats;
      cats.insert(wxString::FromUTF8(lilv_node_as_uri(lilv_plugin_class_get_uri(lilv_plugin_get_class(plug)))));
      LV2Effect *effect = new LV2Effect(plug, cats);
      if (effect->IsValid())
      {
         em.RegisterEffect(this, effect);
      }
      else
      {
         delete effect;
      }
   }

   return true;
}
Example #3
0
int
main(int argc, char** argv)
{
	uint32_t block_size   = 512;
	uint32_t sample_count = (1 << 19);

	for (int i = 1; i < argc; ++i) {
		if (!strcmp(argv[i], "--version")) {
			print_version();
			return 0;
		} else if (!strcmp(argv[i], "--help")) {
			print_usage();
			return 0;
		} else if (!strcmp(argv[i], "-f")) {
			full_output = true;
		} else if (!strcmp(argv[i], "-n") && (i + 1 < argc)) {
			sample_count = atoi(argv[++i]);
		} else if (!strcmp(argv[i], "-b") && (i + 1 < argc)) {
			block_size = atoi(argv[++i]);
		} else {
			print_usage();
			return 1;
		}
	}

	LilvWorld* world = lilv_world_new();
	lilv_world_load_all(world);

	atom_AtomPort   = lilv_new_uri(world, LV2_ATOM__AtomPort);
	atom_Sequence   = lilv_new_uri(world, LV2_ATOM__Sequence);
	lv2_AudioPort   = lilv_new_uri(world, LV2_CORE__AudioPort);
	lv2_CVPort      = lilv_new_uri(world, LV2_CORE__CVPort);
	lv2_ControlPort = lilv_new_uri(world, LV2_CORE__ControlPort);
	lv2_InputPort   = lilv_new_uri(world, LV2_CORE__InputPort);
	lv2_OutputPort  = lilv_new_uri(world, LV2_CORE__OutputPort);
	urid_map        = lilv_new_uri(world, LV2_URID__map);

	if (full_output) {
		printf("# Block Samples Time Plugin\n");
	}

	const LilvPlugins* plugins = lilv_world_get_all_plugins(world);
	LILV_FOREACH(plugins, i, plugins) {
		bench(lilv_plugins_get(plugins, i), sample_count, block_size);
	}
Example #4
0
wxArrayString LV2EffectsModule::FindPlugins(PluginManagerInterface & WXUNUSED(pm))
{
   // Retrieve data about all LV2 plugins
   const LilvPlugins *plugs = lilv_world_get_all_plugins(gWorld);

   // Iterate over all plugins retrieve their URI
   wxArrayString plugins;
   LILV_FOREACH(plugins, i, plugs)
   {
      const LilvPlugin *plug = lilv_plugins_get(plugs, i);

      // Bypass Instrument (MIDI) plugins for now
      const LilvPluginClass *cls = lilv_plugin_get_class(plug);
      if (lilv_node_equals(lilv_plugin_class_get_uri(cls), LV2Effect::gInstrument))
      {
         continue;
      }

      plugins.Add(LilvString(lilv_plugin_get_uri(plug)));
   }

   return plugins;
}