change selection behaviour for track header context click
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index fe5963c53572f5557afa9f5931bc1755ec350b41..15940c2e56f939dcce070ce6ebb351ab189cb10d 100644 (file)
@@ -50,6 +50,7 @@ ARDOUR_UI::connect_to_session (Session *s)
        session = s;
 
        session->HaltOnXrun.connect (mem_fun(*this, &ARDOUR_UI::halt_on_xrun_message));
+       session->RecordStateChanged.connect (mem_fun (*this, &ARDOUR_UI::record_state_changed));
 
        /* sensitize menu bar options that are now valid */
 
@@ -61,6 +62,20 @@ ARDOUR_UI::connect_to_session (Session *s)
                ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
        }
 
+       if (!session->control_out()) {
+               Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), X_("SoloViaBus"));
+               if (act) {
+                       act->set_sensitive (false);
+               }
+       }
+
+       /* allow wastebasket flush again */
+
+       Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("FlushWastebasket"));
+       if (act) {
+               act->set_sensitive (true);
+       }
+
        /* there are never any selections on startup */
 
        ActionManager::set_sensitive (ActionManager::region_selection_sensitive_actions, false);
@@ -92,10 +107,6 @@ ARDOUR_UI::connect_to_session (Session *s)
                option_editor->set_session (s);
        }
 
-       if (sfdb) {
-               sfdb->set_session (s);
-       }
-
        setup_session_options ();
 
        Blink.connect (mem_fun(*this, &ARDOUR_UI::transport_rec_enable_blink));
@@ -128,6 +139,13 @@ ARDOUR_UI::connect_to_session (Session *s)
        
        connect_dependents_to_session (s);
 
+       /* listen to clock mode changes. don't do this earlier because otherwise as the clocks
+          restore their modes or are explicitly set, we will cause the "new" mode to be saved
+          back to the session XML ("extra") state.
+        */
+
+       AudioClock::ModeChanged.connect (mem_fun (*this, &ARDOUR_UI::store_clock_modes));
+
        start_clocking ();
        start_blinking ();
 
@@ -154,6 +172,7 @@ ARDOUR_UI::unload_session ()
        editor->hide ();
        second_connection.disconnect ();
        point_one_second_connection.disconnect ();
+       point_oh_five_second_connection.disconnect ();
        point_zero_one_second_connection.disconnect();
 
        ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);
@@ -318,7 +337,7 @@ int
 ARDOUR_UI::create_route_params ()
 {
        if (route_params == 0) {
-               route_params = new RouteParams_UI (*engine);
+               route_params = new RouteParams_UI ();
                route_params->set_session (session);
                route_params->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleInspector")));
        }
@@ -345,36 +364,6 @@ ARDOUR_UI::toggle_route_params_window ()
        }
 }
 
-int
-ARDOUR_UI::create_sound_file_browser ()
-{
-       if (sfdb == 0) {
-               sfdb = new SoundFileBrowser (_("Sound File Browser"), session);
-               sfdb->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleSoundFileBrowser")));
-       }
-       return 0;
-}
-       
-void
-ARDOUR_UI::toggle_sound_file_browser ()
-{
-       if (create_sound_file_browser()) {
-               return;
-       }
-
-       RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleSoundFileBrowser"));
-       if (act) {
-               RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
-       
-               if (tact->get_active()) {
-                       sfdb->show_all();
-                       sfdb->present();
-               } else {
-                       sfdb->hide ();
-               }
-       }
-}
-
 void
 ARDOUR_UI::handle_locations_change (Location* ignored)
 {