diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index af0d8e6fe1..13b38b1ed4 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -161,7 +161,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) auditioning_alert_button (_("AUDITION")), solo_alert_button (_("SOLO")), - midi_panic_button (_("Panic")), shown_flag (false), error_log_button (_("Errors")) diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 86c9799cb8..dccf5ef38a 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -471,8 +471,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI Gtk::ToggleButton auditioning_alert_button; Gtk::ToggleButton solo_alert_button; - Gtk::ToggleButton midi_panic_button; - Gtk::VBox alert_box; void solo_blink (bool); @@ -484,7 +482,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI void solo_alert_toggle (); void audition_alert_toggle (); - void midi_panic_toggle (); void big_clock_value_changed (); void primary_clock_value_changed (); diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index e40b7ea30f..47218e518b 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -451,13 +451,6 @@ ARDOUR_UI::setup_transport () transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4); transport_tearoff_hbox.pack_start (alert_box, false, false); - VBox* panic_box = manage (new VBox); - midi_panic_button.set_name("TransportMidiPanic"); - midi_panic_button.signal_pressed().connect (mem_fun(*this, &ARDOUR_UI::midi_panic_toggle)); - panic_box->pack_start (midi_panic_button, true, true); - transport_tearoff_hbox.pack_start(*panic_box, true, true, 4); - - if (Profile->get_sae()) { Image* img = manage (new Image ((::get_icon (X_("sae"))))); transport_tearoff_hbox.pack_end (*img, false, false, 6); @@ -525,16 +518,6 @@ ARDOUR_UI::solo_alert_toggle () } } -void -ARDOUR_UI::midi_panic_toggle () -{ - if (session) { - session->midi_panic(); - midi_panic_button.set_active (false); - midi_panic_button.set_state (STATE_NORMAL); - } -} - void ARDOUR_UI::solo_blink (bool onoff) { diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 657e930ad8..38b13b8aab 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -238,6 +238,9 @@ Editor::Editor () automation_mode_button (_("mode")), global_automation_button (_("automation")), + midi_panic_button (_("Panic")), + midi_tools_tearoff (0), + #ifdef WITH_CMT image_socket_listener(0), #endif @@ -3170,6 +3173,15 @@ Editor::setup_toolbar () toolbar_frame.add (toolbar_base); } +void +Editor::midi_panic_toggle () +{ + if (session) { + session->midi_panic(); + midi_panic_button.set_active (false); + midi_panic_button.set_state (STATE_NORMAL); + } +} void Editor::setup_midi_toolbar () @@ -3228,6 +3240,14 @@ Editor::setup_midi_toolbar () &Editor::midi_edit_mode_toggled), Editing::MidiEditResize)); midi_tool_erase_button.signal_toggled().connect (bind (mem_fun(*this, &Editor::midi_edit_mode_toggled), Editing::MidiEditErase)); + + /* Panic */ + + VBox* panic_box = manage (new VBox); + midi_panic_button.set_name("MidiPanicButton"); + midi_panic_button.signal_pressed().connect ( + mem_fun(this, &Editor::midi_panic_toggle)); + panic_box->pack_start (midi_panic_button, true, true); /* Pack everything in... */ @@ -3249,6 +3269,8 @@ Editor::setup_midi_toolbar () midi_toolbar_hbox.set_border_width (1); midi_toolbar_hbox.pack_start (*midi_tools_tearoff, false, true); + + midi_toolbar_hbox.pack_start(*panic_box, false, true, 4); midi_tool_button_box.show_all (); midi_toolbar_hbox.show_all(); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 4793770071..3bd301b0d8 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1713,11 +1713,11 @@ public: /* midi toolbar */ Gtk::HBox midi_tool_button_box; - Gtkmm2ext::TearOff* midi_tool_tearoff; Gtk::ToggleButton midi_tool_pencil_button; Gtk::ToggleButton midi_tool_select_button; Gtk::ToggleButton midi_tool_resize_button; Gtk::ToggleButton midi_tool_erase_button; + Gtk::ToggleButton midi_panic_button; GroupedButtons *midi_tool_button_set; void midi_edit_mode_toggled (Editing::MidiEditMode m); bool ignore_midi_edit_mode_toggle; @@ -1727,6 +1727,7 @@ public: Gtk::EventBox midi_toolbar_base; Gtk::Frame midi_toolbar_frame; + void midi_panic_toggle (); void setup_midi_toolbar (); /* selection process */ diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 5c7c679d72..0c72acf10a 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -348,11 +349,14 @@ Editor::set_mouse_mode (MouseMode m, bool force) break; } - if (mouse_mode == MouseNote) - midi_toolbar_frame.show(); - else - midi_toolbar_frame.hide(); - + if (midi_tools_tearoff) { + if (mouse_mode == MouseNote) { + midi_tools_tearoff->show(); + } else { + midi_tools_tearoff->hide(); + } + } + ignore_mouse_mode_toggle = false; set_canvas_cursor ();