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 
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 
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 
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 
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 
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 
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>
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 */
Glib::ustring logarithmic_format_value(double v, int prec)
virtual float getUpperAsFloat() const
static void create_simple_spin_value_(const char *id)
const std::string id
PluginDef * get_pdef()
static void create_fload_switch_(const char *sw_type, const char *id, const char *idf)
virtual bool load(gx_engine::Plugin *p)
void(* insertSpacer)()
Definition: gx_plugin.h:78
static void load_glade_(const char *data)
BasicOptions & get_options()
Definition: gx_system.h:509
PluginDef * plugin
Definition: gx_plugin.h:64
static void openHorizontalhideBox_(const char *label)
void(* create_fload_switch)(const char *sw_type, const char *id, const char *idf)
Definition: gx_plugin.h:102
void(* load_glade)(const char *data)
Definition: gx_plugin.h:65
std::string get_builder_filepath(const std::string &basename) const
Definition: gx_system.h:373
static void create_feedback_slider_(const char *id, const char *label)
bool load_unit(PluginDef *pl)
int logarithmic_input_value(gpointer obj, gpointer nv)
bool isBool() const
Definition: gx_parameter.h:163
static void create_master_slider_(const char *id, const char *label)
void(* openFlipLabelBox)(const char *label)
Definition: gx_plugin.h:75
const char * value_id
Definition: gx_plugin.h:118
static void openFrameBox_(const char *label)
virtual Parameter & get_parameter(const std::string &id)=0
static void load_glade_file_(const char *fname)
static void create_big_rackknob_(const char *id, const char *label)
uiAdjustmentLog(gx_engine::GxMachineBase &machine_, const std::string &id_, Gtk::Adjustment *adj)
void(* openTabBox)(const char *label)
Definition: gx_plugin.h:67
void(* create_feedback_switch)(const char *sw_type, const char *id)
Definition: gx_plugin.h:90
static void create_eq_rackslider_no_caption_(const char *id)
void(* create_switch_no_caption)(const char *sw_type, const char *id)
Definition: gx_plugin.h:89
void on_parameter_changed(float v)
#define UI_FORM_GLADE
Definition: gx_plugin.h:61
static void openTabBox_(const char *label)
void fixup_controlparameters(gx_engine::GxMachineBase &machine)
static void create_small_rackknobr_(const char *id, const char *label)
virtual float getUpperAsFloat() const
virtual float getLowerAsFloat() const
uiSelector(gx_engine::GxMachineBase &machine, Gtk::Range *rng, const std::string &id)
void(* create_p_display)(const char *id, const char *idl, const char *idh)
Definition: gx_plugin.h:93
void(* closeBox)()
Definition: gx_plugin.h:77
ctrl_type getControlType() const
Definition: gx_parameter.h:166
static void openVerticalBox1_(const char *label)
bool isInt() const
Definition: gx_parameter.h:162
void(* load_glade_file)(const char *fname)
Definition: gx_plugin.h:66
void gx_print_fatal(const char *, const std::string &)
Definition: gx_logging.cpp:177
static void create_small_rackknob_(const char *id, const char *label)
static void create_mid_rackknob_(const char *id, const char *label)
static void openHorizontalBox_(const char *label)
virtual float getLowerAsFloat() const
void(* create_wheel)(const char *id, const char *label)
Definition: gx_plugin.h:99
void(* create_selector)(const char *id, const char *label)
Definition: gx_plugin.h:95
static void insertSpacer_()
void cp_set_value(double value)
void(* openHorizontalBox)(const char *label)
Definition: gx_plugin.h:71
static void openpaintampBox_(const char *label)
static void create_simple_meter_(const char *id)
T get_parameter_value(const std::string &id)
const char * id
Definition: gx_plugin.h:185
bool isFloat() const
Definition: gx_parameter.h:161
string l_group() const
Definition: gx_parameter.h:173
const std::string id
static void set_next_flags_(int flags)
void(* create_port_display)(const char *id, const char *label)
Definition: gx_plugin.h:92
void(* openFrameBox)(const char *label)
Definition: gx_plugin.h:74
static void create_feedback_switch_(const char *sw_type, const char *id)
void(* create_small_rackknobr)(const char *id, const char *label)
Definition: gx_plugin.h:98
Gtk::Object * get_widget_checked(const Glib::ustring &name, GType type, bool take_ref)
void(* create_simple_spin_value)(const char *id)
Definition: gx_plugin.h:100
void(* create_simple_meter)(const char *id)
Definition: gx_plugin.h:96
string l_name() const
Definition: gx_parameter.h:175
virtual bool parameter_hasId(const char *p)=0
void(* create_mid_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:103
int flags
Definition: gx_plugin.h:183
gx_engine::GxMachineBase & machine
void(* openVerticalBox2)(const char *label)
Definition: gx_plugin.h:70
static void openHorizontalTableBox_(const char *label)
virtual void set_parameter_value(const std::string &id, int value)=0
static void openVerticalBox_(const char *label)
void add_plugin(std::vector< PluginUI *> &p, const char *id, const Glib::ustring &tooltip_="")
void connect_midi_controller(Gtk::Widget *w, const std::string &id, gx_engine::GxMachineBase &machine)
void(* create_small_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:86
void set_model(Glib::RefPtr< Gtk::TreeModel > p1)
Definition: selector.cc:132
#define UI_FORM_STACK
Definition: gx_plugin.h:60
UiBuilderImpl(MainWindow *i, StackBoxBuilder *b, std::vector< PluginUI *> *pl=0)
void(* openpaintampBox)(const char *label)
Definition: gx_plugin.h:76
FloatParameter & getFloat()
Definition: gx_parameter.h:451
void gx_print_warning(const char *, const std::string &)
Definition: gx_logging.cpp:161
void(* openHorizontalhideBox)(const char *label)
Definition: gx_plugin.h:72
static void create_selector_(const char *id, const char *label)
const string & desc() const
Definition: gx_parameter.h:176
static void create_simple_c_meter_(const char *id, const char *idl, const char *label)
static Glib::RefPtr< GxBuilder > create()
static StackBoxBuilder * intf
Gtk::Window * get_first_window()
static void create_selector_no_caption_(const char *id)
virtual float getStepAsFloat() const
int main(int argc, char *argv[])
Definition: gxw_demo.cc:62
void(* create_feedback_slider)(const char *id, const char *label)
Definition: gx_plugin.h:85
static void create_switch_no_caption_(const char *sw_type, const char *id)
gx_engine::GxMachineBase & machine
void(* create_spin_value)(const char *id, const char *label)
Definition: gx_plugin.h:91
Gxw::BigKnob * wrap(GxBigKnob *object, bool take_copy)
Definition: bigknob.cc:44
std::vector< PluginUI * > * pluginlist
GtkWidget * load_toplevel(GtkBuilder *builder, const char *filename, const char *windowname)
void(* create_big_rackknob)(const char *id, const char *label)
Definition: gx_plugin.h:87
void(* openHorizontalTableBox)(const char *label)
Definition: gx_plugin.h:73
void(* set_next_flags)(int flags)
Definition: gx_plugin.h:79
static void create_port_display_(const char *id, const char *label)
static void create_p_display_(const char *id, const char *idl, const char *idh)
Definition: bigknob.cc:41
static void create_spin_value_(const char *id, const char *label)
static void openVerticalBox2_(const char *label)
static const char * value_label(const value_pair &vp)
Definition: gx_parameter.h:197
void(* create_simple_c_meter)(const char *id, const char *idl, const char *label)
Definition: gx_plugin.h:97
sigc::signal< void, T > & signal_parameter_value(const std::string &id)
void(* create_eq_rackslider_no_caption)(const char *id)
Definition: gx_plugin.h:101
static void create_switch_(const char *sw_type, const char *id, const char *label)
bool isControllable() const
Definition: gx_parameter.h:167
const string & id() const
Definition: gx_parameter.h:171
void(* create_switch)(const char *sw_type, const char *id, const char *label)
Definition: gx_plugin.h:94
static void openFlipLabelBox_(const char *label)
uiloader load_ui
Definition: gx_plugin.h:201
void(* openVerticalBox1)(const char *label)
Definition: gx_plugin.h:69
static void create_wheel_(const char *id, const char *label)
Gtk::Adjustment * fAdj
void(* create_master_slider)(const char *id, const char *label)
Definition: gx_plugin.h:84
void(* create_selector_no_caption)(const char *id)
Definition: gx_plugin.h:88
void(* openVerticalBox)(const char *label)
Definition: gx_plugin.h:68
virtual const value_pair * getValueNames() const