Guitarix
gx_main_window.h
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/****************************************************************
26 ** class GxTheme
27 */
28
29class GxTheme {
30private:
32 Glib::RefPtr<Gtk::CssProvider> css_provider;
33 Glib::RefPtr<Gtk::CssProvider> css_show_values;
34 Glib::RefPtr<Gtk::StyleContext> style_context;
35#ifndef NDEBUG
36 Gtk::Window *window;
39#endif
40public:
43 bool set_new_skin(const Glib::ustring& skin_name);
45#ifndef NDEBUG
46 void reload_css();
47 void set_window(Gtk::Window *window_) { window = window_; }
48#endif
49};
50
51
52/****************************************************************
53 ** Actions:
54 ** class ToggleAction
55 ** class RadioAction
56 ** template class UiToggleAction
57 */
58
59class ToggleAction: public Gio::SimpleAction {
60protected:
61 ToggleAction(const Glib::ustring& name, bool state)
62 : Gio::SimpleAction(name, Glib::Variant<bool>::create(state)) {}
63public:
64 static Glib::RefPtr<ToggleAction> create(const Glib::ustring& name, bool state=false) {
65 return Glib::RefPtr<ToggleAction>(new ToggleAction(name, state)); }
66 Glib::SignalProxyProperty signal_toggled() { return property_state().signal_changed(); }
67 bool get_active() const { bool v; get_state(v); return v; }
68 void set_active(bool v);
69};
70
71class RadioAction: public Gio::SimpleAction {
72protected:
73 RadioAction(const Glib::ustring& name);
74public:
75 static Glib::RefPtr<RadioAction> create(const Glib::ustring& name) {
76 return Glib::RefPtr<RadioAction>(new RadioAction(name)); }
77
78 bool get_current_value() const { int v; get_state(v); return v; }
79 void set_current_value(int v) { change_state(v); }
80};
81
82template <class T>
84private:
86 std::string id;
87 void on_toggled();
88protected:
90 gx_engine::GxMachineBase& machine_, const std::string& id,
91 const Glib::ustring& name, bool is_active=false);
93public:
94 static Glib::RefPtr<UiToggleAction> create(
95 gx_engine::GxMachineBase& machine, const std::string& id,
96 const Glib::ustring& name, bool is_active=false) {
97 return Glib::RefPtr<UiToggleAction>(
98 new UiToggleAction(machine, id, name, is_active));
99 }
100};
101
103
104
105/****************************************************************
106 ** class UIManager
107 */
108
110public:
111 typedef std::function<bool(const Glib::ustring&, Glib::RefPtr<Gio::Menu>&, int, int)> search_func;
112private:
113 Glib::RefPtr<Gio::Menu> menu;
114 Glib::RefPtr<Gtk::AccelGroup> accelgroup;
115 Glib::RefPtr<Gio::SimpleActionGroup> actiongroup;
116 Gtk::MenuBar *menubar;
117 void set_accelerators_from_menu(Glib::RefPtr<Gio::Menu>& menu);
118 bool foreach_menu_(Glib::RefPtr<Gio::Menu>& menu, search_func& func, int& startpos);
119public:
120 UIManager(const std::string& file, Gtk::MenuBar *bar);
121 Glib::RefPtr<Gtk::AccelGroup>& get_accel_group() { return accelgroup; }
122 Glib::RefPtr<Gio::SimpleActionGroup>& get_action_group() { return actiongroup; }
123 void insert_action_group(Glib::RefPtr<Gio::SimpleActionGroup>& group) { actiongroup = group; }
124
125
127 bool foreach_menu(search_func func) { int pos = 0; return foreach_menu_(menu, func, pos); }
128 Glib::RefPtr<Gio::SimpleAction> add_action(const Glib::ustring& action);
129 Glib::RefPtr<Gio::SimpleAction> add_action(const Glib::ustring& action, sigc::slot<void()> slot);
130 Glib::RefPtr<ToggleAction> add_toggle_action(const Glib::ustring& action, bool state = false);
131 Glib::RefPtr<RadioAction> add_radio_action(const Glib::ustring& action);
132 Glib::RefPtr<UiBoolToggleAction> add_ui_bool_action(
133 gx_engine::GxMachineBase& machine, const std::string& id,
134 const Glib::ustring& name, bool is_active=false);
135 static void add_accelerator(Glib::RefPtr<Gtk::AccelGroup>& group,
136 Glib::RefPtr<Gio::Action> action,
137 const Glib::ustring& accelerator,
138 Glib::VariantBase& target);
139 void add_accelerator(Glib::RefPtr<Gio::Action> action, Glib::VariantBase& target,
140 const Glib::ustring& accelerator);
141 Glib::RefPtr<Gio::Menu> get_linked_menu(const Glib::ustring& action);
142 Gtk::MenuItem *find_item(const Glib::ustring& action);
143 bool remove_item(const Glib::ustring& action);
144 static void set_widget_action(Gtk::Widget *w, const Glib::ustring& action);
145 static void set_widget_action(Gtk::Widget *w, const Glib::RefPtr<Gio::Action>& action);
146};
147
148/****************************************************************
149 ** class KeySwitcher
150 */
151
152class KeySwitcher: public sigc::trackable {
153private:
155 sigc::slot<void, const Glib::ustring&, const Glib::ustring&> display;
156 sigc::connection key_timeout;
157 Glib::ustring last_bank_key;
158private:
159 void display_empty(const Glib::ustring& bank, const Glib::ustring& preset);
162public:
164 sigc::slot<void, const Glib::ustring&, const Glib::ustring&> display_)
165 : machine(machine_), display(display_) {}
166 bool process_bank_key(int key);
167 bool process_preset_key(int key);
170 static char idx_to_char(int idx);
171 static int key_offset_to_idx(int offset);
172 static char bank_idx_to_char(int idx, int bank_size);
173 static int key_offset_to_bank_idx(int offset, int bank_size);
174 static int next_idx(int idx = -1);
175};
176
177
178/****************************************************************
179 ** class Liveplay
180 */
181
182class Liveplay: public sigc::trackable {
183private:
184 Glib::RefPtr<gx_gui::GxBuilder> bld;
188 Glib::RefPtr<Gtk::Adjustment> brightness_adj;
189 Glib::RefPtr<Gtk::Adjustment> background_adj;
191 sigc::connection midi_conn;
192 Gtk::Window *window;
193 sigc::connection mouse_hide_conn;
194 //
195 Gtk::Image *bypass_image;
196 Gtk::Image *mute_image;
197 Gtk::Label *liveplay_bank;
198 Gtk::Label *liveplay_preset;
199 Gtk::Widget *liveplay_canvas;
200 Gxw::HSlider *brightness_slider;
201 Gtk::Box *brightness_box;
202 Gxw::HSlider *background_slider;
203 Gtk::ToggleButton *liveplay_exit;
204 Gtk::Grid *midictrl_table;
205 Gxw::RackTuner *tuner;
206private:
208 bool on_delete(GdkEventAny *ev);
211 bool transparent_draw(const Cairo::RefPtr<Cairo::Context> &cr);
212 bool window_draw(const Cairo::RefPtr<Cairo::Context> &cr);
215 void on_selection_done(bool v);
218 GtkAccelGroup *accel_group, GObject *acceleratable,
219 guint keyval, GdkModifierType modifier, Liveplay& self);
221 GtkAccelGroup *accel_group, GObject *acceleratable,
222 guint keyval, GdkModifierType modifier, Liveplay& self);
224 GtkAccelGroup *accel_group, GObject *acceleratable,
225 guint keyval, GdkModifierType modifier, Liveplay& self);
227 GtkAccelGroup *accel_group, GObject *acceleratable,
228 guint keyval, GdkModifierType modifier, Liveplay& self);
230 GtkAccelGroup *accel_group, GObject *acceleratable,
231 guint keyval, GdkModifierType modifier, Liveplay& self);
232 bool pointer_motion(GdkEventMotion* event);
233 void display(const Glib::ustring& bank, const Glib::ustring& preset);
235public:
237 const std::string& fname, const GxActions& actions,
238 Glib::RefPtr<Gio::SimpleActionGroup>& group);
240 void on_live_play(Glib::RefPtr<ToggleAction> act);
241 void display_tuner(bool v);
242 Gxw::RackTuner& get_tuner() { return *tuner; }
243};
244
245
246/****************************************************************
247 ** class DragIcon
248 */
249
250class DragIcon {
251private:
252 enum { gradient_length = 60 };
253 Gtk::Window *window;
254 Glib::RefPtr<Gdk::Pixbuf> drag_icon_pixbuf;
255private:
256 bool icon_draw(const Cairo::RefPtr<Cairo::Context> &cr);
257 void create_drag_icon_pixbuf(const PluginUI& plugin, Glib::RefPtr<Gdk::Visual> rgba, gx_system::CmdlineOptions& options);
258 bool window_draw(const Cairo::RefPtr<Cairo::Context> &cr, Gtk::OffscreenWindow& w);
259public:
260 DragIcon(PluginUI& plugin, Glib::RefPtr<Gdk::DragContext> context, gx_system::CmdlineOptions& options, int xoff=0);
262};
263
264
265/****************************************************************
266 ** class RackBox, class MiniRackBox
267 */
268
269class MainWindow;
270class RackContainer;
271class MiniRackBox;
272
273class RackBox: public Gtk::VBox {
274 friend class PluginUI;
275private:
278 sigc::connection anim_tag;
281 Gxw::PaintBox mbox;
283 Gtk::Widget *fbox;
284 std::string target;
289 Gxw::PaintBox box;
290 Gxw::Switch on_off_switch;
291private:
292 static void set_paintbox(Gxw::PaintBox& pb, PluginType tp);
293 static void set_paintbox_unit(Gxw::PaintBox& pb, const PluginUI& plugin);
294 static void set_paintbox_unit_shrink(Gxw::PaintBox& pb, PluginType tp);
295 static Gtk::Widget *make_label(const PluginUI& plugin, gx_system::CmdlineOptions& options, bool useshort=true);
296 static Gtk::Widget *make_bar(int left=4, int right=4, bool sens=false);
297 Gtk::Widget *wrap_bar(int left=4, int right=4, bool sens=false);
298 void init_dnd();
299 void enable_drag(bool v);
300 void on_my_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
302 bool on_my_leave_out(GdkEventCrossing *focus);
303 bool on_my_enter_in(GdkEventCrossing *focus);
304 void on_my_drag_end(const Glib::RefPtr<Gdk::DragContext>& context);
305 bool on_my_drag_failed(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::DragResult result);
306 void on_my_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection, int info, int timestamp);
307 void vis_switch(Gtk::Widget& a, Gtk::Widget& b);
308 void set_visibility(bool v);
309 Gtk::Button *make_expand_button(bool expand);
310 Gtk::Button *make_preset_button();
312 bool has_delete() const { return delete_button; }
313 void do_expand();
314public:
315 RackBox(PluginUI& plugin, PluginDict& plugin_dict, Gtk::Widget* bare=0);
316 static Gtk::Widget *create_drag_widget(const PluginUI& plugin, gx_system::CmdlineOptions& options);
318 bool can_compress() { return compress; }
319 friend class MiniRackBox;
320 const char *get_id() const;
321 void set_config_mode(bool mode);
322 void swtch(bool mini);
323 void pack(Gtk::Widget *mainbox, Gtk::Widget *minibox);
325 static Gtk::Widget *create_icon_widget(const PluginUI& plugin, gx_system::CmdlineOptions& options);
326 void set_position(int pos, int post_pre);
327 bool compare_position(int pos, int post_pre);
328 void display(bool v, bool animate);
329 bool get_plug_visible();
330};
331
332class MiniRackBox: public Gtk::HBox {
333private:
334 static Glib::RefPtr<Gtk::SizeGroup> szg_label;
335 Gtk::EventBox evbox;
336 Gtk::HBox mconbox;
337 Gtk::Button *mb_expand_button;
338 Gtk::Widget *mb_delete_button;
339 Gtk::Button *preset_button;
340 Gxw::Switch on_off_switch;
341 bool on_my_leave_out(GdkEventCrossing *focus);
342 bool on_my_enter_in(GdkEventCrossing *focus);
343 sigc::connection evbox_button;
344private:
345 Gtk::Widget *make_delete_button(RackBox& rb);
346public:
348 void set_config_mode(bool mode, PluginUI& plugin);
349 void pack(Gtk::Widget *w);
350};
351
352/****************************************************************
353 ** class RackContainer
354 */
355
356class PluginDict;
357
358class RackContainer: public Gtk::VBox {
359private:
362 int count;
363 std::vector<std::string> targets;
364 std::vector<std::string> othertargets;
365 sigc::connection highlight_connection;
366 sigc::connection autoscroll_connection;
367private:
368 using Gtk::VBox::add;
369 bool drag_highlight_draw(const Cairo::RefPtr<Cairo::Context>&, int y0);
370 void find_index(int x, int y, string* before, int *ypos);
371 bool check_targets(const std::vector<std::string>& tgts1, const std::vector<std::string>& tgts2);
372 virtual bool on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint timestamp);
373 virtual void on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint timestamp);
374 virtual void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& data, guint info, guint timestamp);
375 virtual void on_add(Widget* ch);
378public:
379 typedef Glib::ListHandle<const RackBox*> rackbox_const_list;
380 typedef Glib::ListHandle<RackBox*> rackbox_list;
383 return rackbox_list(
384 gtk_container_get_children(GTK_CONTAINER(gobj())),
385 Glib::OWNERSHIP_SHALLOW);
386 }
388 return rackbox_const_list(
389 gtk_container_get_children(const_cast<GtkContainer*>(GTK_CONTAINER(gobj()))),
390 Glib::OWNERSHIP_SHALLOW);
391 }
392 void add(RackBox& r, int pos=-1);
394 void renumber();
395 double stop_at_bottom(double off, double step_size, double pagesize);
396 double stop_at_top(double off, double step_size);
397 void set_list_targets(const std::vector<Gtk::TargetEntry>& listTargets,
398 const std::vector<std::string>& targets_,
399 const std::vector<std::string>& othertargets_);
400 void set_child_count(int n);
402 inline void reorder(const std::string& name, const std::string& before);
403};
404
405
406/****************************************************************
407 ** class PluginUI
408 */
409
410class PluginUI: public sigc::trackable {
411 friend class PluginDict;
412 friend class RackContainer;
413private:
414 Glib::RefPtr<ToggleAction> action;
415 // data for ToolPalette entry
416 Gtk::ToolItemGroup *group;
417 Gtk::ToolItem *toolitem;
419 bool hidden;
420 bool active;
421 sigc::signal<void(bool)> output_widget_state;
423 Glib::ustring tooltip;
424 const char *shortname;
425private:
428protected:
429 PluginUI(PluginDict& plugin_dict, const char* id_, const Glib::ustring& tooltip_="");
430 virtual ~PluginUI();
431public:
433
434
436
439 }
440 bool has_gui() const {
441 PluginDef const * const pdef = plugin->get_pdef();
442 return pdef->flags & PGN_GUI || pdef->load_ui;
443 }
444 const char *get_id() const { return plugin->get_pdef()->id; }
445 const char *get_name() const { return plugin->get_pdef()->name; }
446 void activate(bool animate);
447 void decativate(bool animate);
448 void set_action(Glib::RefPtr<ToggleAction>& act);
449 void set_active(bool v) { if (action) action->set_active(v); }
450 Glib::RefPtr<ToggleAction> get_action() { return action; }
451 static bool is_registered(gx_engine::GxMachineBase& m, const char *name);
453 inline const char *get_category() {
454 const char *cat = plugin->get_pdef()->category;
455 return (cat && *cat) ? cat : N_("External");
456 }
457 inline const char *get_shortname() const {
458 const char *name = shortname;
459 if (!name) {
460 name = plugin->get_pdef()->shortname;
461 }
462 if (!name || !*name) {
463 name = get_name();
464 }
465 return name;
466 }
468 void compress(bool state);
469 void hide(bool animate);
470 void show(bool animate);
471 void set_config_mode(bool state);
473 void on_ti_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
474 void on_ti_drag_end(const Glib::RefPtr<Gdk::DragContext>& context);
475 void on_ti_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection, int info, int timestamp);
476 void on_ti_drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& context);
477 bool on_ti_button_press(GdkEventButton *ev);
478 bool on_my_leave_out(GdkEventCrossing *focus);
479 bool on_my_enter_in(GdkEventCrossing *focus);
480 void add_toolitem(Gtk::ToolItemGroup *gw);
481 void activate(bool animate, const string& before);
482 void deactivate(bool animate);
484 void set_update_state(bool state);
486 void remove(bool animate);
488 bool on_rack_handle_press(GdkEventButton* ev);
489 Glib::ustring get_displayname(bool useshort) const;
490 sigc::signal<void(bool)> *get_output_widget_state() { return &output_widget_state; }
491};
492
494
495inline const char *RackBox::get_id() const { return plugin.get_id(); }
497
498/****************************************************************
499 ** class PluginDict
500 */
501
502class PluginDict: private std::map<std::string, PluginUI*> {
503private:
506 std::map<Glib::ustring, Gtk::ToolItemGroup*> groupmap;
507 std::vector<std::string> monotargets;
508 std::vector<std::string> stereotargets;
512 Gtk::ToolPalette& toolpalette;
516public:
518private:
519 Glib::ustring category_id(const std::string& group, bool stereo);
521 Gtk::ToolItemGroup *add_plugin_category(const char *cat, bool collapse = true);
522 Glib::ustring add_plugin_menu_entry(PluginUI *pui);
526public:
527 typedef std::map<std::string, PluginUI*>::iterator iterator;
532 void cleanup();
533 void add_bare(const char * id, Gtk::Container *box);
534 void add(PluginUI *p);
535 void remove(PluginUI *p);
536 PluginUI *operator[](const std::string& s) { return find(s)->second; }
537 using std::map<std::string, PluginUI*>::begin;
538 using std::map<std::string, PluginUI*>::end;
539 void compress(bool state);
541 void set_config_mode(bool state);
542 bool get_config_mode() { return config_mode; }
545 double stop_at(RackContainer *container, double off, double step_size, double page_size);
549 void check_order(PluginType tp, bool animate);
550 void unit_order_changed(bool stereo);
551 void reorder(RackContainer *container, const std::string& name, const std::string& before);
553 void on_tp_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& data, int info, int timestamp);
557 void plugin_preset_popup(const PluginDef *pdef, const Glib::ustring& name);
558 RackBox *add_rackbox_internal(PluginUI& plugin, Gtk::Widget *mainwidget, Gtk::Widget *miniwidget,
559 bool mini=false, int pos=-1, bool animate=false, Gtk::Widget *bare=0);
560 RackBox *add_rackbox(PluginUI& pl, bool mini=false, int pos=-1, bool animate=false);
561 void pluginlist_append(std::vector<PluginUI*>& p);
562 void add_plugin(std::vector<PluginUI*>& p, const char *id, const Glib::ustring& tooltip_="");
563 PluginUI *activate(const string& id, const string& before, bool animate);
564 PluginUI *deactivate(const string& id, bool animate);
565};
566
567
568/****************************************************************
569 ** class TextLoggingBox
570 */
571
572class TextLoggingBox: public Gtk::Window {
573private:
574 struct tab_table {
575 const char *tagname;
576 const char *tag_color;
577 };
578 Gtk::VBox box;
579 Gtk::Button ok_button;
580 Gtk::HButtonBox buttonbox;
581 Gtk::ScrolledWindow scrollbox;
582 Gtk::TextView tbox;
584 Glib::RefPtr<Gtk::TextTag> tags[GxLogger::kMessageTypeCount];
586 sigc::signal<void> msg_level_changed;
587private:
588 virtual bool on_key_press_event(GdkEventKey *event);
589 void show_msg(string msgbuf, GxLogger::MsgType msgtype, bool plugged);
590 virtual void on_show();
591 virtual void on_hide();
592public:
597 sigc::signal<void>& signal_msg_level_changed() { return msg_level_changed; }
598};
599
600
601/****************************************************************
602 ** class NsmSignals
603 **
604 ** signal messages from GxNsmHandler to MainWindow and back.
605 **
606 */
607
609
610private:
611
612public: // GxNsmHandler to MainWindow
614
615 sigc::signal<void > trigger_nsm_show_gui;
616 sigc::signal<void >& signal_trigger_nsm_show_gui() { return trigger_nsm_show_gui; }
617
618 sigc::signal<void > trigger_nsm_hide_gui;
619 sigc::signal<void >& signal_trigger_nsm_hide_gui() { return trigger_nsm_hide_gui; }
620
621 sigc::signal<void > trigger_nsm_save_gui;
622 sigc::signal<void >& signal_trigger_nsm_save_gui() { return trigger_nsm_save_gui; }
623
624public: // MainWindow to GxNsmHandler
625 sigc::signal<void > trigger_nsm_gui_is_shown;
627
628 sigc::signal<void > trigger_nsm_gui_is_hidden;
630
633};
634
635
636/****************************************************************
637 ** class MainWindow
638 */
639
640class Freezer {
641private:
642 Gtk::Window *window;
643 sigc::connection tag;
647 sigc::slot<void> work;
648private:
649 void do_thaw();
651 void freeze(Gtk::Window *w, int width, int height);
652 void thaw();
653public:
656 void freeze_until_width_update(Gtk::Window *w, int width);
657 void set_slot(sigc::slot<void> w);
658 void freeze_and_size_request(Gtk::Window *w, int width, int height);
659 bool check_thaw(int width, int height);
660};
661
662
663/****************************************************************
664 ** class PluginPresetPopup
665 */
666
667class PluginPresetPopup: public Gtk::Menu {
668private:
671 const Glib::ustring save_name_default;
674 void set_plugin_preset(bool factory, const Glib::ustring& name);
675 bool add_plugin_preset_list(bool *found);
678protected:
679 virtual void on_selection_done();
680public:
682 const Glib::ustring& save_name_default = "");
683 gx_preset::UnitPresetList::const_iterator begin() { return presetnames.begin(); }
684 gx_preset::UnitPresetList::const_iterator end() { return presetnames.end(); }
685 const PluginDef *get_pdef() { return pdef; }
687};
688
689
690/****************************************************************
691 ** GxUiRadioMenu
692 ** adds the values of an EnumParameter as Gio::MenuItem's
693 ** to a Gio::Menu
694 */
695
697private:
699 const std::string id;
700 Glib::RefPtr<Gio::SimpleAction> action;
701 void set_value(int v);
702 void on_changed(const Glib::VariantBase& value);
703public:
705 void setup(UIManager& uimanager);
706};
707
708
710public:
711 // Main Window
712 Glib::RefPtr<Gio::SimpleAction> quit;
713 Glib::RefPtr<Gio::SimpleAction> compress;
714 Glib::RefPtr<Gio::SimpleAction> expand;
715 Glib::RefPtr<Gio::SimpleAction> jackstartup;
716 Glib::RefPtr<Gio::SimpleAction> loadladspa;
717
718 Glib::RefPtr<ToggleAction> rack_config;
719 Glib::RefPtr<ToggleAction> live_play;
720 Glib::RefPtr<ToggleAction> engine_mute;
721 sigc::connection engine_mute_conn;
722 Glib::RefPtr<ToggleAction> engine_bypass;
723 sigc::connection engine_bypass_conn;
724 Glib::RefPtr<ToggleAction> jackserverconnection;
725 Glib::RefPtr<ToggleAction> jackports;
726 Glib::RefPtr<ToggleAction> midicontroller;
727 Glib::RefPtr<ToggleAction> meterbridge;
728 Glib::RefPtr<ToggleAction> loggingbox;
729 Glib::RefPtr<ToggleAction> animations;
730
731 Glib::RefPtr<ToggleAction> show_plugin_bar;
732 Glib::RefPtr<ToggleAction> presets;
733 Glib::RefPtr<ToggleAction> show_rack;
734 Glib::RefPtr<UiBoolToggleAction> tuner;
735 Glib::RefPtr<UiBoolToggleAction> tunermove;
736 Glib::RefPtr<UiBoolToggleAction> tunermidiout;
737 Glib::RefPtr<UiBoolToggleAction> livetuner;
738 Glib::RefPtr<ToggleAction> show_values;
739 Glib::RefPtr<ToggleAction> tooltips;
740 Glib::RefPtr<UiBoolToggleAction> midi_in_presets;
741 Glib::RefPtr<ToggleAction> rackh;
742 Glib::RefPtr<ToggleAction> midiout;
743
744 Glib::RefPtr<RadioAction> skin;
745 Glib::RefPtr<RadioAction> latency;
746 Glib::RefPtr<RadioAction> osc_buffer_size;
747 Glib::RefPtr<RadioAction> preset_list_menu;
748
749 // preset window
750 Glib::RefPtr<Gio::SimpleAction> new_bank;
751 Glib::RefPtr<Gio::SimpleAction> save_changes;
752 Glib::RefPtr<ToggleAction> organize;
753 Glib::RefPtr<Gio::SimpleAction> online_preset_bank;
754};
755
756
757
758class SelectMidiChannel: public Gtk::Window {
759private:
760 Gtk::Label *description;
761 Gtk::ComboBox *channelcombo;
763 sigc::signal<void> close;
766 bool on_delete_event(GdkEventAny* event);
767 bool on_key_press_event(GdkEventKey *event);
768 static SelectMidiChannel* create_from_builder(BaseObjectType* cobject, Glib::RefPtr<gx_gui::GxBuilder> bld, gx_engine::GxMachineBase& m) {
769 return new SelectMidiChannel(cobject, bld, m);
770 }
771 SelectMidiChannel(BaseObjectType* cobject, Glib::RefPtr<gx_gui::GxBuilder> bld, gx_engine::GxMachineBase& m);
772public:
775 sigc::signal<void>& signal_close() { return close; }
776};
777
778class MainWindowBuilder: public Glib::RefPtr<gx_gui::GxBuilder> {
779public:
780 Gxw::PaintBox *tunerbox;
782 Gtk::ScrolledWindow *vrack_scrolledbox;
783 Gtk::Scrollbar *monorackscroller;
786 Gxw::PaintBox *rackcontainer;
787 Gtk::ScrolledWindow *stereorackbox;
788 Gtk::Box *monocontainer;
789 Gxw::PaintBox *monoampcontainer;
790 Gtk::Paned *main_vpaned;
791 Gtk::Box *monobox;
792 Gtk::Box *upper_rackbox;
793 Gtk::ScrolledWindow *preset_scrolledbox;
796 Gtk::Image *insert_image;
797 Gtk::Image *status_image;
798 Gtk::Image *jackd_image;
799 Gtk::Image *logstate_image;
800 Gtk::Window *window;
801 Gtk::ToggleButton *show_rack_button;
802 Gtk::ToggleButton *rack_order_h_button;
803 Gtk::ToggleButton *config_mode_button;
804 Gtk::ToggleButton *liveplay_button;
805 Gtk::ToggleButton *tuner_button;
806 Gtk::ToggleButton *effects_button;
807 Gtk::ToggleButton *presets_button;
808 Gtk::Button *compress_button;
809 Gtk::Button *expand_button;
810 Gtk::ToolPalette *effects_toolpalette;
811 Gxw::PaintBox *amp_background;
812 Gxw::Switch *tuner_on_off;
813 Gxw::Selector *tuner_mode;
814 Gxw::ValueDisplay *tuner_reference_pitch;
815 Gxw::Selector *tuner_tuning;
816 Gxw::Selector *tuner_temperament;
817 Gxw::RackTuner *racktuner;
818 Gtk::Button *ampdetail_compress;
819 Gtk::Button *ampdetail_expand;
820 Gtk::Widget *ampdetail_mini;
821 Gtk::Widget *ampdetail_normal;
822 Gxw::FastMeter *fastmeter[2];
823 Gtk::Entry *preset_status;
824 Gtk::MenuBar *menubar;
825private:
827public:
830};
831
832class MainWindow: public sigc::trackable {
833private:
840 Glib::RefPtr<Gdk::Pixbuf> gx_head_icon;
859 Glib::RefPtr<Gdk::Pixbuf> pixbuf_insert_on;
860 Glib::RefPtr<Gdk::Pixbuf> pixbuf_insert_off;
861 Glib::RefPtr<Gdk::Pixbuf> pixbuf_on;
862 Glib::RefPtr<Gdk::Pixbuf> pixbuf_off;
863 Glib::RefPtr<Gdk::Pixbuf> pixbuf_bypass;
864 Glib::RefPtr<Gdk::Pixbuf> pixbuf_jack_connected;
865 Glib::RefPtr<Gdk::Pixbuf> pixbuf_jack_disconnected;
866 Glib::RefPtr<Gdk::Pixbuf> pixbuf_log_grey;
867 Glib::RefPtr<Gdk::Pixbuf> pixbuf_log_yellow;
868 Glib::RefPtr<Gdk::Pixbuf> pixbuf_log_red;
870 Glib::RefPtr<Gtk::StatusIcon> status_icon;
873
874private:
875 bool on_my_leave_out(GdkEventCrossing *focus);
876 bool on_my_enter_in(GdkEventCrossing *focus);
877 void maybe_shrink_horizontally(bool preset_no_rack=false);
891 void move_widget(Gtk::Widget& w, Gtk::Box& b1, Gtk::Box& b2);
893 void change_expand(Gtk::Widget& w, bool value);
895 void on_configure_event(GdkEventConfigure *ev);
896 void clear_box(Gtk::Container& box);
899 bool on_visibility_notify(GdkEventVisibility *ev);
905 bool connect_jack(bool v, Gtk::Window *splash = 0);
908 void change_skin(const Glib::VariantBase& value);
911 void change_latency(const Glib::VariantBase& value);
912 void user_disable_latency_warn(Gtk::CheckButton* disable_warn);
917 void change_osc_buffer(const Glib::VariantBase& value);
924 bool on_log_activated(GdkEventButton* ev);
925 bool on_log_scrolled(GdkEventScroll* ev);
928 void set_tuning(Gxw::RackTuner& tuner);
929 void set_tuner_tet(Gxw::RackTuner& tuner);
930 void set_tuner_ref(Gxw::RackTuner& tuner);
931 void setup_tuner_temperament(Gxw::RackTuner& tuner);
932 void setup_tuner(Gxw::RackTuner& tuner);
933 bool on_toggle_mute(GdkEventButton* ev);
934 bool on_scroll_toggle(GdkEventScroll* ev);
935 bool on_toggle_insert(GdkEventButton* ev);
936 bool on_scroll_toggle_insert(GdkEventScroll* ev);
938 bool on_jackserverconnection(GdkEventButton* ev);
939 bool on_jackserverconnection_scroll(GdkEventScroll* ev);
941 void on_ampdetail_switch(bool compress, bool setparam);
942 bool refresh_meter_level(float falloff);
949 void systray_menu(guint button, guint32 activate_time);
950 bool on_window_state_changed(GdkEventWindowState* event);
951 bool on_meter_button_release(GdkEventButton* ev);
953 void on_select_preset(const Glib::VariantBase& value);
963 bool on_key_press_event(GdkEventKey *event);
964 void display_preset_msg(const Glib::ustring& bank, const Glib::ustring& preset);
966 void on_ladspa_finished(bool reload, bool quit);
968 bool on_quit();
971 void amp_controls_visible(Gtk::Range *rr);
975public:
976 Glib::RefPtr<Gtk::SizeGroup> left_column;
978 Gtk::Window *splash, const Glib::ustring& title);
980 PluginUI *get_plugin(const std::string& name) { return plugin_dict[name]; }
983 void run();
987 bool use_animations() { return actions.animations->get_active(); }
990};
991
992inline void RackContainer::reorder(const std::string& name, const std::string& before) {
993 plugin_dict.reorder(this, name, before); }
bool icon_draw(const Cairo::RefPtr< Cairo::Context > &cr)
Glib::RefPtr< Gdk::Pixbuf > drag_icon_pixbuf
bool window_draw(const Cairo::RefPtr< Cairo::Context > &cr, Gtk::OffscreenWindow &w)
DragIcon(PluginUI &plugin, Glib::RefPtr< Gdk::DragContext > context, gx_system::CmdlineOptions &options, int xoff=0)
Gtk::Window * window
void create_drag_icon_pixbuf(const PluginUI &plugin, Glib::RefPtr< Gdk::Visual > rgba, gx_system::CmdlineOptions &options)
bool need_thaw
void do_thaw()
bool thaw_timeout()
void freeze_until_width_update(Gtk::Window *w, int width)
void freeze_and_size_request(Gtk::Window *w, int width, int height)
Gtk::Window * window
void freeze(Gtk::Window *w, int width, int height)
bool check_thaw(int width, int height)
void set_slot(sigc::slot< void > w)
sigc::connection tag
sigc::slot< void > work
void thaw()
Glib::RefPtr< Gio::SimpleAction > quit
Glib::RefPtr< Gio::SimpleAction > online_preset_bank
Glib::RefPtr< ToggleAction > live_play
Glib::RefPtr< UiBoolToggleAction > midi_in_presets
Glib::RefPtr< Gio::SimpleAction > new_bank
Glib::RefPtr< ToggleAction > jackserverconnection
Glib::RefPtr< Gio::SimpleAction > compress
Glib::RefPtr< ToggleAction > midicontroller
Glib::RefPtr< RadioAction > osc_buffer_size
Glib::RefPtr< ToggleAction > tooltips
Glib::RefPtr< RadioAction > skin
Glib::RefPtr< ToggleAction > show_plugin_bar
Glib::RefPtr< ToggleAction > engine_mute
Glib::RefPtr< UiBoolToggleAction > tuner
Glib::RefPtr< Gio::SimpleAction > jackstartup
Glib::RefPtr< Gio::SimpleAction > loadladspa
Glib::RefPtr< ToggleAction > show_values
Glib::RefPtr< ToggleAction > midiout
Glib::RefPtr< RadioAction > preset_list_menu
Glib::RefPtr< ToggleAction > engine_bypass
Glib::RefPtr< ToggleAction > animations
Glib::RefPtr< ToggleAction > jackports
Glib::RefPtr< ToggleAction > show_rack
sigc::connection engine_bypass_conn
Glib::RefPtr< ToggleAction > rack_config
Glib::RefPtr< ToggleAction > organize
Glib::RefPtr< RadioAction > latency
Glib::RefPtr< ToggleAction > meterbridge
sigc::connection engine_mute_conn
Glib::RefPtr< ToggleAction > presets
Glib::RefPtr< Gio::SimpleAction > save_changes
Glib::RefPtr< UiBoolToggleAction > tunermidiout
Glib::RefPtr< UiBoolToggleAction > tunermove
Glib::RefPtr< ToggleAction > rackh
Glib::RefPtr< Gio::SimpleAction > expand
Glib::RefPtr< UiBoolToggleAction > livetuner
Glib::RefPtr< ToggleAction > loggingbox
@ kMessageTypeCount
Definition: gx_logging.h:41
void set_window(Gtk::Window *window_)
int window_y
gx_system::CmdlineOptions * options
int window_x
Glib::RefPtr< Gtk::StyleContext > style_context
Gtk::Window * window
bool set_new_skin(const Glib::ustring &skin_name)
void reload_css_post()
void reload_css()
void init(gx_system::CmdlineOptions *options_)
void update_show_values()
Glib::RefPtr< Gtk::CssProvider > css_show_values
Glib::RefPtr< Gtk::CssProvider > css_provider
GxUiRadioMenu(gx_engine::GxMachineBase &machine, const std::string &id)
Glib::RefPtr< Gio::SimpleAction > action
gx_engine::GxMachineBase & machine
void setup(UIManager &uimanager)
void set_value(int v)
void on_changed(const Glib::VariantBase &value)
const std::string id
void display_key_error()
static char bank_idx_to_char(int idx, int bank_size)
static int next_idx(int idx=-1)
void deactivate()
KeySwitcher(gx_engine::GxMachineBase &machine_, sigc::slot< void, const Glib::ustring &, const Glib::ustring & > display_)
bool process_bank_key(int key)
void display_empty(const Glib::ustring &bank, const Glib::ustring &preset)
sigc::slot< void, const Glib::ustring &, const Glib::ustring & > display
bool display_selected_bank()
sigc::connection key_timeout
Glib::ustring last_bank_key
static int key_offset_to_bank_idx(int offset, int bank_size)
bool display_current()
bool process_preset_key(int key)
gx_engine::GxMachineBase & machine
static char idx_to_char(int idx)
static int key_offset_to_idx(int offset)
static bool on_keyboard_preset_select(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier, Liveplay &self)
static bool on_keyboard_mode_switch(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier, Liveplay &self)
Liveplay(const gx_system::CmdlineOptions &options, gx_engine::GxMachineBase &machine, const std::string &fname, const GxActions &actions, Glib::RefPtr< Gio::SimpleActionGroup > &group)
static bool on_keyboard_toggle_bypass(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier, Liveplay &self)
Gxw::RackTuner & get_tuner()
Gtk::Label * liveplay_preset
void on_selection_done(bool v)
Gtk::Image * mute_image
Gxw::HSlider * background_slider
bool window_draw(const Cairo::RefPtr< Cairo::Context > &cr)
bool pointer_motion(GdkEventMotion *event)
const GxActions & actions
Gtk::ToggleButton * liveplay_exit
Gtk::Image * bypass_image
bool use_composite
KeySwitcher keyswitch
static bool on_keyboard_arrows(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier, Liveplay &self)
Gtk::Grid * midictrl_table
void on_background_changed()
void add_midi_elements()
Gxw::HSlider * brightness_slider
static bool on_keyboard_toggle_mute(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, GdkModifierType modifier, Liveplay &self)
Gtk::Label * liveplay_bank
gx_engine::GxMachineBase & machine
Gtk::Widget * liveplay_canvas
Gxw::RackTuner * tuner
bool on_delete(GdkEventAny *ev)
void on_live_play(Glib::RefPtr< ToggleAction > act)
Glib::RefPtr< gx_gui::GxBuilder > bld
void on_brightness_changed()
void on_selection_changed()
void set_display_state(TunerSwitcher::SwitcherState s)
void on_realize()
Gtk::Window * window
Glib::RefPtr< Gtk::Adjustment > background_adj
Gtk::Box * brightness_box
sigc::connection mouse_hide_conn
void display(const Glib::ustring &bank, const Glib::ustring &preset)
void display_tuner(bool v)
sigc::connection midi_conn
void on_engine_state_change(gx_engine::GxEngineState state)
bool transparent_draw(const Cairo::RefPtr< Cairo::Context > &cr)
Glib::RefPtr< Gtk::Adjustment > brightness_adj
Gtk::Box * monocontainer
Gtk::Scrollbar * monorackscroller
Gtk::ToggleButton * liveplay_button
Gxw::RackTuner * racktuner
Gxw::PaintBox * effects_frame_paintbox
Gtk::Button * expand_button
Gtk::Box * upper_rackbox
Gtk::ToggleButton * show_rack_button
Gxw::PaintBox * monoampcontainer
Gtk::Paned * main_vpaned
Gtk::Button * ampdetail_expand
Gtk::Image * status_image
Gxw::ValueDisplay * tuner_reference_pitch
Gtk::Widget * ampdetail_mini
Gtk::Button * compress_button
Gtk::ToggleButton * effects_button
Gxw::PaintBox * rackcontainer
Gtk::Box * tuner_box_no_rack
Gtk::Box * stereorackcontainerV
Gtk::ToolPalette * effects_toolpalette
Gxw::PaintBox * tunerbox
Gxw::PaintBox * amp_background
Gtk::Button * ampdetail_compress
Gxw::FastMeter * fastmeter[2]
Gtk::ToggleButton * tuner_button
Gtk::ToggleButton * presets_button
Gtk::MenuBar * menubar
Gxw::Selector * tuner_tuning
Gxw::Selector * tuner_mode
Gxw::Selector * tuner_temperament
Gtk::Box * preset_box_no_rack
Gtk::ScrolledWindow * stereorackbox
Gtk::Image * jackd_image
Gtk::ScrolledWindow * vrack_scrolledbox
Gtk::Box * stereorackcontainerH
Gtk::ToggleButton * rack_order_h_button
MainWindowBuilder(const gx_system::CmdlineOptions &options, gx_engine::GxMachineBase &machine)
Gtk::Image * insert_image
Gxw::Switch * tuner_on_off
Gtk::ScrolledWindow * preset_scrolledbox
Gtk::Entry * preset_status
void load_widget_pointers()
Gtk::ToggleButton * config_mode_button
Gtk::Window * window
Gtk::Image * logstate_image
Gtk::Widget * ampdetail_normal
void on_select_midi_channel()
void on_engine_toggled()
bool on_my_enter_in(GdkEventCrossing *focus)
MainWindowBuilder bld
bool refresh_meter_level(float falloff)
void maybe_shrink_horizontally(bool preset_no_rack=false)
bool on_visibility_notify(GdkEventVisibility *ev)
void on_previus_preset()
bool is_variable_size()
bool on_my_leave_out(GdkEventCrossing *focus)
gx_system::CmdlineOptions & options
Glib::RefPtr< Gtk::SizeGroup > left_column
void on_move_tuner()
void on_ladspa_finished(bool reload, bool quit)
void gx_jack_is_down()
void set_osc_size()
void create_default_scratch_preset()
void on_log_activate()
void on_load_ladspa()
PluginDict::iterator plugins_begin()
void on_select_jack_control()
void set_tuner_ref(Gxw::RackTuner &tuner)
void on_insert_jack_changed(bool s)
void show_selected_preset()
bool on_jackserverconnection(GdkEventButton *ev)
gx_system::CmdlineOptions & get_options()
bool on_log_activated(GdkEventButton *ev)
void set_tooltips()
gx_portmap::PortMapWindow * portmap_window
void set_vpaned_handle()
void delete_select_midi_channel()
void on_show_tuner()
GxUiRadioMenu amp_radio_menu
void set_tuner_tet(Gxw::RackTuner &tuner)
TextLoggingBox fLoggingWindow
int gx_wait_latency_warn()
bool on_jackserverconnection_scroll(GdkEventScroll *ev)
void set_tuning(Gxw::RackTuner &tuner)
gx_gui::StackBoxBuilder boxbuilder
Glib::RefPtr< Gdk::Pixbuf > pixbuf_off
void on_miditable_toggle()
Glib::RefPtr< Gdk::Pixbuf > pixbuf_jack_disconnected
int start_jack()
void set_midiout()
bool connect_jack(bool v, Gtk::Window *splash=0)
NsmSignals & nsmsig
void amp_controls_visible(Gtk::Range *rr)
void display_preset_msg(const Glib::ustring &bank, const Glib::ustring &preset)
void on_ampdetail_switch(bool compress, bool setparam)
void add_preset_key_accelerators()
PluginDict::iterator plugins_end()
gx_engine::GxMachineBase & machine
PluginDict plugin_dict
void rebuild_preset_menu()
void user_disable_latency_warn(Gtk::CheckButton *disable_warn)
MainWindow(gx_engine::GxMachineBase &machine, gx_system::CmdlineOptions &options, NsmSignals &nsmsig, GxTheme &theme, Gtk::Window *splash, const Glib::ustring &title)
void add_skin_menu()
void set_next_preset_controller()
void systray_menu(guint button, guint32 activate_time)
void update_width()
void on_nsm_save()
bool on_scroll_toggle_insert(GdkEventScroll *ev)
void setup_tuner_temperament(Gxw::RackTuner &tuner)
void on_show_plugin_bar()
bool on_meter_button_release(GdkEventButton *ev)
Glib::RefPtr< Gdk::Pixbuf > gx_head_icon
bool on_window_state_changed(GdkEventWindowState *event)
PluginUI * get_plugin(const std::string &name)
void on_show_values()
ladspa::PluginDisplay * ladspalist_window
Glib::RefPtr< Gdk::Pixbuf > pixbuf_log_red
Freezer freezer
Glib::RefPtr< Gdk::Pixbuf > pixbuf_jack_connected
void gx_show_help()
Liveplay * live_play
void on_live_play()
GxActions actions
bool on_log_scrolled(GdkEventScroll *ev)
void on_show_rack()
bool survive_jack_shutdown()
void set_rackbox_expansion()
void show_forum_help()
void on_engine_state_change(gx_engine::GxEngineState state)
void on_rack_configuration()
GxTheme & theme
Glib::RefPtr< Gdk::Pixbuf > pixbuf_on
void change_latency(const Glib::VariantBase &value)
void jack_connection()
void on_midiout_tuner()
void on_select_preset(const Glib::VariantBase &value)
void on_compress_all()
void maybe_change_resizable(void)
void hide_extended_settings()
bool on_scroll_toggle(GdkEventScroll *ev)
bool on_key_press_event(GdkEventKey *event)
Glib::RefPtr< Gtk::StatusIcon > status_icon
PresetWindow * preset_window
gx_engine::GxMachineBase & get_machine()
void run()
void set_animations()
void set_switcher_controller()
void jack_session_event()
Glib::RefPtr< Gdk::Pixbuf > pixbuf_log_yellow
void change_expand(Gtk::Widget &w, bool value)
void on_next_preset()
bool delete_ladspalist_window()
void create_actions()
void on_expand_all()
void on_msg_level_changed()
Glib::RefPtr< Gdk::Pixbuf > pixbuf_bypass
void on_portmap_activate()
void set_in_session()
void on_portmap_response(int)
void set_previus_preset_controller()
void on_jack_client_changed()
int rackbox_stacked_vertical() const
void set_bypass_controller()
void on_nsm_quit()
gx_gui::SelectJackControlPgm * select_jack_control
void on_preset_action()
Glib::RefPtr< Gdk::Pixbuf > pixbuf_insert_off
KeySwitcher keyswitch
void on_dir_changed()
Glib::RefPtr< Gdk::Pixbuf > pixbuf_log_grey
bool on_toggle_mute(GdkEventButton *ev)
void on_livetuner_toggled()
void set_latency()
bool use_animations()
void clear_box(Gtk::Container &box)
void jack_session_event_ins()
void move_widget(Gtk::Widget &w, Gtk::Box &b1, Gtk::Box &b2)
Glib::ustring preset_list_menu_bank
bool on_quit()
void setup_tuner(Gxw::RackTuner &tuner)
void change_skin(const Glib::VariantBase &value)
bool on_toggle_insert(GdkEventButton *ev)
Glib::RefPtr< Gdk::Pixbuf > pixbuf_insert_on
SelectMidiChannel * select_midi_channel
void add_osc_size_menu()
void change_osc_buffer(const Glib::VariantBase &value)
void on_configure_event(GdkEventConfigure *ev)
UIManager uimanager
void add_latency_menu()
void delete_select_jack_control()
static Glib::RefPtr< Gtk::SizeGroup > szg_label
Gtk::Button * preset_button
Gtk::HBox mconbox
bool on_my_leave_out(GdkEventCrossing *focus)
sigc::connection evbox_button
Gtk::Widget * mb_delete_button
Gtk::Button * mb_expand_button
void pack(Gtk::Widget *w)
Gtk::Widget * make_delete_button(RackBox &rb)
Gtk::EventBox evbox
void set_config_mode(bool mode, PluginUI &plugin)
MiniRackBox(RackBox &rb, gx_system::CmdlineOptions &options)
Gxw::Switch on_off_switch
bool on_my_enter_in(GdkEventCrossing *focus)
sigc::signal< void > trigger_nsm_gui_is_shown
sigc::signal< void > trigger_nsm_hide_gui
sigc::signal< void > trigger_nsm_show_gui
sigc::signal< void > & signal_trigger_nsm_gui_is_hidden()
sigc::signal< void > & signal_trigger_nsm_save_gui()
sigc::signal< void > trigger_nsm_save_gui
sigc::signal< void > & signal_trigger_nsm_gui_is_shown()
sigc::signal< void > & signal_trigger_nsm_hide_gui()
bool nsm_session_control
sigc::signal< void > trigger_nsm_gui_is_hidden
sigc::signal< void > & signal_trigger_nsm_show_gui()
bool use_animations()
Gtk::ToolItemGroup * add_plugin_category(const char *cat, bool collapse=true)
void check_order()
void check_order(PluginType tp, bool animate)
UIManager & uimanager
void compress(bool state)
void reorder(RackContainer *container, const std::string &name, const std::string &before)
PluginUI * activate(const string &id, const string &before, bool animate)
void register_plugin(PluginUI *pui)
PluginUI * deactivate(const string &id, bool animate)
void unit_order_changed(bool stereo)
void remove(PluginUI *p)
Glib::ustring add_plugin_menu_entry(PluginUI *pui)
gx_system::CmdlineOptions & get_options()
void set_config_mode(bool state)
RackContainer stereorackcontainer
std::map< std::string, PluginUI * >::iterator iterator
std::vector< std::string > stereotargets
void plugin_preset_popup(const PluginDef *pdef)
gx_engine::GxMachineBase & machine
void on_tp_drag_data_received(const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, const Gtk::SelectionData &data, int info, int timestamp)
Glib::ustring category_id(const std::string &group, bool stereo)
void add_plugin(std::vector< PluginUI * > &p, const char *id, const Glib::ustring &tooltip_="")
void add(PluginUI *p)
void plugin_preset_popup(const PluginDef *pdef, const Glib::ustring &name)
void on_plugin_changed(gx_engine::Plugin *pl, gx_engine::PluginChange::pc c)
std::vector< std::string > monotargets
PluginDict(gx_engine::GxMachineBase &machine, gx_system::CmdlineOptions &options, Gtk::ToolPalette &toolpalette, gx_gui::StackBoxBuilder &boxbuilder, UIManager &uimanager)
RackContainer & get_stereorackcontainer()
gx_gui::StackBoxBuilder & boxbuilder
std::map< Glib::ustring, Gtk::ToolItemGroup * > groupmap
void fill_pluginlist()
void remove_plugin_menu_entry(PluginUI *pui)
bool plugins_hidden
RackBox * add_rackbox_internal(PluginUI &plugin, Gtk::Widget *mainwidget, Gtk::Widget *miniwidget, bool mini=false, int pos=-1, bool animate=false, Gtk::Widget *bare=0)
void add_bare(const char *id, Gtk::Container *box)
void hide_entries()
Gtk::ToolPalette & toolpalette
gx_engine::GxMachineBase & get_machine()
DragIcon * drag_icon
RackContainer monorackcontainer
bool get_config_mode()
void cleanup()
RackContainer & get_monorackcontainer()
PluginUI * operator[](const std::string &s)
RackBox * add_rackbox(PluginUI &pl, bool mini=false, int pos=-1, bool animate=false)
double stop_at(RackContainer *container, double off, double step_size, double page_size)
bool get_plugins_hidden()
void pluginlist_append(std::vector< PluginUI * > &p)
gx_system::CmdlineOptions & options
void show_entries()
void set_plugin_std_preset()
PluginPresetPopup(const PluginDef *pdef, gx_engine::GxMachineBase &machine, const Glib::ustring &save_name_default="")
const PluginDef * get_pdef()
virtual void on_selection_done()
const PluginDef * pdef
gx_preset::UnitPresetList::const_iterator begin()
gx_engine::GxMachineBase & machine
const Glib::ustring save_name_default
void remove_plugin_preset()
gx_preset::UnitPresetList::const_iterator end()
void save_plugin_preset()
bool add_plugin_preset_list(bool *found)
gx_engine::GxMachineBase & get_machine()
gx_preset::UnitPresetList presetnames
void set_plugin_preset(bool factory, const Glib::ustring &name)
const char * get_name() const
sigc::signal< void(bool)> output_widget_state
state of output_widgets_active changed
friend bool plugins_by_name_less(PluginUI *a, PluginUI *b)
void deactivate(bool animate)
void activate(bool animate, const string &before)
const char * shortname
virtual void on_plugin_preset_popup()
void remove(bool animate)
PluginType get_type() const
bool has_gui() const
bool on_my_leave_out(GdkEventCrossing *focus)
Glib::RefPtr< ToggleAction > action
void set_active(bool v)
void on_ti_drag_begin(const Glib::RefPtr< Gdk::DragContext > &context)
void set_update_state(bool state)
void on_ti_drag_data_delete(const Glib::RefPtr< Gdk::DragContext > &context)
PluginUI(PluginDict &plugin_dict, const char *id_, const Glib::ustring &tooltip_="")
void decativate(bool animate)
bool hidden
Plugin not visible (but might be in rack, e.g. "Rack" is off)
void dispose_rackbox()
virtual ~PluginUI()
void show(bool animate)
const char * get_id() const
void on_state_change()
bool animate_vanish()
bool on_my_enter_in(GdkEventCrossing *focus)
Glib::ustring tooltip
void on_ti_drag_data_get(const Glib::RefPtr< Gdk::DragContext > &context, Gtk::SelectionData &selection, int info, int timestamp)
Gtk::ToolItemGroup * group
static bool is_registered(gx_engine::GxMachineBase &m, const char *name)
void compress(bool state)
Glib::RefPtr< ToggleAction > get_action()
bool active
Plugin is in rack (effect bar icon not visible)
bool on_rack_handle_press(GdkEventButton *ev)
Gtk::ToolItem * toolitem
bool output_widgets_active
send data updates for output variables
bool get_update_cond()
gx_engine::Plugin * plugin
void set_config_mode(bool state)
sigc::signal< void(bool)> * get_output_widget_state()
bool on_ti_button_press(GdkEventButton *ev)
void on_ti_drag_end(const Glib::RefPtr< Gdk::DragContext > &context)
const char * get_category()
void update_rackbox()
PluginDict & plugin_dict
void hide(bool animate)
RackBox * rackbox
rack widget or nullptr
const char * get_shortname() const
void set_action(Glib::RefPtr< ToggleAction > &act)
void add_toolitem(Gtk::ToolItemGroup *gw)
void on_action_toggled()
void activate(bool animate)
Glib::ustring get_displayname(bool useshort) const
bool has_delete() const
PluginUI & plugin
void set_position(int pos, int post_pre)
void on_my_drag_begin(const Glib::RefPtr< Gdk::DragContext > &context)
Gxw::PaintBox box
int anim_height
void set_config_mode(bool mode)
bool on_my_drag_failed(const Glib::RefPtr< Gdk::DragContext > &context, Gtk::DragResult result)
void on_my_drag_end(const Glib::RefPtr< Gdk::DragContext > &context)
bool compress
void display(bool v, bool animate)
Gtk::Widget * wrap_bar(int left=4, int right=4, bool sens=false)
static void set_paintbox(Gxw::PaintBox &pb, PluginType tp)
bool delete_button
void vis_switch(Gtk::Widget &a, Gtk::Widget &b)
Gxw::PaintBox mbox
RackBox(PluginUI &plugin, PluginDict &plugin_dict, Gtk::Widget *bare=0)
static Gtk::Widget * make_label(const PluginUI &plugin, gx_system::CmdlineOptions &options, bool useshort=true)
int target_height
bool can_compress()
DragIcon * drag_icon
bool animate_create()
Gtk::Widget * fbox
MiniRackBox * minibox
static Gtk::Widget * create_icon_widget(const PluginUI &plugin, gx_system::CmdlineOptions &options)
bool get_plug_visible()
void enable_drag(bool v)
Gtk::Button * make_expand_button(bool expand)
bool on_my_enter_in(GdkEventCrossing *focus)
bool on_my_leave_out(GdkEventCrossing *focus)
static Gtk::Widget * create_drag_widget(const PluginUI &plugin, gx_system::CmdlineOptions &options)
void init_dnd()
void swtch(bool mini)
RackContainer * get_parent()
PluginDict & plugin_dict
void pack(Gtk::Widget *mainbox, Gtk::Widget *minibox)
void do_expand()
Gtk::Button * make_preset_button()
static void set_paintbox_unit(Gxw::PaintBox &pb, const PluginUI &plugin)
Gxw::Switch on_off_switch
void animate_insert()
sigc::connection anim_tag
const char * get_id() const
static Gtk::Widget * make_bar(int left=4, int right=4, bool sens=false)
static void set_paintbox_unit_shrink(Gxw::PaintBox &pb, PluginType tp)
void set_visibility(bool v)
Gtk::HBox * make_full_box(gx_system::CmdlineOptions &options)
std::string target
bool compare_position(int pos, int post_pre)
void on_my_drag_data_get(const Glib::RefPtr< Gdk::DragContext > &context, Gtk::SelectionData &selection, int info, int timestamp)
void ensure_visible(RackBox &child)
virtual void on_drag_leave(const Glib::RefPtr< Gdk::DragContext > &context, guint timestamp)
bool scroll_timeout()
bool scrollother_timeout()
Glib::ListHandle< const RackBox * > rackbox_const_list
int count
count of visible children
void change_child_count(int n)
double stop_at_bottom(double off, double step_size, double pagesize)
rackbox_const_list get_children() const
void add(RackBox &r, int pos=-1)
std::vector< std::string > targets
double stop_at_top(double off, double step_size)
bool drag_highlight_draw(const Cairo::RefPtr< Cairo::Context > &, int y0)
Glib::ListHandle< RackBox * > rackbox_list
void set_list_targets(const std::vector< Gtk::TargetEntry > &listTargets, const std::vector< std::string > &targets_, const std::vector< std::string > &othertargets_)
std::vector< std::string > othertargets
RackContainer(PluginDict &plugin_dict)
sigc::connection autoscroll_connection
void set_child_count(int n)
bool check_targets(const std::vector< std::string > &tgts1, const std::vector< std::string > &tgts2)
virtual bool on_drag_motion(const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, guint timestamp)
sigc::connection highlight_connection
virtual void on_add(Widget *ch)
PluginDict & plugin_dict
virtual void on_drag_data_received(const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, const Gtk::SelectionData &data, guint info, guint timestamp)
rackbox_list get_children()
void reorder(const std::string &name, const std::string &before)
void find_index(int x, int y, string *before, int *ypos)
bool get_current_value() const
static Glib::RefPtr< RadioAction > create(const Glib::ustring &name)
void set_current_value(int v)
RadioAction(const Glib::ustring &name)
static SelectMidiChannel * create(gx_system::CmdlineOptions &opt, gx_engine::GxMachineBase &machine)
Gtk::Label * description
bool on_delete_event(GdkEventAny *event)
bool on_key_press_event(GdkEventKey *event)
SelectMidiChannel(BaseObjectType *cobject, Glib::RefPtr< gx_gui::GxBuilder > bld, gx_engine::GxMachineBase &m)
gx_engine::GxMachineBase & machine
sigc::signal< void > & signal_close()
Gtk::ComboBox * channelcombo
static SelectMidiChannel * create_from_builder(BaseObjectType *cobject, Glib::RefPtr< gx_gui::GxBuilder > bld, gx_engine::GxMachineBase &m)
sigc::signal< void > close
virtual void on_hide()
sigc::signal< void > & signal_msg_level_changed()
int get_unseen_msg_level()
void reset_msg_level()
Gtk::Button ok_button
Gtk::TextView tbox
Gtk::ScrolledWindow scrollbox
int highest_unseen_msg_level
sigc::signal< void > msg_level_changed
Gtk::HButtonBox buttonbox
void show_msg(string msgbuf, GxLogger::MsgType msgtype, bool plugged)
Glib::RefPtr< Gtk::TextTag > tags[GxLogger::kMessageTypeCount]
virtual bool on_key_press_event(GdkEventKey *event)
virtual void on_show()
static tab_table tagdefs[GxLogger::kMessageTypeCount]
void set_active(bool v)
ToggleAction(const Glib::ustring &name, bool state)
Glib::SignalProxyProperty signal_toggled()
bool get_active() const
static Glib::RefPtr< ToggleAction > create(const Glib::ustring &name, bool state=false)
bool remove_item(const Glib::ustring &action)
void insert_action_group(Glib::RefPtr< Gio::SimpleActionGroup > &group)
Gtk::MenuBar * menubar
bool foreach_menu(search_func func)
Glib::RefPtr< Gio::Menu > menu
UIManager(const std::string &file, Gtk::MenuBar *bar)
Glib::RefPtr< ToggleAction > add_toggle_action(const Glib::ustring &action, bool state=false)
void set_accelerators_from_menu()
void add_accelerator(Glib::RefPtr< Gio::Action > action, Glib::VariantBase &target, const Glib::ustring &accelerator)
static void set_widget_action(Gtk::Widget *w, const Glib::ustring &action)
static void add_accelerator(Glib::RefPtr< Gtk::AccelGroup > &group, Glib::RefPtr< Gio::Action > action, const Glib::ustring &accelerator, Glib::VariantBase &target)
Gtk::MenuItem * find_item(const Glib::ustring &action)
Glib::RefPtr< Gio::Menu > get_linked_menu(const Glib::ustring &action)
Glib::RefPtr< Gio::SimpleAction > add_action(const Glib::ustring &action, sigc::slot< void()> slot)
Glib::RefPtr< UiBoolToggleAction > add_ui_bool_action(gx_engine::GxMachineBase &machine, const std::string &id, const Glib::ustring &name, bool is_active=false)
Glib::RefPtr< Gio::SimpleActionGroup > actiongroup
std::function< bool(const Glib::ustring &, Glib::RefPtr< Gio::Menu > &, int, int)> search_func
Glib::RefPtr< Gtk::AccelGroup > accelgroup
void set_accelerators_from_menu(Glib::RefPtr< Gio::Menu > &menu)
static void set_widget_action(Gtk::Widget *w, const Glib::RefPtr< Gio::Action > &action)
Glib::RefPtr< Gio::SimpleAction > add_action(const Glib::ustring &action)
bool foreach_menu_(Glib::RefPtr< Gio::Menu > &menu, search_func &func, int &startpos)
Glib::RefPtr< Gio::SimpleActionGroup > & get_action_group()
Glib::RefPtr< RadioAction > add_radio_action(const Glib::ustring &action)
Glib::RefPtr< Gtk::AccelGroup > & get_accel_group()
UiToggleAction(gx_engine::GxMachineBase &machine_, const std::string &id, const Glib::ustring &name, bool is_active=false)
gx_engine::GxMachineBase & machine
static Glib::RefPtr< UiToggleAction > create(gx_engine::GxMachineBase &machine, const std::string &id, const Glib::ustring &name, bool is_active=false)
std::string id
virtual void create_default_scratch_preset()=0
bool get_plug_visible() const
PluginDef * get_pdef()
#define N_(String)
bool plugins_by_name_less(PluginUI *a, PluginUI *b)
UiToggleAction< bool > UiBoolToggleAction
@ PGN_GUI
Definition: gx_plugin.h:177
@ PGN_STEREO
Definition: gx_plugin.h:174
PluginType
Definition: machine.h:34
@ PLUGIN_TYPE_MONO
Definition: machine.h:35
@ PLUGIN_TYPE_STEREO
Definition: machine.h:36
std::vector< PluginPresetEntry > UnitPresetList
Definition: gx_preset.h:138
const char * name
Definition: gx_plugin.h:200
int flags
Definition: gx_plugin.h:197
const char * shortname
Definition: gx_plugin.h:205
uiloader load_ui
Definition: gx_plugin.h:215
const char * id
Definition: gx_plugin.h:199
const char * category
Definition: gx_plugin.h:204