Guitarix
gx_ui_builder.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  * This is the gx_head GUI main class
21  *
22  * ----------------------------------------------------------------------------
23  */
24 
25 #include "guitarix.h" // NOLINT
26 
27 #include <iomanip> // NOLINT
28 #include <cstring> // NOLINT
29 #include <string> // NOLINT
30 #include <gxw/GxControlParameter.h>
31 
32 namespace gx_gui {
33 
34 /* ----- load a top level window from gtk builder file ------ */
35 
36 GtkWidget *load_toplevel(GtkBuilder *builder, const char* filename, const char* windowname) {
37  string fname = gx_system::get_options().get_builder_filepath(filename);
38  GError *err = NULL;
39  if (!gtk_builder_add_from_file(builder, fname.c_str(), &err)) {
40  g_object_unref(G_OBJECT(builder));
41  gx_print_fatal(_("gtk builder"), err->message);
42  g_error_free(err);
43  return NULL;
44  }
45  GtkWidget *w = GTK_WIDGET(gtk_builder_get_object(builder, windowname));
46  if (!w) {
47  g_object_unref(G_OBJECT(builder));
48  gx_print_fatal(_("gtk builder"), string(windowname)+_(" not found in ")+fname);
49  return NULL;
50  }
51  gtk_builder_connect_signals(builder, 0);
52  return w;
53 }
54 
55 /****************************************************************
56  ** UiBuilder implementation
57  */
58 
59 StackBoxBuilder *UiBuilderImpl::intf = 0;
60 
61 UiBuilderImpl::UiBuilderImpl(MainWindow *i, StackBoxBuilder *b, std::vector<PluginUI*> *pl)
62  : UiBuilderBase(), main(*i), pluginlist(pl) {
63  intf = b;
99 };
100 
102  if (!pd->load_ui) {
103  return false;
104  }
105  intf->prepare();
106  plugin = pd;
107  pd->load_ui(*this, UI_FORM_GLADE|UI_FORM_STACK);
108  return true;
109 }
110 
111 void UiBuilderImpl::openTabBox_(const char* label) {
112  intf->openTabBox(label);
113 }
114 
115 void UiBuilderImpl::openVerticalBox_(const char* label) {
116  intf->openVerticalBox(label);
117 }
118 
119 void UiBuilderImpl::openVerticalBox1_(const char* label) {
120  intf->openVerticalBox1(label);
121 }
122 
123 void UiBuilderImpl::openVerticalBox2_(const char* label) {
124  intf->openVerticalBox2(label);
125 }
126 
127 void UiBuilderImpl::openHorizontalhideBox_(const char* label) {
128  intf->openHorizontalhideBox(label);
129 }
130 
131 void UiBuilderImpl::openHorizontalTableBox_(const char* label) {
132  intf->openHorizontalTableBox(label);
133 }
134 
135 void UiBuilderImpl::openHorizontalBox_(const char* label) {
136  intf->openHorizontalBox(label);
137 }
138 
139 void UiBuilderImpl::openFrameBox_(const char* label) {
140  intf->openFrameBox(label);
141 }
142 
143 void UiBuilderImpl::openFlipLabelBox_(const char* label) {
144  intf->openFlipLabelBox(label);
145 }
146 
147 void UiBuilderImpl::openpaintampBox_(const char* label) {
148  intf->openpaintampBox(label);
149 }
150 
152  intf->openSpaceBox("");
153  intf->closeBox();
154 }
155 
156 void UiBuilderImpl::set_next_flags_(int flags) {
157  intf->set_next_flags(flags);
158 }
159 
160 void UiBuilderImpl::create_mid_rackknob_(const char *id, const char *label) {
161  intf->create_mid_rackknob(id, label);
162 }
163 
164 void UiBuilderImpl::create_small_rackknob_(const char *id, const char *label) {
165  intf->create_small_rackknob(id, label);
166 }
167 
168 void UiBuilderImpl::create_small_rackknobr_(const char *id, const char *label) {
169  intf->create_small_rackknobr(id, label);
170 }
171 
172 void UiBuilderImpl::create_big_rackknob_(const char *id, const char *label) {
173  intf->create_big_rackknob(id, label);
174 }
175 
176 void UiBuilderImpl::create_master_slider_(const char *id, const char *label) {
177  intf->create_master_slider(id, label);
178 }
179 
180 void UiBuilderImpl::create_feedback_slider_(const char *id, const char *label) {
181  intf->create_feedback_slider(id, label);
182 }
183 
184 void UiBuilderImpl::create_selector_no_caption_(const char *id) {
185  intf->create_selector(id, "");
186 }
187 
188 void UiBuilderImpl::create_selector_(const char *id, const char *label) {
189  intf->create_selector_with_caption(id, label);
190 }
191 
192 void UiBuilderImpl::create_simple_meter_(const char *id) {
193  intf->create_simple_meter(id);
194 }
195 
196 void UiBuilderImpl::create_simple_c_meter_(const char *id, const char *idl, const char *label) {
197  intf->create_simple_c_meter(id, idl, label);
198 }
199 
200 void UiBuilderImpl::create_spin_value_(const char *id, const char *label) {
201  intf->create_spin_value(id, label);
202 }
203 
204 void UiBuilderImpl::create_switch_no_caption_(const char *sw_type, const char * id) {
205  intf->create_switch_no_caption(sw_type, id);
206 }
207 
208 void UiBuilderImpl::create_feedback_switch_(const char *sw_type, const char * id) {
209  intf->create_feedback_switch(sw_type, id);
210 }
211 
212 void UiBuilderImpl::create_fload_switch_(const char *sw_type, const char * id, const char * idf) {
213  intf->create_fload_switch(sw_type, id, idf);
214 }
215 
216 void UiBuilderImpl::create_switch_(const char *sw_type, const char * id, const char *label) {
217  intf->create_v_switch(sw_type, id, label);
218 }
219 
220 void UiBuilderImpl::create_wheel_(const char * id, const char *label) {
221  intf->create_wheel(id, label);
222 }
223 
224 void UiBuilderImpl::create_port_display_(const char *id, const char *label) {
225  intf->create_port_display(id, label);
226 }
227 
228 void UiBuilderImpl::create_p_display_(const char *id, const char *idl, const char *idh) {
229  intf->create_p_display(id, idl, idh);
230 }
231 
232 void UiBuilderImpl::create_simple_spin_value_(const char *id) {
233  intf->create_simple_spin_value(id);
234 }
235 
237  intf->create_eq_rackslider_no_caption(id);
238 }
239 
241  intf->closeBox();
242 }
243 
244 void UiBuilderImpl::load_glade_(const char *data) {
245  intf->loadRackFromGladeData(data);
246 }
247 
248 void UiBuilderImpl::load_glade_file_(const char *fname) {
249  intf->loadRackFromGladeFile(fname);
250 }
251 
253  PluginDef *pd = p->get_pdef();
254  if (!(pd->flags & PGN_GUI) || !(pd->flags & gx_engine::PGNI_DYN_POSITION)) {
255  return false;
256  }
257  main.add_plugin(*pluginlist, pd->id, "");
258  return true;
259 }
260 
261 } /* end of gx_gui namespace */
262 
263 /****************************************************************
264  ** class GxBuilder
265  */
266 
267 // GList(GObject*) helper class must be defined in other namespace
268 namespace Glib { namespace Container_Helpers {
269 template <>
270 struct TypeTraits<GObject*> {
271  typedef GObject *CppType;
272  typedef GObject *CType;
273  typedef GObject *CTypeNonConst;
274 
275  static CType to_c_type(CppType item) { return item; }
276  static CppType to_cpp_type(CType item) { return item; }
277  static void release_c_type(CType) {}
278 };
279 }}
280 
281 namespace gx_gui {
282 
283 //static
284 Glib::RefPtr<GxBuilder> GxBuilder::create_from_file(
285  const std::string& filename, gx_engine::GxMachineBase* pmach, const char* object_id) {
286  Glib::RefPtr<GxBuilder> builder = GxBuilder::create();
287  try {
288  if (object_id) {
289  builder->add_from_file(filename, object_id);
290  } else {
291  builder->add_from_file(filename);
292  }
293  } catch(const Glib::FileError& ex) {
294  gx_print_fatal("FileError", ex.what());
295  } catch(const Gtk::BuilderError& ex) {
296  gx_print_fatal("Builder Error", ex.what());
297  }
298  if (pmach) {
299  builder->fixup_controlparameters(*pmach);
300  }
301  return builder;
302 }
303 
304 //static
305 Glib::RefPtr<GxBuilder> GxBuilder::create_from_file(
306  const std::string& filename, gx_engine::GxMachineBase* pmach, const Glib::StringArrayHandle& object_ids) {
307  Glib::RefPtr<GxBuilder> builder = GxBuilder::create();
308  try {
309  builder->add_from_file(filename, object_ids);
310  } catch(const Glib::FileError& ex) {
311  gx_print_fatal("FileError", ex.what());
312  } catch(const Gtk::BuilderError& ex) {
313  gx_print_fatal("Builder Error", ex.what());
314  }
315  if (pmach) {
316  builder->fixup_controlparameters(*pmach);
317  }
318  return builder;
319 }
320 
321 //static
322 Glib::RefPtr<GxBuilder> GxBuilder::create_from_string(
323  const Glib::ustring& buffer, gx_engine::GxMachineBase* pmach, const char* object_id) {
324  Glib::RefPtr<GxBuilder> builder = GxBuilder::create();
325  try {
326  if (object_id) {
327  builder->add_from_string(buffer, object_id);
328  } else {
329  builder->add_from_string(buffer);
330  }
331  } catch(const Gtk::BuilderError& ex) {
332  gx_print_fatal("Builder Error", ex.what());
333  }
334  if (pmach) {
335  builder->fixup_controlparameters(*pmach);
336  }
337  return builder;
338 }
339 
340 //static
341 Glib::RefPtr<GxBuilder> GxBuilder::create_from_string(
342  const Glib::ustring& buffer, gx_engine::GxMachineBase* pmach, const Glib::StringArrayHandle& object_ids) {
343  Glib::RefPtr<GxBuilder> builder = GxBuilder::create();
344  try {
345  builder->add_from_string(buffer, object_ids);
346  } catch(const Gtk::BuilderError& ex) {
347  gx_print_fatal("Builder Error", ex.what());
348  }
349  if (pmach) {
350  builder->fixup_controlparameters(*pmach);
351  }
352  return builder;
353 }
354 
355 Gtk::Window *GxBuilder::get_first_window() {
356  Glib::SListHandle<GObject*> objs = Glib::SListHandle<GObject*>(
357  gtk_builder_get_objects(gobj()), Glib::OWNERSHIP_DEEP);
358  for (Glib::SListHandle<GObject*>::iterator i = objs.begin(); i != objs.end(); ++i) {
359  if (g_type_is_a(G_OBJECT_TYPE(*i), GTK_TYPE_WINDOW)) {
360  return Glib::wrap(GTK_WINDOW(*i), false);
361  }
362  }
363  assert(false);
364  return 0;
365 }
366 
367 GObject* GxBuilder::get_cobject(const Glib::ustring& name)
368 {
369  GObject *cobject = gtk_builder_get_object (gobj(), name.c_str());
370  if(!cobject) {
371  g_critical("gtkmm: object `%s' not found in GtkBuilder file.", name.c_str());
372  return 0;
373  }
374 
375 #if 0
376  if (!GTK_IS_WIDGET(cobject)) {
377  g_critical("gtkmm: object `%s' (type=`%s') (in GtkBuilder file) is not a widget type.",
378  name.c_str(), G_OBJECT_TYPE_NAME(cobject));
379  /* TODO: Unref/sink it? */
380  return 0;
381  }
382 #endif
383 
384  return cobject;
385 }
386 
387 Gtk::Object* GxBuilder::get_widget_checked(const Glib::ustring& name, GType type, bool take_ref) {
388  GObject *cobject = get_cobject(name);
389  if(!cobject) {
390  g_critical("gtkmm: GxBuilder: widget `%s' was not found in the GtkBuilder file, or the specified part of it.",
391  name.c_str());
392  return 0;
393  }
394  if(!g_type_is_a(G_OBJECT_TYPE(cobject), type)) {
395  g_critical("gtkmm: widget `%s' (in GtkBuilder file) is of type `%s' but `%s' was expected",
396  name.c_str(), G_OBJECT_TYPE_NAME(cobject), g_type_name(type));
397  return 0;
398  }
399  return Glib::wrap (GTK_OBJECT(cobject), take_ref);
400 }
401 
402 /*
403  ** GxBuilder::fixup_controlparameters + helper classes
404  */
405 
406 template <class T>
407 class uiSelector: public uiElement {
408 protected:
410  const std::string id;
411  Gtk::Range *rng;
412  void on_value_changed();
413  void set_value(T v);
414 public:
415  uiSelector(gx_engine::GxMachineBase& machine, Gtk::Range *rng, const std::string& id);
416 };
417 
418 template <class T>
419 uiSelector<T>::uiSelector(gx_engine::GxMachineBase& machine_, Gtk::Range *rng_, const std::string& id_)
420  : uiElement(), machine(machine_), id(id_), rng(rng_) {
422  rng->signal_value_changed().connect(
423  sigc::mem_fun(*this, &uiSelector::on_value_changed));
424  machine.signal_parameter_value<T>(id).connect(
425  sigc::mem_fun(this, &uiSelector::set_value));
426 }
427 
428 template <class T>
429 void uiSelector<T>::set_value(T v) {
430  rng->set_value(v);
431 }
432 
433 template<class T>
435  machine.set_parameter_value(id, static_cast<T>(rng->get_value()));
436 }
437 
438 static void widget_destroyed(gpointer data) {
439  delete static_cast<uiElement*>(data);
440 }
441 
442 static void destroy_with_widget(Glib::Object *t, uiElement *p) {
443  t->set_data("uiElement", p, widget_destroyed);
444 }
445 
446 static void make_switch_controller(gx_engine::GxMachineBase& machine, Glib::RefPtr<Gxw::ControlParameter>& w, gx_engine::Parameter& p) {
447  w->cp_configure(p.l_group(), p.l_name(), 0, 0, 0);
448  Gtk::ToggleButton *t = dynamic_cast<Gtk::ToggleButton*>(w.operator->());
449  if (p.isFloat()) {
450  w->cp_set_value(machine.get_parameter_value<float>(p.id()));
451  if (t) {
452  destroy_with_widget(t, new uiToggle<float>(machine, t, p.id()));
453  }
454  } else if (p.isBool()) {
455  w->cp_set_value(machine.get_parameter_value<bool>(p.id()));
456  if (t) {
457  destroy_with_widget(t, new uiToggle<bool>(machine, t, p.id()));
458  }
459  } else {
461  "load dialog",
462  Glib::ustring::compose("Switch Parameter variable %1: type not handled", p.id()));
463  }
464 }
465 
466 struct uiAdjustmentLog: public uiElement {
468  const std::string id;
469  Gtk::Adjustment* fAdj;
470  uiAdjustmentLog(gx_engine::GxMachineBase& machine_, const std::string& id_, Gtk::Adjustment* adj) :
471  uiElement(), machine(machine_), id(id_), fAdj(adj) {
472  fAdj->set_value(log10(machine.get_parameter_value<float>(id)));
473  machine.signal_parameter_value<float>(id).connect(sigc::mem_fun(this, &uiAdjustmentLog::on_parameter_changed));
474  }
475  void changed() {
476  machine.set_parameter_value(id, pow(10.0,fAdj->get_value()));
477  }
478  void on_parameter_changed(float v) {
479  fAdj->set_value(log10(v));
480  }
481 };
482 
483 static void make_continuous_controller(gx_engine::GxMachineBase& machine, Glib::RefPtr<Gxw::ControlParameter>& w, gx_engine::Parameter& p) {
484  Glib::RefPtr<Gxw::Regler> r = Glib::RefPtr<Gxw::Regler>::cast_dynamic(w);
485  if (!r) {
486  make_switch_controller(machine, w, p);
487  return;
488  }
489  if (!p.isFloat()) {
491  "load dialog",
492  Glib::ustring::compose("Continuous Parameter variable %1: type not handled", p.id()));
493  return;
494  }
495  Gtk::Adjustment *adj = r->get_adjustment();
497  if (fp.is_log_display()) {
498  double up = log10(fp.getUpperAsFloat());
499  double step = log10(fp.getStepAsFloat());
500  w->cp_configure(fp.l_group(), fp.l_name(), log10(fp.getLowerAsFloat()), up, step);
501  int prec = 0;
502  float d = log10((fp.getStepAsFloat()-1)*fp.getUpperAsFloat());
503  if (up > 0) {
504  prec = up;
505  if (d < 0) {
506  prec -= floor(d);
507  }
508  } else if (d < 0) {
509  prec = -floor(d);
510  }
511  r->signal_format_value().connect(
512  sigc::bind(
513  sigc::ptr_fun(logarithmic_format_value),
514  prec));
515  r->signal_input_value().connect(
516  sigc::ptr_fun(logarithmic_input_value));
517  w->cp_set_value(log10(machine.get_parameter_value<float>(p.id())));
518  uiAdjustmentLog* c = new uiAdjustmentLog(machine, p.id(), adj);
519  adj->signal_value_changed().connect(sigc::mem_fun(c, &uiAdjustmentLog::changed));
520  destroy_with_widget(r.operator->(), c);
521  } else {
522  w->cp_configure(p.l_group(), p.l_name(), fp.getLowerAsFloat(), fp.getUpperAsFloat(), fp.getStepAsFloat());
523  w->cp_set_value(machine.get_parameter_value<float>(p.id()));
524  uiAdjustment* c = new uiAdjustment(machine, p.id(), adj);
525  adj->signal_value_changed().connect(
526  sigc::mem_fun(c, &uiAdjustment::changed));
527  destroy_with_widget(r.operator->(), c);
528  }
529 }
530 
531 static void make_enum_controller(gx_engine::GxMachineBase& machine, Glib::RefPtr<Gxw::ControlParameter>& w, gx_engine::Parameter& p) {
532  Gxw::Selector *t = dynamic_cast<Gxw::Selector*>(w.operator->());
533  if (!t) {
534  make_continuous_controller(machine, w, p);
535  return;
536  }
537  Gtk::TreeModelColumn<Glib::ustring> label;
538  Gtk::TreeModelColumnRecord rec;
539  rec.add(label);
540  Glib::RefPtr<Gtk::ListStore> ls = Gtk::ListStore::create(rec);
541  for (const value_pair *vp = p.getValueNames(); vp->value_id; ++vp) {
542  ls->append()->set_value(0, Glib::ustring(p.value_label(*vp)));
543  }
544  t->set_model(ls);
545  w->cp_configure(p.l_group(), p.l_name(), p.getLowerAsFloat(), p.getUpperAsFloat(), 1.0);
546  if (p.isInt()) {
547  destroy_with_widget(t, new uiSelector<int>(machine, t, p.id()));
548  t->cp_set_value(machine.get_parameter_value<int>(p.id()));
549  } else if (p.isFloat()) {
550  destroy_with_widget(t, new uiSelector<float>(machine, t, p.id()));
551  t->cp_set_value(machine.get_parameter_value<float>(p.id()));
552  } else {
554  "load dialog",
555  Glib::ustring::compose("Enum Parameter variable %1: type not handled", p.id()));
556  }
557 }
558 
560  Glib::SListHandle<GObject*> objs = Glib::SListHandle<GObject*>(
561  gtk_builder_get_objects(gobj()), Glib::OWNERSHIP_DEEP);
562  for (Glib::SListHandle<GObject*>::iterator i = objs.begin(); i != objs.end(); ++i) {
563  const char *wname = 0;
564  if (g_type_is_a(G_OBJECT_TYPE(*i), GTK_TYPE_WIDGET)) {
565  const char *id = gtk_buildable_get_name(GTK_BUILDABLE(*i));
566  wname = g_strstr_len(id, -1, ":");
567  if (wname) {
568  gtk_widget_set_name(GTK_WIDGET(*i), wname+1);
569  }
570  }
571  if (!g_type_is_a(G_OBJECT_TYPE(*i), GX_TYPE_CONTROL_PARAMETER)) {
572  continue;
573  }
574  Glib::RefPtr<Gxw::ControlParameter> w = Glib::wrap(GX_CONTROL_PARAMETER(*i), true);
575  Glib::ustring v = w->cp_get_var();
576  if (v.empty()) {
577  continue;
578  }
579  if (!wname) {
580  Glib::RefPtr<Gtk::Widget>::cast_dynamic(w)->set_name(v);
581  }
582  if (!machine.parameter_hasId(v)) {
583  Glib::RefPtr<Gtk::Widget> wd = Glib::RefPtr<Gtk::Widget>::cast_dynamic(w);
584  wd->set_sensitive(0);
585  wd->set_tooltip_text(v);
587  "load dialog",
588  (boost::format("Parameter variable %1% not found") % v).str());
589  continue;
590  }
591  gx_engine::Parameter& p = machine.get_parameter(v);
592  if (!p.desc().empty()) {
593  Glib::RefPtr<Gtk::Widget>::cast_dynamic(w)->set_tooltip_text(
594  gettext(p.desc().c_str()));
595  }
596  switch (p.getControlType()) {
597  case gx_engine::Parameter::None: assert(false); break;
598  case gx_engine::Parameter::Continuous: make_continuous_controller(machine, w, p); break;
599  case gx_engine::Parameter::Switch: make_switch_controller(machine, w, p); break;
600  case gx_engine::Parameter::Enum: make_enum_controller(machine, w, p); break;
601  default: assert(false); break;
602  }
603  if (p.isControllable()) {
604  connect_midi_controller(Glib::RefPtr<Gtk::Widget>::cast_dynamic(w).operator->(), v.c_str(), machine);
605  }
606  }
607 }
608 
609 } /* end of gx_gui namespace */
gx_print_fatal
void gx_print_fatal(const char *, const std::string &)
Definition: gx_logging.cpp:176
gx_gui::load_toplevel
GtkWidget * load_toplevel(GtkBuilder *builder, const char *filename, const char *windowname)
Definition: gx_ui_builder.cpp:36
Glib
Definition: bigknob.cc:41
gx_engine::Parameter::l_name
string l_name() const
Definition: gx_parameter.h:175
gx_engine::GxMachineBase::parameter_hasId
virtual bool parameter_hasId(const char *p)=0
Gxw::ControlParameter::cp_set_value
void cp_set_value(double value)
Definition: controlparameter.cc:131
UiBuilder::openHorizontalTableBox
void(* openHorizontalTableBox)(const char *label)
Definition: gx_plugin.h:73
UiBuilder::create_port_display
void(* create_port_display)(const char *id, const char *label)
Definition: gx_plugin.h:92
gx_gui::UiBuilderImpl::create_feedback_switch_
static void create_feedback_switch_(const char *sw_type, const char *id)
Definition: gx_ui_builder.cpp:207
UiBuilder::create_wheel
void(* create_wheel)(const char *id, const char *label)
Definition: gx_plugin.h:99
gx_gui::uiSelector::id
const std::string id
Definition: gx_ui_builder.cpp:409
gx_gui::UiBuilderImpl::openHorizontalBox_
static void openHorizontalBox_(const char *label)
Definition: gx_ui_builder.cpp:134
gx_gui::uiElement
Definition: gx_ui_builder.h:33
gx_engine::GxMachineBase::get_parameter_value
T get_parameter_value(const std::string &id)
gx_engine::Parameter::getUpperAsFloat
virtual float getUpperAsFloat() const
Definition: gx_paramtable.cpp:994
UiBuilder::openVerticalBox
void(* openVerticalBox)(const char *label)
Definition: gx_plugin.h:68
gx_gui::UiBuilderImpl::insertSpacer_
static void insertSpacer_()
Definition: gx_ui_builder.cpp:150
gx_engine::GxMachineBase
Definition: machine.h:53
UiBuilder::create_switch_no_caption
void(* create_switch_no_caption)(const char *sw_type, const char *id)
Definition: gx_plugin.h:89
gx_gui::uiAdjustmentLog::fAdj
Gtk::Adjustment * fAdj
Definition: gx_ui_builder.cpp:468
gx_gui::UiBuilderImpl::create_mid_rackknob_
static void create_mid_rackknob_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:159
UiBuilder::create_mid_rackknob
void(* create_mid_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:103
gx_gui::UiBuilderImpl::create_eq_rackslider_no_caption_
static void create_eq_rackslider_no_caption_(const char *id)
Definition: gx_ui_builder.cpp:235
value_pair
Definition: gx_plugin.h:117
gx_engine::ParameterV< float >::getLowerAsFloat
virtual float getLowerAsFloat() const
Definition: gx_paramtable.cpp:1275
gx_gui::uiSelector::set_value
void set_value(T v)
Definition: gx_ui_builder.cpp:428
gx_engine::Parameter::getControlType
ctrl_type getControlType() const
Definition: gx_parameter.h:166
gx_gui::StackBoxBuilder::prepare
void prepare()
Definition: gx_stackbox_builder.cpp:104
gx_gui::UiBuilderImpl::load
virtual bool load(gx_engine::Plugin *p)
Definition: gx_ui_builder.cpp:251
gx_engine::ParameterV< float >::getUpperAsFloat
virtual float getUpperAsFloat() const
Definition: gx_paramtable.cpp:1279
gx_gui::logarithmic_format_value
Glib::ustring logarithmic_format_value(double v, int prec)
Definition: gx_gui_helpers.cpp:46
UiBuilder::create_p_display
void(* create_p_display)(const char *id, const char *idl, const char *idh)
Definition: gx_plugin.h:93
gx_engine::Parameter::is_log_display
bool is_log_display()
Definition: gx_parameter.h:180
gx_gui::uiAdjustmentLog::id
const std::string id
Definition: gx_ui_builder.cpp:467
Glib::Container_Helpers::TypeTraits< GObject * >::CTypeNonConst
GObject * CTypeNonConst
Definition: gx_ui_builder.cpp:275
gx_engine::Parameter::getValueNames
virtual const value_pair * getValueNames() const
Definition: gx_paramtable.cpp:998
gx_gui::uiAdjustmentLog::on_parameter_changed
void on_parameter_changed(float v)
Definition: gx_ui_builder.cpp:477
UiBuilder::openVerticalBox2
void(* openVerticalBox2)(const char *label)
Definition: gx_plugin.h:70
gx_engine::GxMachineBase::signal_parameter_value
sigc::signal< void, T > & signal_parameter_value(const std::string &id)
gx_engine::Parameter::desc
const string & desc() const
Definition: gx_parameter.h:176
gx_gui::UiBuilderImpl::intf
static StackBoxBuilder * intf
Definition: gx_ui_builder.h:203
PluginDef::load_ui
uiloader load_ui
Definition: gx_plugin.h:203
gx_gui::UiBuilderImpl::create_feedback_slider_
static void create_feedback_slider_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:179
gx_gui::uiSelector
Definition: gx_ui_builder.cpp:406
gx_engine::PGNI_DYN_POSITION
Definition: gx_pluginloader.h:40
UiBuilder::openpaintampBox
void(* openpaintampBox)(const char *label)
Definition: gx_plugin.h:76
UiBuilder::create_feedback_slider
void(* create_feedback_slider)(const char *id, const char *label)
Definition: gx_plugin.h:85
gx_gui::UiBuilderImpl::openVerticalBox_
static void openVerticalBox_(const char *label)
Definition: gx_ui_builder.cpp:114
gx_print_warning
void gx_print_warning(const char *, const std::string &)
Definition: gx_logging.cpp:160
gx_gui::uiSelector::machine
gx_engine::GxMachineBase & machine
Definition: gx_ui_builder.cpp:408
gx_gui::UiBuilderImpl::create_port_display_
static void create_port_display_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:223
gx_gui::uiAdjustmentLog::changed
void changed()
Definition: gx_ui_builder.cpp:474
gx_engine::GxMachineBase::set_parameter_value
virtual void set_parameter_value(const std::string &id, int value)=0
gx_system::get_options
BasicOptions & get_options()
Definition: gx_system.h:511
UiBuilder::openFrameBox
void(* openFrameBox)(const char *label)
Definition: gx_plugin.h:74
gx_gui::UiBuilderImpl::create_switch_
static void create_switch_(const char *sw_type, const char *id, const char *label)
Definition: gx_ui_builder.cpp:215
PluginDef
Definition: gx_plugin.h:183
gx_engine::Parameter::Continuous
Definition: gx_parameter.h:106
gx_gui::UiBuilderImpl::load_glade_file_
static void load_glade_file_(const char *fname)
Definition: gx_ui_builder.cpp:247
gx_gui::uiAdjustmentLog::uiAdjustmentLog
uiAdjustmentLog(gx_engine::GxMachineBase &machine_, const std::string &id_, Gtk::Adjustment *adj)
Definition: gx_ui_builder.cpp:469
gx_gui::UiBuilderImpl::create_big_rackknob_
static void create_big_rackknob_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:171
UiBuilder::create_fload_switch
void(* create_fload_switch)(const char *sw_type, const char *id, const char *idf)
Definition: gx_plugin.h:102
gx_engine::Parameter::isControllable
bool isControllable() const
Definition: gx_parameter.h:167
gx_gui::UiBuilderImpl::pluginlist
std::vector< PluginUI * > * pluginlist
Definition: gx_ui_builder.h:202
UiBuilder::create_spin_value
void(* create_spin_value)(const char *id, const char *label)
Definition: gx_plugin.h:91
UiBuilder::load_glade_file
void(* load_glade_file)(const char *fname)
Definition: gx_plugin.h:66
gx_gui::GxBuilder::get_first_window
Gtk::Window * get_first_window()
Definition: gx_ui_builder.cpp:354
gx_engine::ParameterV< float >
Definition: gx_parameter.h:228
gx_gui::UiBuilderImpl::load_unit
bool load_unit(PluginDef *pl)
Definition: gx_ui_builder.cpp:100
gx_gui::UiBuilderImpl::openTabBox_
static void openTabBox_(const char *label)
Definition: gx_ui_builder.cpp:110
MainWindow::add_plugin
void add_plugin(std::vector< PluginUI * > &p, const char *id, const Glib::ustring &tooltip_="")
Definition: gx_main_window.cpp:1988
gx_gui::UiBuilderImpl::create_simple_meter_
static void create_simple_meter_(const char *id)
Definition: gx_ui_builder.cpp:191
UiBuilder::create_small_rackknob
void(* create_small_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:86
Glib::wrap
Gxw::BigKnob * wrap(GxBigKnob *object, bool take_copy)
Definition: bigknob.cc:44
gx_gui::UiBuilderImpl::create_selector_
static void create_selector_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:187
UiBuilder::create_feedback_switch
void(* create_feedback_switch)(const char *sw_type, const char *id)
Definition: gx_plugin.h:90
gx_gui::UiBuilderImpl::create_spin_value_
static void create_spin_value_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:199
gx_gui::UiBuilderImpl::create_p_display_
static void create_p_display_(const char *id, const char *idl, const char *idh)
Definition: gx_ui_builder.cpp:227
gx_engine::Parameter::isInt
bool isInt() const
Definition: gx_parameter.h:162
UiBuilder::create_small_rackknobr
void(* create_small_rackknobr)(const char *id, const char *label)
Definition: gx_plugin.h:98
Gxw::Selector
Definition: selector.h:43
UiBuilder::create_eq_rackslider_no_caption
void(* create_eq_rackslider_no_caption)(const char *id)
Definition: gx_plugin.h:101
UiBuilder::create_selector_no_caption
void(* create_selector_no_caption)(const char *id)
Definition: gx_plugin.h:88
gx_gui::uiAdjustment::changed
void changed()
Definition: gx_main_interface.h:231
gx_engine::Parameter::getFloat
FloatParameter & getFloat()
Definition: gx_parameter.h:453
gx_engine::Plugin::get_pdef
PluginDef * get_pdef()
Definition: gx_pluginloader.h:54
UiBuilder::plugin
PluginDef * plugin
Definition: gx_plugin.h:64
gx_engine::GxMachineBase::get_parameter
virtual Parameter & get_parameter(const std::string &id)=0
gx_gui::uiAdjustmentLog::machine
gx_engine::GxMachineBase & machine
Definition: gx_ui_builder.cpp:466
UI_FORM_GLADE
#define UI_FORM_GLADE
Definition: gx_plugin.h:61
gx_gui::UiBuilderImpl::openFlipLabelBox_
static void openFlipLabelBox_(const char *label)
Definition: gx_ui_builder.cpp:142
gx_gui::GxBuilder::create
static Glib::RefPtr< GxBuilder > create()
Definition: gx_ui_builder.h:136
gx_gui::UiBuilderImpl::openHorizontalhideBox_
static void openHorizontalhideBox_(const char *label)
Definition: gx_ui_builder.cpp:126
gx_gui::GxBuilder::get_widget_checked
Gtk::Object * get_widget_checked(const Glib::ustring &name, GType type, bool take_ref)
Definition: gx_ui_builder.cpp:386
UI_FORM_STACK
#define UI_FORM_STACK
Definition: gx_plugin.h:60
gx_gui::UiBuilderImpl::create_simple_c_meter_
static void create_simple_c_meter_(const char *id, const char *idl, const char *label)
Definition: gx_ui_builder.cpp:195
gx_engine::Parameter::value_label
static const char * value_label(const value_pair &vp)
Definition: gx_parameter.h:197
UiBuilder::closeBox
void(* closeBox)()
Definition: gx_plugin.h:77
gx_gui::UiBuilderImpl::set_next_flags_
static void set_next_flags_(int flags)
Definition: gx_ui_builder.cpp:155
gx_engine::Parameter::l_group
string l_group() const
Definition: gx_parameter.h:173
UiBuilder::openVerticalBox1
void(* openVerticalBox1)(const char *label)
Definition: gx_plugin.h:69
gx_system::BasicOptions::get_builder_filepath
std::string get_builder_filepath(const std::string &basename) const
Definition: gx_system.h:369
PluginDef::id
const char * id
Definition: gx_plugin.h:187
gx_gui::UiBuilderImpl::create_master_slider_
static void create_master_slider_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:175
value_pair::value_id
const char * value_id
Definition: gx_plugin.h:118
gx_gui::UiBuilderImpl::create_simple_spin_value_
static void create_simple_spin_value_(const char *id)
Definition: gx_ui_builder.cpp:231
gx_gui::UiBuilderImpl::create_small_rackknob_
static void create_small_rackknob_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:163
gx_gui::uiSelector::uiSelector
uiSelector(gx_engine::GxMachineBase &machine, Gtk::Range *rng, const std::string &id)
Definition: gx_ui_builder.cpp:418
gx_gui
Definition: gx_gui_helpers.h:28
gx_gui::UiBuilderImpl::openVerticalBox2_
static void openVerticalBox2_(const char *label)
Definition: gx_ui_builder.cpp:122
gx_gui::UiBuilderImpl::openHorizontalTableBox_
static void openHorizontalTableBox_(const char *label)
Definition: gx_ui_builder.cpp:130
UiBuilder::create_simple_meter
void(* create_simple_meter)(const char *id)
Definition: gx_plugin.h:96
PluginDef::flags
int flags
Definition: gx_plugin.h:185
gx_gui::uiSelector::on_value_changed
void on_value_changed()
Definition: gx_ui_builder.cpp:433
gx_gui::StackBoxBuilder
Definition: gx_stackbox_builder.h:44
gx_engine::Parameter::id
const string & id() const
Definition: gx_parameter.h:171
gx_engine::Parameter::Switch
Definition: gx_parameter.h:106
UiBuilder::openFlipLabelBox
void(* openFlipLabelBox)(const char *label)
Definition: gx_plugin.h:75
gx_engine::Parameter::isFloat
bool isFloat() const
Definition: gx_parameter.h:161
gx_engine::ParameterV< float >::getStepAsFloat
virtual float getStepAsFloat() const
Definition: gx_paramtable.cpp:1283
UiBuilder::create_simple_spin_value
void(* create_simple_spin_value)(const char *id)
Definition: gx_plugin.h:100
gx_gui::UiBuilderImpl::main
MainWindow & main
Definition: gx_ui_builder.h:201
gx_gui::UiBuilderImpl::create_selector_no_caption_
static void create_selector_no_caption_(const char *id)
Definition: gx_ui_builder.cpp:183
gx_gui::UiBuilderImpl::create_small_rackknobr_
static void create_small_rackknobr_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:167
gx_gui::connect_midi_controller
void connect_midi_controller(Gtk::Widget *w, const std::string &id, gx_engine::GxMachineBase &machine)
Definition: gx_main_interface.h:275
gx_engine::Parameter::None
Definition: gx_parameter.h:106
gx_gui::UiBuilderImpl::openFrameBox_
static void openFrameBox_(const char *label)
Definition: gx_ui_builder.cpp:138
UiBuilder::set_next_flags
void(* set_next_flags)(int flags)
Definition: gx_plugin.h:79
UiBuilder::create_master_slider
void(* create_master_slider)(const char *id, const char *label)
Definition: gx_plugin.h:84
UiBuilder::openHorizontalBox
void(* openHorizontalBox)(const char *label)
Definition: gx_plugin.h:71
gx_gui::UiBuilderImpl::openVerticalBox1_
static void openVerticalBox1_(const char *label)
Definition: gx_ui_builder.cpp:118
gx_gui::UiBuilderImpl::closeBox_
static void closeBox_()
Definition: gx_ui_builder.cpp:239
UiBuilder::openHorizontalhideBox
void(* openHorizontalhideBox)(const char *label)
Definition: gx_plugin.h:72
gx_gui::UiBuilderImpl::create_fload_switch_
static void create_fload_switch_(const char *sw_type, const char *id, const char *idf)
Definition: gx_ui_builder.cpp:211
gx_engine::Plugin
Definition: gx_pluginloader.h:44
UiBuilder::create_big_rackknob
void(* create_big_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:87
gx_gui::UiBuilderImpl::UiBuilderImpl
UiBuilderImpl(MainWindow *i, StackBoxBuilder *b, std::vector< PluginUI * > *pl=0)
Definition: gx_ui_builder.cpp:60
Gxw::Selector::set_model
void set_model(Glib::RefPtr< Gtk::TreeModel > p1)
Definition: selector.cc:132
gx_gui::uiAdjustmentLog
Definition: gx_ui_builder.cpp:465
gx_gui::logarithmic_input_value
int logarithmic_input_value(gpointer obj, gpointer nv)
Definition: gx_gui_helpers.cpp:54
MainWindow
Definition: gx_main_window.h:574
gx_gui::GxBuilder::fixup_controlparameters
void fixup_controlparameters(gx_engine::GxMachineBase &machine)
Definition: gx_ui_builder.cpp:558
UiBuilder::create_simple_c_meter
void(* create_simple_c_meter)(const char *id, const char *idl, const char *label)
Definition: gx_plugin.h:97
gx_engine::Parameter::getLowerAsFloat
virtual float getLowerAsFloat() const
Definition: gx_paramtable.cpp:990
Glib::Container_Helpers::TypeTraits< GObject * >::CType
GObject * CType
Definition: gx_ui_builder.cpp:274
gx_gui::UiBuilderImpl::create_switch_no_caption_
static void create_switch_no_caption_(const char *sw_type, const char *id)
Definition: gx_ui_builder.cpp:203
guitarix.h
UiBuilder::load_glade
void(* load_glade)(const char *data)
Definition: gx_plugin.h:65
gx_engine::Parameter
Definition: gx_parameter.h:104
gx_engine::Parameter::isBool
bool isBool() const
Definition: gx_parameter.h:163
UiBuilder::openTabBox
void(* openTabBox)(const char *label)
Definition: gx_plugin.h:67
UiBuilder::create_switch
void(* create_switch)(const char *sw_type, const char *id, const char *label)
Definition: gx_plugin.h:94
PGN_GUI
Definition: gx_plugin.h:165
gx_gui::uiSelector::rng
Gtk::Range * rng
Definition: gx_ui_builder.cpp:410
gx_engine::Parameter::Enum
Definition: gx_parameter.h:106
UiBuilder::create_selector
void(* create_selector)(const char *id, const char *label)
Definition: gx_plugin.h:95
gx_gui::UiBuilderImpl::create_wheel_
static void create_wheel_(const char *id, const char *label)
Definition: gx_ui_builder.cpp:219
main
int main(int argc, char *argv[])
Definition: gxw_demo.cc:67
UiBuilder::insertSpacer
void(* insertSpacer)()
Definition: gx_plugin.h:78
Glib::Container_Helpers::TypeTraits< GObject * >::CppType
GObject * CppType
Definition: gx_ui_builder.cpp:273
gx_gui::UiBuilderImpl::load_glade_
static void load_glade_(const char *data)
Definition: gx_ui_builder.cpp:243
gx_gui::UiBuilderImpl::openpaintampBox_
static void openpaintampBox_(const char *label)
Definition: gx_ui_builder.cpp:146