37 static void init(
unsigned int samplingFreq,
PluginDef *plugin);
38 static void mono_process(
int count,
float *input,
float *output,
PluginDef *plugin);
39 static void stereo_process(
int count,
float *input1,
float *input2,
float *output1,
float *output2,
PluginDef *plugin);
41 static int registerparam(
const ParamReg& reg);
42 static int uiloader(
const UiBuilder& builder,
int form);
43 static void del_instance(
PluginDef *plugin);
45 const LADSPA_Descriptor *desc;
47 LADSPA_Handle instance;
49 Glib::ustring name_str;
52 void connect(
int tp,
int i,
float *v);
53 inline void cleanup();
57 inline void mono_dry_wet(
int count,
float *input0,
float *input1,
float *output0);
58 inline void stereo_dry_wet(
int count,
float *input0,
float *input1,
float *input2,
float *input3,
float *output0,
float *output1);
59 std::string make_id(
const paradesc& p);
60 LadspaDsp(
const plugdesc *plug,
void *handle_,
const LADSPA_Descriptor *desc_,
bool mono);
69 handle = dlopen(plug->
path.c_str(), RTLD_LOCAL|RTLD_NOW);
71 gx_print_error(
"ladspaloader",ustring::compose(_(
"Cannot open plugin: %1 [%2]"), plug->
path, dlerror()));
74 LADSPA_Descriptor_Function ladspa_descriptor = (LADSPA_Descriptor_Function)dlsym(handle,
"ladspa_descriptor");
75 const char *dlsym_error = dlerror();
77 gx_print_error(
"ladspaloader",ustring::compose(_(
"Cannot load symbol 'ladspa_descriptor': %1"), dlsym_error));
82 const LADSPA_Descriptor *desc = ladspa_descriptor(plug->
index);
83 if (!desc || desc->UniqueID != plug->
UniqueID) {
84 for (
int i = 0; ; i++) {
85 desc = ladspa_descriptor(i);
89 if (desc->UniqueID == plug->
UniqueID) {
95 gx_print_error(
"ladspaloader",ustring::compose(_(
"Cannot load ladspa descriptor #%1 from %2"), plug->
index, plug->
path));
100 if (desc->UniqueID == 4069 || desc->UniqueID == 4070) {
108 for (
unsigned int i = 0; i < desc->PortCount; ++i) {
109 if (LADSPA_IS_PORT_AUDIO(desc->PortDescriptors[i])) {
110 if (LADSPA_IS_PORT_INPUT(desc->PortDescriptors[i])) {
118 if (num_inputs == 1 && num_outputs == 1) {
120 }
else if (num_inputs == 2 && num_outputs == 2) {
124 "ladspaloader",ustring::compose(
125 _(
"cannot use ladspa plugin %1 with %2 inputs and %3 outputs"),
126 desc->Label, num_inputs, num_outputs));
131 return new LadspaDsp(plug, handle, desc, mono);
134 LadspaDsp::LadspaDsp(
const plugdesc *plug,
void *handle_,
const LADSPA_Descriptor *desc_,
bool mono)
135 :
PluginDef(), desc(desc_), handle(handle_), instance(),
136 ports(
new LADSPA_Data[desc->PortCount]), name_str(), pd(plug), is_activated(
false) {
155 inline void LadspaDsp::cleanup() {
158 activate(
true,
this);
160 activate(
false,
this);
162 desc->cleanup(instance);
172 if (jp.
read_kv(
"index", index) ||
179 jp.
read_kv(
"newrow", newrow) ||
180 jp.
read_kv(
"has_caption", has_caption)) {
182 std::vector<std::string> v;
207 jw.
write_kv(
"has_caption", has_caption);
213 jw.
write(p->value_id);
214 jw.
write(p->value_label);
226 if (jp.
read_kv(
"path", path) ||
228 jp.
read_kv(
"UniqueID", UniqueID) ||
232 jp.
read_kv(
"quirks", quirks) ||
233 jp.
read_kv(
"add_wet_dry", add_wet_dry) ||
234 jp.
read_kv(
"master_idx", master_idx) ||
235 jp.
read_kv(
"master_label", master_label) ||
236 jp.
read_kv(
"id_str", id_str)) {
256 jw.
write_kv(
"UniqueID", static_cast<unsigned int>(UniqueID));
261 jw.
write_kv(
"add_wet_dry", add_wet_dry);
262 jw.
write_kv(
"master_idx", master_idx);
263 jw.
write_kv(
"master_label", master_label);
267 for (std::vector<paradesc*>::iterator i = names.begin(); i != names.end(); ++i) {
274 plugdesc::~plugdesc() {
275 for (std::vector<paradesc*>::const_iterator it = names.begin(); it != names.end(); ++it) {
280 LadspaDsp::~LadspaDsp() {
290 if (start ==
self.is_activated) {
293 self.is_activated =
start;
295 if (
self.desc->activate) {
296 self.desc->activate(
self.instance);
299 if (
self.desc->deactivate) {
300 self.desc->deactivate(
self.instance);
306 void LadspaDsp::connect(
int tp,
int i,
float *v) {
307 for (
unsigned int n = 0; n < desc->PortCount; ++n) {
308 if (!LADSPA_IS_PORT_AUDIO(desc->PortDescriptors[n])) {
311 if (desc->PortDescriptors[n] & tp) {
313 desc->connect_port(instance, n, v);
329 void LadspaDsp::set_shortname() {
333 name_str = desc->Name;
334 if (name_str.size() > 15) {
341 void LadspaDsp::init(
unsigned int samplingFreq,
PluginDef *plugin) {
344 if (samplingFreq == 0) {
347 self.instance =
self.desc->instantiate(
self.desc, samplingFreq);
349 for (std::vector<paradesc*>::const_iterator it =
self.pd->
names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
350 self.desc->connect_port(
self.instance, (*it)->index, &
self.ports[(*it)->index]);
354 inline void LadspaDsp::mono_dry_wet(
int count,
float *input0,
float *input1,
float *output0)
356 double fSlow0 = (0.01 * dry_wet);
357 double fSlow1 = (1 - fSlow0);
358 for (
int i=0; i<count; i++) {
359 output0[i] = ((fSlow0 * (double)input1[i]) + (fSlow1 * (double)input0[i]));
363 void LadspaDsp::mono_process(
int count,
float *input,
float *output,
PluginDef *plugin) {
365 assert(
self.is_activated);
367 float wet_out[count];
368 self.connect(LADSPA_PORT_INPUT, 0, input);
369 self.connect(LADSPA_PORT_OUTPUT, 0, wet_out);
370 self.desc->run(
self.instance, count);
371 self.mono_dry_wet(count, input, wet_out, output);
373 self.connect(LADSPA_PORT_INPUT, 0, input);
374 self.connect(LADSPA_PORT_OUTPUT, 0, output);
375 self.desc->run(
self.instance, count);
379 inline void LadspaDsp::stereo_dry_wet(
int count,
float *input0,
float *input1,
float *input2,
float *input3,
float *output0,
float *output1)
381 double fSlow0 = (0.01 * dry_wet);
382 double fSlow1 = (1 - fSlow0);
383 for (
int i=0; i<count; i++) {
384 output0[i] = ((fSlow0 * (double)input2[i]) + (fSlow1 * (double)input0[i]));
385 output1[i] = ((fSlow0 * (double)input3[i]) + (fSlow1 * (double)input1[i]));
389 void LadspaDsp::stereo_process(
int count,
float *input1,
float *input2,
float *output1,
float *output2,
PluginDef *plugin) {
391 assert(
self.is_activated);
393 float wet_out1[count];
394 float wet_out2[count];
395 self.connect(LADSPA_PORT_INPUT, 0, input1);
396 self.connect(LADSPA_PORT_INPUT, 1, input2);
397 self.connect(LADSPA_PORT_OUTPUT, 0, wet_out1);
398 self.connect(LADSPA_PORT_OUTPUT, 1, wet_out2);
399 self.desc->run(
self.instance, count);
400 self.stereo_dry_wet(count, input1, input2, wet_out1, wet_out2, output1, output2);
402 self.connect(LADSPA_PORT_INPUT, 0, input1);
403 self.connect(LADSPA_PORT_INPUT, 1, input2);
404 self.connect(LADSPA_PORT_OUTPUT, 0, output1);
405 self.connect(LADSPA_PORT_OUTPUT, 1, output2);
406 self.desc->run(
self.instance, count);
410 static Glib::ustring TrimLabel(
const char *label,
int cnt_in_row) {
411 const size_t minlen = 60 / cnt_in_row - 1;
412 const size_t maxlen = minlen + 10;
413 const size_t cutlen = (maxlen + minlen) / 2;
414 Glib::ustring pn(label);
415 size_t rem = pn.find_first_of(
"([");
416 if(rem != Glib::ustring::npos) {
419 while ((rem = pn.find_last_of(
" ")) == pn.size()-1) {
426 rem1 = pn.find_first_of(
" ", rem1);
427 if (rem1 == Glib::ustring::npos) {
430 while (rem1 > rem + minlen) {
433 pn.replace(lastpos, 1, 1,
'\n');
434 }
else if (rem1 < rem + maxlen) {
435 if (rem1 == pn.size()) {
439 pn.replace(rem1, 1, 1,
'\n');
442 pn.insert(rem,
"\n");
448 if (rem1 >= pn.size()) {
455 static Glib::ustring TrimEffectLabel(
const char *label,
int cnt_in_row) {
456 const size_t minlen = 60 / cnt_in_row - 1;
457 const size_t maxlen = minlen + 10;
458 const size_t cutlen = (maxlen + minlen) / 2;
459 Glib::ustring pn(label);
464 rem1 = pn.find_first_of(
" ", rem1);
465 if (rem1 == Glib::ustring::npos) {
468 while (rem1 > rem + minlen) {
471 pn.replace(lastpos, 1, 1,
'\n');
472 }
else if (rem1 < rem + maxlen) {
473 if (rem1 == pn.size()) {
477 pn.replace(rem1, 1, 1,
'\n');
480 pn.insert(rem,
"\n");
486 if (rem1 >= pn.size()) {
493 std::string LadspaDsp::make_id(
const paradesc& p) {
497 int LadspaDsp::registerparam(
const ParamReg& reg) {
502 for (std::vector<paradesc*>::const_iterator it =
self.pd->
names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
508 std::vector<paradesc*>::const_iterator it2 = it+1;
509 while (it2 !=
self.pd->
names.end() && !(*it2)->newrow) {
518 const char *nm =
self.desc->PortNames[d->
index];
519 Glib::ustring snm(d->
name);
521 snm = TrimLabel(nm, cnt_in_row);
530 case tp_int: tp =
"S";
break;
536 default: assert(
false);
538 reg.
registerVar(
self.make_id(*d).c_str(), snm.c_str(), tp, nm, &
self.ports[d->
index],
542 self.idd =
self.pd->id_str +
".dry_wet";
543 reg.
registerVar(
self.idd.c_str(),
"",
"S",
"dry/wet",&
self.dry_wet, 100, 0, 100, 1);
547 int LadspaDsp::uiloader(
const UiBuilder& b,
int form) {
555 for (std::vector<paradesc*>::const_iterator it =
self.pd->
names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
556 if ((n)==
self.pd->master_idx) {
562 const char *p =
self.pd->master_label.c_str();
574 for (std::vector<paradesc*>::const_iterator it =
self.pd->
names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
588 for (std::vector<paradesc*>::const_iterator it =
self.pd->
names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
591 if ( (rows == 1) || ( rows > 1 && row > 0 )) {
599 const char *p1 =
self.desc->PortNames[(*it)->index];
600 Glib::ustring trim = TrimEffectLabel(p1, 4);
601 const char *p = trim.c_str();
602 std::string
id =
self.make_id(**it);
603 if ((row == 1 && rows == 1 ) || (row >1 && rows >1 )) {
609 if (!(*it)->has_caption) {
615 if ((*it)->has_caption) {
622 if (!(*it)->has_caption) {
628 if ((*it)->has_caption) {
635 if (!(*it)->has_caption) {
638 if (((*it)->up - (*it)->low)<200) {
645 if ((*it)->has_caption) {
665 void LadspaDsp::del_instance(
PluginDef *plugin) {
676 static void init(
unsigned int samplingFreq,
PluginDef *plugin);
677 static void mono_process(
int count,
float *input,
float *output,
PluginDef *plugin);
678 static void stereo_process(
int count,
float *input1,
float *input2,
float *output1,
float *output2,
PluginDef *plugin);
679 static int activate(
bool start,
PluginDef *plugin);
680 static int registerparam(
const ParamReg& reg);
682 static void del_instance(
PluginDef *plugin);
685 const LilvPlugin* plugin;
687 LilvInstance* instance;
689 Glib::ustring name_str;
692 void connect(
const LilvNode* tp,
int i,
float *v);
693 inline void cleanup();
694 void set_shortname();
697 inline void mono_dry_wet(
int count,
float *input0,
float *input1,
float *output0);
698 inline void stereo_dry_wet(
int count,
float *input0,
float *input1,
float *input2,
float *input3,
float *output0,
float *output1);
699 std::string make_id(
const paradesc& p);
708 LilvNode* plugin_uri = lilv_new_uri(loader.world, plug->
path.c_str());
709 const LilvPlugin* plugin = lilv_plugins_get_by_uri(loader.lv2_plugins, plugin_uri);
710 lilv_node_free(plugin_uri);
712 gx_print_error(
"lv2loader",ustring::compose(_(
"Cannot open LV2 plugin: %1"), plug->
path));
716 int num_inputs = lilv_plugin_get_num_ports_of_class(plugin, loader.lv2_AudioPort, loader.lv2_InputPort, 0);
717 int num_outputs = lilv_plugin_get_num_ports_of_class(plugin, loader.lv2_AudioPort, loader.lv2_OutputPort, 0);
719 if (num_inputs == 1 && num_outputs == 1) {
721 }
else if (num_inputs == 2 && num_outputs == 2) {
724 LilvNode *nm = lilv_plugin_get_name(plugin);
726 "lv2loader",ustring::compose(
727 _(
"cannot use LV2 plugin %1 with %2 inputs and %3 outputs"),
728 lilv_node_as_string(nm), num_inputs, num_outputs));
732 return new Lv2Dsp(plug, plugin, loader, mono);
735 Lv2Dsp::Lv2Dsp(
const plugdesc *plug,
const LilvPlugin* plugin_,
const LadspaLoader& loader_,
bool mono)
736 :
PluginDef(), loader(loader_), plugin(plugin_), name_node(lilv_plugin_get_name(plugin_)), instance(),
737 ports(
new LADSPA_Data[lilv_plugin_get_num_ports(plugin_)]), name_str(), pd(plug), is_activated(
false) {
739 id = pd->id_str.c_str();
742 name = lilv_node_as_string(name_node);
756 inline void Lv2Dsp::cleanup() {
759 activate(
true,
this);
761 activate(
false,
this);
763 lilv_instance_free(instance);
772 lilv_node_free(name_node);
775 int Lv2Dsp::activate(
bool start,
PluginDef *plugin) {
777 if (start ==
self.is_activated) {
780 if (!
self.instance) {
784 self.is_activated =
start;
786 lilv_instance_activate(
self.instance);
788 lilv_instance_deactivate(
self.instance);
793 void Lv2Dsp::connect(
const LilvNode* tp,
int i,
float *v) {
794 unsigned int num_ports = lilv_plugin_get_num_ports(plugin);
795 for (
unsigned int n = 0; n < num_ports; ++n) {
796 const LilvPort* port = lilv_plugin_get_port_by_index(plugin, n);
797 if (!lilv_port_is_a(plugin, port, loader.lv2_AudioPort)) {
800 if (lilv_port_is_a(plugin, port, tp)) {
802 lilv_instance_connect_port(instance, n, v);
818 void Lv2Dsp::set_shortname() {
819 if (!pd->shortname.empty()) {
822 name_str = lilv_node_as_string(name_node);
823 if (name_str.size() > 15) {
830 void Lv2Dsp::init(
unsigned int samplingFreq,
PluginDef *pldef) {
833 if (samplingFreq == 0) {
836 self.instance = lilv_plugin_instantiate(
self.plugin, samplingFreq, 0);
837 if (!
self.instance) {
838 gx_print_error(
"Lv2Dsp", ustring::compose(
"cant init plugin: %1 \n uri: %2",
self.
name,
self.pd->path));
842 for (std::vector<paradesc*>::const_iterator it =
self.pd->names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
843 lilv_instance_connect_port(
self.instance, (*it)->index, &
self.ports[(*it)->index]);
847 inline void Lv2Dsp::mono_dry_wet(
int count,
float *input0,
float *input1,
float *output0)
849 double fSlow0 = (0.01 * dry_wet);
850 double fSlow1 = (1 - fSlow0);
851 for (
int i=0; i<count; i++) {
852 output0[i] = ((fSlow0 * (double)input1[i]) + (fSlow1 * (double)input0[i]));
856 void Lv2Dsp::mono_process(
int count,
float *input,
float *output,
PluginDef *plugin) {
858 assert(
self.is_activated);
859 if (
self.pd->add_wet_dry) {
860 float wet_out[count];
861 self.connect(
self.loader.lv2_InputPort, 0, input);
862 self.connect(
self.loader.lv2_OutputPort, 0, wet_out);
863 lilv_instance_run(
self.instance, count);
864 self.mono_dry_wet(count, input, wet_out, output);
866 self.connect(
self.loader.lv2_InputPort, 0, input);
867 self.connect(
self.loader.lv2_OutputPort, 0, output);
868 lilv_instance_run(
self.instance, count);
872 inline void Lv2Dsp::stereo_dry_wet(
int count,
float *input0,
float *input1,
float *input2,
float *input3,
float *output0,
float *output1)
874 double fSlow0 = (0.01 * dry_wet);
875 double fSlow1 = (1 - fSlow0);
876 for (
int i=0; i<count; i++) {
877 output0[i] = ((fSlow0 * (double)input2[i]) + (fSlow1 * (double)input0[i]));
878 output1[i] = ((fSlow0 * (double)input3[i]) + (fSlow1 * (double)input1[i]));
882 void Lv2Dsp::stereo_process(
int count,
float *input1,
float *input2,
float *output1,
float *output2,
PluginDef *plugin) {
884 assert(
self.is_activated);
885 if (
self.pd->add_wet_dry) {
886 float wet_out1[count];
887 float wet_out2[count];
888 self.connect(
self.loader.lv2_InputPort, 0, input1);
889 self.connect(
self.loader.lv2_InputPort, 1, input2);
890 self.connect(
self.loader.lv2_OutputPort, 0, wet_out1);
891 self.connect(
self.loader.lv2_OutputPort, 1, wet_out2);
892 lilv_instance_run(
self.instance, count);
893 self.stereo_dry_wet(count, input1, input2, wet_out1, wet_out2, output1, output2);
895 self.connect(
self.loader.lv2_InputPort, 0, input1);
896 self.connect(
self.loader.lv2_InputPort, 1, input2);
897 self.connect(
self.loader.lv2_OutputPort, 0, output1);
898 self.connect(
self.loader.lv2_OutputPort, 1, output2);
899 lilv_instance_run(
self.instance, count);
903 std::string Lv2Dsp::make_id(
const paradesc& p) {
907 int Lv2Dsp::registerparam(
const ParamReg& reg) {
912 for (std::vector<paradesc*>::const_iterator it =
self.pd->names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
918 std::vector<paradesc*>::const_iterator it2 = it+1;
919 while (it2 !=
self.pd->names.end() && !(*it2)->newrow) {
928 const LilvPort* port = lilv_plugin_get_port_by_index(
self.plugin, d->
index);
929 LilvNode* nm_node = lilv_port_get_name(
self.plugin, port);
930 const char *nm = lilv_node_as_string(nm_node);
931 Glib::ustring snm(d->
name);
933 snm = TrimLabel(nm, cnt_in_row);
942 case tp_int: tp =
"S";
break;
948 default: assert(
false);
950 reg.
registerVar(
self.make_id(*d).c_str(), snm.c_str(), tp, nm, &
self.ports[d->
index],
953 lilv_node_free(nm_node);
955 self.idd =
self.pd->id_str +
".dry_wet";
956 reg.
registerVar(
self.idd.c_str(),
"",
"S",
"dry/wet",&
self.dry_wet, 100, 0, 100, 1);
960 int Lv2Dsp::uiloader(
const UiBuilder& b,
int form) {
966 if (
self.pd->master_idx >= 0) {
968 for (std::vector<paradesc*>::const_iterator it =
self.pd->names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
969 if ((n)==
self.pd->master_idx) {
975 const char *p =
self.pd->master_label.c_str();
990 for (std::vector<paradesc*>::const_iterator it =
self.pd->names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
997 for (std::vector<paradesc*>::const_iterator it =
self.pd->names.begin(); it !=
self.pd->names.end(); ++it, ++n) {
1000 if ( (rows == 1) || ( rows > 1 && row > 0 )) {
1008 const LilvPort* port = lilv_plugin_get_port_by_index(
self.plugin, (*it)->index);
1009 LilvNode* nm_node = lilv_port_get_name(
self.plugin, port);
1010 const char *p = lilv_node_as_string(nm_node);
1011 std::string
id =
self.make_id(**it);
1012 if ((row == 1 && rows == 1 ) || (row >1 && rows >1 )) {
1015 switch ((*it)->tp) {
1018 if (!(*it)->has_caption) {
1024 if ((*it)->has_caption) {
1031 if (!(*it)->has_caption) {
1037 if ((*it)->has_caption) {
1044 if (!(*it)->has_caption) {
1047 if (((*it)->up - (*it)->low)<200) {
1054 if ((*it)->has_caption) {
1065 lilv_node_free(nm_node);
1067 if (
self.pd->add_wet_dry) {
1075 void Lv2Dsp::del_instance(
PluginDef *plugin) {
1076 delete static_cast<Lv2Dsp*
>(plugin);
1093 : options(options_),
1095 world(lilv_world_new()),
1097 lv2_AudioPort(lilv_new_uri(world, LV2_CORE__AudioPort)),
1098 lv2_ControlPort(lilv_new_uri(world, LV2_CORE__ControlPort)),
1099 lv2_InputPort(lilv_new_uri(world, LV2_CORE__InputPort)),
1100 lv2_OutputPort(lilv_new_uri(world, LV2_CORE__OutputPort)) {
1101 lilv_world_load_all(world);
1102 lv2_plugins = lilv_world_get_all_plugins(world);
1107 for (pluginarray::iterator i = plugins.begin(); i != plugins.end(); ++i) {
1110 lilv_node_free(lv2_OutputPort);
1111 lilv_node_free(lv2_InputPort);
1112 lilv_node_free(lv2_ControlPort);
1113 lilv_node_free(lv2_AudioPort);
1114 lilv_world_free(world);
1119 read_module_list(ml);
1121 gx_print_error(
"ladspaloader",ustring::compose(_(
"Exception in LADSPA list reader: %1"), e.
what()));
1128 for (pluginarray::iterator i = plugins.begin(); i != plugins.end(); ++i) {
1131 plugins = new_plugins;
1138 plugins = new_plugins;
1142 for (pluginarray::iterator i =
begin(); i !=
end(); ++i) {
1144 if ((*i)->path == desc->
path) {
1148 if ((*i)->UniqueID == desc->
UniqueID) {
1158 static_cast<Lv2Dsp*
>(pdef)->set_plugdesc(pdesc);
1160 static_cast<LadspaDsp*
>(pdef)->set_plugdesc(pdesc);
1165 for (
value_pair *p = values; p->value_id; ++p) {
1166 g_free(const_cast<char*>(p->value_id));
1174 for (std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i, ++n) {
1175 const char *p = g_strdup(i->c_str());
1176 values[n].value_id = p;
1177 values[n].value_label = p;
1179 values[n].value_id = 0;
1180 values[n].value_label = 0;
1183 void LadspaLoader::read_module_config(
const std::string& filename,
plugdesc *p) {
1184 std::ifstream ifs(filename.c_str());
1186 gx_print_error(
"ladspaloader", ustring::compose(_(
"can't open %1"), filename));
1230 std::vector<std::string> v;
1238 p->
names.push_back(para);
1245 void LadspaLoader::read_module_list(
pluginarray& ml) {
1275 if (access(fname.c_str(), F_OK) != 0) {
1277 if (access(fname.c_str(), F_OK) != 0) {
1281 if (!fname.empty()) {
1283 read_module_config(fname, p);
1285 gx_print_error(
"ladspaloader",ustring::compose(_(
"read error in file %1: %2"), s, e.
what()));
void write_kv(const char *key, float v)
CmdConnection::msg_type start
void begin_array(bool nl=false)
pluginarray::iterator end()
void end_array(bool nl=false)
void writeJSON(gx_system::JsonWriter &jw)
int(* uiloader)(const UiBuilder &builder, int format)
void set_plugins(pluginarray &new_plugins)
void set_plugdesc(const plugdesc *pd_)
LadspaLoader(const gx_system::CmdlineOptions &options)
std::vector< plugdesc * > pluginarray
void set_plugdesc(const plugdesc *pd_)
float *(* registerVar)(const char *id, const char *name, const char *tp, const char *tooltip, float *var, float val, float low, float up, float step)
void(* create_switch_no_caption)(const char *sw_type, const char *id)
void(* registerEnumVar)(const char *id, const char *name, const char *tp, const char *tooltip, const value_pair *values, float *var, float val, float low, float up, float step)
pluginarray::iterator find(plugdesc *desc)
void write_key(const char *p, bool nl=false)
bool load(pluginarray &p)
void readJSON(gx_system::JsonParser &jp)
deletefunc delete_instance
static LadspaDsp * create(const plugdesc *plug)
static Lv2Dsp * create(const plugdesc *plug, const LadspaLoader &loader)
void gx_print_error(const char *, const std::string &)
bool read_kv(const char *key, float &v)
virtual const char * what() const
void(* create_selector)(const char *id, const char *label)
PluginDef * create(unsigned int idx)
#define PLUGINDEF_VERSION
void(* openHorizontalBox)(const char *label)
registerfunc register_params
std::string get_user_filepath(const std::string &basename) const
void(* create_port_display)(const char *id, const char *label)
void begin_object(bool nl=false)
void(* create_small_rackknobr)(const char *id, const char *label)
Glib::ustring master_label
std::string to_string(const T &t)
void(* create_small_rackknob)(const char *id, const char *label)
std::string get_factory_filepath(const std::string &basename) const
std::vector< paradesc * > names
void gx_print_warning(const char *, const std::string &)
void(* openHorizontalhideBox)(const char *label)
activatefunc activate_plugin
std::string get_plugin_filepath(const std::string &basename) const
void(* create_spin_value)(const char *id, const char *label)
process_stereo_audio stereo_audio
void update_instance(PluginDef *pdef, plugdesc *pdesc)
pluginarray::iterator begin()
void readJSON(gx_system::JsonParser &jp)
void(* set_next_flags)(int flags)
void writeJSON(gx_system::JsonWriter &jw)
process_mono_audio mono_audio
void set_valuelist(const std::vector< std::string > &v)
static std::string get_ladspa_filename(unsigned long uid)
string current_value() const
float current_value_float()
token next(token expect=no_token)
void write(float v, bool nl=false)
void(* create_switch)(const char *sw_type, const char *id, const char *label)
void change_plugins(pluginarray &new_plugins)
void(* create_master_slider)(const char *id, const char *label)
void end_object(bool nl=false)
void(* create_selector_no_caption)(const char *id)
void(* openVerticalBox)(const char *label)
std::string encode_filename(const std::string &s)