33 gx_engine::GxMachineBase& machine_,
const std::string&
id,
const Glib::ustring& name,
const Glib::ustring& icon_name,
34 const Glib::ustring& label=Glib::ustring(),
const Glib::ustring& tooltip=Glib::ustring(),
35 bool is_active=
false);
38 static Glib::RefPtr<UiToggleAction>
create(
39 gx_engine::GxMachineBase& machine,
const std::string&
id,
const Glib::ustring& name,
const Glib::ustring& label=Glib::ustring(),
40 const Glib::ustring& tooltip=Glib::ustring(),
bool is_active=
false) {
41 return Glib::RefPtr<UiToggleAction>(
42 new UiToggleAction(machine,
id, name, Glib::ustring(), label, tooltip, is_active));
57 sigc::slot<void, const Glib::ustring&, const Glib::ustring&> display;
58 sigc::connection key_timeout;
59 Glib::ustring last_bank_key;
61 void display_empty(
const Glib::ustring& bank,
const Glib::ustring& preset);
62 bool display_selected_bank();
63 bool display_current();
66 sigc::slot<void, const Glib::ustring&, const Glib::ustring&> display_)
67 : machine(machine_), display(display_) {}
79 class Liveplay:
public sigc::trackable {
81 Glib::RefPtr<gx_gui::GxBuilder> bld;
85 Gtk::Adjustment *brightness_adj;
86 Gtk::Adjustment *background_adj;
88 sigc::connection midi_conn;
90 sigc::connection mouse_hide_conn;
92 Gtk::Image *bypass_image;
93 Gtk::Image *mute_image;
94 Gtk::Label *liveplay_bank;
95 Gtk::Label *liveplay_preset;
96 Gtk::Widget *liveplay_canvas;
98 Gtk::Box *brightness_box;
100 Gtk::ToggleButton *liveplay_exit;
101 Gtk::Table *midictrl_table;
104 void add_midi_elements();
105 bool on_delete(GdkEventAny *ev);
106 void on_brightness_changed();
107 void on_background_changed();
108 bool transparent_expose(GdkEventExpose *event);
109 bool window_expose_event(GdkEventExpose* event);
112 void on_selection_done(
bool v);
113 void on_selection_changed();
114 static bool do_action(
115 GtkAccelGroup *accel_group, GObject *acceleratable,
116 guint keyval, GdkModifierType modifier, GtkAction* act);
117 static bool on_keyboard_preset_select(
118 GtkAccelGroup *accel_group, GObject *acceleratable,
119 guint keyval, GdkModifierType modifier,
Liveplay&
self);
120 static bool on_keyboard_toggle_mute(
121 GtkAccelGroup *accel_group, GObject *acceleratable,
122 guint keyval, GdkModifierType modifier,
Liveplay&
self);
123 static bool on_keyboard_toggle_bypass(
124 GtkAccelGroup *accel_group, GObject *acceleratable,
125 guint keyval, GdkModifierType modifier,
Liveplay&
self);
126 static bool on_keyboard_arrows(
127 GtkAccelGroup *accel_group, GObject *acceleratable,
128 guint keyval, GdkModifierType modifier,
Liveplay&
self);
129 static bool on_keyboard_mode_switch(
130 GtkAccelGroup *accel_group, GObject *acceleratable,
131 guint keyval, GdkModifierType modifier,
Liveplay&
self);
132 bool pointer_motion(GdkEventMotion* event);
133 void display(
const Glib::ustring& bank,
const Glib::ustring& preset);
137 const std::string& fname,
const GxActions& actions);
152 class PluginUI:
public sigc::trackable {
154 Gtk::UIManager::ui_merge_id merge_id;
155 Glib::RefPtr<Gtk::ToggleAction> action;
156 void on_action_toggled();
163 Glib::RefPtr<Gdk::Pixbuf>
icon;
173 const Glib::ustring& tooltip_=
"");
180 void display(
bool v,
bool animate);
184 void set_action(Glib::RefPtr<Gtk::ToggleAction>& act);
185 void set_active(
bool v) {
if (action) action->set_active(v); }
186 Glib::RefPtr<Gtk::ToggleAction>
get_action() {
return action; }
191 return (cat && *cat) ? cat :
N_(
"External");
198 if (!name || !*name) {
205 void hide(
bool animate);
206 void show(
bool animate);
218 typedef std::map<std::string, PluginUI*>::iterator
iterator;
219 PluginDict(): std::map<std::string, PluginUI*>() {}
225 using std::map<std::string, PluginUI*>::begin;
237 enum { gradient_length = 60 };
239 Glib::RefPtr<Gdk::Pixbuf> drag_icon_pixbuf;
241 bool icon_expose_event(GdkEventExpose *ev);
243 bool window_expose_event(GdkEventExpose *event, Gtk::OffscreenWindow& w);
259 class RackBox:
public Gtk::VBox {
262 static Glib::RefPtr<Gtk::SizeGroup> szg;
267 sigc::connection anim_tag;
287 static Gtk::Widget *make_bar(
int left=4,
int right=4,
bool sens=
false);
288 Gtk::Widget *wrap_bar(
int left=4,
int right=4,
bool sens=
false);
290 void enable_drag(
bool v);
291 bool animate_vanish();
292 void animate_remove();
293 void on_my_drag_begin(
const Glib::RefPtr<Gdk::DragContext>& context);
294 bool animate_create();
295 bool on_my_leave_out(GdkEventCrossing *focus);
296 bool on_my_enter_in(GdkEventCrossing *focus);
297 bool on_my_button_press(GdkEventButton* ev);
298 void on_my_drag_end(
const Glib::RefPtr<Gdk::DragContext>& context);
299 void on_my_drag_data_get(
const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection,
int info,
int timestamp);
300 void vis_switch(Gtk::Widget& a, Gtk::Widget& b);
301 void set_visibility(
bool v);
302 Gtk::Button *make_expand_button(
bool expand);
303 Gtk::Button *make_preset_button();
306 bool has_delete()
const {
return delete_button; }
317 void pack(Gtk::Widget *mainbox, Gtk::Widget *minibox,
const Glib::RefPtr<Gtk::SizeGroup>& szg);
321 void display(
bool v,
bool animate);
328 static Glib::RefPtr<Gtk::SizeGroup> szg_label;
331 Gtk::Button *mb_expand_button;
332 Gtk::Widget *mb_delete_button;
333 Gtk::Button *preset_button;
335 bool on_my_leave_out(GdkEventCrossing *focus);
336 bool on_my_enter_in(GdkEventCrossing *focus);
339 Gtk::Widget *make_delete_button(
RackBox& rb);
357 std::vector<std::string> targets;
358 std::vector<std::string> othertargets;
359 sigc::connection highlight_connection;
360 sigc::connection autoscroll_connection;
362 using Gtk::VBox::add;
363 bool drag_highlight_expose(GdkEventExpose *event,
int y0);
364 void find_index(
int x,
int y,
int* len,
int *ypos);
365 void on_my_remove(Gtk::Widget*);
366 bool check_targets(
const std::vector<std::string>& tgts1,
const std::vector<std::string>& tgts2);
367 virtual bool on_drag_motion(
const Glib::RefPtr<Gdk::DragContext>& context,
int x,
int y, guint timestamp);
368 virtual void on_drag_leave(
const Glib::RefPtr<Gdk::DragContext>& context, guint timestamp);
369 virtual void on_drag_data_received(
const Glib::RefPtr<Gdk::DragContext>& context,
int x,
int y,
const Gtk::SelectionData& data, guint info, guint timestamp);
370 virtual void on_add(Widget* ch);
371 void unit_order_changed(
bool stereo);
373 bool scroll_timeout();
374 bool scrollother_timeout();
381 gtk_container_get_children(GTK_CONTAINER(gobj())),
382 Glib::OWNERSHIP_SHALLOW);
386 gtk_container_get_children(const_cast<GtkContainer*>(GTK_CONTAINER(gobj()))),
387 Glib::OWNERSHIP_SHALLOW);
393 bool empty()
const {
return child_count == 0; }
397 void reorder(
const std::string& name,
unsigned int pos);
412 const char *tag_color;
415 Gtk::Button ok_button;
416 Gtk::HButtonBox buttonbox;
417 Gtk::ScrolledWindow scrollbox;
421 int highest_unseen_msg_level;
422 sigc::signal<void> msg_level_changed;
424 virtual bool on_key_press_event(GdkEventKey *event);
426 virtual void on_show();
427 virtual void on_hide();
444 sigc::connection tag;
448 sigc::slot<void> work;
452 void freeze(Gtk::Window *w,
int width,
int height);
472 const Glib::ustring save_name_default;
474 void set_plugin_std_preset();
475 void set_plugin_preset(
bool factory,
const Glib::ustring& name);
476 bool add_plugin_preset_list(
bool *found);
477 void save_plugin_preset();
478 void remove_plugin_preset();
483 const Glib::ustring& save_name_default =
"");
484 gx_preset::UnitPresetList::const_iterator
begin() {
return presetnames.begin(); }
485 gx_preset::UnitPresetList::const_iterator
end() {
return presetnames.end(); }
500 const std::string id;
501 Glib::RefPtr<Gtk::RadioAction> action;
502 void set_value(
unsigned int v);
503 void on_changed(Glib::RefPtr<Gtk::RadioAction> act);
506 void setup(
const Glib::ustring& prefix,
const Glib::ustring& postfix,
507 Glib::RefPtr<Gtk::UIManager>& uimanager, Glib::RefPtr<Gtk::ActionGroup>& actiongroup);
513 Glib::RefPtr<Gtk::ActionGroup>
group;
516 Glib::RefPtr<Gtk::Action>
quit;
525 Glib::RefPtr<Gtk::ToggleAction>
live_play;
538 Glib::RefPtr<Gtk::ToggleAction>
presets;
540 Glib::RefPtr<UiBoolToggleAction>
tuner;
542 Glib::RefPtr<UiBoolToggleAction>
livetuner;
543 Glib::RefPtr<UiBoolToggleAction>
midi_out;
548 Glib::RefPtr<Gtk::ToggleAction>
rackh;
550 Glib::RefPtr<Gtk::RadioAction>
skin;
551 Glib::RefPtr<Gtk::RadioAction>
latency;
557 Glib::RefPtr<Gtk::ToggleAction>
organize;
565 Gtk::Label *description;
566 Gtk::ComboBox *channelcombo;
568 sigc::signal<void> close;
570 void on_cancel_button();
571 bool on_delete_event(GdkEventAny* event);
572 bool on_key_press_event(GdkEventKey *event);
589 Glib::RefPtr<gx_gui::GxBuilder> bld;
602 Glib::ustring preset_list_menu_bank;
603 Gtk::UIManager::ui_merge_id preset_list_merge_id;
604 Glib::RefPtr<Gtk::ActionGroup> preset_list_actiongroup;
605 Glib::RefPtr<Gtk::UIManager> uimanager;
609 Gtk::Label convolver_filename_label;
610 Gtk::Label convolver_mono_filename_label;
611 Glib::RefPtr<Gdk::Pixbuf> gx_head_icon;
618 Glib::RefPtr<Gdk::Pixbuf> pixbuf_insert_on;
619 Glib::RefPtr<Gdk::Pixbuf> pixbuf_insert_off;
620 Glib::RefPtr<Gdk::Pixbuf> pixbuf_on;
621 Glib::RefPtr<Gdk::Pixbuf> pixbuf_off;
622 Glib::RefPtr<Gdk::Pixbuf> pixbuf_bypass;
623 Glib::RefPtr<Gdk::Pixbuf> pixbuf_jack_connected;
624 Glib::RefPtr<Gdk::Pixbuf> pixbuf_jack_disconnected;
625 Glib::RefPtr<Gdk::Pixbuf> pixbuf_log_grey;
626 Glib::RefPtr<Gdk::Pixbuf> pixbuf_log_yellow;
627 Glib::RefPtr<Gdk::Pixbuf> pixbuf_log_red;
629 Glib::RefPtr<Gtk::StatusIcon> status_icon;
630 Glib::RefPtr<Gdk::Pixbuf> gx_head_midi;
631 Glib::RefPtr<Gdk::Pixbuf> gx_head_warn;
634 std::map<Glib::ustring, Gtk::ToolItemGroup*> groupmap;
636 Glib::RefPtr<Gtk::SizeGroup> szg_rack_units;
640 Gtk::VBox *tuner_box_no_rack;
641 Gtk::ScrolledWindow *vrack_scrolledbox;
642 Gtk::HBox *stereorackcontainerH;
643 Gtk::HBox *stereorackcontainerV;
645 Gtk::ScrolledWindow *stereorackbox;
646 Gtk::VBox *monocontainer;
648 Gtk::VPaned *main_vpaned;
649 Gtk::HBox *amp_toplevel_box;
651 Gtk::VBox *upper_rackbox;
652 Gtk::ScrolledWindow *preset_scrolledbox;
653 Gtk::Box *preset_box_no_rack;
655 Gtk::Image *insert_image;
656 Gtk::Image *status_image;
657 Gtk::Image *jackd_image;
658 Gtk::Image *logstate_image;
661 Gtk::ToggleButton *show_rack_button;
662 Gtk::ToggleButton *rack_order_h_button;
663 Gtk::ToggleButton *config_mode_button;
664 Gtk::ToggleButton *liveplay_button;
665 Gtk::ToggleButton *tuner_button;
666 Gtk::ToggleButton *effects_button;
667 Gtk::ToggleButton *presets_button;
668 Gtk::Button *compress_button;
669 Gtk::Button *expand_button;
670 Gtk::ToolPalette *effects_toolpalette;
678 Gtk::Button *ampdetail_compress;
679 Gtk::Button *ampdetail_expand;
680 Gtk::Widget *ampdetail_mini;
681 Gtk::Widget *ampdetail_normal;
683 Gtk::Entry *preset_status;
684 Gtk::Container *midi_out_box;
685 Gtk::Container *midi_out_normal;
686 Gtk::Container *midi_out_mini;
687 Gtk::Button *midi_out_compress;
688 Gtk::Button *midi_out_expand;
689 Gtk::Button *midi_out_presets_mini;
690 Gtk::Button *midi_out_presets_normal;
691 Gtk::RadioButton *channel1_button;
692 Gtk::Container *channel1_box;
693 Gtk::RadioButton *channel2_button;
694 Gtk::Container *channel2_box;
695 Gtk::RadioButton *channel3_button;
696 Gtk::Container *channel3_box;
697 Gtk::Alignment *vbam;
702 bool on_my_leave_out(GdkEventCrossing *focus);
703 bool on_my_enter_in(GdkEventCrossing *focus);
704 void load_widget_pointers();
705 void maybe_shrink_horizontally(
bool preset_no_rack=
false);
706 void on_show_tuner();
707 void on_move_tuner();
708 bool is_variable_size();
709 void maybe_change_resizable(
void);
711 void on_preset_action();
712 void on_compress_all();
713 void on_expand_all();
714 void on_show_plugin_bar();
715 void on_rack_configuration();
717 void set_animations();
718 void move_widget(Gtk::Widget& w, Gtk::Box& b1, Gtk::Box& b2);
719 int rackbox_stacked_vertical()
const;
720 void change_expand(Gtk::Widget& w,
bool value);
721 void on_dir_changed();
722 void on_configure_event(GdkEventConfigure *ev);
723 void clear_box(Gtk::Container& box);
724 RackBox *add_rackbox_internal(
PluginUI& plugin, Gtk::Widget *mainwidget, Gtk::Widget *miniwidget,
725 bool mini=
false,
int pos=-1,
bool animate=
false, Gtk::Widget *bare=0);
726 void on_show_values();
727 void create_actions();
728 void add_toolitem(
PluginUI& pl, Gtk::ToolItemGroup *gw);
729 bool on_visibility_notify(GdkEventVisibility *ev);
731 void on_ti_drag_begin(
const Glib::RefPtr<Gdk::DragContext>& context,
const PluginUI& plugin);
732 void on_ti_drag_end(
const Glib::RefPtr<Gdk::DragContext>& context);
733 void on_ti_drag_data_get(
const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection,
int info,
int timestamp,
const char *effect_id);
734 void on_ti_drag_data_delete(
const Glib::RefPtr<Gdk::DragContext>& context,
const char *effect_id);
735 bool on_ti_button_press(GdkEventButton *ev,
const char *effect_id);
736 void on_tp_drag_data_received(
const Glib::RefPtr<Gdk::DragContext>& context,
int x,
int y,
const Gtk::SelectionData& data,
int info,
int timestamp);
737 void fill_pluginlist();
738 void make_icons(
bool force=
true);
739 void jack_connection();
740 void on_miditable_toggle();
741 void on_portmap_activate();
742 void on_portmap_response(
int);
743 bool connect_jack(
bool v, Gtk::Window *splash = 0);
745 void add_skin_menu();
746 void change_skin(Glib::RefPtr<Gtk::RadioAction> action);
747 void on_jack_client_changed();
748 void add_latency_menu();
749 void change_latency(Glib::RefPtr<Gtk::RadioAction> action);
750 void user_disable_latency_warn(Gtk::CheckButton* disable_warn);
751 int gx_wait_latency_warn();
754 void add_osc_size_menu();
755 void change_osc_buffer(Glib::RefPtr<Gtk::RadioAction> action);
756 void on_select_jack_control();
757 void on_load_ladspa();
758 void delete_select_jack_control();
759 void on_select_midi_channel();
760 void delete_select_midi_channel();
761 void on_log_activate();
762 bool on_log_activated(GdkEventButton* ev);
763 bool on_log_scrolled(GdkEventScroll* ev);
764 void do_program_change(
int pgm);
765 void on_engine_toggled();
767 void set_new_skin(
const Glib::ustring& skin_name);
773 bool on_toggle_mute(GdkEventButton* ev);
774 bool on_scroll_toggle(GdkEventScroll* ev);
775 bool on_toggle_insert(GdkEventButton* ev);
776 bool on_scroll_toggle_insert(GdkEventScroll* ev);
777 void on_insert_jack_changed(
bool s);
778 bool on_jackserverconnection(GdkEventButton* ev);
779 bool on_jackserverconnection_scroll(GdkEventScroll* ev);
780 void on_msg_level_changed();
781 void on_ampdetail_switch(
bool compress,
bool setparam);
782 void on_show_oscilloscope(
bool v);
783 void set_waveview_buffer(
unsigned int size);
784 void on_oscilloscope_post_pre(
int post_pre);
785 int on_oscilloscope_activate(
bool start);
786 bool on_refresh_oscilloscope();
787 bool refresh_meter_level(
float falloff);
788 bool survive_jack_shutdown();
789 void gx_jack_is_down();
790 void jack_session_event();
791 void jack_session_event_ins();
792 void set_in_session();
793 void hide_extended_settings();
794 void systray_menu(guint button, guint32 activate_time);
796 bool on_window_state_changed(GdkEventWindowState* event);
797 bool on_meter_button_release(GdkEventButton* ev);
798 void show_selected_preset();
799 void on_select_preset(
int idx);
800 void on_next_preset();
801 void on_previus_preset();
802 void set_next_preset_controller();
803 void set_previus_preset_controller();
804 void set_switcher_controller();
805 void set_bypass_controller();
806 void set_vpaned_handle();
807 void rebuild_preset_menu();
808 bool on_key_press_event(GdkEventKey *event);
809 void display_preset_msg(
const Glib::ustring& bank,
const Glib::ustring& preset);
810 void on_show_midi_out();
811 void on_show_midi_out_plug();
812 void on_midi_out_channel_toggled(Gtk::RadioButton *rb, Gtk::Container *c);
813 void on_livetuner_toggled();
814 Gtk::ToolItemGroup *add_plugin_category(
const char *cat,
bool collapse =
true);
815 Glib::ustring add_plugin_menu_entry(
PluginUI *pui);
816 void register_plugin(
PluginUI *pui);
817 void on_ladspa_finished(
bool reload,
bool quit);
818 bool delete_ladspalist_window();
820 void amp_controls_visible(Gtk::Range *rr);
825 Gtk::Window *splash,
const Glib::ustring& title);
830 void add_icon(
const std::string& name);
839 void add_plugin(std::vector<PluginUI*>& p,
const char *
id,
const Glib::ustring& tooltip_=
"");