Remove unused header include
[ardour.git] / gtk2_ardour / ardour_ui_dialogs.cc
index 8c1c81167415fa5149d65ac51ba04524bb6b92e7..7fc50df673aaf582020619112a702b98f284f619 100644 (file)
@@ -35,6 +35,7 @@
 #include "gui_thread.h"
 #include "keyeditor.h"
 #include "location_ui.h"
+#include "main_clock.h"
 #include "midi_tracer.h"
 #include "mixer_ui.h"
 #include "public_editor.h"
@@ -64,11 +65,15 @@ ARDOUR_UI::set_session (Session *s)
                return;
        }
 
-       const XMLNodeList& children = _session->extra_xml (X_("UI"))->children();
-       for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
-               if ((*i)->name() == GUIObjectState::xml_node_name) {
-                       gui_object_state->load (**i);
-                       break;
+       const XMLNode* node = _session->extra_xml (X_("UI"));
+
+       if (node) {
+               const XMLNodeList& children = node->children();
+               for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
+                       if ((*i)->name() == GUIObjectState::xml_node_name) {
+                               gui_object_state->load (**i);
+                               break;
+                       }
                }
        }
 
@@ -105,8 +110,6 @@ ARDOUR_UI::set_session (Session *s)
        primary_clock->set_session (s);
        secondary_clock->set_session (s);
        big_clock->set_session (s);
-       preroll_clock->set_session (s);
-       postroll_clock->set_session (s);
        time_info_box->set_session (s);
 
        /* sensitize menu bar options that are now valid */
@@ -152,21 +155,22 @@ ARDOUR_UI::set_session (Session *s)
        Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::solo_blink));
        Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::sync_blink));
        Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::audition_blink));
+       Blink.connect (sigc::mem_fun(*this, &ARDOUR_UI::feedback_blink));
 
        _session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context());
        _session->StepEditStatusChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::step_edit_status_change, this, _1), gui_context());
        _session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context());
        _session->DirtyChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_autosave, this), gui_context());
 
-       _session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
-       _session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
-       _session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context());
-       _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
-       _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
-       _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
+       _session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
+       _session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
+       _session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context());
+       _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
+       _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
+       _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
 
 #ifdef HAVE_JACK_SESSION
-       engine->JackSessionEvent.connect (*_session, MISSING_INVALIDATOR, ui_bind (&Session::jack_session_event, _session, _1), gui_context());
+       engine->JackSessionEvent.connect (*_session, MISSING_INVALIDATOR, boost::bind (&Session::jack_session_event, _session, _1), gui_context());
 #endif
 
        /* Clocks are on by default after we are connected to a session, so show that here.
@@ -237,6 +241,9 @@ ARDOUR_UI::unload_session (bool hide_stuff)
        Blink.clear ();
 
        delete _session;
+       _session = 0;
+
+       session_loaded = false;
 
        update_buffer_load ();