[Summary] Hide MasterBus in Multi out mode. Fix bug #43576
authorNikolay <MPolianovskyi@wavesglobal.com>
Wed, 22 Oct 2014 09:47:40 +0000 (12:47 +0300)
committerNikolay <MPolianovskyi@wavesglobal.com>
Wed, 22 Oct 2014 09:47:40 +0000 (12:47 +0300)
[Reviewed] nobody

gtk2_ardour/editor.cc
gtk2_ardour/master_bus_ui.cc
gtk2_ardour/master_bus_ui.h
gtk2_ardour/ui/master_ui.xml

index ae658c3b009ffc6ee6984cc4af59f53a257e16cc..d655d4774425330fd9db30061c5912c750d0de38 100644 (file)
@@ -1503,6 +1503,9 @@ Editor::set_session (Session *t)
         _master_bus_ui->init(_session);
     }
     
+    bool set_master_bus_visible = Config->get_output_auto_connect() & AutoConnectMaster;
+    _master_bus_ui->master_bus_set_visible ( set_master_bus_visible );
+    
     _set_session_in_progress = false;
 }
 
@@ -5722,6 +5725,8 @@ Editor::output_connection_mode_changed ()
     
     if (Config->get_output_auto_connect() & AutoConnectMaster) {
         
+        _master_bus_ui->master_bus_set_visible (true);
+        
         if (_session->master_out() && !axis_view_from_route(_session->master_out() ) ) {
 
             selection->block_tracks_changed(true);
@@ -5744,6 +5749,9 @@ Editor::output_connection_mode_changed ()
             selection->block_tracks_changed(false);
         }
     } else {
+        
+        _master_bus_ui->master_bus_set_visible (false);
+        
         TimeAxisView* tv = 0;
         if (_session->master_out() && (tv = axis_view_from_route(_session->master_out() ) ) ) {
             delete tv;
index f17ec3e96bf3f655d8746db36f2a785d553c4150..641a5417b4daa284670c6bd5cafb0a2416aa5550 100644 (file)
@@ -106,6 +106,8 @@ MasterBusUI::MasterBusUI (Session* sess, PublicEditor& ed)
        , _clear_solo_button (get_waves_button ("clear_solo_button"))
        , _global_rec_button (get_waves_button ("global_rec_button"))
     , _no_peak_display_box (get_event_box("no_peak_display_box") )
+    , _master_bus_hbox (get_h_box("master_bus_hbox") )
+    , _master_bus_empty_hbox (get_h_box("master_bus_empty_hbox"))
     , _master_bus_multi_out_mode_icon (get_image("master_bus_multi_out_mode_icon"))
     , _master_event_box (WavesUI::root () )
     , _selected(false)
@@ -211,6 +213,20 @@ void MasterBusUI::on_output_connection_mode_changed()
     route_mute_state_changed(NULL);
 }
 
+void
+MasterBusUI::master_bus_set_visible (bool set_visible)
+{
+    if ( set_visible )
+    {
+        _master_bus_hbox.show ();
+        _master_bus_empty_hbox.hide ();
+    } else
+    {
+        _master_bus_hbox.hide ();
+        _master_bus_empty_hbox.show ();
+    }
+}
+
 void
 MasterBusUI::update_master_bus_selection ()
 {
index c93bf5c3b1dac5d86cbf485fb1712e83b30fa3e9..3e7c742e99fd1b7fa0462e9c5a3b7e97d4ea9a20 100644 (file)
@@ -54,6 +54,8 @@ public:
        void set_route (boost::shared_ptr<ARDOUR::Route>);
     void update_master_bus_selection();
        static PBD::Signal1<void,MasterBusUI*> CatchDeletion;
+    
+    void master_bus_set_visible (bool set_visible);
 
 private:
        static int __meter_width;
@@ -105,6 +107,8 @@ private:
        WavesButton& _clear_solo_button;
        WavesButton& _global_rec_button;
     Gtk::EventBox& _no_peak_display_box;
+    Gtk::HBox& _master_bus_hbox;
+    Gtk::HBox& _master_bus_empty_hbox;
     Gtk::Image& _master_bus_multi_out_mode_icon;
     Gtk::Container& _master_event_box;
     
index 77792e8b44ca8957c7c75d5487d645cafd9d7d49..ba6f46729d1186b70ff5df1c3d57e6eb422bbc3a 100644 (file)
@@ -9,25 +9,31 @@
               bgnormal="#494949"
               bgactive="#494949"/>
     <HBox height="17">
-      <EventBox width="29"
-                bgnormal="#424242"
-                bgactive="#F48E16"/>
-      <EventBox width="6"
-                bgnormal="#F48E16"
-                bgactive="#F48E16"/>
-      <EventBox width="1"
-                bgnormal="#000000"
-                bgactive="#000000"/>
-      <VBox width="6"/>
-      <Label text="MASTER BUS"
-             winfont ="Arial 10"
-             macfont ="Helvetica 10"
-             fgnormal="#ffffff"
-             fgactive="#ffffff"
-             width="99"
-             height="17"
-             horzalignment="start"
-             vertalignment="center"/>
+      <HBox id="master_bus_hbox"
+            noshowall="true">
+          <EventBox width="29"
+                    bgnormal="#424242"
+                    bgactive="#F48E16"/>
+          <EventBox width="6"
+                    bgnormal="#F48E16"
+                    bgactive="#F48E16"/>
+          <EventBox width="1"
+                    bgnormal="#000000"
+                    bgactive="#000000"/>
+          <VBox width="6"/>
+          <Label text="MASTER BUS"
+                 winfont ="Arial 10"
+                 macfont ="Helvetica 10"
+                 fgnormal="#ffffff"
+                 fgactive="#ffffff"
+                 width="99"
+                 height="17"
+                 horzalignment="start"
+                 vertalignment="center"/>
+      </HBox>
+      <HBox id="master_bus_empty_hbox"
+            width="141"
+            noshowall="true"/>
       <iconbutton id="master_mute_button"
                   width="83"
                   height="17"