Guitarix
gx_engine.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
3  * Copyright (C) 2011 Pete Shorthose
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  * --------------------------------------------------------------------------
19  *
20  *
21  * This is the guitarix engine definitions
22  *
23  *
24  * --------------------------------------------------------------------------
25  */
26 
27 #include "engine.h"
28 #include "valve.h"
29 
30 #include "gx_faust_plugins.h"
31 #include "../plugins/pluginlib.h"
32 
33 namespace gx_engine {
34 
35 /****************************************************************
36  ** class GxEngine
37  */
38 
39 static plugindef_creator builtin_crybaby_plugins[] = {
40  gx_effects::crybaby::plugin,
41  gx_effects::autowah::plugin,
42  0
43 };
44 
45 static int load_crybaby_ui(const UiBuilder& builder, int format) {
46  if (format & UI_FORM_GLADE) {
47  builder.load_glade_file("crybaby_ui.glade");
48  return 0;
49  }
50  if (format & UI_FORM_STACK) {
51  builder.openHorizontalhideBox("");
52  builder.create_master_slider("crybaby.level", _(" level "));
53  builder.closeBox();
54  builder.openHorizontalBox("");
55  {
56  builder.insertSpacer();
57  builder.create_selector("crybaby.autowah", _("Mode"));
58  builder.insertSpacer();
59  builder.insertSpacer();
60  builder.openHorizontalTableBox("");
61  {
62  builder.create_small_rackknobr("crybaby.wah", _(" wah "));
63  builder.create_small_rackknob("crybaby.level", _(" level "));
64  builder.create_small_rackknob("crybaby.wet_dry", _(" dry/wet "));
65  }
66  builder.closeBox();
67  builder.insertSpacer();
68  }
69  builder.closeBox();
70  return 0;
71  }
72  return -1;
73 }
74 
75 static plugindef_creator builtin_wah_plugins[] = {
76  gx_effects::colwah::plugin,
77  gx_effects::dallaswah::plugin,
78  gx_effects::foxwah::plugin,
79  gx_effects::jenwah::plugin,
80  gx_effects::maestrowah::plugin,
81  gx_effects::selwah::plugin,
82  gx_effects::voxwah::plugin,
83  gx_effects::rolwah::plugin,
84  gx_effects::colbwah::plugin,
85  gx_effects::jenbasswah::plugin,
86  0
87 };
88 
89 static int load_wah_ui(const UiBuilder& builder, int format) {
90  if (format & UI_FORM_GLADE) {
91  builder.load_glade_file("wah_ui.glade");
92  return 0;
93  }
94  if (format & UI_FORM_STACK) {
95  builder.openHorizontalhideBox("");
96  builder.create_master_slider("wah.Wah", _("Wah"));
97  builder.closeBox();
98  builder.openHorizontalBox("");
99  {
100  builder.openVerticalBox("");
101  {
102  builder.insertSpacer();
103  builder.create_selector("wah.select", _("Model"));
104  builder.insertSpacer();
105  builder.create_selector("wah.mode", _("Mode"));
106  builder.insertSpacer();
107  }
108  builder.closeBox();
109  builder.openHorizontalTableBox("");
110  {
111  builder.create_small_rackknobr("wah.Wah", _("Wah"));
112  builder.create_small_rackknob("wah.freq", _("Alien Freq"));
113  builder.create_small_rackknob("wah.wet_dry", _(" dry/wet "));
114  }
115  builder.closeBox();
116  builder.insertSpacer();
117  }
118  builder.closeBox();
119  return 0;
120  }
121  return -1;
122 }
123 
124 static plugindef_creator builtin_tonestack_plugins[] = {
125  gx_tonestacks::tonestack_default::plugin,
126  gx_tonestacks::tonestack_bassman::plugin,
127  gx_tonestacks::tonestack_twin::plugin,
128  gx_tonestacks::tonestack_princeton::plugin,
129  gx_tonestacks::tonestack_jcm800::plugin,
130  gx_tonestacks::tonestack_jcm2000::plugin,
131  gx_tonestacks::tonestack_mlead::plugin,
132  gx_tonestacks::tonestack_m2199::plugin,
133  gx_tonestacks::tonestack_ac30::plugin,
134  gx_tonestacks::tonestack_soldano::plugin,
135  gx_tonestacks::tonestack_mesa::plugin,
136  gx_tonestacks::tonestack_jtm45::plugin,
137  gx_tonestacks::tonestack_ac15::plugin,
138  gx_tonestacks::tonestack_peavey::plugin,
139  gx_tonestacks::tonestack_ibanez::plugin,
140  gx_tonestacks::tonestack_roland::plugin,
141  gx_tonestacks::tonestack_ampeg::plugin,
142  gx_tonestacks::tonestack_ampeg_rev::plugin,
143  gx_tonestacks::tonestack_sovtek::plugin,
144  gx_tonestacks::tonestack_bogner::plugin,
145  gx_tonestacks::tonestack_groove::plugin,
146  gx_tonestacks::tonestack_crunch::plugin,
147  gx_tonestacks::tonestack_fender_blues::plugin,
148  gx_tonestacks::tonestack_fender_default::plugin,
149  gx_tonestacks::tonestack_fender_deville::plugin,
150  gx_tonestacks::tonestack_gibsen::plugin,
151  gx_tonestacks::tonestack_engl::plugin,
152  0
153 };
154 
155 static int load_tonestack_ui(const UiBuilder& builder, int format) {
156  if (format & UI_FORM_GLADE) {
157  builder.load_glade_file("amp.tonestack_ui.glade");
158  return 0;
159  }
160  if (format & UI_FORM_STACK) {
161  builder.openHorizontalhideBox("");
162  builder.create_selector("amp.tonestack.select", 0);
163  builder.closeBox();
164  builder.openVerticalBox("");
165  {
166  builder.openHorizontalBox("");
167  {
168  builder.create_selector("amp.tonestack.select", 0);
169  builder.create_small_rackknobr("amp.tonestack.Bass", _("bass"));
170  builder.create_small_rackknobr("amp.tonestack.Middle", _("middle"));
171  builder.create_small_rackknobr("amp.tonestack.Treble", _("treble"));
172  }
173  builder.closeBox();
174  }
175  builder.closeBox();
176  return 0;
177  }
178  return -1;
179 }
180 
181 
182 static plugindef_creator builtin_amp_plugins[] = {
183  gx_amps::gxamp::plugin,
184  gx_amps::gxamp3::plugin,
185  gx_amps::gxamp14::plugin,
186  gx_amps::gxamp10::plugin,
187  gx_amps::gxamp18::plugin,
188 
189  gx_amps::gxamp2::plugin,
190 
191  gx_amps::gxamp9::plugin,
192  gx_amps::gxamp11::plugin,
193  gx_amps::gxamp17::plugin,
194  gx_amps::gxamp13::plugin,
195 
196  gx_amps::gxamp5::plugin,
197  gx_amps::gxamp4::plugin,
198  gx_amps::gxamp15::plugin,
199  gx_amps::gxamp12::plugin,
200 
201  gx_amps::gxamp7::plugin,
202  gx_amps::gxamp8::plugin,
203  gx_amps::gxamp16::plugin,
204  gx_amps::gxamp6::plugin,
205 
206  gx_amps::gxnoamp::plugin, // keep last position (UI switches controls)
207 
208  0
209 };
210 
211 static const char* ampstack_groups[] = {
212  ".amp2.stage1", N_("Tube1"),
213  ".amp2.stage2", N_("Tube2"),
214  ".tube", N_("Tube 1"),
215  ".gxdistortion", N_("Multi Band Distortion"),
216  0
217 };
218 
219 GxEngine::GxEngine(const string& plugin_dir, ParameterGroups& groups, const gx_system::CmdlineOptions& options)
220  : ModuleSequencer(),
221  resamp(),
222  plugin_changed(),
223  ladspaloader(options),
224  controller_map(),
225  // ModuleSelector's
226  crybaby(
227  *this, "crybaby", N_("Crybaby"), N_("Guitar Effects"), builtin_crybaby_plugins,
228  "crybaby.autowah", _("select"), load_crybaby_ui, 0, PGN_POST_PRE),
229  wah(
230  *this, "wah", N_("Wah"), N_("Guitar Effects"), builtin_wah_plugins,
231  "wah.select", _("select"), load_wah_ui, 0, PGN_POST_PRE),
232  tonestack(
233  *this, "amp.tonestack", N_("Tonestack"), N_("Tone Control"),
234  builtin_tonestack_plugins, "amp.tonestack.select",
235  _("select"), load_tonestack_ui, 0, PGN_POST_PRE),
236  ampstack(
237  *this, "ampstack", _("Amp"), "", builtin_amp_plugins,
238  "tube.select", _("select"), 0, ampstack_groups),
239  // internal audio modules
240  noisegate(),
241  monomute(),
242  stereomute(),
243  tuner(*this),
244  midiaudiobuffer(tuner),
245  maxlevel(),
246  oscilloscope(*this),
247  mono_convolver(*this, sigc::mem_fun(mono_chain, &MonoModuleChain::sync), get_param()),
248  stereo_convolver(*this, sigc::mem_fun(stereo_chain, &StereoModuleChain::sync), get_param()),
249  cabinet(*this, sigc::mem_fun(mono_chain, &MonoModuleChain::sync), resamp),
250  cabinet_st(*this, sigc::mem_fun(stereo_chain, &StereoModuleChain::sync), resamp),
251  preamp(*this, sigc::mem_fun(mono_chain, &MonoModuleChain::sync), resamp),
252  contrast(*this, sigc::mem_fun(mono_chain, &MonoModuleChain::sync), resamp),
253  loop(get_param(), sigc::mem_fun(mono_chain,&MonoModuleChain::sync),options.get_loop_dir()),
254  record(*this, 1), record_st(*this, 2), dseq(get_param()),
255  detune(get_param(), *this, sigc::mem_fun(mono_chain, &MonoModuleChain::sync)) {
257  if (!options.get_convolver_watchdog()) {
259  }
260  if (!options.get_xrun_watchdog()) {
261  ov_disabled |= ov_XRun;
262  }
263  if (options.get_mute()) {
265  }
266 #ifdef USE_MIDI_OUT
268 #endif
269 
270  load_static_plugins();
271  // loaded from shared libs
272  if (!plugin_dir.empty()) {
274  }
275 
276  for (unsigned int i = 0; i < ladspaloader.size(); ++i) {
277  PluginDef *p = ladspaloader.create(i);
278  if (p) {
279  pluginlist.add(p);
280  }
281  }
282 
283  // selector objects to switch "alternative" modules
286  add_selector(wah);
289 
290  registerParameter(groups);
291 
292 #ifndef NDEBUG
294 #endif
295 }
296 
299 }
300 
301 void GxEngine::load_static_plugins() {
302  PluginList& pl = pluginlist; // just a shortcut
303 
304  // * mono amp input position *
305 
309  pl.add(gx_effects::noise_shaper::plugin(), PLUGIN_POS_START, PGN_GUI|PGN_FIXED_GUI|PGN_PRE);
310 
311  // rack pre mono modules inserted here
312 
313  pl.add(builtin_amp_plugins, PLUGIN_POS_START, PGN_ALTERNATIVE|PGN_POST);
315  pl.add(gx_effects::softclip::plugin(), PLUGIN_POS_START, PGN_GUI|PGN_FIXED_GUI|PGN_POST);
316 
317  // rack post mono modules inserted here
318 
319  pl.add(gx_effects::bassbooster::plugin(), PLUGIN_POS_END, PGN_GUI|PGN_FIXED_GUI|PGN_POST);
320  pl.add(gx_effects::gx_ampout::plugin(), PLUGIN_POS_END, PGN_GUI|PGN_FIXED_GUI|PGN_POST);
324 
325  // * amp insert position (stereo amp input) *
326 
327  pl.add(gx_effects::gxfeed::plugin(), PLUGIN_POS_START);
328 
329  // rack stereo modules inserted here
330 
331  pl.add(gx_effects::gx_outputlevel::plugin(), PLUGIN_POS_END);
332  pl.add(balance::plugin(), PLUGIN_POS_END, PGN_MODE_BYPASS);
335 
336  // * fx amp output *
337 
338  // dynamic rack modules
339  // builtin
340  pl.add(builtin_crybaby_plugins, PLUGIN_POS_RACK, PGN_ALTERNATIVE);
341  pl.add(builtin_wah_plugins, PLUGIN_POS_RACK, PGN_ALTERNATIVE);
342  pl.add(builtin_tonestack_plugins, PLUGIN_POS_RACK, PGN_ALTERNATIVE);
343 
344  // mono
345  pl.add(gx_effects::gain::plugin(), PLUGIN_POS_RACK, PGN_GUI);
346  pl.add(gx_effects::low_high_pass::plugin(), PLUGIN_POS_RACK, PGN_GUI);
347  pl.add(gx_effects::highbooster::plugin(), PLUGIN_POS_RACK, PGN_GUI);
348  pl.add(gx_effects::selecteq::plugin(), PLUGIN_POS_RACK, PGN_GUI);
355  pl.add(gx_effects::gx_distortion::plugin(), PLUGIN_POS_RACK, PGN_GUI);
356  pl.add(gx_effects::bitdowner::plugin(), PLUGIN_POS_RACK, PGN_GUI);
357  pl.add(pluginlib::ts9sim::plugin(), PLUGIN_POS_RACK, PGN_GUI);
358  pl.add(pluginlib::aclipper::plugin(), PLUGIN_POS_RACK, PGN_GUI);
359  pl.add(pluginlib::mxrdist::plugin(), PLUGIN_POS_RACK, PGN_GUI);
360  pl.add(pluginlib::bossds1::plugin(), PLUGIN_POS_RACK, PGN_GUI);
361  pl.add(pluginlib::bmp::plugin(), PLUGIN_POS_RACK, PGN_GUI);
362  pl.add(gx_effects::impulseresponse::plugin(), PLUGIN_POS_RACK, PGN_GUI);
363  pl.add(gx_effects::compressor::plugin(), PLUGIN_POS_RACK, PGN_GUI);
364  pl.add(gx_effects::expander::plugin(), PLUGIN_POS_RACK, PGN_GUI);
365  pl.add(gx_effects::overdrive::plugin(), PLUGIN_POS_RACK, PGN_GUI);
366  pl.add(gx_effects::echo::plugin(), PLUGIN_POS_RACK, PGN_GUI);
367  pl.add(gx_effects::delay::plugin(), PLUGIN_POS_RACK, PGN_GUI);
369  pl.add(gx_effects::freeverb::plugin(), PLUGIN_POS_RACK, PGN_GUI);
371  pl.add(gx_effects::biquad::plugin(), PLUGIN_POS_RACK, PGN_GUI);
372  pl.add(gx_effects::tremolo::plugin(), PLUGIN_POS_RACK, PGN_GUI);
373  pl.add(gx_effects::phaser_mono::plugin(), PLUGIN_POS_RACK, PGN_GUI);
374  pl.add(gx_effects::chorus_mono::plugin(), PLUGIN_POS_RACK, PGN_GUI);
375  pl.add(gx_effects::flanger_mono::plugin(), PLUGIN_POS_RACK, PGN_GUI);
376  pl.add(pluginlib::flanger_gx::plugin(), PLUGIN_POS_RACK, PGN_GUI);
377  pl.add(gx_effects::gx_feedback::plugin(), PLUGIN_POS_RACK, PGN_GUI);
378  pl.add(gx_effects::peak_eq::plugin(), PLUGIN_POS_RACK, PGN_GUI);
379  pl.add(gx_effects::digital_delay::plugin(), PLUGIN_POS_RACK, PGN_GUI);
383  pl.add(pluginlib::abgate::plugin(), PLUGIN_POS_RACK);
384  pl.add(gx_effects::ring_modulator::plugin(), PLUGIN_POS_RACK, PGN_GUI);
385  pl.add(gx_effects::graphiceq::plugin(), PLUGIN_POS_RACK, PGN_GUI);
386  pl.add(pluginlib::vibe::plugin_mono(), PLUGIN_POS_RACK);
387  pl.add(pluginlib::mbc::plugin(), PLUGIN_POS_RACK, PGN_GUI);
388  pl.add(pluginlib::mbd::plugin(), PLUGIN_POS_RACK, PGN_GUI);
389  pl.add(pluginlib::mbe::plugin(), PLUGIN_POS_RACK, PGN_GUI);
390  pl.add(pluginlib::mbdel::plugin(), PLUGIN_POS_RACK, PGN_GUI);
391  pl.add(pluginlib::mbclipper::plugin(), PLUGIN_POS_RACK, PGN_GUI);
392  pl.add(pluginlib::bassboom::plugin(), PLUGIN_POS_RACK, PGN_GUI);
393  pl.add(pluginlib::mbchor::plugin(), PLUGIN_POS_RACK, PGN_GUI);
394  pl.add(pluginlib::jcm800pre::plugin(), PLUGIN_POS_RACK, PGN_GUI);
395  pl.add(pluginlib::gcb_95::plugin(), PLUGIN_POS_RACK, PGN_GUI);
396  pl.add(gx_effects::duck_delay::plugin(), PLUGIN_POS_RACK, PGN_GUI);
397  pl.add(pluginlib::reversedelay::plugin(), PLUGIN_POS_RACK, PGN_GUI);
398  pl.add(gx_effects::baxandall::plugin(), PLUGIN_POS_RACK, PGN_GUI);
399  pl.add(gx_effects::distortion2::plugin(), PLUGIN_POS_RACK, PGN_GUI);
400  pl.add(gx_effects::fuzzface::plugin(), PLUGIN_POS_RACK, PGN_GUI);
401  pl.add(gx_effects::trbuff::plugin(), PLUGIN_POS_RACK, PGN_GUI);
402  pl.add(pluginlib::fuzzfacefm::plugin(), PLUGIN_POS_RACK, PGN_GUI);
403  pl.add(pluginlib::fuzzfacerm::plugin(), PLUGIN_POS_RACK, PGN_GUI);
404  pl.add(pluginlib::hornet::plugin(), PLUGIN_POS_RACK, PGN_GUI);
405  pl.add(pluginlib::susta::plugin(), PLUGIN_POS_RACK, PGN_GUI);
406  pl.add(pluginlib::hfb::plugin(), PLUGIN_POS_RACK, PGN_GUI);
407  pl.add(pluginlib::muff::plugin(), PLUGIN_POS_RACK, PGN_GUI);
408  pl.add(pluginlib::scream::plugin(), PLUGIN_POS_RACK, PGN_GUI);
409  pl.add(pluginlib::lpbboost::plugin(), PLUGIN_POS_RACK, PGN_GUI);
410  pl.add(pluginlib::foxeylady::plugin(), PLUGIN_POS_RACK, PGN_GUI);
411  pl.add(pluginlib::hogsfoot::plugin(), PLUGIN_POS_RACK, PGN_GUI);
412  pl.add(pluginlib::cstb::plugin(), PLUGIN_POS_RACK, PGN_GUI);
413  pl.add(pluginlib::coverd::plugin(), PLUGIN_POS_RACK, PGN_GUI);
414  pl.add(pluginlib::rangem::plugin(), PLUGIN_POS_RACK, PGN_GUI);
415  pl.add(pluginlib::ruin::plugin(), PLUGIN_POS_RACK, PGN_GUI);
416  pl.add(pluginlib::ffreak::plugin(), PLUGIN_POS_RACK, PGN_GUI);
417  pl.add(pluginlib::fumaster::plugin(), PLUGIN_POS_RACK, PGN_GUI);
418  pl.add(pluginlib::fuzzdrive::plugin(), PLUGIN_POS_RACK, PGN_GUI);
419  pl.add(pluginlib::rolandwah::plugin(), PLUGIN_POS_RACK, PGN_GUI);
420  pl.add(pluginlib::astrofuzz::plugin(), PLUGIN_POS_RACK, PGN_GUI);
421  pl.add(pluginlib::buffb::plugin(), PLUGIN_POS_RACK, PGN_GUI);
422  pl.add(pluginlib::eldist::plugin(), PLUGIN_POS_RACK, PGN_GUI);
423  pl.add(pluginlib::mole::plugin(), PLUGIN_POS_RACK, PGN_GUI);
424  pl.add(pluginlib::buzz::plugin(), PLUGIN_POS_RACK, PGN_GUI);
425  pl.add(pluginlib::bfuzz::plugin(), PLUGIN_POS_RACK, PGN_GUI);
426  pl.add(pluginlib::axface::plugin(), PLUGIN_POS_RACK, PGN_GUI);
427  pl.add(pluginlib::metronome::plugin(), PLUGIN_POS_RACK, PGN_GUI);
428  pl.add(pluginlib::vumeter::plugin(), PLUGIN_POS_RACK, PGN_GUI);
429  // stereo
430  pl.add(gx_effects::chorus::plugin(), PLUGIN_POS_RACK, PGN_GUI);
431  pl.add(gx_effects::flanger::plugin(), PLUGIN_POS_RACK, PGN_GUI);
432  pl.add(gx_effects::phaser::plugin(), PLUGIN_POS_RACK, PGN_GUI);
433  pl.add(gx_effects::stereodelay::plugin(), PLUGIN_POS_RACK, PGN_GUI);
434  pl.add(gx_effects::stereoecho::plugin(), PLUGIN_POS_RACK, PGN_GUI);
435  pl.add(gx_effects::moog::plugin(), PLUGIN_POS_RACK, PGN_GUI);
436  pl.add(gx_amps::gx_ampmodul::plugin(), PLUGIN_POS_RACK, PGN_GUI);
437  pl.add(gx_effects::tonecontroll::plugin(), PLUGIN_POS_RACK, PGN_GUI);
438  pl.add(gx_effects::digital_delay_st::plugin(),PLUGIN_POS_RACK, PGN_GUI);
441  pl.add(gx_effects::stereoverb::plugin(), PLUGIN_POS_RACK, PGN_GUI);
442  pl.add(pluginlib::zita_rev1::plugin(), PLUGIN_POS_RACK);
443  pl.add(pluginlib::vibe::plugin_stereo(), PLUGIN_POS_RACK);
444  pl.add(pluginlib::mbcs::plugin(), PLUGIN_POS_RACK, PGN_GUI);
445  pl.add(gx_effects::dattorros_progenitor::plugin(),PLUGIN_POS_RACK, PGN_GUI);
446  pl.add(gx_effects::panoram_enhancer::plugin(),PLUGIN_POS_RACK, PGN_GUI);
447  pl.add(gx_effects::bass_enhancer::plugin(), PLUGIN_POS_RACK, PGN_GUI);
448  pl.add(gx_effects::ring_modulator_st::plugin(),PLUGIN_POS_RACK, PGN_GUI);
449  pl.add(gx_effects::duck_delay_st::plugin(), PLUGIN_POS_RACK, PGN_GUI);
451  pl.add(pluginlib::vumeter_st::plugin(), PLUGIN_POS_RACK, PGN_GUI);
452 }
453 
454 static LadspaLoader::pluginarray::iterator find_plugin(LadspaLoader::pluginarray& ml, plugdesc *pl) {
455  for (LadspaLoader::pluginarray::iterator i = ml.begin(); i != ml.end(); ++i) {
456  if (pl->quirks & is_lv2) {
457  if ((*i)->path == pl->path) {
458  return i;
459  }
460  } else {
461  if ((*i)->UniqueID == pl->UniqueID) {
462  return i;
463  }
464  }
465  }
466  return ml.end();
467 }
468 
470  // load plugindesc list
472  ladspaloader.load(ml);
473  // look for removed and changed plugins
474  std::vector<PluginChange> pv;
475  for (LadspaLoader::pluginarray::iterator i = ladspaloader.begin(); i != ladspaloader.end(); ++i) {
476  Plugin *pl = pluginlist.lookup_plugin((*i)->id_str);
477  LadspaLoader::pluginarray::iterator j = find_plugin(ml, *i);
478  if (j == ml.end()) {
479  pl->set_on_off(false);
480  pv.push_back(PluginChange(pl, PluginChange::remove));
481  } else {
482  ladspaloader.update_instance(pl->get_pdef(), *j);
483  if (pl->get_pdef()->register_params) {
484  pmap.set_replace_mode(true);
486  // FIXME we need to register on_off parameters new when ui is changed
487  bool state = pl->get_on_off();
489  pl->set_on_off(state);
490  preg.plugin = pl->get_pdef();
491  pl->get_pdef()->register_params(preg);
492  pmap.set_replace_mode(false);
493  }
494  pv.push_back(
495  PluginChange(
496  pl,
497  ((*j)->category == (*i)->category ? PluginChange::update : PluginChange::update_category)));
498  }
499  }
500 
501  // update engine for plugins to be removed
505  // remove plugins
506  for (std::vector<PluginChange>::iterator i = pv.begin(); i != pv.end(); ++i) {
507  if (i->status == PluginChange::remove) {
508  plugin_changed(i->pl, PluginChange::remove);
510  pluginlist.delete_module(i->pl);
511  } else {
512  plugin_changed(i->pl, i->status);
513  }
514  }
515  // add new plugins (engine)
516  for (LadspaLoader::pluginarray::const_iterator i = ml.begin(); i != ml.end(); ++i) {
517  if (ladspaloader.find(*i) == ladspaloader.end()) {
518  PluginDef *plugin = ladspaloader.create(*i);
519  if (plugin) {
520  Plugin *p = pluginlist.add(plugin);
522  plugin->set_samplerate(get_samplerate(), plugin);
523  plugin_changed(p, PluginChange::add);
524  }
525  }
526  }
527  // update ladspaloader with new list
528  ladspaloader.set_plugins(ml);
529  plugin_changed(0, PluginChange::update);
530 }
531 
532 } /* end of gx_engine namespace */
CabinetConvolver cabinet
Definition: gx_engine.h:92
pluginarray::iterator end()
PluginDef * get_pdef()
OscilloscopeAdapter oscilloscope
Definition: gx_engine.h:89
TunerAdapter tuner
Definition: gx_engine.h:86
void(* insertSpacer)()
Definition: gx_plugin.h:78
void unregisterPlugin(Plugin *pl, ParamMap &param, ParameterGroups &groups)
int load_from_path(const string &path, PluginPos pos=PLUGIN_POS_RACK)
void registerParameter(ParameterGroups &groups)
void set_plugins(pluginarray &new_plugins)
PluginDef * plugin
Definition: gx_plugin.h:123
ModuleSelectorFromList ampstack
Definition: gx_engine.h:81
#define N_(String)
std::vector< plugdesc * > pluginarray
MaxLevel maxlevel
Definition: gx_engine.h:88
bool get_on_off() const
ModuleSelectorFromList crybaby
Definition: gx_engine.h:78
#define UI_FORM_GLADE
Definition: gx_plugin.h:61
GxEngine(const string &plugin_dir, ParameterGroups &groups, const gx_system::CmdlineOptions &options)
Definition: gx_engine.cpp:219
void(* closeBox)()
Definition: gx_plugin.h:77
pluginarray::iterator find(plugdesc *desc)
void(* load_glade_file)(const char *fname)
Definition: gx_plugin.h:66
ModuleSelectorFromList tonestack
Definition: gx_engine.h:80
bool load(pluginarray &p)
smbPitchShift detune
Definition: gx_engine.h:100
ConvolverStereoAdapter stereo_convolver
Definition: gx_engine.h:91
ParameterGroups & get_group_table()
PreampConvolver preamp
Definition: gx_engine.h:94
void(* create_selector)(const char *id, const char *label)
Definition: gx_plugin.h:95
PluginDef * create(unsigned int idx)
void(* openHorizontalBox)(const char *label)
Definition: gx_plugin.h:71
registerfunc register_params
Definition: gx_plugin.h:202
void registerPlugin(Plugin *pl, ParamMap &param, ParameterGroups &groups)
void add_selector(ModuleSelector &sel)
static PluginDef outputgate
void delete_module(Plugin *pl)
void set_replace_mode(bool mode)
Definition: gx_parameter.h:538
bool get_convolver_watchdog() const
Definition: gx_system.h:508
void ladspaloader_update_plugins()
Definition: gx_engine.cpp:469
void(* create_small_rackknobr)(const char *id, const char *label)
Definition: gx_plugin.h:98
MidiAudioBuffer midiaudiobuffer
Definition: gx_engine.h:87
ContrastConvolver contrast
Definition: gx_engine.h:95
ConvolverMonoAdapter mono_convolver
Definition: gx_engine.h:90
Plugin * lookup_plugin(const std::string &id) const
PluginDef *(* plugindef_creator)()
void set_state(GxEngineState state)
void(* create_small_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:86
#define UI_FORM_STACK
Definition: gx_plugin.h:60
void(* openHorizontalhideBox)(const char *label)
Definition: gx_plugin.h:72
bool get_xrun_watchdog() const
Definition: gx_system.h:507
void printlist(bool ordered=true)
DrumSequencer dseq
Definition: gx_engine.h:99
ModuleSelectorFromList wah
Definition: gx_engine.h:79
MonoMute monomute
Definition: gx_engine.h:84
void update_instance(PluginDef *pdef, plugdesc *pdesc)
LiveLooper loop
Definition: gx_engine.h:96
pluginarray::iterator begin()
NoiseGate noisegate
Definition: gx_engine.h:83
static void set_overload_interval(int i)
void(* openHorizontalTableBox)(const char *label)
Definition: gx_plugin.h:73
inifunc set_samplerate
Definition: gx_plugin.h:200
void set_dep_module(Plugin *dep)
void set_on_off(bool v) const
void rescueParameter(Plugin *pl, ParamMap &param)
CabinetStereoConvolver cabinet_st
Definition: gx_engine.h:93
int get_sporadic_overload() const
Definition: gx_system.h:506
int add(Plugin *pl, PluginPos pos, int flags)
SCapture record_st
Definition: gx_engine.h:98
void(* create_master_slider)(const char *id, const char *label)
Definition: gx_plugin.h:84
StereoMute stereomute
Definition: gx_engine.h:85
void(* openVerticalBox)(const char *label)
Definition: gx_plugin.h:68