first pass hiding/rearrangement of UI elements related to trx
[ardour.git] / gtk2_ardour / mixer_strip.cc
index 80548ea20b71c60a4b6d2fd525ed13fefadc269c..6c4b4428700e194ac0a98c5817a1bcbf1670350e 100644 (file)
@@ -37,6 +37,7 @@
 #include "ardour/audio_track.h"
 #include "ardour/audioengine.h"
 #include "ardour/internal_send.h"
+#include "ardour/meter.h"
 #include "ardour/midi_track.h"
 #include "ardour/pannable.h"
 #include "ardour/panner.h"
@@ -131,6 +132,8 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt
 void
 MixerStrip::init ()
 {
+       int button_table_row = 0;
+
        input_selector = 0;
        output_selector = 0;
        group_menu = 0;
@@ -206,15 +209,19 @@ MixerStrip::init ()
 
        top_button_table.set_homogeneous (true);
        top_button_table.set_spacings (2);
-       top_button_table.attach (*monitor_input_button, 0, 1, 0, 1);
-        top_button_table.attach (*monitor_disk_button, 1, 2, 0, 1);
+       if (!ARDOUR::Profile->get_trx()) {
+               top_button_table.attach (*monitor_input_button, 0, 1, 0, 1);
+               top_button_table.attach (*monitor_disk_button, 1, 2, 0, 1);
+       }
        top_button_table.show ();
 
        rec_solo_table.set_homogeneous (true);
        rec_solo_table.set_row_spacings (2);
        rec_solo_table.set_col_spacings (2);
-        rec_solo_table.attach (*solo_isolated_led, 1, 2, 0, 1);
-        rec_solo_table.attach (*solo_safe_led, 1, 2, 1, 2);
+       if (!ARDOUR::Profile->get_trx()) {
+               rec_solo_table.attach (*solo_isolated_led, 1, 2, 0, 1);
+               rec_solo_table.attach (*solo_safe_led, 1, 2, 1, 2);
+       }
         rec_solo_table.show ();
 
        button_table.set_homogeneous (false);
@@ -236,17 +243,24 @@ MixerStrip::init ()
                button_size_group->add_widget (*monitor_input_button);
        }
 
-       button_table.attach (name_button, 0, 1, 0, 1);
-       button_table.attach (input_button_box, 0, 1, 1, 2);
-       button_table.attach (_invert_button_box, 0, 1, 2, 3);
+       if (!ARDOUR::Profile->get_trx()) {
+               button_table.attach (name_button, button_table_row, button_table_row+1, 0, 1);
+               button_table_row++;
+               button_table.attach (input_button_box, button_table_row, button_table_row+1, 1, 2);
+               button_table_row++;
+               button_table.attach (_invert_button_box, button_table_row, button_table_row+1, 2, 3);
+               button_table_row++;
+       }
 
        middle_button_table.set_homogeneous (true);
        middle_button_table.set_spacings (2);
 
        bottom_button_table.set_spacings (2);
        bottom_button_table.set_homogeneous (true);
-//     bottom_button_table.attach (group_button, 0, 1, 0, 1);
-       bottom_button_table.attach (gpm.gain_automation_state_button, 0, 1, 0, 1);
+       bottom_button_table.attach (group_button, button_table_row, button_table_row+1, 0, 1);
+       button_table_row++;
+       bottom_button_table.attach (gpm.gain_automation_state_button, button_table_row, button_table_row+1, 0, 1);
+       button_table_row++;
 
        name_button.set_name ("mixer strip button");
        name_button.set_text (" "); /* non empty text, forces creation of the layout */
@@ -280,17 +294,23 @@ MixerStrip::init ()
        whvbox.pack_start (width_hide_box, true, true);
 
        global_vpacker.set_spacing (2);
-       global_vpacker.pack_start (whvbox, Gtk::PACK_SHRINK);
-       global_vpacker.pack_start (button_table, Gtk::PACK_SHRINK);
-       global_vpacker.pack_start (processor_box, true, true);
+       if (!ARDOUR::Profile->get_trx()) {
+               global_vpacker.pack_start (whvbox, Gtk::PACK_SHRINK);
+               global_vpacker.pack_start (button_table, Gtk::PACK_SHRINK);
+               global_vpacker.pack_start (processor_box, true, true);
+       }
        global_vpacker.pack_start (panners, Gtk::PACK_SHRINK);
        global_vpacker.pack_start (top_button_table, Gtk::PACK_SHRINK);
        global_vpacker.pack_start (rec_solo_table, Gtk::PACK_SHRINK);
        global_vpacker.pack_start (middle_button_table, Gtk::PACK_SHRINK);
        global_vpacker.pack_start (gpm, Gtk::PACK_SHRINK);
        global_vpacker.pack_start (bottom_button_table, Gtk::PACK_SHRINK);
-       global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
-       global_vpacker.pack_start (_comment_button, Gtk::PACK_SHRINK);
+       if (!ARDOUR::Profile->get_trx()) {
+               global_vpacker.pack_start (output_button, Gtk::PACK_SHRINK);
+               global_vpacker.pack_start (_comment_button, Gtk::PACK_SHRINK);
+       } else {
+               global_vpacker.pack_start (name_button, Gtk::PACK_SHRINK);
+       }
 
        global_frame.add (global_vpacker);
        global_frame.set_shadow_type (Gtk::SHADOW_IN);
@@ -496,6 +516,10 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
                rec_enable_button->set_sensitive (_session->writable());
                rec_enable_button->show();
 
+               if (ARDOUR::Profile->get_trx()) {
+                       rec_solo_table.attach (*monitor_input_button, 1, 2, 0, 2);
+               }
+
        } else {
 
                /* non-master bus */
@@ -992,18 +1016,11 @@ MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR
 void
 MixerStrip::update_diskstream_display ()
 {
-       if (is_track()) {
-
-               if (input_selector) {
-                       input_selector->hide_all ();
-               }
-
-               route_color_changed ();
+        if (is_track() && input_selector) {
+                        input_selector->hide_all ();
+        }
 
-       } else {
-
-               show_passthru_color ();
-       }
+        route_color_changed ();
 }
 
 void
@@ -1033,6 +1050,7 @@ MixerStrip::connect_to_pan ()
        if (panners._panner == 0) {
                panners.panshell_changed ();
        }
+       update_panner_choices();
 }
 
 void
@@ -1869,6 +1887,7 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
 
        set_current_delivery (send);
 
+       send->meter()->set_type(_route->shared_peak_meter()->get_type());
        send->set_metering (true);
        _current_delivery->DropReferences.connect (send_gone_connection, invalidator (*this), boost::bind (&MixerStrip::revert_to_default_display, this), gui_context());
 
@@ -2159,8 +2178,8 @@ MixerStrip::popup_level_meter_menu (GdkEventButton* ev)
 
        _suspend_menu_callbacks = true;
        add_level_meter_item_point (items, group, _("Input"), MeterInput);
-       add_level_meter_item_point (items, group, _("Pre-fader"), MeterPreFader);
-       add_level_meter_item_point (items, group, _("Post-fader"), MeterPostFader);
+       add_level_meter_item_point (items, group, _("Pre Fader"), MeterPreFader);
+       add_level_meter_item_point (items, group, _("Post Fader"), MeterPostFader);
        add_level_meter_item_point (items, group, _("Output"), MeterOutput);
        add_level_meter_item_point (items, group, _("Custom"), MeterCustom);