Commence transport tool bar re-layout

This commit is contained in:
Robin Gareus 2016-12-11 17:24:30 +01:00
parent a631706059
commit 1a25b906b3
12 changed files with 388 additions and 532 deletions

View file

@ -44,8 +44,7 @@ using std::min;
using std::max;
TimeInfoBox::TimeInfoBox ()
: left (2, 4)
, right (2, 4)
: table (3, 4)
, syncing_selection (false)
, syncing_punch (false)
{
@ -65,67 +64,44 @@ TimeInfoBox::TimeInfoBox ()
set_spacing (0);
set_border_width (2);
pack_start (left, true, true);
if (!ARDOUR::Profile->get_trx()) {
pack_start (right, true, true);
}
pack_start (table, false, false);
left.set_homogeneous (false);
left.set_spacings (0);
left.set_border_width (2);
left.set_col_spacings (2);
right.set_homogeneous (false);
right.set_spacings (0);
right.set_border_width (2);
right.set_col_spacings (2);
table.set_homogeneous (false);
table.set_spacings (0);
table.set_border_width (2);
table.set_col_spacings (2);
Gtk::Label* l;
selection_title.set_name ("TimeInfoSelectionTitle");
left.attach (selection_title, 1, 2, 0, 1);
table.attach (selection_title, 1, 2, 0, 1);
l = manage (new Label);
l->set_text (_("Start"));
l->set_alignment (1.0, 0.5);
l->set_name (X_("TimeInfoSelectionLabel"));
left.attach (*l, 0, 1, 1, 2, FILL);
left.attach (*selection_start, 1, 2, 1, 2);
table.attach (*l, 0, 1, 1, 2, FILL);
table.attach (*selection_start, 1, 2, 1, 2);
l = manage (new Label);
l->set_text (_("End"));
l->set_alignment (1.0, 0.5);
l->set_name (X_("TimeInfoSelectionLabel"));
left.attach (*l, 0, 1, 2, 3, FILL);
left.attach (*selection_end, 1, 2, 2, 3);
table.attach (*l, 0, 1, 2, 3, FILL);
table.attach (*selection_end, 1, 2, 2, 3);
l = manage (new Label);
l->set_text (_("Length"));
l->set_alignment (1.0, 0.5);
l->set_name (X_("TimeInfoSelectionLabel"));
left.attach (*l, 0, 1, 3, 4, FILL);
left.attach (*selection_length, 1, 2, 3, 4);
punch_in_button.set_name ("punch button");
punch_out_button.set_name ("punch button");
punch_in_button.set_text (_("In"));
punch_out_button.set_text (_("Out"));
Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "TogglePunchIn");
punch_in_button.set_related_action (act);
act = ActionManager::get_action ("Transport", "TogglePunchOut");
punch_out_button.set_related_action (act);
Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
table.attach (*l, 0, 1, 3, 4, FILL);
table.attach (*selection_length, 1, 2, 3, 4);
punch_title.set_name ("TimeInfoSelectionTitle");
right.attach (punch_title, 3, 4, 0, 1);
right.attach (punch_in_button, 2, 3, 1, 2, FILL, SHRINK);
right.attach (*punch_start, 3, 4, 1, 2);
right.attach (punch_out_button, 2, 3, 2, 3, FILL, SHRINK);
right.attach (*punch_end, 3, 4, 2, 3);
table.attach (punch_title, 2, 3, 0, 1);
table.attach (*punch_start, 2, 3, 1, 2);
table.attach (*punch_end, 2, 3, 2, 3);
show_all ();
show_all ();
selection_start->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_selection_mode), selection_start));
selection_end->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_selection_mode), selection_end));
@ -149,12 +125,12 @@ TimeInfoBox::TimeInfoBox ()
TimeInfoBox::~TimeInfoBox ()
{
delete selection_length;
delete selection_end;
delete selection_start;
delete selection_length;
delete selection_end;
delete selection_start;
delete punch_start;
delete punch_end;
delete punch_start;
delete punch_end;
}
void