13
0

Move panic button to MIDI toolbar (reduce required horizontal space).

git-svn-id: svn://localhost/ardour2/branches/3.0@3864 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2008-10-05 03:22:29 +00:00
parent dca03d05cd
commit 7b5dbd5f2b
6 changed files with 33 additions and 27 deletions

View File

@ -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"))

View File

@ -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 ();

View File

@ -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)
{

View File

@ -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 ()
@ -3229,6 +3241,14 @@ Editor::setup_midi_toolbar ()
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... */
midi_tools_tearoff = manage (new TearOff (midi_tool_button_box));
@ -3250,6 +3270,8 @@ Editor::setup_midi_toolbar ()
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();
midi_tools_tearoff->show_all();

View File

@ -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 */

View File

@ -28,6 +28,7 @@
#include <pbd/error.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/tearoff.h>
#include <pbd/memento_command.h>
#include <pbd/basename.h>
@ -348,10 +349,13 @@ 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;