right side track-header control buttons (for non mixbus profile)

This commit is contained in:
Robin Gareus 2014-08-31 16:12:43 +02:00
parent db34d9a556
commit 098a698052
3 changed files with 73 additions and 16 deletions

View file

@ -181,7 +181,11 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
break;
}
controls_table.attach (*rec_enable_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (*rec_enable_button, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (*rec_enable_button, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
controls_button_size_group->add_widget(*rec_enable_button);
if (is_midi_track()) {
@ -202,34 +206,59 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
gm.set_fader_name ("AudioBusFader");
Gtk::Fixed *blank = manage(new Gtk::Fixed());
controls_button_size_group->add_widget(*blank);
controls_table.attach (*blank, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus() ) {
controls_table.attach (*blank, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (*blank, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
blank->show();
}
top_hbox.pack_end(gm.get_level_meter(), false, false, 4);
if (!ARDOUR::Profile->get_mixbus()) {
controls_meters_size_group->add_widget (gm.get_level_meter());
}
_route->meter_change.connect (*this, invalidator (*this), bind (&RouteTimeAxisView::meter_changed, this), gui_context());
_route->input()->changed.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::io_changed, this, _1, _2), gui_context());
_route->output()->changed.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::io_changed, this, _1, _2), gui_context());
_route->track_number_changed.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::label_view, this), gui_context());
controls_table.attach (*mute_button, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (*mute_button, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (*mute_button, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
controls_button_size_group->add_widget(*mute_button);
if (!_route->is_master()) {
controls_table.attach (*solo_button, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (*solo_button, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (*solo_button, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
controls_button_size_group->add_widget(*solo_button);
} else {
Gtk::Fixed *blank = manage(new Gtk::Fixed());
controls_button_size_group->add_widget(*blank);
controls_table.attach (*blank, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (*blank, 2, 3, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (*blank, 4, 5, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
blank->show();
}
if (!ARDOUR::Profile->get_trx()) {
controls_table.attach (route_group_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus()) {
controls_button_size_group->add_widget(route_group_button);
controls_table.attach (gm.get_gain_slider(), 3, 6, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
controls_table.attach (route_group_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (gm.get_gain_slider(), 3, 5, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
}
else if (!ARDOUR::Profile->get_trx()) {
controls_button_size_group->add_widget(route_group_button);
controls_table.attach (route_group_button, 4, 5, 3, 4, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
controls_table.attach (gm.get_gain_slider(), 0, 2, 2, 4, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
}
ARDOUR_UI::instance()->set_tip(*solo_button,_("Solo"));
@ -245,14 +274,24 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
update_track_number_visibility();
label_view ();
if (!ARDOUR::Profile->get_trx()) {
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (automation_button, 1, 2, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(automation_button);
}
else if (!ARDOUR::Profile->get_trx()) {
controls_table.attach (automation_button, 3, 4, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(automation_button);
}
if (!ARDOUR::Profile->get_trx() && is_track() && track()->mode() == ARDOUR::Normal) {
controls_table.attach (playlist_button, 0, 1, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(playlist_button);
if (is_track() && track()->mode() == ARDOUR::Normal) {
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (playlist_button, 0, 1, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(playlist_button);
}
else if (!ARDOUR::Profile->get_trx()) {
controls_table.attach (playlist_button, 2, 3, 3, 4, Gtk::SHRINK, Gtk::SHRINK);
controls_button_size_group->add_widget(playlist_button);
}
}
_y_position = -1;
@ -382,10 +421,14 @@ RouteTimeAxisView::update_track_number_visibility ()
}
if (number_label.get_parent()) {
controls_table.remove (number_label); // XXX
controls_table.remove (number_label);
}
if (show_label) {
controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
if (ARDOUR::Profile->get_mixbus()) {
controls_table.attach (number_label, 3, 4, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
} else {
controls_table.attach (number_label, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
}
const int tnw = std::max(2u, _session->track_number_decimals()) * 8; // TODO 8 = max_width_of_digit_0_to_9()
number_label.set_size_request(3 + tnw, -1);
number_label.show ();

View file

@ -36,6 +36,8 @@
#include "canvas/rectangle.h"
#include "canvas/debug.h"
#include "ardour/profile.h"
#include "ardour_ui.h"
#include "ardour_dialog.h"
#include "global_signals.h"
@ -69,6 +71,7 @@ uint32_t TimeAxisView::button_height = 0;
uint32_t TimeAxisView::extra_height = 0;
int const TimeAxisView::_max_order = 512;
PBD::Signal1<void,TimeAxisView*> TimeAxisView::CatchDeletion;
Glib::RefPtr<Gtk::SizeGroup> TimeAxisView::controls_meters_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisView* rent, Canvas& /*canvas*/)
: AxisView (sess)
@ -126,7 +129,13 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
delete an_entry;
name_hbox.pack_end (name_label, true, true);
name_hbox.set_size_request(100, 0); // XXX min header width (if fader is not visible)
// set min. track-header width if fader is not visible
if (ARDOUR::Profile->get_mixbus() ) {
name_hbox.set_size_request(100, 0);
} else {
name_hbox.set_size_request(90, 0);
}
name_hbox.show ();
name_label.show ();
@ -134,7 +143,11 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
controls_table.set_col_spacings (2);
controls_table.set_border_width (2);
controls_table.attach (name_hbox, 4, 5, 0, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
if (ARDOUR::Profile->get_mixbus() ) {
controls_table.attach (name_hbox, 4, 5, 0, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
} else {
controls_table.attach (name_hbox, 1, 2, 0, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
}
controls_table.show_all ();
controls_table.set_no_show_all ();

View file

@ -200,6 +200,7 @@ class TimeAxisView : public virtual AxisView
static uint32_t preset_height (Height);
protected:
static Glib::RefPtr<Gtk::SizeGroup> controls_meters_size_group;
/* The Standard LHS Controls */
Gtk::Table controls_table;
Glib::RefPtr<Gtk::SizeGroup> controls_button_size_group;