leftmost_position => leftmost_sample, current_page_frames => current_page_samples
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index 0116f4e842d65cda93e01301892cc6c296db7604..256a1a593e44b41f947a4f365747d416353bf2a0 100644 (file)
@@ -62,6 +62,13 @@ ARDOUR_UI::set_session (Session *s)
 {
        SessionHandlePtr::set_session (s);
 
+       for (ARDOUR::DataType::iterator i = ARDOUR::DataType::begin(); i != ARDOUR::DataType::end(); ++i) {
+               GlobalPortMatrixWindow* w;
+               if ((w = _global_port_matrix[*i]->get()) != 0) {
+                       w->set_session (s);
+               }
+       }
+
        if (!_session) {
                return;
        }
@@ -114,6 +121,7 @@ ARDOUR_UI::set_session (Session *s)
        secondary_clock->set_session (s);
        big_clock->set_session (s);
        time_info_box->set_session (s);
+       video_timeline->set_session (s);
 
        /* sensitize menu bar options that are now valid */
 
@@ -205,6 +213,10 @@ ARDOUR_UI::set_session (Session *s)
 int
 ARDOUR_UI::unload_session (bool hide_stuff)
 {
+       if (_session) {
+               ARDOUR_UI::instance()->video_timeline->sync_session_state();
+       }
+
        if (_session && _session->dirty()) {
                std::vector<std::string> actions;
                actions.push_back (_("Don't close"));
@@ -236,6 +248,8 @@ ARDOUR_UI::unload_session (bool hide_stuff)
 
        rec_button.set_sensitive (false);
 
+       ARDOUR_UI::instance()->video_timeline->close_session();
+
        stop_blinking ();
        stop_clocking ();