26 #include <gxw/GxLevelSlider.h> 27 #include <gtkmm/accelmap.h> 35 TextLoggingBox::tab_table TextLoggingBox::tagdefs[] = {
36 {
"colinfo",
"#cccccc"},
37 {
"colwarn",
"#77994f"},
38 {
"colerr",
"#ff8800"},
43 ok_button(Gtk::Stock::OK),
47 highest_unseen_msg_level(-1),
50 set_default_size(640, 320);
53 set_gravity(Gdk::GRAVITY_SOUTH);
54 set_keep_below(
false);
55 set_title(_(
"Logging Window"));
56 set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
59 box.set_border_width(0);
60 scrollbox.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
64 tbox.set_wrap_mode(Gtk::WRAP_WORD_CHAR);
65 tbox.set_border_width(0);
66 tbox.set_editable(
false);
67 tbox.set_cursor_visible(
false);
68 tbox.set_pixels_above_lines(0);
69 tbox.set_pixels_below_lines(2);
70 tbox.set_justification(Gtk::JUSTIFY_LEFT);
71 tbox.set_left_margin(5);
74 Glib::RefPtr<Gtk::TextBuffer> buffer = tbox.get_buffer();
76 tags[i] = buffer->create_tag(tagdefs[i].tagname);
77 tags[i]->property_foreground() = tagdefs[i].tag_color;
81 box.pack_end(buttonbox, Gtk::PACK_SHRINK);
82 buttonbox.set_layout(Gtk::BUTTONBOX_END);
83 buttonbox.add(ok_button);
84 buttonbox.set_border_width(4);
85 ok_button.set_can_default();
86 ok_button.grab_default();
87 ok_button.signal_clicked().connect(sigc::mem_fun(
this, &TextLoggingBox::hide));
90 tbox.set_size_request(-1, 50);
93 sigc::mem_fun(*
this, &TextLoggingBox::show_msg));
100 bool TextLoggingBox::on_key_press_event(GdkEventKey *event) {
101 if (event->keyval ==
GDK_KEY_Escape && (event->state & Gtk::AccelGroup::get_default_mod_mask()) == 0) {
105 return Gtk::Window::on_key_press_event(event);
108 void TextLoggingBox::on_show() {
110 Gtk::Window::on_show();
113 void TextLoggingBox::on_hide() {
114 highest_unseen_msg_level = -1;
115 Gtk::Window::on_hide();
121 highest_unseen_msg_level = -1;
124 void TextLoggingBox::show_msg(
string msgbuf,
GxLogger::MsgType msgtype,
bool plugged) {
128 Glib::RefPtr<Gtk::TextBuffer> buffer = tbox.get_buffer();
131 const int nlines = 50;
134 int linecount = buffer->get_line_count();
135 if (linecount >= nlines) {
136 Gtk::TextIter iter1 = buffer->get_iter_at_line(0);
137 Gtk::TextIter iter2 = buffer->get_iter_at_line(1);
138 buffer->erase(iter1, iter2);
141 Gtk::TextIter iter = buffer->end();
142 if (buffer->get_char_count() > 0) {
143 iter = buffer->insert(iter,
"\n");
146 buffer->insert_with_tag(iter, msgbuf, tags[msgtype]);
147 scrollbox.get_vadjustment()->set_value(10000);
151 if (msgtype > highest_unseen_msg_level) {
152 highest_unseen_msg_level = msgtype;
163 SelectMidiChannel::SelectMidiChannel(BaseObjectType* cobject, Glib::RefPtr<gx_gui::GxBuilder> bld,
gx_engine::GxMachineBase& m)
164 : Gtk::Window(cobject),
169 signal_delete_event().connect(sigc::mem_fun(*
this, &SelectMidiChannel::on_delete_event));
170 bld->find_widget(
"description", description);
171 bld->find_widget(
"channelcombo", channelcombo);
172 const char *v_id = machine.get_parameter(
"system.midi_channel").getValueNames()[machine.get_parameter_value<
int>(
"system.midi_channel")].value_id;
174 Glib::RefPtr<Gtk::TreeModel> model = channelcombo->get_model();
175 for (Gtk::TreeIter i = model->children().begin(); i; ++i, ++n) {
179 channelcombo->set_active(n);
183 bld->find_widget(
"ok_button", button);
184 button->signal_clicked().connect(
185 sigc::mem_fun(*
this, &SelectMidiChannel::on_ok_button));
186 bld->find_widget(
"cancel_button", button);
187 button->signal_clicked().connect(
188 sigc::mem_fun(*
this, &SelectMidiChannel::on_cancel_button));
196 Glib::RefPtr<gx_gui::GxBuilder> bld = gx_gui::GxBuilder::create_from_file(opt.
get_builder_filepath(
"midi_channel.glade"), &m);
198 bld->get_toplevel_derived(
"selectmidichannel", w,
199 sigc::bind(sigc::ptr_fun(SelectMidiChannel::create_from_builder), bld, sigc::ref(m)));
203 bool SelectMidiChannel::on_key_press_event(GdkEventKey *event) {
204 if (event->keyval ==
GDK_KEY_Escape && (event->state & Gtk::AccelGroup::get_default_mod_mask()) == 0) {
208 return Gtk::Window::on_key_press_event(event);
211 bool SelectMidiChannel::on_delete_event(GdkEventAny* event) {
216 void SelectMidiChannel::on_ok_button() {
218 channelcombo->get_active()->get_value(1, s);
219 int n = machine.get_parameter(
"system.midi_channel").getInt().idx_from_id(s);
221 machine.set_parameter_value(
"system.midi_channel", n);
228 void SelectMidiChannel::on_cancel_button() {
242 typedef list<GtkAccelKey> accel_list;
243 unsigned int next_key;
245 static gboolean add_keys_to_list(GtkAccelKey *key, GClosure *cl, gpointer data);
247 KeyFinder(Glib::RefPtr<Gtk::AccelGroup> group);
252 KeyFinder::KeyFinder(Glib::RefPtr<Gtk::AccelGroup> group) {
254 gtk_accel_group_find(group->gobj(), add_keys_to_list,
static_cast<gpointer
>(&l));
257 KeyFinder::~KeyFinder() {
260 gboolean KeyFinder::add_keys_to_list(GtkAccelKey *key, GClosure *cl, gpointer data) {
261 accel_list* l = (accel_list*)data;
262 if (key->accel_mods == GDK_SHIFT_MASK) {
268 int KeyFinder::operator()() {
269 while (next_key <= GDK_z) {
271 for (accel_list::iterator i = l.begin(); i != l.end(); ++i) {
272 if (next_key == i->accel_key) {
294 static unsigned int keysep[];
301 unsigned int TubeKeys::keysep[] = {
302 GDK_a, GDK_b, GDK_c, GDK_d, GDK_e, 0,
304 GDK_g, GDK_h, GDK_i, GDK_j, 0,
305 GDK_k, GDK_l, GDK_m, GDK_n, 0,
306 GDK_o, GDK_p, GDK_q, GDK_r
310 if (ks <
sizeof(keysep)/
sizeof(keysep[0])) {
320 sigc::mem_fun(
this, &GxUiRadioMenu::set_value));
324 Glib::RefPtr<Gtk::UIManager>& uimanager, Glib::RefPtr<Gtk::ActionGroup>& actiongroup) {
328 Glib::ustring s = prefix;
329 Gtk::RadioButtonGroup group;
337 Glib::ustring actname = Glib::ustring::compose(
"Enum_%1.%2", param.
id(), p->
value_id);
338 s += Glib::ustring::compose(
"<menuitem action=\"%1\"/>", actname);
339 Glib::RefPtr<Gtk::RadioAction> act = Gtk::RadioAction::create(group, actname, param.
value_label(*p));
340 act->property_value().set_value(static_cast<int>(param.
getLowerAsFloat())+i);
342 actiongroup->add(act, Gtk::AccelKey(Glib::ustring::compose(
"<shift>%1", (
char)c)));
344 actiongroup->add(act);
347 act->signal_changed().connect(
348 sigc::mem_fun(*
this, &GxUiRadioMenu::on_changed));
354 uimanager->add_ui_from_string(s);
357 void GxUiRadioMenu::set_value(
unsigned int v) {
358 action->set_current_value(v);
361 void GxUiRadioMenu::on_changed(Glib::RefPtr<Gtk::RadioAction> act) {
371 : window(0), tag(), need_thaw(false), size_x(-1), size_y(-1) {
378 void Freezer::freeze(Gtk::Window *w,
int width,
int height) {
385 Glib::RefPtr<Gdk::Window> win = window->get_window();
388 win->freeze_updates();
406 freeze(w, width, -1);
412 if (wd >= width && ht == height) {
415 freeze(w, width, height);
416 w->set_size_request(width, height);
419 bool Freezer::thaw_timeout() {
426 window->set_size_request(-1,-1);
432 void Freezer::do_thaw() {
433 size_x = size_y = -1;
434 Glib::RefPtr<Gdk::Window> win = window->get_window();
440 Glib::signal_idle().connect_once(work);
448 void Freezer::thaw() {
459 Glib::RefPtr<Gdk::Window> win = window->get_window();
460 if (win && win->get_state()) {
465 if (size_x == width) {
466 window->set_size_request(-1,-1);
471 if (size_x <= width && size_y == height) {
472 window->set_size_request(-1,-1);
476 if (!tag.connected()) {
477 tag = Glib::signal_timeout().connect(sigc::mem_fun(*
this, &Freezer::thaw_timeout), 500);
489 gx_engine::GxMachineBase& machine_,
const std::string& id_,
const Glib::ustring& name,
const Glib::ustring& icon_name,
490 const Glib::ustring& label,
const Glib::ustring& tooltip,
492 : Gtk::ToggleAction(name, icon_name, label, tooltip, is_active),
497 sigc::mem_fun(
this, &UiToggleAction::set_active));
510 Gtk::PolicyType hp, vp;
511 w.get_policy(hp, vp);
512 w.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
513 w.set_policy(hp, vp);
520 void MainWindow::maybe_shrink_horizontally(
bool preset_no_rack) {
521 Glib::RefPtr<Gdk::Window> w = window->get_window();
525 int state = w->get_state();
526 if (state & (Gdk::WINDOW_STATE_MAXIMIZED | Gdk::WINDOW_STATE_FULLSCREEN)) {
529 Gtk::Requisition req;
530 window->size_request(req);
532 window->get_position(x, y);
534 geom.min_width = req.width;
535 geom.min_height = req.height;
536 w->set_geometry_hints(geom, Gdk::HINT_MIN_SIZE);
537 if (preset_no_rack) {
538 req.height += options.preset_window_height - preset_scrolledbox->size_request().height;
540 req.height =
std::max(req.height, options.window_height);
542 w->move_resize(x, y, req.width, req.height);
544 freezer.freeze_until_width_update(window, req.width);
548 void MainWindow::on_move_tuner() {
549 bool v = actions.tuner->get_active();
550 if(tunerbox->get_parent() == upper_rackbox) {
551 tunerbox->set_visible(
false);
552 upper_rackbox->remove(*tunerbox);
553 tuner_box_no_rack->pack_start(*tunerbox,
false,
false);
554 }
else if(tunerbox->get_parent() == tuner_box_no_rack) {
555 tunerbox->set_visible(
false);
556 tuner_box_no_rack->remove(*tunerbox);
557 upper_rackbox->add(*tunerbox);
559 on_livetuner_toggled();
560 tunerbox->set_visible(v);
564 void MainWindow::on_show_tuner() {
565 bool v = actions.tuner->get_active();
566 on_livetuner_toggled();
567 tunerbox->set_visible(v);
571 void MainWindow::load_widget_pointers() {
572 bld->get_toplevel(
"MainWindow", window);
573 bld->find_widget(
"tunerbox", tunerbox);
574 bld->find_widget(
"tuner_box_no_rack", tuner_box_no_rack);
575 bld->find_widget(
"vrack_scrolledbox", vrack_scrolledbox);
576 bld->find_widget(
"stereorackcontainerH", stereorackcontainerH);
577 bld->find_widget(
"stereorackcontainerV", stereorackcontainerV);
578 bld->find_widget(
"rackcontainer", rackcontainer);
579 bld->find_widget(
"stereorackbox", stereorackbox);
580 bld->find_widget(
"monorackcontainer", monocontainer);
581 bld->find_widget(
"monoampcontainer:ampdetails", monoampcontainer);
582 bld->find_widget(
"main_vpaned", main_vpaned);
583 bld->find_widget(
"amp_toplevel_box", amp_toplevel_box);
584 bld->find_widget(
"monobox", monobox);
585 bld->find_widget(
"upper_rackbox", upper_rackbox);
586 bld->find_widget(
"preset_scrolledbox", preset_scrolledbox);
587 bld->find_widget(
"preset_box_no_rack", preset_box_no_rack);
588 bld->find_widget(
"effects_frame_paintbox", effects_frame_paintbox);
589 bld->find_widget(
"insert_image", insert_image);
590 bld->find_widget(
"status_image", status_image);
591 bld->find_widget(
"jackd_image", jackd_image);
592 bld->find_widget(
"logstate_image", logstate_image);
593 bld->find_widget(
"menubox", menubox);
594 bld->find_widget(
"show_rack:barbutton", show_rack_button);
595 bld->find_widget(
"rack_order_h:barbutton", rack_order_h_button);
596 bld->find_widget(
"config_mode:barbutton", config_mode_button);
597 bld->find_widget(
"liveplay:barbutton", liveplay_button);
598 bld->find_widget(
"tuner:barbutton", tuner_button);
599 bld->find_widget(
"effects:barbutton", effects_button);
600 bld->find_widget(
"presets:barbutton", presets_button);
601 bld->find_widget(
"compress:barbutton", compress_button);
602 bld->find_widget(
"expand:barbutton", expand_button);
603 bld->find_widget(
"effects_toolpalette", effects_toolpalette);
604 bld->find_widget(
"amp_background:ampbox", amp_background);
605 bld->find_widget(
"tuner_on_off", tuner_on_off);
606 bld->find_widget(
"tuner_mode", tuner_mode);
607 bld->find_widget(
"tuner_reference_pitch", tuner_reference_pitch);
608 bld->find_widget(
"tuner_tuning", tuner_tuning);
609 bld->find_widget(
"tuner_temperament", tuner_temperament);
610 bld->find_widget(
"racktuner", racktuner);
611 bld->find_widget(
"ampdetail_compress:effect_reset", ampdetail_compress);
612 bld->find_widget(
"ampdetail_expand:effect_reset", ampdetail_expand);
613 bld->find_widget(
"ampdetail_mini", ampdetail_mini);
614 bld->find_widget(
"ampdetail_normal", ampdetail_normal);
615 bld->find_widget(
"fastmeterL", fastmeter[0]);
616 bld->find_widget(
"fastmeterR", fastmeter[1]);
617 bld->find_widget(
"preset_status", preset_status);
618 bld->find_widget(
"midi_out_box", midi_out_box);
619 bld->find_widget(
"midi_out_normal", midi_out_normal);
620 bld->find_widget(
"midi_out_mini", midi_out_mini);
621 bld->find_widget(
"midi_out_compress:effect_reset", midi_out_compress);
622 bld->find_widget(
"midi_out_expand:effect_reset", midi_out_expand);
623 bld->find_widget(
"midi_out_presets_mini", midi_out_presets_mini);
624 bld->find_widget(
"midi_out_presets_normal", midi_out_presets_normal);
625 bld->find_widget(
"channel1_button", channel1_button);
626 bld->find_widget(
"channel1_box", channel1_box);
627 bld->find_widget(
"channel2_button", channel2_button);
628 bld->find_widget(
"channel2_box", channel2_box);
629 bld->find_widget(
"channel3_button", channel3_button);
630 bld->find_widget(
"channel3_box", channel3_box);
634 void MainWindow::set_next_preset_controller() {
640 void MainWindow::set_previus_preset_controller() {
646 void MainWindow::on_select_preset(
int idx) {
647 keyswitch.process_preset_key(idx);
650 void MainWindow::on_next_preset() {
656 void MainWindow::on_previus_preset() {
662 void MainWindow::rebuild_preset_menu() {
663 if (preset_list_merge_id) {
664 uimanager->remove_ui(preset_list_merge_id);
665 uimanager->remove_action_group(preset_list_actiongroup);
666 preset_list_menu_bank.clear();
667 preset_list_merge_id = 0;
668 preset_list_actiongroup.reset();
669 uimanager->ensure_update();
678 preset_list_actiongroup = Gtk::ActionGroup::create(
"PresetList");
680 Glib::ustring s =
"<menubar><menu action=\"PresetsMenu\"><menu action=\"PresetListMenu\">";
683 Glib::ustring actname =
"PresetList_" + i->name;
684 Glib::RefPtr<Gtk::Action> action = Gtk::Action::create(actname, i->name);
685 preset_list_actiongroup->add(
686 action, sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_select_preset), idx));
689 Gtk::AccelMap::change_entry(action->get_accel_path(), c, Gdk::ModifierType(0),
true);
691 s += Glib::ustring::compose(
"<menuitem action=\"%1\"/>", actname);
693 s +=
"</menu></menu></menubar>";
694 uimanager->insert_action_group(preset_list_actiongroup);
695 preset_list_merge_id = uimanager->add_ui_from_string(s);
696 dynamic_cast<Gtk::MenuItem*
>(uimanager->get_widget(
"/menubar/PresetsMenu/PresetListMenu"))->set_label(_(
"_Bank: ")+preset_list_menu_bank);
699 void MainWindow::show_selected_preset() {
700 keyswitch.deactivate();
705 rebuild_preset_menu();
708 preset_status->set_text(t);
711 bool MainWindow::is_variable_size() {
712 return actions.presets->get_active() || actions.show_rack->get_active();
715 void MainWindow::maybe_change_resizable() {
716 Glib::RefPtr<Gdk::Window> w = window->get_window();
717 if (w && w->get_state() != 0) {
720 if (!is_variable_size() && window->get_resizable()) {
721 window->set_resizable(
false);
722 }
else if (!window->get_resizable()) {
723 window->set_resizable(
true);
727 void MainWindow::set_vpaned_handle() {
729 main_vpaned->get_handle_window()->get_size(w, h);
730 int pos = main_vpaned->get_allocation().get_height() - options.preset_window_height - h;
731 main_vpaned->set_position(pos);
734 void MainWindow::on_show_rack() {
736 if (rackbox_stacked_vertical()) {
737 w = stereorackcontainerV;
741 bool v = options.system_show_rack = actions.show_rack->get_active();
742 actions.rackh->set_sensitive(v);
743 stereorackcontainer.set_visible(v);
744 rack_order_h_button->set_visible(v);
747 compress_button->set_visible(!c);
748 expand_button->set_visible(c);
750 compress_button->set_visible(v);
751 expand_button->set_visible(v);
753 if (actions.presets->get_active() && preset_scrolledbox->get_mapped()) {
754 options.preset_window_height = preset_scrolledbox->get_allocation().get_height();
757 midi_out_box->set_visible(actions.midi_out->get_active());
759 actions.show_plugin_bar->set_active(
true);
761 options.window_height =
max(options.window_height, window->size_request().height);
762 main_vpaned->set_position(oldpos);
764 monoampcontainer->show();
765 monorackcontainer.show_entries();
766 vrack_scrolledbox->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
767 vrack_scrolledbox->set_size_request(scrl_size_x, scrl_size_y);
768 if (preset_scrolledbox->get_parent() != main_vpaned) {
769 preset_box_no_rack->remove(*preset_scrolledbox);
770 main_vpaned->add(*preset_scrolledbox);
771 change_expand(*preset_box_no_rack,
false);
772 change_expand(*main_vpaned,
true);
775 Glib::RefPtr<Gdk::Window> win = window->get_window();
776 if (!win || win->get_state() == 0) {
777 Gtk::Requisition req;
778 window->size_request(req);
779 req.height =
max(req.height, options.window_height);
780 freezer.freeze_and_size_request(window, req.width, req.height);
781 if (win && actions.presets->get_active()) {
782 freezer.set_slot(sigc::mem_fun(
this, &MainWindow::set_vpaned_handle));
786 if (actions.midi_out->get_active()) {
787 midi_out_box->set_visible(
false);
789 pool_act = actions.show_plugin_bar->get_active();
791 actions.show_plugin_bar->set_active(
false);
793 oldpos = main_vpaned->get_position();
795 monoampcontainer->hide();
796 monorackcontainer.hide_entries();
797 if (preset_scrolledbox->get_parent() == main_vpaned) {
798 main_vpaned->remove(*preset_scrolledbox);
799 preset_box_no_rack->add(*preset_scrolledbox);
800 change_expand(*main_vpaned,
false);
801 change_expand(*preset_box_no_rack,
true);
803 preset_box_no_rack->set_visible(actions.presets->get_active());
804 vrack_scrolledbox->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_NEVER);
805 vrack_scrolledbox->get_size_request(scrl_size_x, scrl_size_y);
806 vrack_scrolledbox->set_size_request(-1,-1);
807 if (actions.presets->get_active()) {
808 maybe_shrink_horizontally(
true);
810 maybe_shrink_horizontally();
813 maybe_change_resizable();
816 void MainWindow::on_compress_all() {
817 plugin_dict.compress(
true);
818 on_ampdetail_switch(
true,
true);
819 actions.midi_out_plug->set_active(
true);
821 compress_button->set_visible(
false);
822 expand_button->set_visible(
true);
825 void MainWindow::on_expand_all() {
826 plugin_dict.compress(
false);
827 on_ampdetail_switch(
false,
true);
828 actions.midi_out_plug->set_active(
false);
830 compress_button->set_visible(
true);
831 expand_button->set_visible(
false);
834 void MainWindow::on_rack_configuration() {
835 bool v = actions.rack_config->get_active();
836 actions.show_plugin_bar->set_sensitive(!v);
837 actions.show_rack->set_sensitive(!v);
838 actions.tuner->set_sensitive(!v);
839 actions.compress->set_sensitive(!v);
840 actions.expand->set_sensitive(!v);
841 actions.live_play->set_sensitive(!v);
842 Gtk::Requisition req;
843 monobox->size_request(req);
844 stereorackcontainer.set_config_mode(v);
845 monorackcontainer.set_config_mode(v);
846 szg_rack_units->set_ignore_hidden(v);
847 bool plugin_bar = actions.show_plugin_bar->get_active();
849 pre_act = actions.presets->get_active();
851 actions.presets->set_active(
false);
853 actions.show_rack->set_active(
true);
854 effects_frame_paintbox->show();
855 upper_rackbox->hide();
856 Gtk::Requisition req2;
857 effects_frame_paintbox->size_request(req2);
858 int width = req.width;
860 if (rackbox_stacked_vertical()) {
863 if (req2.width & 1) {
866 width -= req2.width/2;
869 effects_frame_paintbox->set_size_request(req2.width, -1);
870 monobox->set_size_request(width,-1);
873 effects_frame_paintbox->hide();
875 upper_rackbox->show();
876 effects_frame_paintbox->set_size_request(-1,-1);
877 monobox->set_size_request(-1,-1);
879 actions.presets->set_active(
true);
884 maybe_shrink_horizontally();
888 void MainWindow::on_show_plugin_bar() {
889 bool v = options.system_show_toolbar = actions.show_plugin_bar->get_active();
891 actions.show_rack->set_active(
true);
893 effects_frame_paintbox->set_visible(v);
897 maybe_shrink_horizontally();
901 void MainWindow::move_widget(Gtk::Widget& w, Gtk::Box& b1, Gtk::Box& b2) {
911 int MainWindow::rackbox_stacked_vertical()
const {
912 return !actions.rackh->get_active();
915 void MainWindow::change_expand(Gtk::Widget& w,
bool value) {
916 Gtk::Box *p =
dynamic_cast<Gtk::Box*
>(w.get_parent());
918 unsigned int padding;
919 GtkPackType pack_type;
920 gtk_box_query_child_packing(p->gobj(), w.gobj(), &expand, &fill, &padding, &pack_type);
921 gtk_box_set_child_packing(p->gobj(), w.gobj(), value, value, padding, pack_type);
925 Gtk::Allocation alloc = stereorackcontainer.get_allocation();
926 double lim = alloc.get_y() + alloc.get_height() - pagesize;
930 return min(off+step_size, lim);
934 Gtk::Allocation alloc = monorackcontainer.get_allocation();
935 if (off < alloc.get_y()) {
938 return max(off-step_size,
double(alloc.get_y()));
941 void MainWindow::on_dir_changed() {
942 bool v = options.system_order_rack_h = actions.rackh->get_active();
945 move_widget(stereorackcontainer, *stereorackcontainerV, *stereorackcontainerH);
946 change_expand(*monobox,
true);
947 stereorackbox->show();
949 move_widget(stereorackcontainer, *stereorackcontainerH, *stereorackcontainerV);
950 change_expand(*monobox,
false);
951 stereorackbox->hide();
952 maybe_shrink_horizontally();
956 void MainWindow::on_configure_event(GdkEventConfigure *ev) {
957 if (freezer.check_thaw(ev->width, ev->height)) {
958 if (actions.show_rack->get_active()) {
959 options.window_height = ev->height;
966 if (ch == &monorackcontainer && !actions.rackh->get_active()) {
967 stereorackcontainer.queue_draw();
976 RackBox *MainWindow::add_rackbox_internal(
PluginUI& plugin, Gtk::Widget *mainwidget, Gtk::Widget *miniwidget,
977 bool mini,
int pos,
bool animate, Gtk::Widget *bare) {
982 r->
pack(mainwidget, miniwidget, szg_rack_units);
985 monorackcontainer.add(*manage(r), pos);
987 stereorackcontainer.add(*manage(r), pos);
996 Gtk::Widget *mainwidget = 0;
997 Gtk::Widget *miniwidget = 0;
998 boxbuilder.get_box(pl.
get_id(), mainwidget, miniwidget);
1003 boxbuilder.fetch(mainwidget, miniwidget);
1006 return add_rackbox_internal(pl, mainwidget, miniwidget, mini, pos, animate);
1014 void MainWindow::on_show_values() {
1015 options.system_show_value = actions.show_values->get_active();
1017 "style \"ShowValue\" {\n" 1020 "class \"*GxRegler*\" style:highest \"ShowValue\"\n";
1021 gtk_rc_parse_string(s.c_str());
1022 gtk_rc_reset_styles(gtk_settings_get_default());
1025 void MainWindow::on_preset_action() {
1026 bool v = options.system_show_presets = actions.presets->get_active();
1027 if (!v && preset_scrolledbox->get_mapped()) {
1028 options.preset_window_height = preset_scrolledbox->get_allocation().get_height();
1030 maybe_change_resizable();
1031 if (v && !actions.show_rack->get_active()) {
1032 Glib::RefPtr<Gdk::Window> win = window->get_window();
1033 if (!win || win->get_state() == 0) {
1034 Gtk::Requisition req;
1035 window->size_request(req);
1036 freezer.freeze_and_size_request(window, req.width, req.height+options.preset_window_height);
1039 preset_box_no_rack->set_visible(v);
1040 preset_window->on_preset_select(v, use_animations() && actions.show_rack->get_active(), options.preset_window_height);
1047 bool MainWindow::on_my_leave_out(GdkEventCrossing *focus) {
1048 Glib::RefPtr<Gdk::Window> wind = window->get_window();
1053 bool MainWindow::on_my_enter_in(GdkEventCrossing *focus) {
1054 Glib::RefPtr<Gdk::Window> wind = window->get_window();
1055 Gdk::Cursor cursor(Gdk::HAND1);
1056 wind->set_cursor(cursor);
1060 void MainWindow::add_toolitem(
PluginUI& pl, Gtk::ToolItemGroup *gw) {
1061 Gtk::ToolItem *tb =
new Gtk::ToolItem();
1062 tb->set_use_drag_window(
true);
1063 tb->signal_drag_begin().connect(sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ti_drag_begin), sigc::ref(pl)));
1064 tb->signal_drag_end().connect(sigc::mem_fun(*
this, &MainWindow::on_ti_drag_end));
1065 tb->signal_drag_data_delete().connect(sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ti_drag_data_delete), pl.
get_id()));
1066 tb->signal_button_press_event().connect(sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ti_button_press), pl.
get_id()));
1067 tb->add_events(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
1068 tb->signal_leave_notify_event().connect(sigc::mem_fun(*
this, &MainWindow::on_my_leave_out));
1069 tb->signal_enter_notify_event().connect(sigc::mem_fun(*
this, &MainWindow::on_my_enter_in));
1070 std::vector<Gtk::TargetEntry> listTargets;
1072 listTargets.push_back(Gtk::TargetEntry(
"application/x-gtk-tool-palette-item-mono", Gtk::TARGET_SAME_APP, 0));
1074 listTargets.push_back(Gtk::TargetEntry(
"application/x-gtk-tool-palette-item-stereo", Gtk::TARGET_SAME_APP, 0));
1076 tb->drag_source_set(listTargets, Gdk::BUTTON1_MASK, Gdk::ACTION_MOVE);
1077 tb->signal_drag_data_get().connect(sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ti_drag_data_get), pl.
get_id()));
1078 Gtk::Image *img =
new Gtk::Image(pl.
icon);
1080 img->set_tooltip_text(pl.
tooltip);
1082 tb->add(*manage(img));
1085 gw->add(*manage(tb));
1089 bool MainWindow::on_visibility_notify(GdkEventVisibility *ev) {
1090 bool v = ev->state != GDK_VISIBILITY_FULLY_OBSCURED;
1091 if (v == is_visible) {
1098 void MainWindow::on_live_play() {
1099 live_play->on_live_play(actions.live_play);
1102 void MainWindow::on_ti_drag_begin(
const Glib::RefPtr<Gdk::DragContext>& context,
const PluginUI& plugin) {
1103 drag_icon =
new DragIcon(plugin, context, options);
1106 void MainWindow::on_ti_drag_end(
const Glib::RefPtr<Gdk::DragContext>& context) {
1113 void MainWindow::on_ti_drag_data_get(
const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection,
int info,
int timestamp,
const char *effect_id) {
1114 selection.set(*context->get_targets().begin(), effect_id);
1118 Gtk::ToolItem *toolitem = plugin_dict[name]->toolitem;
1124 void MainWindow::on_ti_drag_data_delete(
const Glib::RefPtr<Gdk::DragContext>& context,
const char *effect_id) {
1125 hide_effect(effect_id);
1128 bool MainWindow::on_ti_button_press(GdkEventButton *ev,
const char *effect_id) {
1129 if (ev->type == GDK_2BUTTON_PRESS) {
1130 get_plugin(effect_id)->display_new();
1136 void MainWindow::on_tp_drag_data_received(
const Glib::RefPtr<Gdk::DragContext>& context,
int x,
int y,
const Gtk::SelectionData& data,
int info,
int timestamp) {
1137 Glib::ustring
id = data.get_data_as_string();
1141 p->
group->set_collapsed(
false);
1144 void MainWindow::jack_connection() {
1145 bool v = actions.jackserverconnection->get_active();
1146 if (!connect_jack(v)) {
1147 actions.jackserverconnection->set_active(!v);
1151 void MainWindow::on_portmap_response(
int) {
1152 actions.jackports->set_active(
false);
1155 void MainWindow::on_portmap_activate() {
1160 if (actions.jackports->get_active()) {
1161 if (portmap_window) {
1165 portmap_window->signal_response().connect(
1166 sigc::mem_fun(*
this, &MainWindow::on_portmap_response));
1168 if (!portmap_window) {
1171 delete portmap_window;
1176 void MainWindow::on_miditable_toggle() {
1180 void MainWindow::change_skin(Glib::RefPtr<Gtk::RadioAction> action) {
1181 set_new_skin(options.skin[action->get_current_value()]);
1184 void MainWindow::set_new_skin(
const Glib::ustring& skin_name) {
1185 if (!skin_name.empty()) {
1186 options.skin_name = skin_name;
1187 string rcfile = options.get_style_filepath(
1188 "gx_head_" + skin_name +
".rc");
1189 gtk_rc_parse(rcfile.c_str());
1190 gtk_rc_reset_styles(gtk_settings_get_default());
1195 void MainWindow::add_skin_menu() {
1196 Glib::ustring s =
"<menubar><menu action=\"OptionsMenu\"><menu action=\"SkinMenu\">";
1198 Gtk::RadioButtonGroup sg;
1199 for (vector<Glib::ustring>::iterator i = options.skin.skin_list.begin();
1200 i != options.skin.skin_list.end();
1202 Glib::ustring name = *i;
1203 Glib::ustring actname = Glib::ustring::compose(
"ChangeSkin_%1", name);
1204 s += Glib::ustring::compose(
"<menuitem action=\"%1\"/>", actname);
1205 Glib::RefPtr<Gtk::RadioAction> action = Gtk::RadioAction::create(sg, actname, name);
1206 if (name == options.skin_name) {
1207 action->set_active(
true);
1209 actions.group->add(action);
1211 actions.skin = action;
1213 action->property_value().set_value(idx++);
1215 actions.skin->signal_changed().connect(
1216 sigc::mem_fun(*
this, &MainWindow::change_skin));
1217 s.append(
"</menu></menu></menubar>");
1218 uimanager->add_ui_from_string(s);
1227 void MainWindow::user_disable_latency_warn(Gtk::CheckButton* disable_warn) {
1228 options.no_warn_latency = disable_warn->get_active();
1231 int MainWindow::gx_wait_latency_warn() {
1232 Gtk::Dialog warn_dialog;
1234 warn_dialog.property_destroy_with_parent().set_value(
true);
1236 Gtk::VBox box(0, 4);
1237 Gtk::Label labelt(_(
"\nWARNING\n"));
1239 _(
"CHANGING THE JACK_BUFFER_SIZE ON THE FLY \n" 1240 "MAY CAUSE UNPREDICTABLE EFFECTS \n" 1241 "TO OTHER RUNNING JACK APPLICATIONS. \n" 1242 "DO YOU WANT TO PROCEED ?"));
1243 Gdk::Color colorGreen(
"#969292");
1244 labelt1.modify_fg(Gtk::STATE_NORMAL, colorGreen);
1245 Pango::FontDescription font = labelt1.get_style()->get_font();
1246 font.set_size(10*Pango::SCALE);
1247 font.set_weight(Pango::WEIGHT_BOLD);
1248 labelt1.modify_font(font);
1250 Gdk::Color colorWhite(
"#ffffff");
1251 labelt.modify_fg(Gtk::STATE_NORMAL, colorWhite);
1252 font = labelt.get_style()->get_font();
1253 font.set_size(14*Pango::SCALE);
1254 font.set_weight(Pango::WEIGHT_BOLD);
1255 labelt.modify_font(font);
1260 Gtk::HBox box1(0, 4);
1261 Gtk::HBox box2(0, 4);
1263 Gtk::CheckButton disable_warn;
1264 disable_warn.signal_clicked().connect(
1266 sigc::mem_fun(*
this, &MainWindow::user_disable_latency_warn),
1270 _(
"Don't bother me again with such a question, " 1271 "I know what I am doing"));
1277 box1.add(disable_warn);
1279 warn_dialog.get_vbox()->add(box);
1281 labelt2.modify_fg(Gtk::STATE_NORMAL, colorWhite);
1283 font = labelt2.get_style()->get_font();
1284 font.set_size(8*Pango::SCALE);
1285 font.set_weight(Pango::WEIGHT_NORMAL);
1286 labelt2.modify_font(font);
1290 return warn_dialog.run();
1293 void MainWindow::change_latency(Glib::RefPtr<Gtk::RadioAction> action) {
1301 _(
"Jack Buffer Size setting"),
1302 _(
"we are not a jack gxjack.client, server may be down")
1306 jack_nframes_t buf_size = action->get_current_value();
1310 if (!options.no_warn_latency && gx_wait_latency_warn() !=
kChangeLatency) {
1311 Glib::signal_idle().connect_once(
1313 sigc::mem_fun(action.operator->(), &Gtk::RadioAction::set_current_value), jack->
get_jack_bs()));
1315 if (jack_set_buffer_size(jack->
client, buf_size) != 0)
1317 _(
"Could not change latency"));
1320 _(
"Jack Buffer Size"),
1321 boost::format(_(
"latency is %1%")) % jack_get_buffer_size(jack->
client));
1324 void MainWindow::add_latency_menu() {
1325 Glib::ustring s =
"<menubar><menu action=\"EngineMenu\"><menu action=\"JackLatency\">";
1326 Gtk::RadioButtonGroup group;
1327 const int min_pow = 4;
1328 const int max_pow = 13;
1329 int jack_buffer_size = 16;
1330 for (
int i = 0; i <= max_pow-min_pow; ++i) {
1332 Glib::ustring actname = Glib::ustring::compose(
"Latency_%1", name);
1333 s += Glib::ustring::compose(
"<menuitem action=\"%1\"/>", actname);
1334 Glib::RefPtr<Gtk::RadioAction> action = Gtk::RadioAction::create(group, actname, name);
1335 actions.group->add(action);
1337 action->signal_changed().connect(
1338 sigc::mem_fun(*
this, &MainWindow::change_latency));
1339 actions.latency = action;
1341 action->property_value().set_value(jack_buffer_size);
1342 jack_buffer_size *= 2;
1344 s.append(
"</menu></menu></menubar>");
1345 uimanager->add_ui_from_string(s);
1348 void MainWindow::set_latency() {
1355 actions.latency->set_current_value(n);
1357 if (n > 1023) actions.osc_buffer_menu->set_sensitive(
false);
1358 else actions.osc_buffer_menu->set_sensitive(
true);
1362 GError *error = NULL;
1363 gtk_show_uri(gdk_screen_get_default(),
"https://sourceforge.net/p/guitarix/discussion/general/",
1364 gtk_get_current_event_time(), &error);
1368 _(
"failed to load online help "));
1369 g_error_free(error);
1379 static string about;
1380 if (about.empty()) {
1381 about +=_(
"<b>Guitarix:gx_head</b> (");
1382 about += GX_VERSION;
1384 _(
")\n\nThis Application is to a large extent provided" 1385 "\nwith the marvelous faust compiler.Yann Orlary" 1386 "\n(http://faust.grame.fr/)" 1387 "\n\nA large part is based on the work of Julius Orion Smith" 1388 "\n(htttp://ccrma.stanford.edu/realsimple/faust/)" 1389 "\nand Albert Graef\n(http://q-lang.sourceforge.net/examples.html#Faust)" 1394 _(
"for impulse response it use zita-convolver" 1395 "\nby Fons Adriaensen" 1396 "\n(http://www.kokkinizita.net/linuxaudio/index.html)" 1397 "\n\nThe included IR-files are contributed by" 1398 "\nDavid Fau Casquel (BESTPLUGINS)" 1399 "\nhome: http://www.youtube.com/bestplugins" 1400 "\n\nauthors: Hermann Meyer <brummer-@web.de>" 1401 "\nauthors: James Warden <warjamy@yahoo.com>" 1402 "\nauthors: Andreas Degert <andreas.degert@googlemail.com>" 1403 "\nauthors: Pete Shorthose <pshorthose@gmail.com>" 1404 "\nauthors: Markus Schmidt <schmidt@boomshop.net>" 1405 "\n\nwebsite: http://guitarix.org/\n");
1411 void MainWindow::set_tooltips() {
1412 options.system_show_tooltips = actions.tooltips->get_active();
1413 gtk_settings_set_long_property(
1414 gtk_settings_get_default(),
"gtk-enable-tooltips", options.system_show_tooltips,
1415 "gx_head menu-option");
1418 void MainWindow::set_animations() {
1419 options.system_animations = actions.animations->get_active();
1422 void MainWindow::on_select_jack_control() {
1423 if (select_jack_control) {
1424 select_jack_control->present();
1427 select_jack_control->signal_close().connect(
1428 sigc::mem_fun(*
this, &MainWindow::delete_select_jack_control));
1429 select_jack_control->set_transient_for(*window);
1430 select_jack_control->show();
1434 void MainWindow::delete_select_jack_control() {
1435 delete select_jack_control;
1436 select_jack_control = 0;
1439 void MainWindow::on_select_midi_channel() {
1440 if (select_midi_channel) {
1441 select_midi_channel->present();
1444 select_midi_channel->signal_close().connect(
1445 sigc::mem_fun(*
this, &MainWindow::delete_select_midi_channel));
1446 select_midi_channel->set_transient_for(*window);
1447 select_midi_channel->show();
1451 void MainWindow::delete_select_midi_channel() {
1452 delete select_midi_channel;
1453 select_midi_channel = 0;
1457 void MainWindow::on_log_activate() {
1458 if (actions.loggingbox->get_active()) {
1460 window->get_position(rxorg, ryorg);
1461 fLoggingWindow.move(rxorg+5, ryorg+272);
1462 fLoggingWindow.show_all();
1463 on_msg_level_changed();
1465 fLoggingWindow.hide();
1469 bool MainWindow::on_log_activated(GdkEventButton* ev) {
1470 if (ev->type == GDK_BUTTON_PRESS && ev->button == 1) {
1471 if (!actions.loggingbox->get_active()) {
1472 actions.loggingbox->set_active(
true);
1474 window->get_position(rxorg, ryorg);
1475 fLoggingWindow.move(rxorg+5, ryorg+272);
1476 fLoggingWindow.show_all();
1477 on_msg_level_changed();
1479 fLoggingWindow.hide();
1480 actions.loggingbox->set_active(
false);
1482 }
else if (ev->type == GDK_BUTTON_PRESS && ev->button == 2) {
1483 fLoggingWindow.reset_msg_level();
1488 bool MainWindow::on_log_scrolled(GdkEventScroll* ev) {
1489 if (!actions.loggingbox->get_active()) {
1490 actions.loggingbox->set_active(
true);
1492 window->get_position(rxorg, ryorg);
1493 fLoggingWindow.move(rxorg+5, ryorg+272);
1494 fLoggingWindow.show_all();
1495 on_msg_level_changed();
1497 fLoggingWindow.hide();
1498 actions.loggingbox->set_active(
false);
1503 void MainWindow::on_engine_toggled() {
1505 if (actions.engine_mute->get_active()) {
1507 }
else if (actions.engine_bypass->get_active()) {
1515 void MainWindow::set_switcher_controller() {
1521 void MainWindow::set_bypass_controller() {
1527 void MainWindow::on_show_midi_out() {
1529 if (actions.midi_out->get_active()) {
1530 actions.show_rack->set_active(
true);
1531 midi_out_box->set_visible(
true);
1533 midi_out_box->set_visible(
false);
1539 void MainWindow::on_show_midi_out_plug() {
1540 if (actions.midi_out_plug->get_active()) {
1541 midi_out_normal->hide();
1542 midi_out_mini->show();
1544 midi_out_mini->hide();
1545 midi_out_normal->show();
1549 void MainWindow::on_midi_out_channel_toggled(Gtk::RadioButton *rb, Gtk::Container *c) {
1550 c->set_visible(rb->get_active());
1553 void MainWindow::on_livetuner_toggled() {
1554 if (actions.livetuner->get_active()) {
1555 if (actions.live_play->get_active()) {
1556 live_play->display_tuner(
true);
1557 racktuner->set_sensitive(
false);
1560 live_play->display_tuner(
false);
1561 if (actions.tuner->get_active()) {
1562 racktuner->set_sensitive(
true);
1569 live_play->display_tuner(
false);
1570 racktuner->set_sensitive(
false);
1575 void MainWindow::create_actions() {
1577 actions.group = Gtk::ActionGroup::create(
"Main");
1581 actions.group->add(Gtk::Action::create(
"EngineMenu",_(
"_Engine")));
1582 actions.jack_latency_menu = Gtk::Action::create(
"JackLatency",_(
"_Latency"));
1583 actions.group->add(actions.jack_latency_menu);
1584 actions.osc_buffer_menu = Gtk::Action::create(
"OscBuffer",_(
"Osc. Buffer-size"));
1585 actions.group->add(actions.osc_buffer_menu);
1587 actions.group->add(Gtk::Action::create(
"PresetsMenu",_(
"_Presets")));
1588 actions.group->add(Gtk::Action::create(
"NextPreset",_(
"Next Preset")),
1589 sigc::mem_fun(*
this, &MainWindow::on_next_preset));
1590 actions.group->add(Gtk::Action::create(
"PreviusPreset",_(
"Previous Preset")),
1591 sigc::mem_fun(*
this, &MainWindow::on_previus_preset));
1593 actions.group->add(Gtk::Action::create(
"SetNextPresetSwitcher", _(
"Next Preset Midi Switch")),
1594 sigc::mem_fun(
this, &MainWindow::set_next_preset_controller));
1596 actions.group->add(Gtk::Action::create(
"SetPreviusPresetSwitcher", _(
"Previous Preset Midi Switch")),
1597 sigc::mem_fun(
this, &MainWindow::set_previus_preset_controller));
1599 actions.group->add(Gtk::Action::create(
"PresetListMenu",
"--"));
1600 actions.group->add(Gtk::Action::create(
"PluginsMenu",_(
"P_lugins")));
1601 actions.group->add(Gtk::Action::create(
"MonoPlugins",_(
"_Mono Plugins")));
1602 actions.group->add(Gtk::Action::create(
"StereoPlugins",_(
"_Stereo Plugins")));
1603 actions.group->add(Gtk::Action::create(
"TubeMenu",_(
"_Tube")));
1604 actions.group->add(Gtk::Action::create(
"OptionsMenu",_(
"_Options")));
1605 actions.group->add(Gtk::Action::create(
"SkinMenu", _(
"_Skin...")));
1606 actions.group->add(Gtk::Action::create(
"AboutMenu",_(
"_About")));
1611 actions.jackserverconnection = Gtk::ToggleAction::create(
"JackServerConnection", _(
"Jack Server _Connection"));
1613 actions.jackserverconnection,
1614 sigc::mem_fun(*
this, &MainWindow::jack_connection));
1616 actions.jackports = Gtk::ToggleAction::create(
"JackPorts", _(
"Jack _Ports"));
1619 sigc::mem_fun(*
this, &MainWindow::on_portmap_activate));
1621 actions.midicontroller = Gtk::ToggleAction::create(
"MidiController", _(
"M_idi Controller"));
1623 actions.midicontroller,
1624 sigc::mem_fun(*
this, &MainWindow::on_miditable_toggle));
1626 actions.engine_mute = Gtk::ToggleAction::create(
"EngineMute", _(
"Engine _Mute"));
1627 actions.group->add(actions.engine_mute);
1628 actions.engine_mute_conn = actions.engine_mute->signal_toggled().connect(
1629 sigc::mem_fun(*
this, &MainWindow::on_engine_toggled));
1631 actions.engine_bypass = Gtk::ToggleAction::create(
"EngineBypass", _(
"Engine _Bypass"));
1632 actions.group->add(actions.engine_bypass);
1633 actions.engine_bypass_conn = actions.engine_bypass->signal_toggled().connect(
1634 sigc::mem_fun(*
this, &MainWindow::on_engine_toggled));
1636 if (options.get_hideonquit()) {
1637 actions.quit = Gtk::Action::create(
"Quit",_(
"Hide"));
1639 actions.quit = Gtk::Action::create(
"Quit",_(
"_Quit"));
1643 sigc::hide_return(sigc::mem_fun(
this, &MainWindow::on_quit)));
1648 actions.presets = Gtk::ToggleAction::create(
1649 "Presets",_(
"_Preset Selection"));
1650 actions.group->add(actions.presets,
1651 sigc::mem_fun(*
this, &MainWindow::on_preset_action));
1653 actions.show_plugin_bar = Gtk::ToggleAction::create(
1654 "ShowPluginBar",_(
"Show Plugin _Bar"));
1655 actions.group->add(actions.show_plugin_bar,
1656 sigc::mem_fun(*
this, &MainWindow::on_show_plugin_bar));
1658 actions.show_rack = Gtk::ToggleAction::create(
1659 "ShowRack",_(
"Show _Rack"),
"",
true);
1660 actions.group->add(actions.show_rack,
1661 sigc::mem_fun(*
this, &MainWindow::on_show_rack));
1663 actions.loggingbox = Gtk::ToggleAction::create(
"LoggingBox", _(
"Show _Logging Box"));
1666 sigc::mem_fun(*
this, &MainWindow::on_log_activate));
1668 actions.live_play = Gtk::ToggleAction::create(
"Liveplay",_(
"Live _Display"));
1669 actions.group->add(actions.live_play,
1670 sigc::mem_fun(*
this, &MainWindow::on_live_play));
1672 actions.meterbridge = Gtk::ToggleAction::create(
"Meterbridge", _(
"_Meterbridge"));
1675 actions.meterbridge,
1677 sigc::ref(actions.meterbridge), sigc::ref(*jack)));
1679 actions.group->add(actions.meterbridge);
1683 machine,
"ui.racktuner",
"LiveTuner",
"??");
1684 actions.group->add(actions.livetuner);
1685 actions.livetuner->signal_toggled().connect(
1686 sigc::mem_fun(
this, &MainWindow::on_livetuner_toggled));
1689 machine,
"ui.midi_out",
"MidiOut", _(
"M_idi Out"));
1692 sigc::mem_fun(
this, &MainWindow::on_show_midi_out));
1695 machine,
"midi_out.s_h",
"MidiOutSH",
"??");
1697 actions.midi_out_plug,
1698 sigc::mem_fun(
this, &MainWindow::on_show_midi_out_plug));
1704 machine,
"system.show_tuner",
"Tuner",_(
"_Tuner show"));
1705 actions.group->add(actions.tuner,
1706 sigc::mem_fun(*
this, &MainWindow::on_show_tuner));
1708 machine,
"system.stick_tuner",
"Tunermove",_(
"Tuner stic_k "));
1709 actions.group->add(actions.tunermove,
1710 sigc::mem_fun(*
this, &MainWindow::on_move_tuner));
1712 actions.rack_config = Gtk::ToggleAction::create(
"RackConfig", _(
"R_ack Configuration"));
1713 actions.group->add(actions.rack_config,
1714 sigc::mem_fun(*
this, &MainWindow::on_rack_configuration));
1716 actions.compress = Gtk::Action::create(
"Compress",_(
"C_ompress all"));
1717 actions.group->add(actions.compress,
1718 sigc::mem_fun(*
this, &MainWindow::on_compress_all));
1720 actions.expand = Gtk::Action::create(
"Expand",_(
"E_xpand all"));
1721 actions.group->add(actions.expand,
1722 sigc::mem_fun(*
this, &MainWindow::on_expand_all));
1724 actions.rackh = Gtk::ToggleAction::create(
1725 "RackH", _(
"Order Rack _Horizontally"));
1726 actions.group->add(actions.rackh,
1727 sigc::mem_fun(*
this, &MainWindow::on_dir_changed));
1732 actions.show_values = Gtk::ToggleAction::create(
1733 "ShowValues",_(
"_Show _Values"),
"",
true);
1734 actions.group->add(actions.show_values,
1735 sigc::mem_fun(*
this, &MainWindow::on_show_values));
1737 actions.tooltips = Gtk::ToggleAction::create(
1738 "ShowTooltips", _(
"Show _Tooltips"),
"",
true);
1741 sigc::mem_fun(
this, &MainWindow::set_tooltips));
1744 machine,
"system.midi_in_preset",
"MidiInPresets", _(
"Include MIDI in _presets"));
1745 actions.group->add(actions.midi_in_presets);
1747 actions.jackstartup = Gtk::Action::create(
"JackStartup", _(
"_Jack Startup Control"));
1749 actions.jackstartup,
1750 sigc::mem_fun(*
this, &MainWindow::on_select_jack_control));
1752 actions.loadladspa = Gtk::Action::create(
"LoadLADSPA", _(
"LADSPA/LV2 Pl_ugins"));
1755 sigc::mem_fun(
this, &MainWindow::on_load_ladspa));
1757 actions.group->add(Gtk::Action::create(
"ResetAll", _(
"Reset _All Parameters")),
1760 actions.animations = Gtk::ToggleAction::create(
1761 "Animations", _(
"_Use Animations"),
"",
true);
1762 actions.group->add(actions.animations,
1763 sigc::mem_fun(
this, &MainWindow::set_animations));
1765 actions.group->add(Gtk::Action::create(
"SetPresetSwitcher", _(
"L_iveplay Midi Switch")),
1766 sigc::mem_fun(
this, &MainWindow::set_switcher_controller));
1768 actions.group->add(Gtk::Action::create(
"SetBypassSwitcher", _(
"B_ypass Midi Switch")),
1769 sigc::mem_fun(
this, &MainWindow::set_bypass_controller));
1771 actions.group->add(Gtk::Action::create(
"SetMidiChannel", _(
"Set Midi Channel")),
1772 sigc::mem_fun(
this, &MainWindow::on_select_midi_channel));
1777 actions.group->add(Gtk::Action::create(
"Help", _(
"_Help")),
1779 actions.group->add(Gtk::Action::create(
"About", _(
"_About")),
1783 actions.jack_latency_menu->set_visible(
false);
1784 actions.jackserverconnection->set_visible(
false);
1785 actions.jackports->set_visible(
false);
1786 actions.meterbridge->set_visible(
false);
1791 int get_current_workarea_height_from_desktop(GdkWindow *root) {
1793 GdkAtom actual_type, atom_cardinal;
1798 atom_cardinal = gdk_atom_intern(
"CARDINAL",
false);
1799 if (!gdk_property_get(
1800 root, gdk_atom_intern(
"_NET_CURRENT_DESKTOP",
false), atom_cardinal,
1801 0, 1,
false, &actual_type, &actual_format, &num_items,
1802 (guchar**)&ret_data_ptr)) {
1805 idx = *ret_data_ptr * 4 + 3;
1806 g_free(ret_data_ptr);
1807 if (!gdk_property_get(
1808 root, gdk_atom_intern(
"_NET_WORKAREA",
false), atom_cardinal,
1809 idx, 1,
false, &actual_type, &actual_format, &num_items,
1810 (guchar**)&ret_data_ptr)) {
1813 if (idx >= num_items) {
1817 int height = *ret_data_ptr;
1818 g_free(ret_data_ptr);
1822 int get_current_workarea_height() {
1824 GdkWindow *root = gdk_get_default_root_window();
1825 int height = get_current_workarea_height_from_desktop(root);
1829 int x, y, width, depth;
1830 gdk_window_get_geometry(root, &x, &y, &width, &height, &depth);
1843 void MainWindow::clear_box(Gtk::Container& box) {
1844 std::vector<Gtk::Widget*> l = box.get_children();
1845 for (std::vector<Gtk::Widget*>::iterator p = l.begin(); p != l.end(); ++p) {
1850 void MainWindow::make_icons(
bool force) {
1851 Gtk::OffscreenWindow w;
1852 w.set_type_hint(Gdk::WINDOW_TYPE_HINT_DOCK);
1853 Glib::RefPtr<Gdk::Screen> screen = w.get_screen();
1854 Glib::RefPtr<Gdk::Colormap> rgba = screen->get_rgba_colormap();
1856 w.set_colormap(rgba);
1860 Glib::RefPtr<Gtk::SizeGroup> sz = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_BOTH);
1861 std::vector<std::pair<PluginUI*,Gtk::Widget*> > l;
1862 for (std::map<std::string, PluginUI*>::iterator i = plugin_dict.begin(); i != plugin_dict.end(); ++i) {
1863 if (!force && i->second->icon) {
1868 r->set_no_show_all(
true);
1871 l.push_back(std::pair<PluginUI*,Gtk::Widget*>(i->second, r));
1874 l.begin()->second->show();
1875 if (vb.size_request().width < 110) {
1876 vb.set_size_request(110, -1);
1879 for (std::vector<std::pair<PluginUI*,Gtk::Widget*> >::iterator i = l.begin(); i != l.end(); ++i) {
1882 w.get_window()->process_updates(
true);
1883 i->first->icon = w.get_pixbuf();
1884 if (i->first->toolitem) {
1885 dynamic_cast<Gtk::Image*
>(i->first->toolitem->get_child())->
set(i->first->icon);
1892 hanl = gtk_widget_render_icon(GTK_WIDGET(window->gobj()),
"handle_left", (GtkIconSize)-1, NULL);
1893 hanr = gtk_widget_render_icon(GTK_WIDGET(window->gobj()),
"handle_right", (GtkIconSize)-1, NULL);
1894 gint wl = gdk_pixbuf_get_width(hanl);
1895 gint wr = gdk_pixbuf_get_width(hanr);
1896 g_object_unref(hanl);
1897 g_object_unref(hanr);
1898 bld->find_widget(
"amp_padding", vbam);
1899 vbam->set_padding(0, 4, wl, wr);
1900 bld->find_widget(
"tuner_padding", vbam);
1901 vbam->set_padding(0, 4, wl, wr);
1902 bld->find_widget(
"details_padding", vbam);
1903 vbam->set_padding(0, 4, wl, wr);
1908 virtual void on_plugin_preset_popup();
1911 const Glib::ustring& tooltip=
"")
1916 void JConvPluginUI::on_plugin_preset_popup() {
1918 &
main.get_machine().get_parameter(std::string(get_id())+
".convolver"));
1921 Glib::ustring::size_type n = name.find_last_of(
'.');
1922 if (n != Glib::ustring::npos) {
1925 main.plugin_preset_popup(plugin->get_pdef(), name);
1936 plugin_dict.remove(pui);
1938 uimanager->ensure_update();
1943 Gtk::ToolItemGroup * group = groupmap[group_id];
1944 if (group->get_n_items() == 0) {
1945 Glib::ustring groupname = Glib::ustring::compose(
"PluginCategory_%1", group_id);
1946 Glib::RefPtr<Gtk::Action> act = actions.group->get_action(groupname);
1947 actions.group->remove(actions.group->get_action(groupname));
1948 groupmap.erase(group_id);
1961 add_plugin_menu_entry(pui);
1967 void MainWindow::on_ladspa_finished(
bool reload,
bool quit) {
1969 machine.commit_ladspa_changes();
1972 Glib::signal_idle().connect(sigc::mem_fun(
this, &MainWindow::delete_ladspalist_window));
1976 bool MainWindow::delete_ladspalist_window() {
1977 if (ladspalist_window) {
1979 delete ladspalist_window;
1980 ladspalist_window = 0;
1985 void MainWindow::on_load_ladspa() {
1986 if (ladspalist_window) {
1987 ladspalist_window->present();
1989 ladspalist_window =
new ladspa::PluginDisplay(machine, gx_head_icon, sigc::mem_fun(
this, &MainWindow::on_ladspa_finished));
1997 p.push_back(
new PluginUI(*
this,
id, tooltip));
2000 #ifdef accel_keys_for_plugins 2001 struct accel_search {
2006 static void accel_search_callback(gpointer data,
const gchar *accel_path, guint accel_key, GdkModifierType accel_mods, gboolean changed) {
2007 accel_search *s =
static_cast<accel_search*
>(data);
2008 if (accel_key == s->key && accel_mods == 0) {
2013 static bool accel_map_has_key(
unsigned int accel_key) {
2017 gtk_accel_map_foreach_unfiltered(gpointer(&s), accel_search_callback);
2021 static bool accel_map_next_key(
unsigned int *accel_key) {
2022 while (*accel_key <= GDK_z) {
2023 if (!accel_map_has_key(*accel_key)) {
2036 : group(g), plugins(p) {}
2039 Gtk::ToolItemGroup *MainWindow::add_plugin_category(
const char *group,
bool collapse) {
2040 std::map<Glib::ustring, Gtk::ToolItemGroup*>::iterator it = groupmap.find(group);
2041 if (it != groupmap.end()) {
2044 Glib::ustring ui_template =
2045 "<menubar><menu action=\"PluginsMenu\"><menu action=\"%1Plugins\"><menu action=\"%2\">" 2046 "</menu></menu></menu></menubar>";
2047 Glib::ustring groupname = Glib::ustring::compose(
"PluginCategory_%1", group);
2048 uimanager->add_ui_from_string(Glib::ustring::compose(ui_template,
"Mono", groupname));
2049 uimanager->add_ui_from_string(Glib::ustring::compose(ui_template,
"Stereo", groupname));
2050 actions.group->add(Gtk::Action::create(groupname, gettext(group)));
2051 Gtk::ToolItemGroup *gw =
new Gtk::ToolItemGroup(gettext(group));
2052 groupmap[group] = gw;
2053 gw->set_collapsed(collapse);
2054 effects_toolpalette->add(*manage(gw));
2055 effects_toolpalette->set_exclusive(*gw,
true);
2056 effects_toolpalette->set_expand(*gw,
true);
2060 Glib::ustring MainWindow::add_plugin_menu_entry(
PluginUI *pui) {
2061 Glib::ustring ui_template =
2062 "<menubar><menu action=\"PluginsMenu\"><menu action=\"%1Plugins\"><menu action=\"%2\">" 2063 "<menuitem action=\"%3\"/>" 2064 "</menu></menu></menu></menubar>";
2066 Glib::ustring groupname = Glib::ustring::compose(
"PluginCategory_%1", group);
2067 Glib::ustring actionname = Glib::ustring::compose(
"Plugin_%1", pui->
get_id());
2069 pui->
set_ui_merge_id(uimanager->add_ui_from_string(Glib::ustring::compose(ui_template, tp, groupname, actionname)));
2074 void MainWindow::register_plugin(
PluginUI *pui) {
2075 plugin_dict.add(pui);
2076 Gtk::ToolItemGroup *gw = add_plugin_category(pui->
get_category());
2077 Glib::ustring actionname = add_plugin_menu_entry(pui);
2078 add_toolitem(*pui, gw);
2079 Glib::RefPtr<Gtk::ToggleAction> act = Gtk::ToggleAction::create(actionname, pui->
get_name());
2080 actions.group->add(act);
2081 #ifdef accel_keys_for_plugins 2082 unsigned int key = GDK_a;
2083 if (accel_map_next_key(&key)) {
2084 Gtk::AccelMap::add_entry(act->get_accel_path(), key, Gdk::ModifierType(0));
2089 act->set_active(
true);
2094 void MainWindow::fill_pluginlist() {
2097 add_plugin_category(
N_(
"Tone Control"),
false);
2098 add_plugin_category(
N_(
"Distortion"));
2099 add_plugin_category(
N_(
"Fuzz"));
2100 add_plugin_category(
N_(
"Reverb"));
2101 add_plugin_category(
N_(
"Echo / Delay"));
2102 add_plugin_category(
N_(
"Modulation"));
2103 add_plugin_category(
N_(
"Guitar Effects"));
2104 add_plugin_category(
N_(
"Misc"));
2106 std::vector<PluginUI*> p;
2111 machine.pluginlist_append_rack(builder);
2114 for (std::vector<PluginUI*>::iterator v = p.begin(); v != p.end(); ++v) {
2115 register_plugin(*v);
2123 int MainWindow::start_jack() {
2128 int wait_after_connect = 0;
2131 if (v_id ==
"autostart") {
2135 if (v_id ==
"other") {
2136 cmd = machine.get_parameter(
"ui.jack_starter").getString().get_value();
2140 }
else if (v_id ==
"qjackctl") {
2141 wait_after_connect = 500000;
2142 cmd =
"qjackctl --start";
2147 for (
int i = 0; i < 10; i++) {
2155 string(_(
"I really tried to get jack up and running, sorry ... ")));
2159 bool MainWindow::connect_jack(
bool v, Gtk::Window *splash) {
2171 bool ask = machine.get_parameter_value<
bool>(
"ui.ask_for_jack_starter");
2173 switch (start_jack()) {
2174 case 1:
return true;
2175 case -1:
return false;
2186 return start_jack() == 1;
2189 void MainWindow::on_jack_client_changed() {
2197 bool v = (jack->
client != 0);
2201 actions.jackserverconnection->set_active(v);
2202 Glib::ustring s =
"Guitarix: ";
2208 window->set_title(s);
2209 actions.jack_latency_menu->set_sensitive(v);
2210 actions.engine_mute->set_sensitive(v);
2211 actions.engine_bypass->set_sensitive(v);
2212 status_image->set_sensitive(v);
2214 jackd_image->set(pixbuf_jack_disconnected);
2216 jackd_image->set(pixbuf_jack_connected);
2223 actions.engine_mute_conn.block();
2224 actions.engine_mute->set_active(
true);
2225 actions.engine_mute_conn.unblock();
2226 status_image->set(pixbuf_off);
2227 machine.msend_midi_cc(0xB0,120,127,3);
2230 actions.engine_mute_conn.block();
2231 actions.engine_bypass_conn.block();
2232 actions.engine_mute->set_active(
false);
2233 actions.engine_bypass->set_active(
false);
2234 actions.engine_mute_conn.unblock();
2235 actions.engine_bypass_conn.unblock();
2236 status_image->set(pixbuf_on);
2237 machine.msend_midi_cc(0xB0,120,0,3);
2240 actions.engine_mute_conn.block();
2241 actions.engine_bypass_conn.block();
2242 actions.engine_mute->set_active(
false);
2243 actions.engine_bypass->set_active(
true);
2244 actions.engine_mute_conn.unblock();
2245 actions.engine_bypass_conn.unblock();
2246 status_image->set(pixbuf_bypass);
2252 static struct TuningTab {
2258 {
"Standard",
"E",
false, {40, 45, 50, 55, 59, 64}},
2259 {
"Standard/Es",
"Es",
true, {39, 44, 49, 54, 58, 63}},
2260 {
"Open E",
"E",
false, {40, 47, 52, 56, 59, 64}},
2261 {
"Drop D",
"D",
false, {38, 45, 50, 55, 59, 64}},
2262 {
"Half Step Down",
"E",
false, {39, 44, 49, 54, 58, 63}},
2263 {
"Full Step Down",
"D",
false, {38, 43, 48, 53, 57, 62}},
2264 {
"1 and 1/2 Steps Down",
"E",
false, {37, 42, 47, 52, 56, 61}},
2265 {
"Double Drop D",
"D",
false, {38, 45, 50, 55, 59, 62}},
2266 {
"Drop C",
"C",
false, {36, 43, 48, 53, 57, 62}},
2267 {
"Drop C#",
"C#",
false, {37, 44, 49, 54, 58, 63}},
2268 {
"Drop B",
"B",
false, {35, 42, 47, 52, 56, 61}},
2269 {
"Drop A#",
"A#",
false, {34, 41, 46, 51, 55, 60}},
2270 {
"Drop A",
"A",
false, {33, 40, 45, 50, 54, 59}},
2271 {
"Open D",
"D",
false, {38, 45, 50, 54, 57, 62}},
2272 {
"Open D Minor",
"D",
false, {38, 45, 50, 53, 57, 62}},
2273 {
"Open G",
"G",
false, {38, 43, 50, 55, 59, 62}},
2274 {
"Open G Minor",
"G",
false, {38, 43, 50, 55, 58, 62}},
2275 {
"Open C",
"C",
false, {36, 43, 48, 55, 60, 64}},
2276 {
"Open C#",
"C#",
false, {37, 42, 59, 52, 56, 61}},
2277 {
"Open C Minor",
"C",
false, {36, 43, 48, 55, 60, 63}},
2278 {
"Open E7",
"E7",
false, {40, 44, 50, 52, 59, 64}},
2279 {
"Open E Minor7",
"E",
false, {40, 47, 50, 55, 59, 64}},
2280 {
"Open G Major7",
"G",
false, {38, 43, 50, 54, 59, 62}},
2281 {
"Open A Minor",
"A",
false, {40, 45, 52, 57, 60, 64}},
2282 {
"Open A Minor7",
"A",
false, {40, 45, 52, 55, 60, 64}},
2283 {
"Open A",
"A",
false, {40, 45, 49, 52, 57, 64}},
2284 {
"C Tuning",
"C",
false, {36, 41, 46, 51, 55, 60}},
2285 {
"C# Tuning",
"C#",
false, {37, 42, 47, 52, 56, 61}},
2286 {
"Bb Tuning",
"Bb",
false, {34, 39, 44, 49, 53, 58}},
2287 {
"A to A (Baritone)",
"A",
false, {33, 38, 43, 48, 52, 57}},
2288 {
"Open Dsus2",
"D",
false, {38, 45, 50, 55, 57, 62}},
2289 {
"Open Gsus2",
"G",
false, {38, 43, 50, 55, 60, 62}},
2290 {
"G6",
"G6",
false, {38, 43, 50, 55, 59, 64}},
2291 {
"Modal G",
"G",
false, {38, 43, 50, 55, 60, 62}},
2292 {
"Overtone",
"E",
false, {48, 52, 55, 58, 60, 62}},
2293 {
"Pentatonic",
"E",
false, {45, 48, 50, 52, 55, 69}},
2294 {
"Minor Third",
"E",
false, {48, 51, 54, 57, 60, 63}},
2295 {
"Major Third",
"E",
false, {48, 52, 56, 60, 64, 68}},
2296 {
"All Fourths",
"E",
false, {40, 45, 50, 55, 60, 65}},
2297 {
"Augmented Fourths",
"E",
false, {36, 42, 48, 54, 60, 66}},
2298 {
"Slow Motion",
"E",
false, {38, 43, 50, 53, 60, 62}},
2299 {
"Admiral",
"E",
false, {36, 43, 50, 55, 59, 60}},
2300 {
"Buzzard",
"E",
false, {36, 41, 48, 55, 58, 65}},
2301 {
"Face",
"E",
false, {36, 43, 50, 55, 57, 62}},
2302 {
"Four and Twenty",
"E",
false, {38, 45, 50, 50, 57, 62}},
2303 {
"Ostrich",
"E",
false, {38, 50, 50, 50, 62, 62}},
2304 {
"Capo 200",
"E",
false, {36, 43, 50, 51, 62, 63}},
2305 {
"Balalaika",
"E",
false, {40, 45, 50, 52, 52, 57}},
2306 {
"Cittern One",
"E",
false, {36, 41, 48, 55, 60, 62}},
2307 {
"Cittern Two",
"E",
false, {36, 43, 48, 55, 60, 67}},
2308 {
"Dobro",
"E",
false, {43, 47, 50, 55, 59, 62}},
2309 {
"Lefty",
"E",
false, {64, 59, 55, 50, 45, 40}},
2310 {
"Mandoguitar",
"E",
false, {36, 43, 50, 57, 64, 71}},
2311 {
"Rusty Cage",
"E",
false, {35, 45, 50, 55, 59, 64}},
2312 {
"Hardcore",
"C",
false, {36, 43, 48, 53, 57, 58}},
2314 int mode = tuner_tuning->get_value();
2318 for (
int i = 0; i < 6; ++i) {
2319 tuner.
push_note(tuning_tab[mode-1].notes[i], 69, 12);
2327 Glib::ustring tet = options.get_tuner_tet();
2329 if (tet.find(
"12") !=Glib::ustring::npos) t=0;
2330 else if (tet.find(
"19") !=Glib::ustring::npos) t=1;
2331 else if (tet.find(
"24") !=Glib::ustring::npos) t=2;
2332 else if (tet.find(
"31") !=Glib::ustring::npos) t=3;
2333 else if (tet.find(
"53") !=Glib::ustring::npos) t=4;
2334 else t = tuner_temperament->get_value();
2335 machine.set_parameter_value(
"racktuner.temperament", t);
2341 Glib::ustring ref = options.get_tuner_ref();
2342 float t = atof(ref.c_str());
2343 machine.set_parameter_value(
"ui.tuner_reference_pitch", t);
2348 void MainWindow::setup_tuner_temperament(
Gxw::RackTuner& tuner) {
2358 tuner_mode->signal_value_changed().connect(
2361 sigc::mem_fun(*tuner_mode, &Gxw::Selector::get_value)));
2362 tuner_reference_pitch->signal_value_changed().connect(
2365 sigc::mem_fun(*tuner_reference_pitch, &Gxw::ValueDisplay::get_value)));
2366 tuner_tuning->signal_value_changed().connect(
2367 sigc::bind(sigc::mem_fun(*
this, &MainWindow::set_tuning), sigc::ref(tuner)));
2368 tuner_temperament->signal_value_changed().connect(
2369 sigc::bind(sigc::mem_fun(*
this, &MainWindow::setup_tuner_temperament), sigc::ref(tuner)));
2373 bool MainWindow::on_toggle_mute(GdkEventButton* ev) {
2374 if (ev->type == GDK_BUTTON_PRESS && ev->button == 1) {
2384 bool MainWindow::on_scroll_toggle(GdkEventScroll* ev) {
2385 if (ev->direction == GDK_SCROLL_UP) {
2393 }
else if (ev->direction == GDK_SCROLL_DOWN) {
2406 bool MainWindow::on_toggle_insert(GdkEventButton* ev) {
2407 if (ev->type == GDK_BUTTON_PRESS && ev->button == 1) {
2408 if (machine.get_parameter_value<
bool>(
"engine.insert")) {
2409 machine.set_parameter_value(
"engine.insert",
false);
2411 machine.set_parameter_value(
"engine.insert",
true);
2417 bool MainWindow::on_scroll_toggle_insert(GdkEventScroll* ev) {
2418 if (machine.get_parameter_value<
bool>(
"engine.insert")) {
2419 machine.set_parameter_value(
"engine.insert",
false);
2421 machine.set_parameter_value(
"engine.insert",
true);
2426 void MainWindow::on_insert_jack_changed(
bool s) {
2428 insert_image->set(pixbuf_insert_off);
2430 insert_image->set(pixbuf_insert_on);
2434 bool MainWindow::on_jackserverconnection(GdkEventButton* ev) {
2435 if (ev->type == GDK_BUTTON_PRESS && ev->button == 1) {
2436 bool v = actions.jackserverconnection->get_active();
2437 actions.jackserverconnection->set_active(!v);
2442 bool MainWindow::on_jackserverconnection_scroll(GdkEventScroll* ev) {
2443 bool v = actions.jackserverconnection->get_active();
2444 actions.jackserverconnection->set_active(!v);
2448 void MainWindow::on_msg_level_changed() {
2449 switch (fLoggingWindow.get_unseen_msg_level()) {
2452 default: logstate_image->set(pixbuf_log_grey);
break;
2460 void MainWindow::on_ampdetail_switch(
bool compress,
bool setparam) {
2462 ampdetail_normal->hide();
2463 ampdetail_mini->show();
2465 ampdetail_mini->hide();
2466 ampdetail_normal->show();
2469 machine.set_parameter_value(
"ui.mp_s_h", compress);
2477 void MainWindow::set_osc_size() {
2479 if (options.mul_buffer > 0) {
2480 actions.osc_buffer_size->set_current_value(options.mul_buffer);
2484 void MainWindow::change_osc_buffer(Glib::RefPtr<Gtk::RadioAction> action) {
2486 if (!jack || jack->
client) {
2487 options.mul_buffer = action->get_current_value();
2488 on_oscilloscope_activate(
false);
2489 machine.set_oscilloscope_mul_buffer(options.mul_buffer);
2490 on_oscilloscope_activate(
true);
2496 void MainWindow::add_osc_size_menu() {
2497 Glib::ustring s =
"<menubar><menu action=\"OptionsMenu\"><menu action=\"OscBuffer\">";
2498 Gtk::RadioButtonGroup group;
2499 int osc_buffer_size = 1;
2500 for (
int i = 1; i <= 6; ++i) {
2502 Glib::ustring actname = Glib::ustring::compose(
"buffer size %1", name);
2503 s += Glib::ustring::compose(
"<menuitem action=\"%1\"/>", actname);
2504 Glib::RefPtr<Gtk::RadioAction> action = Gtk::RadioAction::create(group, actname, name);
2505 actions.group->add(action);
2507 action->signal_changed().connect(
2508 sigc::mem_fun(*
this, &MainWindow::change_osc_buffer));
2509 actions.osc_buffer_size = action;
2511 action->property_value().set_value(osc_buffer_size);
2514 s.append(
"</menu></menu></menubar>");
2515 uimanager->add_ui_from_string(s);
2518 void MainWindow::on_show_oscilloscope(
bool v) {
2521 Glib::signal_timeout().connect(
2522 sigc::mem_fun(*
this, &MainWindow::on_refresh_oscilloscope), 60);
2526 void MainWindow::set_waveview_buffer(
unsigned int size) {
2527 fWaveView.set_frame(machine.get_oscilloscope_buffer(), size);
2530 void MainWindow::on_oscilloscope_post_pre(
int post_pre) {
2534 fWaveView.set_multiplicator(20.,60.);
2538 int MainWindow::on_oscilloscope_activate(
bool start) {
2540 machine.clear_oscilloscope_buffer();
2541 fWaveView.queue_draw();
2546 bool MainWindow::on_refresh_oscilloscope() {
2549 jack_nframes_t bsize;
2550 machine.get_oscilloscope_info(load, frames, is_rt, bsize);
2553 jack_nframes_t bsize;
2556 if (!oc.bsize || oc.load != load) {
2559 (boost::format(_(
"DSP Load %1% %%")) % oc.load).str().c_str(),
2560 Gtk::CORNER_TOP_LEFT);
2562 if (!oc.bsize || oc.frames != frames) {
2565 (boost::format(_(
"HT Frames %1%")) % oc.frames).str().c_str(),
2566 Gtk::CORNER_BOTTOM_LEFT);
2568 if (!oc.bsize || oc.rt != is_rt) {
2571 oc.rt ? _(
"RT Mode YES ") : _(
"RT mode <span color=\"#cc1a1a\">NO</span>"),
2572 Gtk::CORNER_BOTTOM_RIGHT);
2574 if (!oc.bsize || oc.bsize != bsize) {
2577 (boost::format(_(
"Latency %1%")) % oc.bsize).str().c_str(),
2578 Gtk::CORNER_TOP_RIGHT);
2580 fWaveView.queue_draw();
2581 return machine.oscilloscope_plugin_box_visible();
2587 return 20.*log10(power);
2590 bool MainWindow::refresh_meter_level(
float falloff) {
2591 const unsigned int channels =
sizeof(fastmeter)/
sizeof(fastmeter[0]);
2593 if (jack && !jack->
client) {
2598 static float old_peak_db[channels] = {-INFINITY, -INFINITY};
2601 float level[channels];
2602 machine.maxlevel_get(channels, level);
2603 for (
unsigned int c = 0; c < channels; c++) {
2606 float peak_db = -INFINITY;
2611 if (peak_db < old_peak_db[c]) {
2612 peak_db =
max(peak_db, old_peak_db[c] - falloff);
2614 fastmeter[c]->set(log_meter(peak_db));
2615 old_peak_db[c] = peak_db;
2620 bool MainWindow::survive_jack_shutdown() {
2633 _(
"jack has bumped us out!! "));
2634 actions.jackserverconnection->set_active(
true);
2640 actions.jackserverconnection->set_active(
false);
2643 _(
"jack has bumped us out!! "));
2649 void MainWindow::gx_jack_is_down() {
2650 actions.jackserverconnection->set_active(
false);
2651 Glib::signal_timeout().connect(
2652 sigc::mem_fun(*
this, &MainWindow::survive_jack_shutdown),
2653 200, Glib::PRIORITY_LOW);
2656 #ifdef HAVE_JACK_SESSION 2657 void MainWindow::jack_session_event() {
2662 const char *statefile =
"gx_head.state";
2663 jack_session_event_t *
event = jack->get_last_session_event();
2665 machine.set_statefilename(
string(event->session_dir) + statefile);
2666 machine.save_to_state();
2669 string cmd(options.get_path_to_program());
2671 string cmd(
"guitarix");
2674 cmd +=
event->client_uuid;
2676 cmd += jack->get_uuid_insert();
2677 cmd +=
" -f ${SESSION_DIR}";
2679 event->command_line = strdup(cmd.c_str());
2681 JackSessionEventType tp =
event->type;
2682 if (jack->return_last_session_event() == 0) {
2683 if (tp == JackSessionSaveAndQuit) {
2689 void MainWindow::jack_session_event_ins() {
2694 jack_session_event_t *
event = jack->get_last_session_event_ins();
2696 event->command_line = strdup(
"true ${SESSION_DIR}");
2697 JackSessionEventType tp =
event->type;
2698 if (jack->return_last_session_event_ins() == 0) {
2699 if (tp == JackSessionSaveAndQuit) {
2706 void MainWindow::set_in_session() {
2712 machine.disable_autosave(
true);
2716 void MainWindow::systray_menu(guint button, guint32 activate_time) {
2717 Gtk::Menu *menu =
dynamic_cast<Gtk::MenuItem*
>(uimanager->get_widget(
"/menubar/EngineMenu"))->get_submenu();
2718 menu->popup(2, gtk_get_current_event_time());
2724 status_icon->set(gx_head_midi);
2728 status_icon->set(gx_head_icon);
2731 status_icon->set(gx_head_warn);
2738 bool MainWindow::on_window_state_changed(GdkEventWindowState* event) {
2739 if (event->changed_mask & event->new_window_state & (Gdk::WINDOW_STATE_ICONIFIED|Gdk::WINDOW_STATE_WITHDRAWN)) {
2740 window->get_window()->get_root_origin(options.mainwin_x, options.mainwin_y);
2745 void MainWindow::hide_extended_settings() {
2747 (window->get_window()->get_state()
2748 & (Gdk::WINDOW_STATE_ICONIFIED|Gdk::WINDOW_STATE_WITHDRAWN))) {
2749 window->move(options.mainwin_x, options.mainwin_y);
2751 window->deiconify();
2765 int port = options.get_rpcport();
2767 machine.start_socket(sigc::ptr_fun(Gtk::Main::quit), options.get_rpcaddress(), port);
2769 if (options.get_liveplaygui()) liveplay_button->set_active();
2773 if (options.get_liveplaygui()) liveplay_button->set_active();
2779 bool MainWindow::on_meter_button_release(GdkEventButton* ev) {
2780 if (ev->button == 1) {
2781 for (
unsigned int i = 0; i <
sizeof(fastmeter)/
sizeof(fastmeter[0]); i++) {
2782 fastmeter[i]->clear();
2789 void MainWindow::display_preset_msg(
const Glib::ustring& bank,
const Glib::ustring& preset) {
2790 preset_status->set_text(bank +
" / " + preset);
2793 bool MainWindow::on_key_press_event(GdkEventKey *event) {
2794 if ((event->state & Gtk::AccelGroup::get_default_mod_mask()) != 0) {
2798 keyswitch.process_preset_key(event->keyval -
GDK_KEY_0);
2802 keyswitch.process_preset_key(event->keyval -
GDK_KEY_KP_0);
2806 keyswitch.process_bank_key(event->keyval -
GDK_KEY_a);
2812 bool MainWindow::on_quit() {
2813 if (options.get_hideonquit()) {
2814 machine.save_to_state();
2817 hide_extended_settings();
2820 if (ladspalist_window && !ladspalist_window->check_exit()) {
2823 machine.stop_socket();
2828 void MainWindow::amp_controls_visible(Gtk::Range *rr) {
2830 bool v = std::abs(rr->get_value() - machine.get_parameter(
"tube.select").getUpperAsFloat()) < 0.5;
2831 const char *knobs1[] = {
"gxmediumknobpregain",
"gxmediumknobdrive",
"gxmediumknobdist",
"gxmediumknobgain",
"labelpregain:effekt_label",
"labeldrive:effekt_label",
"labeldist:effekt_label",
"labelgain:effekt_label"};
2832 const char *knobs2[] = {
"gxbigknobgain",
"labelgain2:effekt_label"};
2833 for (
unsigned int i = 0; i <
sizeof(knobs1)/
sizeof(knobs1[1]); ++i) {
2835 bld->find_widget(knobs1[i], w);
2838 for (
unsigned int i = 0; i <
sizeof(knobs2)/
sizeof(knobs2[1]); ++i) {
2840 bld->find_widget(knobs2[i], w);
2846 Gtk::Window *splash,
const Glib::ustring& title)
2847 : sigc::trackable(),
2861 preset_list_menu_bank(),
2862 preset_list_merge_id(0),
2863 preset_list_actiongroup(),
2868 convolver_filename_label(),
2869 convolver_mono_filename_label(),
2870 gx_head_icon(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_head.png"))),
2871 boxbuilder(machine_, fWaveView, convolver_filename_label, convolver_mono_filename_label, gx_head_icon),
2873 select_jack_control(0),
2874 select_midi_channel(0),
2876 amp_radio_menu(machine_,
"tube.select"),
2877 pixbuf_insert_on(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"insert_on.png"))),
2878 pixbuf_insert_off(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"insert_off.png"))),
2879 pixbuf_on(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_on.png"))),
2880 pixbuf_off(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_off.png"))),
2881 pixbuf_bypass(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_bypass.png"))),
2882 pixbuf_jack_connected(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"jackd_on.png"))),
2883 pixbuf_jack_disconnected(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"jackd_off.png"))),
2884 pixbuf_log_grey(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_log_grey.png"))),
2885 pixbuf_log_yellow(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_log_yellow.png"))),
2886 pixbuf_log_red(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_log_red.png"))),
2888 status_icon(Gtk::StatusIcon::
create(gx_head_icon)),
2889 gx_head_midi(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_head-midi.png"))),
2890 gx_head_warn(Gdk::Pixbuf::create_from_file(options.get_pixmap_filepath(
"gx_head-warn.png"))),
2892 keyswitch(machine, sigc::mem_fun(this, &
MainWindow::display_preset_msg)),
2894 ladspalist_window(),
2895 szg_rack_units(Gtk::SizeGroup::
create(Gtk::SIZE_GROUP_HORIZONTAL)) {
2897 convolver_filename_label.set_ellipsize(Pango::ELLIPSIZE_END);
2898 convolver_mono_filename_label.set_ellipsize(Pango::ELLIPSIZE_END);
2912 const char *id_list[] = {
"MainWindow",
"amp_background:ampbox",
"bank_liststore",
"target_liststore",
2913 "bank_combo_liststore", 0 };
2914 bld = gx_gui::GxBuilder::create_from_file(options_.
get_builder_filepath(
"mainpanel.glade"), &machine, id_list);
2915 load_widget_pointers();
2916 rackcontainer->set_homogeneous(
true);
2917 szg_rack_units->add_widget(*ampdetail_mini);
2918 szg_rack_units->add_widget(*ampdetail_normal);
2921 clear_box(*monocontainer);
2922 clear_box(*stereorackcontainerH);
2923 clear_box(*stereorackcontainerV);
2924 clear_box(*preset_box_no_rack);
2927 left_column = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
2928 Gtk::ScrolledWindow *swe;
2929 bld->find_widget(
"scrolledwindow_effects", swe);
2930 gtk_size_group_add_widget(
left_column, GTK_WIDGET(swe->gobj()));
2932 bld->find_widget(
"presets:barbutton", pb);
2933 gtk_size_group_add_widget(
left_column, GTK_WIDGET(pb->gobj()));
2939 uimanager = Gtk::UIManager::create();
2940 uimanager->insert_action_group(actions.
group);
2948 add_osc_size_menu();
2949 amp_radio_menu.
setup(
"<menubar><menu action=\"TubeMenu\">",
"</menu></menubar>",uimanager,actions.
group);
2952 Gtk::Widget *menubar = uimanager->get_widget(
"/menubar");
2953 actions.
accels = uimanager->get_accel_group();
2954 menubox->pack_start(*menubar);
2955 window->add_accel_group(actions.
accels);
2956 window->set_icon(gx_head_icon);
2962 window->signal_window_state_event().connect(
2963 sigc::mem_fun(*
this, &MainWindow::on_window_state_changed));
2964 window->signal_delete_event().connect(
2965 sigc::hide(sigc::mem_fun(
this, &MainWindow::on_quit)));
2966 window->signal_configure_event().connect_notify(
2967 sigc::mem_fun(*
this, &MainWindow::on_configure_event));
2968 window->signal_visibility_notify_event().connect(
2969 sigc::mem_fun(*
this, &MainWindow::on_visibility_notify));
2970 window->signal_key_press_event().connect(
2971 sigc::mem_fun(*
this, &MainWindow::on_key_press_event));
2977 status_icon->signal_activate().connect(
2978 sigc::mem_fun(*
this, &MainWindow::hide_extended_settings));
2979 status_icon->signal_popup_menu().connect(
2980 sigc::mem_fun(*
this, &MainWindow::systray_menu));
2984 stereorackcontainerV->pack_start(stereorackcontainer, Gtk::PACK_EXPAND_WIDGET);
2985 monocontainer->pack_start(monorackcontainer, Gtk::PACK_EXPAND_WIDGET);
2993 jack->
shutdown.connect(sigc::mem_fun(*
this, &MainWindow::gx_jack_is_down));
2994 jack->signal_buffersize_change().connect(
2995 sigc::mem_fun(*
this, &MainWindow::set_latency));
2996 jack->signal_client_change().connect(
2997 sigc::mem_fun(*
this, &MainWindow::on_jack_client_changed));
2998 #ifdef HAVE_JACK_SESSION 2999 jack->session.connect(sigc::mem_fun(*
this, &MainWindow::jack_session_event));
3000 jack->session_ins.connect(sigc::mem_fun(*
this, &MainWindow::jack_session_event_ins));
3008 sigc::mem_fun(*
this, &MainWindow::on_engine_state_change));
3010 sigc::mem_fun(*
this, &MainWindow::overload_status_changed));
3012 sigc::mem_fun(
this, &MainWindow::on_plugin_changed));
3017 sigc::mem_fun(*
this, &MainWindow::rebuild_preset_menu));
3019 sigc::mem_fun(*
this, &MainWindow::show_selected_preset));
3028 std::vector<Gtk::TargetEntry> listTargets;
3029 listTargets.push_back(Gtk::TargetEntry(
"application/x-guitarix-mono", Gtk::TARGET_SAME_APP, 1));
3030 listTargets.push_back(Gtk::TargetEntry(
"application/x-guitarix-stereo", Gtk::TARGET_SAME_APP, 2));
3031 effects_toolpalette->drag_dest_set(listTargets, Gtk::DEST_DEFAULT_ALL, Gdk::ACTION_MOVE);
3032 effects_toolpalette->signal_drag_data_received().connect(sigc::mem_fun(*
this, &MainWindow::on_tp_drag_data_received));
3038 jackd_image->set(pixbuf_jack_disconnected);
3039 jackd_image->get_parent()->add_events(Gdk::SCROLL_MASK);
3040 jackd_image->get_parent()->signal_button_press_event().connect(
3041 sigc::mem_fun(*
this, &MainWindow::on_jackserverconnection));
3042 jackd_image->get_parent()->signal_scroll_event().connect(
3043 sigc::mem_fun(*
this, &MainWindow::on_jackserverconnection_scroll));
3051 jackd_image->hide();
3057 setup_tuner(*racktuner);
3058 tuner_on_off->set_name(
"effect_on_off");
3059 tuner_on_off->signal_toggled().connect(
3061 sigc::mem_fun(*racktuner, &Gxw::RackTuner::set_sensitive),
3062 sigc::mem_fun(*tuner_on_off, &Gxw::Switch::get_active)));
3070 sigc::mem_fun(*
this, &MainWindow::on_oscilloscope_post_pre));
3072 sigc::mem_fun(*
this, &MainWindow::on_show_oscilloscope));
3074 sigc::mem_fun(*
this, &MainWindow::on_oscilloscope_activate));
3076 sigc::mem_fun(*
this, &MainWindow::set_waveview_buffer));
3081 for (
unsigned int i = 0; i <
sizeof(fastmeter)/
sizeof(fastmeter[0]); ++i) {
3082 fastmeter[i]->signal_button_release_event().connect(
3083 sigc::mem_fun(*
this, &MainWindow::on_meter_button_release));
3084 fastmeter[i]->set_tooltip_text(_(
"Overall Rack output"));
3086 const float meter_falloff = 27;
3087 const float meter_display_timeout = 60;
3088 const float falloff = meter_falloff * meter_display_timeout * 0.001;
3089 Glib::signal_timeout().connect(
3090 sigc::bind(sigc::mem_fun(
this, &MainWindow::refresh_meter_level), falloff),
3091 meter_display_timeout);
3096 ampdetail_compress->signal_clicked().connect(
3097 sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ampdetail_switch),
true,
true));
3098 ampdetail_expand->signal_clicked().connect(
3099 sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ampdetail_switch),
false,
true));
3101 sigc::bind(sigc::mem_fun(*
this, &MainWindow::on_ampdetail_switch),
false));
3106 midi_out_compress->signal_clicked().connect(
3108 sigc::mem_fun(actions.
midi_out_plug.operator->(), &Gtk::ToggleAction::set_active),
3110 midi_out_expand->signal_clicked().connect(
3112 sigc::mem_fun(actions.
midi_out_plug.operator->(), &Gtk::ToggleAction::set_active),
3114 midi_out_presets_mini->signal_clicked().connect(
3118 midi_out_presets_normal->signal_clicked().connect(
3122 channel1_button->signal_toggled().connect(
3124 sigc::mem_fun(
this, &MainWindow::on_midi_out_channel_toggled),
3125 channel1_button, channel1_box));
3126 channel2_button->signal_toggled().connect(
3128 sigc::mem_fun(
this, &MainWindow::on_midi_out_channel_toggled),
3129 channel2_button, channel2_box));
3130 channel3_button->signal_toggled().connect(
3132 sigc::mem_fun(
this, &MainWindow::on_midi_out_channel_toggled),
3133 channel3_button, channel3_box));
3138 status_image->set(pixbuf_on);
3139 status_image->get_parent()->add_events(Gdk::SCROLL_MASK);
3141 status_image->get_parent()->signal_button_press_event().connect(
3142 sigc::mem_fun(*
this, &MainWindow::on_toggle_mute));
3143 status_image->get_parent()->signal_scroll_event().connect(
3144 sigc::mem_fun(*
this, &MainWindow::on_scroll_toggle));
3145 on_engine_state_change(machine.
get_state());
3150 insert_image->set(pixbuf_insert_on);
3151 insert_image->get_parent()->add_events(Gdk::SCROLL_MASK);
3153 insert_image->get_parent()->signal_button_press_event().connect(
3154 sigc::mem_fun(*
this, &MainWindow::on_toggle_insert));
3155 insert_image->get_parent()->signal_scroll_event().connect(
3156 sigc::mem_fun(*
this, &MainWindow::on_scroll_toggle_insert));
3158 ip.
signal_changed().connect(sigc::mem_fun(*
this, &MainWindow::on_insert_jack_changed));
3163 gtk_activatable_set_related_action(GTK_ACTIVATABLE(show_rack_button->gobj()), GTK_ACTION(actions.
show_rack->gobj()));
3164 gtk_activatable_set_related_action(GTK_ACTIVATABLE(rack_order_h_button->gobj()), GTK_ACTION(actions.
rackh->gobj()));
3165 gtk_activatable_set_related_action(GTK_ACTIVATABLE(config_mode_button->gobj()), GTK_ACTION(actions.
rack_config->gobj()));
3166 gtk_activatable_set_related_action(GTK_ACTIVATABLE(liveplay_button->gobj()),GTK_ACTION(actions.
live_play->gobj()));
3167 gtk_activatable_set_related_action(GTK_ACTIVATABLE(tuner_button->gobj()),GTK_ACTION(actions.
tuner->gobj()));
3168 gtk_activatable_set_related_action(GTK_ACTIVATABLE(effects_button->gobj()), GTK_ACTION(actions.
show_plugin_bar->gobj()));
3169 gtk_activatable_set_related_action(GTK_ACTIVATABLE(presets_button->gobj()), GTK_ACTION(actions.
presets->gobj()));
3170 gtk_activatable_set_related_action(GTK_ACTIVATABLE(compress_button->gobj()), GTK_ACTION(actions.
compress->gobj()));
3171 gtk_activatable_set_related_action(GTK_ACTIVATABLE(expand_button->gobj()), GTK_ACTION(actions.
expand->gobj()));
3191 fLoggingWindow.set_transient_for(*window);
3192 fLoggingWindow.set_icon(gx_head_icon);
3194 sigc::mem_fun(*
this, &MainWindow::on_msg_level_changed));
3195 fLoggingWindow.signal_hide().connect(
3197 sigc::mem_fun(actions.
loggingbox.operator->(), &Gtk::ToggleAction::set_active),
3199 on_msg_level_changed();
3200 logstate_image->get_parent()->add_events(Gdk::SCROLL_MASK);
3201 logstate_image->get_parent()->signal_button_press_event().connect(
3202 sigc::mem_fun(*
this, &MainWindow::on_log_activated));
3203 logstate_image->get_parent()->signal_scroll_event().connect(
3204 sigc::mem_fun(*
this, &MainWindow::on_log_scrolled));
3221 plugin_dict.
add(mainamp_plugin);
3222 mainamp_plugin->
rackbox = add_rackbox_internal(*mainamp_plugin, 0, 0,
false, -1,
false, amp_background);
3224 effects_toolpalette->show();
3244 if (!title.empty()) {
3245 window->set_title(title);
3261 if (!connect_jack(
true, splash)) {
3264 jack->signal_client_change()();
3280 bld->find_widget(
"gxselector1:amp_selector", rr);
3281 rr->signal_value_changed().connect(
3283 sigc::mem_fun(
this, &MainWindow::amp_controls_visible),
3285 amp_controls_visible(rr);
3289 insert_image->set(pixbuf_insert_off);
3292 insert_image->set(pixbuf_insert_on);
3296 compress_button->set_visible(!c);
3297 expand_button->set_visible(c);
3298 if (!options.
get_tuner_tet().empty()) set_tuner_tet(*racktuner);
3299 if (!machine.
get_jack()) on_move_tuner();
3304 #if false // set true to generate a new keyboard accel file 3305 gtk_accel_map_add_filter(
"<Actions>/Main/ChangeSkin_*");
3306 gtk_accel_map_add_filter(
"<Actions>/Main/Enum_tube.select.*");
3307 gtk_accel_map_add_filter(
"<Actions>/Main/Latency_*");
3308 gtk_accel_map_add_filter(
"<Actions>/Main/Plugin_*");
3309 gtk_accel_map_add_filter(
"<Actions>/PresetList/PresetList_*");
3315 Glib::RefPtr<Gdk::Window> win = window->get_window();
3319 if (actions.
presets->get_active()) {
3324 delete preset_window;
virtual GxEngineState get_state()=0
virtual gx_system::PresetFileGui * get_current_bank_file()=0
void gx_print_info(const char *, const std::string &)
virtual float getLowerAsFloat() const
CmdConnection::msg_type start
void set_jack_down(bool v)
double stop_at_mono_top(double off, double step_size)
void set_streaming(bool p1)
Glib::RefPtr< Gtk::ToggleAction > get_action()
virtual sigc::signal< void, int > & signal_oscilloscope_post_pre()=0
void set_display_flat(bool p1)
Glib::RefPtr< UiBoolToggleAction > midi_out_plug
void freeze_and_size_request(Gtk::Window *w, int width, int height)
void add_icon(const std::string &name)
std::string get_builder_filepath(const std::string &basename) const
virtual sigc::signal< void, GxEngineState > & signal_state_change()=0
static Glib::RefPtr< UiToggleAction > create(gx_engine::GxMachineBase &machine, const std::string &id, const Glib::ustring &name, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring(), bool is_active=false)
virtual sigc::signal< void > & signal_presetlist_changed()=0
const char * get_name() const
virtual sigc::signal< void, bool > & signal_oscilloscope_visible()=0
bool get_hideonquit() const
void display(bool v, bool animate)
virtual Parameter & get_parameter(const std::string &id)=0
void set_temperament(int p1)
void set_ui_merge_id(Gtk::UIManager::ui_merge_id id)
virtual void set_state(GxEngineState state)=0
int gx_system_call(const std::string &, bool devnull=false, bool escape=false)
static void rt_watchdog_set_limit(int limit)
static bool is_registered(gx_engine::GxMachineBase &m, const char *name)
Glib::RefPtr< Gtk::ToggleAction > show_values
virtual sigc::signal< void, unsigned int > & signal_oscilloscope_size_change()=0
Glib::RefPtr< Gdk::Pixbuf > icon
void plugin_preset_popup(const PluginDef *pdef)
virtual void set_init_values()=0
bool check_thaw(int width, int height)
void set_reference_pitch(double p1)
bool system_show_tooltips
GtkSizeGroup * left_column
virtual void tuner_used_for_display(bool on)=0
Glib::RefPtr< Gtk::ToggleAction > tooltips
virtual gx_jack::GxJack * get_jack()=0
jack_nframes_t get_jack_bs()
std::vector< Position >::iterator iterator
Glib::RefPtr< Gtk::ToggleAction > rackh
void hide_effect(const std::string &name)
UiToggleAction(gx_engine::GxMachineBase &machine_, const std::string &id, const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring(), bool is_active=false)
void pack(Gtk::Widget *mainbox, Gtk::Widget *minibox, const Glib::RefPtr< Gtk::SizeGroup > &szg)
virtual bool setting_is_preset()=0
std::string get_style_filepath(const std::string &basename) const
double stop_at_stereo_bottom(double off, double step_size, double pagesize)
PluginDesc(const Glib::ustring &g, std::vector< PluginUI *> *p)
int get_idle_thread_timeout() const
Glib::RefPtr< Gtk::ToggleAction > rack_config
Glib::RefPtr< Gtk::ToggleAction > show_rack
static SelectMidiChannel * create(gx_system::CmdlineOptions &opt, gx_engine::GxMachineBase &machine)
static Gtk::Widget * create_icon_widget(const PluginUI &plugin, gx_system::CmdlineOptions &options)
Glib::RefPtr< Gtk::ToggleAction > animations
void gx_print_error(const char *, const std::string &)
Gtk::ToolItemGroup * group
gx_engine::Plugin * plugin
Glib::RefPtr< Gtk::ActionGroup > group
static GxLogger & get_logger()
Glib::SignalProxy1< void, bool > signal_poll_status_changed()
Glib::RefPtr< Gtk::Action > expand
virtual bool load_unit(gx_gui::UiBuilderImpl &builder, PluginDef *pdef)=0
Glib::SignalProxy0< void > signal_frequency_poll()
float power2db(float power)
T get_parameter_value(const std::string &id)
virtual const Glib::ustring & get_current_bank()=0
RackBox * add_rackbox(PluginUI &pl, bool mini=false, int pos=-1, bool animate=false)
sigc::signal< void > & signal_msg_level_changed()
sigc::signal< void, bool > & signal_changed()
virtual float get_tuner_freq()=0
MainWindow(gx_engine::GxMachineBase &machine, gx_system::CmdlineOptions &options, Gtk::Window *splash, const Glib::ustring &title)
static GxExit & get_instance()
PluginType get_type() const
static void toggle(gx_engine::GxMachineBase &machine, Glib::RefPtr< Gtk::ToggleAction > item)
const std::string & getIRFile() const
msg_signal & signal_message()
virtual sigc::signal< void, Plugin *, PluginChange::pc > & signal_plugin_changed()=0
JConvPluginUI(MainWindow &main, const char *id, const Glib::ustring &tooltip="")
virtual void set_parameter_value(const std::string &id, int value)=0
void set_action(Glib::RefPtr< Gtk::ToggleAction > &act)
virtual sigc::signal< void > & signal_selection_changed()=0
std::string to_string(const T &t)
std::vector< PluginUI * > * plugins
void add_plugin(std::vector< PluginUI *> &p, const char *id, const Glib::ustring &tooltip_="")
Glib::RefPtr< Gtk::ToggleAction > live_play
void connect_midi_controller(Gtk::Widget *w, const std::string &id, gx_engine::GxMachineBase &machine)
bool plugins_by_name_less(PluginUI *a, PluginUI *b)
Glib::RefPtr< Gtk::AccelGroup > accels
virtual void next_preset_switch()=0
void set_slot(sigc::slot< void > w)
bool get_opt_save_on_exit() const
void unset_ui_merge_id(Glib::RefPtr< Gtk::UIManager > uimanager)
void gx_print_warning(const char *, const std::string &)
Glib::RefPtr< UiBoolToggleAction > tuner
const Glib::ustring & get_tuner_tet()
virtual void disable_autosave(bool v)=0
bool gx_start_jack_dialog(Glib::RefPtr< Gdk::Pixbuf > gw_ib)
void exit_program(std::string msg="", int errcode=1)
const string & get_instancename()
const GxJConvSettings & get_value() const
int main(int argc, char *argv[])
static void start_stop(Glib::RefPtr< Gtk::ToggleAction > &action, gx_jack::GxJack &jack)
std::string get_user_filepath(const std::string &basename) const
Glib::Dispatcher shutdown
const char * get_id() const
void child_set_property(Gtk::Container &container, Gtk::Widget &child, const char *property_name, bool value)
Glib::RefPtr< Gtk::ToggleAction > presets
const Glib::ustring & get_jack_uuid() const
virtual Plugin * pluginlist_lookup_plugin(const std::string &id) const =0
EnumParameter & getEnum()
bool gx_jack_connection(bool connect, bool startserver, int wait_after_connect, const gx_system::CmdlineOptions &opt)
virtual void previus_preset_switch()=0
Glib::RefPtr< Gtk::ToggleAction > show_plugin_bar
virtual void set_jack_insert(bool v)=0
void push_note(int p1, int p2, int p3)
virtual const Glib::ustring & get_current_name()=0
void set_on_off(bool v) const
Gxw::RackTuner & get_tuner()
bool get_clear_rc() const
const char * get_category()
virtual sigc::signal< int, bool > & signal_oscilloscope_activation()=0
static const char * value_label(const value_pair &vp)
virtual bool midi_get_config_mode(int *ctl=0)=0
sigc::signal< void, T > & signal_parameter_value(const std::string &id)
BoolParameter & getBool()
void update_scrolled_window(Gtk::ScrolledWindow &w)
const string & id() const
int gx_message_popup(const char *)
void resize_finished(RackContainer *ch)
const value_pair & get_pair()
void set_accelgroup(Glib::RefPtr< Gtk::AccelGroup > accels_)
virtual void loadstate()=0
Glib::RefPtr< Gtk::Action > compress
Glib::RefPtr< Gtk::ToggleAction > loggingbox
static PortMapWindow * create(gx_engine::GxMachineBase &machine, Glib::RefPtr< Gtk::AccelGroup > ag)
sigc::signal< void, MidiAudioBuffer::Load > & signal_jack_load_change()
static SelectJackControlPgm * create(gx_system::CmdlineOptions &opt, gx_engine::GxMachineBase &machine)
void freeze_until_width_update(Gtk::Window *w, int width)
virtual const value_pair * getValueNames() const