Guitarix
gx_stackbox_builder.cpp
Go to the documentation of this file.
1 #include "guitarix.h" // NOLINT
2 
3 #include <glibmm/i18n.h> // NOLINT
4 
5 // -------- the gx_head user interface build instruktions
6 
7 namespace gx_gui {
8 
9 // Paint Functions for Gxw::PaintBox
10 
11 const char *pb_gx_rack_amp_expose = "gx_rack_amp_expose";
12 const char *pb_rectangle_skin_color_expose = "rectangle_skin_color_expose";
13 const char *pb_zac_expose = "zac_expose";
14 const char *pb_gxhead_expose = "gxhead_expose";
15 const char *pb_RackBox_expose = "RackBox_expose";
16 const char *pb_gxrack_expose = "gxrack_expose";
17 const char *pb_level_meter_expose = "level_meter_expose";
18 
19 
20 int precision(double n) {
21  if (n < 0.009999)
22  return 3;
23  else if (n < 0.099999)
24  return 2;
25  else if (n < 0.999999)
26  return 1;
27  else
28  return 0;
29 }
30 
31 string fformat(float value, float step) {
32  ostringstream buf;
33  buf << fixed << setprecision(precision(step)) << value;
34  return buf.str();
35 }
36 
37 bool button_press_cb(GdkEventButton *event, gx_engine::GxMachineBase& machine, const std::string& id) {
38  if (event->button == 2) {
39  if (!machine.midi_get_config_mode()) {
40  new gx_main_midi::MidiConnect(event, machine.get_parameter(id), machine);
41  }
42  return true;
43  }
44  return false;
45 }
46 
47 
48 /****************************************************************
49  ** class WidgetStack
50  */
51 
52 void WidgetStack::container_add(Gtk::Widget *w) {
53  dynamic_cast<Gtk::Container*>(top())->add(*w);
54 }
55 
56 void WidgetStack::box_pack_start(Gtk::Widget *w, bool expand, bool fill, int padding) {
57  dynamic_cast<Gtk::Box*>(top())->pack_start(*w, expand, fill, padding);
58 }
59 
60 void WidgetStack::notebook_append_page(Gtk::Widget *w, Gtk::Widget *label) {
61  dynamic_cast<Gtk::Notebook*>(top())->append_page(*w, *label);
62 }
63 
64 Gtk::Widget *WidgetStack::add(Gtk::Widget *w, const Glib::ustring& label) {
65  w->show();
66  Gtk::Widget *t = top();
67  Gtk::Notebook *n = dynamic_cast<Gtk::Notebook*>(t);
68  if (n) {
69  n->append_page(*w, *manage(new Gtk::Label(label)));
70  return w;
71  }
72  Gtk::Box *b = dynamic_cast<Gtk::Box*>(t);
73  if (b) {
74  b->pack_start(*w, true, true, 0);
75  return w;
76  }
77  Gtk::Container *c = dynamic_cast<Gtk::Container*>(t);
78  if (c) {
79  c->add(*w);
80  return w;
81  }
82  assert(false);
83  return w;
84 }
85 
86 /****************************************************************
87  ** class StackBoxBuilder
88  */
89 
91  gx_engine::GxMachineBase& machine_, Gxw::WaveView &fWaveView_, Gtk::Label &convolver_filename_label_,
92  Gtk::Label &convolver_mono_filename_label_, Glib::RefPtr<Gdk::Pixbuf> window_icon_)
93  : fBox(), machine(machine_),
94  fWaveView(fWaveView_), convolver_filename_label(convolver_filename_label_),
95  convolver_mono_filename_label(convolver_mono_filename_label_),
96  widget(), accels(), window_icon(window_icon_), next_flags(0) {
97 }
98 
100 }
101 
102 void StackBoxBuilder::openVerticalMidiBox(const char* label) {
103  openVerticalBox(label);
104 }
105 
107  widget = new Gtk::HBox();
108  widget->show();
109  fBox.push(manage(widget));
110 }
111 
112 #ifndef NDEBUG
113 void wnotify(gpointer data, GObject *where_the_object_was) {
114  printf("WN %p %p\n", where_the_object_was, data);
115 }
116 
117 // check if object will be finalized
118 void trace_finalize(Glib::Object *o, int n) {
119  g_object_weak_ref(o->gobj(), wnotify, GINT_TO_POINTER(n));
120 }
121 #endif
122 
123 void StackBoxBuilder::fetch(Gtk::Widget*& mainbox, Gtk::Widget*& minibox) {
124  fBox.pop();
125  assert(fBox.empty());
126  mainbox = widget;
127  Glib::ListHandle<Gtk::Widget*> l = widget->get_children();
128  if (l.size() == 2) {
129  Glib::ListHandle<Gtk::Widget*>::iterator i = l.begin();
130  minibox = new Gtk::VBox();
131  minibox->show();
132  (*i)->show();
133  (*i)->reparent(*minibox);
134  } else {
135  minibox = 0;
136  }
137 }
138 
139 void StackBoxBuilder::get_box(const std::string& name, Gtk::Widget*& mainbox, Gtk::Widget*& minibox) {
140  struct {
141  const char *name;
142  void (StackBoxBuilder::*func)();
143  } mapping[] = {
144  // mono
145  { "oscilloscope", &StackBoxBuilder::make_rackbox_oscilloscope },
146  { "jconv_mono", &StackBoxBuilder::make_rackbox_jconv_mono },
148  // stereo
150  };
151  mainbox = minibox = 0;
152  for (unsigned int i = 0; i < sizeof(mapping) / sizeof(mapping[0]); ++i) {
153  if (name == mapping[i].name) {
154  prepare();
155  (this->*mapping[i].func)();
156  fetch(mainbox, minibox);
157  }
158  }
159 }
160 
161 void StackBoxBuilder::loadRackFromBuilder(const Glib::RefPtr<GxBuilder>& bld) {
162  if (!bld->has_object("rackbox")) {
163  gx_print_error("load_ui Error", "can't find widget 'rackbox'");
164  return;
165  }
166  Gtk::Widget* w;
167  if (bld->has_object("minibox")) {
168  bld->find_widget("minibox", w);
169  fBox.add(w);
170  }
171  bld->find_widget("rackbox", w);
172  fBox.add(w);
173 
174  // find fastmeters in glade UI's and add a timeout callback to set the levels
175  // fastmeters must have id=gxfastmeterN were N starts with 1
176  std::string id;
177  for (int i = 1; i<12;++i) {
178  Glib::ustring fm = "gxfastmeter" + gx_system::to_string(i);
179  if (bld->has_object(fm)) {
180  Gxw::FastMeter *fastmeter;
181  bld->find_widget(fm, fastmeter);
182  fastmeter->get_property("var_id",id);
183  fastmeter->set_name("simplemeter");
184  if (!id.empty())
185  Glib::signal_timeout().connect(sigc::bind<Gxw::FastMeter*>(sigc::bind<const std::string>(
186  sigc::mem_fun(*this, &StackBoxBuilder::set_simple),id), fastmeter), 60);
187  fastmeter->set_by_power(0.0001);
188  } else {
189  break;
190  }
191  }
192  for (int i = 1; i<12;++i) {
193  Glib::ustring fm = "gxfastmeter" + gx_system::to_string(i)+ ":meterframe";
194  if (bld->has_object(fm)) {
195  Gxw::FastMeter *fastmeter;
196  bld->find_widget(fm, fastmeter);
197  fastmeter->get_property("var_id",id);
198  //fastmeter->set_name("meterframe");
199  if (!id.empty())
200  Glib::signal_timeout().connect(sigc::bind<Gxw::FastMeter*>(sigc::bind<const std::string>(
201  sigc::mem_fun(*this, &StackBoxBuilder::set_simple),id), fastmeter), 60);
202  fastmeter->set_by_power(0.0001);
203  } else {
204  break;
205  }
206  }
207  for (int i = 1; i<12;++i) {
208  Glib::ustring fm = "gxcompressormeter" + gx_system::to_string(i);
209  if (bld->has_object(fm)) {
210  Gxw::FastMeter *fastmeter;
211  bld->find_widget(fm, fastmeter);
212  fastmeter->get_property("var_id",id);
213  fastmeter->set_name("simplemeter");
214  if (!id.empty())
215  Glib::signal_timeout().connect(sigc::bind<Gxw::FastMeter*>(sigc::bind<const std::string>(
216  sigc::mem_fun(*this, &StackBoxBuilder::set_compressor_level),id), fastmeter), 60);
217  fastmeter->set_c_level(0.0);
218  } else {
219  break;
220  }
221  }
222  // find feedback switches and connect a timeout callback to update the UI elements.
223  // feedback switches must have the id gxfswitchN were N starts with 1
224  for (int i = 1; i<12;++i) {
225  Glib::ustring fm = "gxfswitch" + gx_system::to_string(i);
226  if (bld->has_object(fm)) {
227  Gxw::Switch *sw;
228  bld->find_widget(fm, sw);
229  sw->get_property("var_id",id);
230  sw->set_name("effect_on_off");
231  if (!id.empty())
232  Glib::signal_timeout().connect(sigc::bind<Gxw::Switch*>(sigc::bind<const std::string>(
233  sigc::mem_fun(*this, &StackBoxBuilder::set_engine_cp_value),id),sw), 60);
234  } else {
235  break;
236  }
237  }
238  // find feedback Regler and connect a timeout callback to update the UI elements.
239  // were Regler could be GxKnob's or GxSlider's
240  // feedback Regler must have the id gxfreglerN were N starts with 1
241  for (int i = 1; i<12;++i) {
242  Glib::ustring fm = "gxfregler" + gx_system::to_string(i);
243  if (bld->has_object(fm)) {
244  Gxw::Regler *regler;
245  bld->find_widget(fm, regler);
246  regler->get_property("var_id",id);
247  if (!id.empty())
248  Glib::signal_timeout().connect(sigc::bind<Gxw::Regler*>(sigc::bind<const std::string>(
249  sigc::mem_fun(*this, &StackBoxBuilder::set_regler_cp_value),id),regler), 60);
250  } else {
251  break;
252  }
253  }
254 }
255 
256 static const char *rackbox_ids[] = { "rackbox", "minibox", 0 };
257 
258 void StackBoxBuilder::loadRackFromGladeFile(const char *fname) {
259  loadRackFromBuilder(
260  GxBuilder::create_from_file(
261  machine.get_options().get_builder_filepath(fname), &machine, rackbox_ids));
262 }
263 
264 void StackBoxBuilder::loadRackFromGladeData(const char *xmldesc) {
265  loadRackFromBuilder(GxBuilder::create_from_string(xmldesc, &machine, rackbox_ids));
266 }
267 
268 void StackBoxBuilder::addwidget(Gtk::Widget *widget) {
269  if (widget) {
270  fBox.container_add(manage(widget));
271  }
272  next_flags = 0;
273 }
274 
275 void StackBoxBuilder::addSmallJConvFavButton(const char* label, gx_jconv::IRWindow *irw) {
276  Gtk::Button *button = new Gtk::Button();
277  button->set_name("smallbutton");
278  Gtk::Label *lab = new Gtk::Label(label);
279  Pango::FontDescription font = lab->get_style()->get_font();
280  font.set_size(7*Pango::SCALE);
281  font.set_weight(Pango::WEIGHT_NORMAL);
282  lab->modify_font(font);
283  button->add(*manage(lab));
284  //lab->set_name("rack_label_inverse");
285  lab->set_padding(5,0);
286  fBox.add(manage(button), label);
287  lab->show();
288  button->signal_clicked().connect(
289  sigc::mem_fun(*irw, &gx_jconv::IRWindow::reload_and_show));
290 }
291 
292 void StackBoxBuilder::set_convolver_filename(const gx_engine::GxJConvSettings *jcs) {
293  convolver_filename_label.set_label(jcs->getIRFile());
294 }
295 
296 void StackBoxBuilder::set_convolver_mono_filename(const gx_engine::GxJConvSettings *jcs) {
297  convolver_mono_filename_label.set_label(jcs->getIRFile());
298 }
299 
300 void StackBoxBuilder::openSetLabelBox() {
301  Gtk::VBox *box = new Gtk::VBox();
302  box->set_homogeneous(false);
303  box->set_spacing(0);
304  box->set_border_width(0);
305  convolver_filename_label.set_name("rack_label");
306  Pango::FontDescription font = convolver_filename_label.get_style()->get_font();
307  font.set_size(8*Pango::SCALE);
308  font.set_weight(Pango::WEIGHT_BOLD);
309  convolver_filename_label.modify_font(font);
310  box->pack_start(convolver_filename_label, false, false, 0);
311  box->show_all();
312  gx_engine::JConvParameter *jcp = dynamic_cast<gx_engine::JConvParameter*>(&machine.get_parameter("jconv.convolver"));
313  assert(jcp);
314  convolver_filename_label.set_label(jcp->get_value().getIRFile());
315  jcp->signal_changed().connect(
316  sigc::mem_fun(*this, &StackBoxBuilder::set_convolver_filename));
317  fBox.box_pack_start(manage(box), false);
318  fBox.push(box);
319 }
320 
321 void StackBoxBuilder::openSetMonoLabelBox() {
322  Gtk::VBox *box = new Gtk::VBox();
323  box->set_homogeneous(false);
324  box->set_spacing(0);
325  box->set_border_width(0);
326  convolver_mono_filename_label.set_name("rack_label");
327  Pango::FontDescription font = convolver_mono_filename_label.get_style()->get_font();
328  font.set_size(8*Pango::SCALE);
329  font.set_weight(Pango::WEIGHT_BOLD);
330  convolver_mono_filename_label.modify_font(font);
331  box->pack_start(convolver_mono_filename_label, true, false, 0);
332  box->show_all();
333  gx_engine::JConvParameter *jcp = dynamic_cast<gx_engine::JConvParameter*>(&machine.get_parameter("jconv_mono.convolver"));
334  assert(jcp);
335  convolver_mono_filename_label.set_label(jcp->get_value().getIRFile());
336  jcp->signal_changed().connect(
337  sigc::mem_fun(*this, &StackBoxBuilder::set_convolver_mono_filename));
338  fBox.box_pack_start(manage(box));
339  fBox.push(box);
340 }
341 
342 void StackBoxBuilder::addJConvButton(const char* label, gx_jconv::IRWindow *irw) {
343  Gtk::Button *button = new Gtk::Button();
344  button->set_can_default(false);
345  button->set_can_focus(false);
346  Gtk::Label *lab = new Gtk::Label(label);
347  //Pango::FontDescription font = lab->get_style()->get_font();
348  //font.set_size(10*Pango::SCALE);
349  //font.set_weight(Pango::WEIGHT_NORMAL);
350  //lab->modify_font(font);
351  button->add(*manage(lab));
352  //lab->set_name("rack_label_inverse");
353  Gtk::Alignment *al = new Gtk::Alignment(0.0, 0.5, 0.0, 0.0);
354  al->add(*manage(button));
355  al->show_all();
356  fBox.box_pack_start(manage(al), false);
357  button->signal_clicked().connect(
358  sigc::mem_fun(*irw, &gx_jconv::IRWindow::reload_and_show));
359 }
360 
361 void StackBoxBuilder::set_next_flags(int flags) {
362  next_flags = flags;
363 }
364 
365 bool StackBoxBuilder::set_simple(Gxw::FastMeter *fastmeter,const std::string id) {
366  if (machine.parameter_hasId(id)) {
367  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off"))
368  fastmeter->set_by_power(machine.get_parameter_value<float>(id));
369  else
370  fastmeter->set_by_power(0.0001);
371  return true;
372  } else {
373  return false;
374  }
375 }
376 
377 bool StackBoxBuilder::set_compressor_level(Gxw::FastMeter *fastmeter,const std::string id) {
378  if (machine.parameter_hasId(id)) {
379  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off"))
380  fastmeter->set_c_level(machine.get_parameter_value<float>(id));
381  else
382  fastmeter->set_c_level(0.0);
383  return true;
384  } else {
385  return false;
386  }
387 }
388 
389 void StackBoxBuilder::create_simple_meter(const std::string& id) {
390  Gxw::FastMeter *fastmeter = new Gxw::FastMeter();
391  fastmeter->set_hold_count(5);
392  fastmeter->set_property("dimen",2);
393  fastmeter->set_property("type",0);
394  Glib::signal_timeout().connect(sigc::bind<Gxw::FastMeter*>(sigc::bind<const std::string>(
395  sigc::mem_fun(*this, &StackBoxBuilder::set_simple),id), fastmeter), 60);
396  fastmeter->set_by_power(0.0001);
397  Gtk::HBox *box = new Gtk::HBox();
398  box->set_border_width(2);
399  box->pack_start(*Gtk::manage(static_cast<Gtk::Widget*>(fastmeter)),Gtk::PACK_SHRINK);
400  box->show_all();
401  fBox.box_pack_start(manage(box),false);
402 }
403 
404 void StackBoxBuilder::create_simple_c_meter(const std::string& id, const std::string& idm, const char *label) {
405  Gxw::FastMeter *fastmeter = new Gxw::FastMeter();
406  fastmeter->set_hold_count(5);
407  fastmeter->set_property("dimen",2);
408  fastmeter->set_property("type",0);
409  fastmeter->set_name("simplemeter");
410  Glib::signal_timeout().connect(sigc::bind<Gxw::FastMeter*>(sigc::bind<const std::string>(
411  sigc::mem_fun(*this, &StackBoxBuilder::set_simple),id), fastmeter), 60);
412  fastmeter->set_by_power(0.0001);
413  Gxw::LevelSlider *w = new UiRegler<Gxw::LevelSlider>(machine, idm);
414  w->set_name("lmw");
415  GxPaintBox *box = new GxPaintBox("simple_level_meter_expose");
416  box->set_border_width(2);
417  box->pack_start(*Gtk::manage(static_cast<Gtk::Widget*>(fastmeter)),Gtk::PACK_SHRINK);
418  box->add(*Gtk::manage(static_cast<Gtk::Widget*>(w)));
419  if (label && label[0]) {
420  Gtk::VBox *boxv = new Gtk::VBox();
421  //boxv->set_property("orientation",Gtk::ORIENTATION_VERTICAL);
422  boxv->set_homogeneous(false);
423  boxv->set_spacing(0);
424  // boxv->set_border_width(4);
425  Gtk::Label *lab = new Gtk::Label(label);
426  Pango::FontDescription font = lab->get_style()->get_font();
427  font.set_size(6*Pango::SCALE);
428  font.set_weight(Pango::WEIGHT_NORMAL);
429  lab->modify_font(font);
430  lab->set_name("beffekt_label");
431  boxv->add(*manage(lab));
432  boxv->add(*manage(box));
433  boxv->show_all();
434  fBox.box_pack_start(manage(boxv),false);
435  } else {
436  box->show_all();
437  fBox.box_pack_start(manage(box),false);
438  }
439 }
440 
441 bool StackBoxBuilder::set_regler_cp_value(Gxw::Regler * regler, const std::string id) {
442  if (machine.parameter_hasId(id)) {
443  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off"))
444  regler->cp_set_value(machine.get_parameter_value<float>(id));
445  return true;
446  } else {
447  return false;
448  }
449 }
450 
451 bool StackBoxBuilder::set_engine_cp_value(Gxw::Switch * sw, const std::string id) {
452  if (machine.parameter_hasId(id)) {
453  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off"))
454  sw->cp_set_value(machine.get_parameter_value<float>(id));
455  return true;
456  } else {
457  return false;
458  }
459 }
460 
461 bool StackBoxBuilder::set_engine_value(const std::string id) {
462  if (machine.parameter_hasId(id)) {
463  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off"))
464  machine.signal_parameter_value<float>(id)(machine.get_parameter_value<float>(id));
465  return true;
466  } else {
467  return false;
468  }
469 }
470 
471 void StackBoxBuilder::create_port_display(const std::string& id, const char *label) {
473  Glib::signal_timeout().connect(sigc::bind<const std::string>(
474  sigc::mem_fun(*this, &StackBoxBuilder::set_engine_value),id), 60);
475  if (next_flags & UI_LABEL_INVERSE) {
476  w->set_rack_label_inverse(label);
477  } else {
478  w->set_rack_label(label);
479  }
480  addwidget(w);
481 }
482 
483 bool StackBoxBuilder::set_pd_value(Gxw::PortDisplay *w, const std::string id, const std::string& idl, const std::string& idh) {
484  if (machine.parameter_hasId(id)) {
485  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off")) {
486  float low = machine.get_parameter_value<float>(idl);
487  float high = 100-machine.get_parameter_value<float>(idh);
488  w->set_state(int(low),int(high));
489  float set = (low + high)*0.001;
490  machine.signal_parameter_value<float>(id)(machine.get_parameter_value<float>(id)+set);
491  }
492  return true;
493  } else {
494  return false;
495  }
496 }
497 
498 void StackBoxBuilder::create_p_display(const std::string& id, const std::string& idl, const std::string& idh) {
499  Gxw::PortDisplay *w = new UiRegler<Gxw::PortDisplay>(machine, id);
500  w->set_name("playhead");
501  Gtk::EventBox* e_box = new Gtk::EventBox();
502  e_box->set_size_request(-1, -1);
503  e_box->set_border_width(0);
504  e_box->set_visible_window(true);
505  e_box->set_above_child(true);
506  e_box->add(*manage(static_cast<Gtk::Widget*>(w)));
507  addwidget(e_box);
508  e_box->show_all();
509  Glib::signal_timeout().connect(sigc::bind<Gxw::PortDisplay*>(sigc::bind<const std::string>(
510  sigc::bind<const std::string>(sigc::bind<const std::string>(
511  sigc::mem_fun(*this, &StackBoxBuilder::set_pd_value),idh),idl),id),w ), 60);
512 }
513 
514 void StackBoxBuilder::create_feedback_switch(const char *sw_type, const std::string& id) {
515  Gtk::Widget *sw = UiSwitch::create(machine, sw_type, id);
516  Gxw::Switch *regler = static_cast<Gxw::Switch*>(sw);
517  //regler->set_relief(Gtk::RELIEF_NONE);
518  regler->set_name("effect_on_off");
519  addwidget(sw);
520  Glib::signal_timeout().connect(sigc::bind<const std::string>(
521  sigc::mem_fun(*this, &StackBoxBuilder::set_engine_value),id), 60);
522 }
523 
524 void StackBoxBuilder::load_file(const std::string& id, const std::string& idf) {
525  static Glib::ustring recent_filename = "";
526  static Glib::ustring hostname = "localhost";
527  if (! machine.get_jack()) {
528  hostname = Gio::Resolver::get_default()->lookup_by_address
529  (Gio::InetAddress::create( machine.get_options().get_rpcaddress()));
530  }
531  if (machine.parameter_hasId(id)) {
532  if (machine.get_parameter_value<bool>(id.substr(0,id.find_last_of(".")+1)+"on_off")) {
533  if (machine.get_parameter_value<float>(id)>0) {
534  Glib::ustring filename = machine.get_parameter_value<string>(idf);
535  Glib::ustring title = hostname + ": Select loop file";
536  Gtk::FileChooserDialog d( title);
537  d.set_local_only(false);
538  d.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
539  d.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
540  Glib::ustring loop_dir = machine.get_options().get_loop_dir();
541  d.add_shortcut_folder_uri(Glib::filename_to_uri(loop_dir, hostname));
542  Gtk::FileFilter wav;
543  wav.set_name("WAV Files");
544  wav.add_mime_type("audio/x-vorbis+ogg");
545  wav.add_mime_type("audio/x-wav");
546  wav.add_pattern("*.ogg");
547  wav.add_pattern("*.wav");
548  wav.add_pattern("*.WAV");
549  wav.add_pattern("*.Wav");
550  d.add_filter(wav);
551  Gtk::FileFilter audio;
552  audio.set_name("Audio Files");
553  audio.add_mime_type("audio/*");
554  d.add_filter(audio);
555  Gtk::FileFilter all;
556  all.add_pattern("*");
557  all.set_name("All Files");
558  d.add_filter(all);
559  if (!recent_filename.empty()) {
560  d.set_uri(Glib::filename_to_uri (recent_filename, hostname));
561  } else if ((filename.find("tape") != Glib::ustring::npos) && (!filename.empty())) {
562  d.set_uri(Glib::filename_to_uri (loop_dir + filename + string(".wav"), hostname));
563  } else {
564  d.set_current_folder_uri(Glib::filename_to_uri (loop_dir, hostname));
565  }
566  if (d.run() != Gtk::RESPONSE_OK) {
567  machine.set_parameter_value(id,0.0);
568  machine.signal_parameter_value<float>(id)(0.0);
569  return;
570  }
571  filename = Glib::filename_from_uri(d.get_uri(), hostname);
572  recent_filename = filename;
573  Gtk::RecentManager::Data data;
574  bool result_uncertain;
575  data.mime_type = Gio::content_type_guess(filename, "", result_uncertain);
576  data.app_name = "guitarix";
577  data.groups.push_back("loopfiles");
578  Gtk::RecentManager::get_default()->add_item(d.get_uri(), data);
579  machine.set_parameter_value(idf,filename);
580  machine.set_parameter_value(id,0.0);
581  machine.signal_parameter_value<float>(id)(0.0);
582  }
583  }
584  }
585 }
586 
587 void StackBoxBuilder::load_file_f(const std::string& id, const std::string& idf) {
588  Glib::signal_timeout().connect_once(
589  sigc::bind<const std::string>(sigc::bind<const std::string>(sigc::mem_fun(this, &StackBoxBuilder::load_file), idf), id),100);
590 }
591 
592 void StackBoxBuilder::create_fload_switch(const char *sw_type, const std::string& id, const std::string& idf) {
593  //if (machine.get_jack()) {
594  Gtk::Widget *sw = UiSwitch::create(machine, sw_type, id);
595  Gxw::Switch *regler = static_cast<Gxw::Switch*>(sw);
596  //regler->set_relief(Gtk::RELIEF_NONE);
597  regler->set_name("effect_on_off");
598  addwidget(sw);
599  gx_engine::Parameter& p = machine.get_parameter(id);
600  p.signal_changed_float().connect(sigc::hide(
601  sigc::bind<const std::string>(sigc::bind<const std::string>(sigc::mem_fun(this, &StackBoxBuilder::load_file_f), idf), id)));
602  //}
603 }
604 
605 void StackBoxBuilder::create_h_switch(const char *sw_type, const std::string& id, const char *label) {
606  Gtk::Widget* sw = UiHSwitchWithCaption::create(machine, sw_type, id, label);
607  UiHSwitchWithCaption *w = static_cast<UiHSwitchWithCaption*>(sw);
608  //w->get_regler()->set_relief(Gtk::RELIEF_NONE);
609  w->get_regler()->set_name("effect_on_off");
610  if (next_flags & UI_LABEL_INVERSE) {
612  }
613  addwidget(sw);
614 }
615 
616 void StackBoxBuilder::create_v_switch(const char *sw_type, const std::string& id, const char *label) {
617  Gtk::Widget* sw = UiVSwitchWithCaption::create(machine, sw_type, id, label);
618  UiVSwitchWithCaption *w = static_cast<UiVSwitchWithCaption*>(sw);
619  //w->get_regler()->set_relief(Gtk::RELIEF_NONE);
620  w->get_regler()->set_name("effect_on_off");
621  if (next_flags & UI_LABEL_INVERSE) {
623  }
624  addwidget(sw);
625 }
626 
627 void StackBoxBuilder::create_feedback_slider(const std::string& id, const char *label) {
629  Glib::signal_timeout().connect(sigc::bind<const std::string>(
630  sigc::mem_fun(*this, &StackBoxBuilder::set_engine_value),id), 60);
631  w->set_label(label);
632  addwidget(w);
633  }
634 
635 void StackBoxBuilder::create_selector(const std::string& id, const char *widget_name) {
636  gx_engine::Parameter& p = machine.get_parameter(id);
637  Gxw::Selector *s;
638  if (p.isFloat()) {
639  s = new UiSelector<float>(machine, id);
640  } else {
641  s = new UiSelector<int>(machine, id);
642  }
643  if (widget_name) {
644  s->set_name(widget_name);
645  }
646  addwidget(s);
647 }
648 
649 void StackBoxBuilder::create_selector_with_caption(const std::string& id, const char *label) {
650  gx_engine::Parameter& p = machine.get_parameter(id);
651  Gtk::VBox *s;
652  if (p.isFloat()) {
654  s = new UiSelectorWithCaption<float>(machine, id, label);
655  sel = static_cast<UiSelectorWithCaption<float>*>(s);
656  if (next_flags & UI_LABEL_INVERSE) {
657  sel->set_rack_label_inverse();
658  }
659  } else {
661  s = new UiSelectorWithCaption<int>(machine, id, label);
662  sel = static_cast<UiSelectorWithCaption<int>*>(s);
663  if (next_flags & UI_LABEL_INVERSE) {
664  sel->set_rack_label_inverse();
665  }
666  }
667  addwidget(s);
668 }
669 
670 void StackBoxBuilder::openSpaceBox(const char* label) {
671  GxVBox * box = new GxVBox();
672  box->set_homogeneous(true);
673  box->set_spacing(1);
674  box->set_border_width(4);
675  box->show_all();
676  if (!fBox.top_is_notebook() && label && label[0]) {
677  fBox.box_pack_start(manage(box));
678  fBox.push(box);
679  } else {
680  fBox.push(fBox.add(manage(box), label));
681  }
682 }
683 
684 void StackBoxBuilder::check_set_flags(Gxw::Regler *r) {
685  if (next_flags & UI_NUM_SHOW_ALWAYS) {
686  r->set_name("show_always");
687  }
688  if ((next_flags & UI_NUM_POSITION_MASK)) {
689  Gtk::PositionType pos = Gtk::POS_BOTTOM;
690  switch (next_flags & UI_NUM_POSITION_MASK) {
691  case UI_NUM_TOP: pos = Gtk::POS_TOP; break;
692  case UI_NUM_LEFT: pos = Gtk::POS_LEFT; break;
693  case UI_NUM_RIGHT: pos = Gtk::POS_RIGHT; break;
694  }
695  r->set_value_position(pos);
696  }
697 }
698 
699 void StackBoxBuilder::create_mid_rackknob(const std::string& id, const char *label) {
701  if (next_flags & UI_LABEL_INVERSE) {
702  w->set_rack_label_inverse(label);
703  } else {
704  w->set_rack_label(label);
705  }
706  check_set_flags(w->get_regler());
707  addwidget(w);
708 }
709 
710 void StackBoxBuilder::create_small_rackknob(const std::string& id, const char *label) {
712  if (next_flags & UI_LABEL_INVERSE) {
713  w->set_rack_label_inverse(label);
714  } else {
715  w->set_rack_label(label);
716  }
717  check_set_flags(w->get_regler());
718  addwidget(w);
719 }
720 
721 void StackBoxBuilder::create_small_rackknobr(const std::string& id, const char *label) {
723  if (next_flags & UI_LABEL_INVERSE) {
724  w->set_rack_label_inverse(label);
725  } else {
726  w->set_rack_label(label);
727  }
728  check_set_flags(w->get_regler());
729  addwidget(w);
730 }
731 
732 void StackBoxBuilder::create_big_rackknob(const std::string& id, const char *label) {
734  if (next_flags & UI_LABEL_INVERSE) {
735  w->set_rack_label_inverse(label);
736  } else {
737  w->set_rack_label(label);
738  }
739  check_set_flags(w->get_regler());
740  addwidget(w);
741 }
742 
743 void StackBoxBuilder::addLiveWaveDisplay(const char* label) {
744  Gtk::HBox * box = new Gtk::HBox(false, 4);
745  Gtk::VBox * box1 = new Gtk::VBox(false, 0);
746  Gtk::VBox * box2 = new Gtk::VBox(false, 0);
747  Gtk::EventBox* e_box = new Gtk::EventBox();
748  //g_signal_connect(box->gobj(), "expose-event", G_CALLBACK(gx_cairo::conv_widget_expose), NULL);
749  //box->set_size_request(303, 82);
750  e_box->set_size_request(284, 84);
751  //box->set_border_width(12);
752  e_box->add(fWaveView);
753  box->pack_start(*manage(box1), true, true, 0);
754  box->pack_start(*manage(e_box), false, false, 0);
755  box->pack_start(*manage(box2), true, true, 0);
756  fBox.add(manage(box), label);
757  fWaveView.hide(); // was show()'n by addWidget
758  fWaveView.property_text_pos_left() = 1.5;
759  fWaveView.property_text_pos_right() = 77;
760  // multiplicator is already set by signal handler
761  box->show_all();
762 }
763 
764 void StackBoxBuilder::openVerticalBox1(const char* label) {
765  GxVBox * box = new GxVBox();
766  box->set_homogeneous(false);
767  box->set_spacing(1);
768  box->set_border_width(0);
769 
770  if (!fBox.top_is_notebook() && label && label[0]) {
771  box->m_label.set_text(label);
772  box->m_label.set_name("effekt_label");
773  box->pack_start(box->m_label, false, false, 0 );
774  fBox.box_pack_start(manage(box));
775  box->show();
776  box->m_label.show();
777  fBox.push(box);
778  } else {
779  fBox.push(fBox.add(manage(box), label));
780  }
781 }
782 
783 void StackBoxBuilder::openVerticalBox2(const char* label) {
784  Gtk::VPaned * box = new Gtk::VPaned();
785  box->set_border_width(0);
786  GxHBox * pbox = new GxHBox();
787  if (!fBox.top_is_notebook() && label && label[0]) {
788  pbox->m_label.set_text(label);
789  pbox->m_label.set_name("rack_label");
790  pbox->pack_start(pbox->m_label, false, false, 0 );
791  }
792  pbox->set_border_width(0);
793  box->pack1(*Gtk::manage(static_cast<Gtk::Widget*>(pbox)),true,true);
794  GxHBox * hbox = new GxHBox();
795  hbox->set_homogeneous(false);
796  hbox->set_spacing(1);
797  hbox->set_border_width(0);
798  box->pack2(*Gtk::manage(static_cast<Gtk::Widget*>(hbox)),true,true);
799  box->set_position(200);
800  fBox.box_pack_start(manage(box), false, false, 0);
801  box->show_all();
802  fBox.push(hbox);
803 }
804 
805 void StackBoxBuilder::openFlipLabelBox(const char* label) {
806  GxVBox * box = new GxVBox();
807  box->set_homogeneous(false);
808  box->set_spacing(0);
809  box->set_border_width(0);
810 
811  if (!fBox.top_is_notebook() && label && label[0]) {
812  GxVBox * vbox = new GxVBox();
813  vbox->set_homogeneous(false);
814  vbox->set_spacing(0);
815  vbox->set_border_width(0);
816 
817  GxHBox * hbox = new GxHBox();
818  hbox->set_homogeneous(false);
819  hbox->set_spacing(0);
820  hbox->set_border_width(0);
821 
822  hbox->m_label.set_text(label);
823  hbox->m_label.set_name("effekt_label");
824  hbox->m_label.set_angle(90);
825  hbox->m_label.set_size_request(15, -1);
826 
827  Pango::FontDescription font = hbox->m_label.get_style()->get_font();
828  font.set_size(8*Pango::SCALE);
829  font.set_weight(Pango::WEIGHT_BOLD);
830  hbox->m_label.modify_font(font);
831 
832  hbox->add(hbox->m_label);
833  hbox->add(*manage(vbox));
834  box->add(*manage(hbox));
835  fBox.box_pack_start(manage(box), false);
836  box->show_all();
837  fBox.push(vbox);
838  } else {
839  fBox.push(fBox.add(manage(box), label));
840  }
841 }
842 
843 class uiSpinner: public Gtk::SpinButton {
844 private:
845  uiAdjustment adj;
846 public:
847  uiSpinner(float step, gx_engine::GxMachineBase& machine, const std::string& id)
848  : Gtk::SpinButton(step, precision(step)), adj(machine, id, get_adjustment()) {
849  get_adjustment()->signal_value_changed().connect(
850  sigc::mem_fun(adj, &uiAdjustment::changed));
851  }
852 };
853 
854 void StackBoxBuilder::addNumEntry(const std::string& id, const char* label_) {
855  Glib::ustring label(label_);
856  if (!machine.parameter_hasId(id)) {
857  return;
858  }
859  const gx_engine::FloatParameter &p = machine.get_parameter(id).getFloat();
860  if (label.empty()) {
861  label = p.l_name();
862  }
863  float step = p.getStepAsFloat();
864  uiSpinner* spinner = new uiSpinner(step, machine, id);
865  spinner->get_adjustment()->configure(
866  machine.get_parameter_value<float>(id), p.getLowerAsFloat(), p.getUpperAsFloat(), step, 10*step, 0);
867  connect_midi_controller(spinner, id, machine);
868  Gtk::HBox *box = new Gtk::HBox(homogene, 0);
869  Gtk::Label *lab = new Gtk::Label(label);
870  box->add(*manage(lab));
871  lab->set_name("rack_label");
872  fBox.add(manage(box), label);
873  fBox.add(manage(spinner), label);
874 }
875 
876 class uiToggleButton: public Gtk::ToggleButton {
877 private:
878  gx_engine::GxMachineBase& machine;
879  const std::string id;
880 public:
881  uiToggleButton(gx_engine::GxMachineBase& machine_, const std::string& id_);
882  void toggled();
883  void set_value(bool v);
884 };
885 
887  : Gtk::ToggleButton(), machine(machine_), id(id_) {
888  machine.signal_parameter_value<bool>(id).connect(
889  sigc::mem_fun(this, &Gtk::ToggleButton::set_active));
890  signal_toggled().connect(
891  sigc::mem_fun(this, &uiToggleButton::toggled));
892 }
893 
895  machine.set_parameter_value(id, get_active());
896 }
897 
898 void StackBoxBuilder::addMToggleButton(const std::string& id, const char* label_) {
899  Glib::ustring label(label_);
900  if (!machine.parameter_hasId(id)) {
901  return;
902  }
903  const gx_engine::BoolParameter &p = machine.get_parameter(id).getBool();
904  if (label.empty()) {
905  label = p.l_name();
906  }
907  Gdk::Color colorRed("#58b45e");
908  Gdk::Color colorOwn("#7f7f7f");
909  Gdk::Color colorwn("#000000");
910  uiToggleButton* button = new uiToggleButton(machine, id);
911  Gtk::Label* lab = new Gtk::Label(label);
912  Pango::FontDescription font = lab->get_style()->get_font();
913  font.set_weight(Pango::WEIGHT_BOLD);
914  lab->modify_font(font);
915  button->add(*manage(lab));
916  button->set_size_request(70, 20);
917  Gtk::Box* box = new Gtk::HBox(homogene, 4);
918  Gtk::Box* box1 = new Gtk::VBox(homogene, 4);
919  box->set_border_width(0);
920  box1->set_border_width(0);
921  box->add(*manage(box1));
922  Gtk::Box* box2 = new Gtk::VBox(homogene, 4);
923  box2->set_border_width(0);
924  box2->set_size_request(6, 20);
925  box->add(*manage(button));
926  box->add(*manage(box2));
927  box1->set_size_request(6, 20);
928  button->show();
929  box1->show();
930  box2->show();
931  lab->show();
932  box->show();
933  fBox.container_add(manage(box));
934  button->modify_bg(Gtk::STATE_NORMAL, colorOwn);
935  button->modify_bg(Gtk::STATE_ACTIVE, colorRed);
936  lab->set_name("rack_label");
937  connect_midi_controller(button, id, machine);
938 }
939 
940 class uiCheckButton: public Gtk::CheckButton {
941 private:
942  gx_engine::GxMachineBase& machine;
943  const std::string& id;
944 public:
945  uiCheckButton(gx_engine::GxMachineBase& machine_, const std::string& id_)
946  : Gtk::CheckButton(), machine(machine_), id(id_) {
947  set_active(machine.get_parameter_value<bool>(id));
948  machine.signal_parameter_value<bool>(id).connect(sigc::mem_fun(this, &Gtk::CheckButton::set_active));
949  signal_toggled().connect(
950  sigc::mem_fun(this, &uiCheckButton::toggled));
951  }
952  void toggled() {
953  machine.set_parameter_value(id, get_active());
954  }
955 };
956 
957 void StackBoxBuilder::addCheckButton(const std::string& id, const char* label_) {
958  if (!machine.parameter_hasId(id)) {
959  return;
960  }
961  Glib::ustring label;
962  if (label_ && label_[0]) {
963  label = label_;
964  } else {
965  label = machine.get_parameter(id).getBool().l_name();
966  }
967  Gdk::Color colorRed("#000000");
968  Gdk::Color colorOwn("#4c5159");
969  Gdk::Color colorba("#c4c0c0");
970  Gtk::Label *lab = new Gtk::Label(label);
971  uiCheckButton *button = new uiCheckButton(machine, id);
972  button->add(*manage(lab));
973  fBox.add(manage(button), label);
974  button->modify_bg(Gtk::STATE_PRELIGHT, colorOwn);
975  button->modify_fg(Gtk::STATE_PRELIGHT, colorRed);
976  button->modify_text(Gtk::STATE_NORMAL, colorRed);
977  button->modify_base(Gtk::STATE_NORMAL, colorba);
978  Glib::RefPtr<Gtk::Style> style = lab->get_style();
979  style->get_font().set_size(8*Pango::SCALE);
980  style->get_font().set_weight(Pango::WEIGHT_NORMAL);
981  lab->modify_font(style->get_font());
982  connect_midi_controller(button, id, machine);
983  lab->show();
984 }
985 
986 void StackBoxBuilder::openHorizontalhideBox(const char* label) {
987  GxHBox * box = new GxHBox();
988  box->set_homogeneous(false);
989  box->set_spacing(0);
990  box->set_border_width(0);
991  fBox.box_pack_start(manage(box) , false, false, 5);
992  fBox.push(box);
993  box->hide();
994  if (label[0] != 0) {
995  box->show();
996  }
997 }
998 
999 void StackBoxBuilder::openHorizontalTableBox(const char* label) {
1000  Gtk::HBox *box;
1001  if (!fBox.top_is_notebook() && label && label[0]) {
1002  GxHFrame *frame = new GxHFrame();
1003  frame->set_label(label);
1004  frame->set_shadow_type(Gtk::SHADOW_NONE);
1005  frame->add(frame->m_hbox);
1006  fBox.box_pack_start(manage(frame), false);
1007  frame->m_hbox.show();
1008  frame->show();
1009  box = &frame->m_hbox;
1010  fBox.push(box);
1011  } else {
1012  box = new Gtk::HBox();
1013  fBox.push(fBox.add(manage(box), label));
1014  }
1015  box->set_homogeneous(false);
1016  box->set_spacing(1);
1017  box->set_border_width(0);
1018 }
1019 
1020 void StackBoxBuilder::openPaintBox2(const char* label) {
1021  GxEventBox *box = new GxEventBox();
1022  box->m_eventbox.set_name(label);
1023  box->set_homogeneous(false);
1024  box->set_spacing(0);
1025  box->set_border_width(0);
1026  fBox.box_pack_start(manage(box), false, false);
1027  box->show_all();
1028  fBox.push(&box->m_hbox);
1029 }
1030 
1031 void StackBoxBuilder::openTabBox(const char* label) {
1032  GxNotebookBox * box = new GxNotebookBox();
1033  fBox.push(fBox.add(manage(box), label));
1034 }
1035 
1036 void StackBoxBuilder::openpaintampBox(const char* label) {
1037  GxPaintBox *box = new GxPaintBox("rectangle_skin_color_expose");
1038  box->m_hbox.set_border_width(4);
1039  box->set_name(label);
1040  box->set_tooltip_text(label);
1041  fBox.box_pack_start(manage(box));
1042  box->show_all();
1043  fBox.push(&box->m_hbox);
1044 }
1045 
1046 void StackBoxBuilder::closeBox() {
1047  assert(!fBox.empty());
1048  fBox.pop();
1049 }
1050 
1051 void StackBoxBuilder::openHorizontalBox(const char* label) {
1052  Gtk::HBox *box;
1053  if (!fBox.top_is_notebook() && label && label[0]) {
1054  GxHFrame *frame = new GxHFrame();
1055  frame->set_label(label);
1056  frame->set_shadow_type(Gtk::SHADOW_NONE);
1057  frame->add(frame->m_hbox);
1058  fBox.box_pack_start(manage(frame), false);
1059  frame->m_hbox.show();
1060  frame->show();
1061  box = &frame->m_hbox;
1062  fBox.push(box);
1063  } else {
1064  box = new Gtk::HBox();
1065  fBox.push(fBox.add(manage(box), label));
1066  }
1067  box->set_homogeneous(false);
1068  box->set_spacing(1);
1069  box->set_border_width(0);
1070 }
1071 
1072 void StackBoxBuilder::openVerticalBox(const char* label) {
1073  GxVBox * box = new GxVBox();
1074  box->set_homogeneous(false);
1075  box->set_spacing(1);
1076  box->set_border_width(0);
1077 
1078  if (!fBox.top_is_notebook() && label && label[0]) {
1079  box->m_label.set_text(label);
1080  box->m_label.set_name("rack_effect_label");
1081  Glib::RefPtr<Gtk::Style> style = box->m_label.get_style();
1082  style->get_font().set_size(8*Pango::SCALE);
1083  style->get_font().set_weight(Pango::WEIGHT_BOLD);
1084  box->m_label.modify_font(style->get_font());
1085  box->pack_start(box->m_label, false, false, 0 );
1086  fBox.box_pack_start(manage(box), false);
1087  box->show();
1088  box->m_label.show();
1089  fBox.push(box);
1090  } else {
1091  fBox.push(fBox.add(manage(box), label));
1092  }
1093 }
1094 
1095 void StackBoxBuilder::openFrameBox(const char* label) {
1096  Gtk::HBox *box;
1097 
1098  if (!fBox.top_is_notebook() && label && label[0]) {
1099  GxHFrame *frame = new GxHFrame();
1100  frame->set_label(label);
1101  frame->set_shadow_type(Gtk::SHADOW_NONE);
1102  frame->add(frame->m_hbox);
1103  fBox.box_pack_start(manage(frame), false);
1104  frame->m_hbox.show();
1105  frame->show();
1106  box = &frame->m_hbox;
1107  fBox.push(box);
1108  } else {
1109  box = new Gtk::HBox();
1110  fBox.push(fBox.add(manage(box), label));
1111  }
1112  box->set_homogeneous(false);
1113  box->set_spacing(1);
1114  box->set_border_width(2);
1115 }
1116 
1117 } // end namespace gx_gui
static Gtk::Widget * create(gx_engine::GxMachineBase &machine, const char *sw_type, const std::string &id, const char *label)
static Gtk::Widget * create(gx_engine::GxMachineBase &machine, const char *sw_type, const std::string &id, const char *label)
StackBoxBuilder(gx_engine::GxMachineBase &machine_, Gxw::WaveView &fWaveView_, Gtk::Label &convolver_filename_label_, Gtk::Label &convolver_mono_filename_label_, Glib::RefPtr< Gdk::Pixbuf > window_icon)
const char * pb_gxhead_expose
void notebook_append_page(Gtk::Widget *w, Gtk::Widget *label)
void wnotify(gpointer data, GObject *where_the_object_was)
const std::string & get_loop_dir() const
Definition: gx_system.h:476
const char * pb_zac_expose
void get_box(const std::string &name, Gtk::Widget *&mainbox, Gtk::Widget *&minibox)
void container_add(Gtk::Widget *w)
virtual Parameter & get_parameter(const std::string &id)=0
static UiSwitch * create(gx_engine::GxMachineBase &machine, const char *sw_type, gx_engine::Parameter &param)
#define UI_NUM_POSITION_MASK
Definition: gx_plugin.h:43
#define UI_LABEL_INVERSE
Definition: gx_plugin.h:45
virtual gx_jack::GxJack * get_jack()=0
void set_c_level(double lvl)
Definition: fastmeter.cc:142
const char * pb_gx_rack_amp_expose
int precision(double n)
bool isFloat() const
Definition: gx_parameter.h:159
void set_label(const char *label)
sigc::signal< void, const GxJConvSettings * > & signal_changed()
Gtk::EventBox m_eventbox
#define UI_NUM_TOP
Definition: gx_plugin.h:39
const Glib::ustring & get_rpcaddress()
Definition: gx_system.h:490
void gx_print_error(const char *, const std::string &)
Definition: gx_logging.cpp:166
sigc::signal< void, float > & signal_changed_float()
Definition: gx_parameter.h:478
void cp_set_value(double value)
Gtk::Widget * add(Gtk::Widget *w, const Glib::ustring &label=Glib::ustring())
const std::string & getIRFile() const
void set_rack_label(const char *label)
T get_parameter_value(const std::string &id)
const char * pb_RackBox_expose
#define UI_NUM_LEFT
Definition: gx_plugin.h:41
virtual float getUpperAsFloat() const
virtual bool parameter_hasId(const char *p)=0
uiToggleButton(gx_engine::GxMachineBase &machine_, const std::string &id_)
virtual void set_parameter_value(const std::string &id, int value)=0
const char * pb_level_meter_expose
void set_state(int cutoff_low, int cutoff_high)
Definition: portdisplay.cc:54
std::string to_string(const T &t)
Definition: gx_system.h:523
void connect_midi_controller(Gtk::Widget *w, const std::string &id, gx_engine::GxMachineBase &machine)
virtual float getLowerAsFloat() const
void push(Gtk::Widget *w)
string l_name() const
Definition: gx_parameter.h:173
void set_rack_label_inverse(const char *label)
void set_value_position(Gtk::PositionType p1)
Definition: regler.cc:477
virtual float getStepAsFloat() const
void set_hold_count(int val)
Definition: fastmeter.cc:152
const GxJConvSettings & get_value() const
FloatParameter & getFloat()
Definition: gx_parameter.h:447
virtual gx_system::CmdlineOptions & get_options() const =0
struct _GxPaintBox GxPaintBox
Definition: paintbox.h:32
bool button_press_cb(GdkEventButton *event, gx_engine::GxMachineBase &machine, const std::string &id)
Gtk::Label m_label
uiCheckButton(gx_engine::GxMachineBase &machine_, const std::string &id_)
void set_by_power(double lvl)
Definition: fastmeter.cc:137
const char * pb_rectangle_skin_color_expose
uiSpinner(float step, gx_engine::GxMachineBase &machine, const std::string &id)
void box_pack_start(Gtk::Widget *w, bool expand=true, bool fill=true, int padding=0)
std::string get_builder_filepath(const std::string &basename) const
Definition: gx_system.h:373
void trace_finalize(Glib::Object *o, int n)
Gtk::Label m_label
#define UI_NUM_RIGHT
Definition: gx_plugin.h:42
const char * pb_gxrack_expose
void fetch(Gtk::Widget *&mainbox, Gtk::Widget *&minibox)
virtual bool midi_get_config_mode(int *ctl=0)=0
sigc::signal< void, T > & signal_parameter_value(const std::string &id)
BoolParameter & getBool()
Definition: gx_parameter.h:463
std::string fformat(float value, float step)
#define UI_NUM_SHOW_ALWAYS
Definition: gx_plugin.h:44