summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-16 12:08:19 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-16 12:08:19 -0400
commit39ee88b3f9e73421690230cfd7e11aee9be8b7ec (patch)
treedc4b3d6e228ffe4cb748982f171a95b2e1b35683 /libs/ardour/session_state.cc
parented61a9ebbde06f5bf2e8e09caea496cc1eca2022 (diff)
more session construction order changes, and removal of n_physical_{inputs,outputs} members which were (a) not initialized early enough (b) not used anywhere except monitor bus connection.
Things almost make sense now.
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc46
1 files changed, 41 insertions, 5 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 99fa3f4a3b..c33fd91b5d 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -210,9 +210,6 @@ Session::post_engine_init ()
set_block_size (_engine.samples_per_cycle());
set_frame_rate (_engine.sample_rate());
- n_physical_outputs = _engine.n_physical_outputs ();
- n_physical_inputs = _engine.n_physical_inputs ();
-
BootMessage (_("Using configuration"));
_midi_ports = new MidiPortManager;
@@ -273,8 +270,47 @@ Session::post_engine_init ()
Config->map_parameters (ff);
config.map_parameters (ft);
- when_engine_running ();
-
+ /* Reset all panners */
+
+ Delivery::reset_panners ();
+
+ /* this will cause the CPM to instantiate any protocols that are in use
+ * (or mandatory), which will pass it this Session, and then call
+ * set_state() on each instantiated protocol to match stored state.
+ */
+
+ ControlProtocolManager::instance().set_session (this);
+
+ /* This must be done after the ControlProtocolManager set_session above,
+ as it will set states for ports which the ControlProtocolManager creates.
+ */
+
+ // XXX set state of MIDI::Port's
+ // MidiPortManager::instance()->set_port_states (Config->midi_port_states ());
+
+ /* And this must be done after the MIDI::Manager::set_port_states as
+ * it will try to make connections whose details are loaded by set_port_states.
+ */
+
+ hookup_io ();
+
+ /* Let control protocols know that we are now all connected, so they
+ * could start talking to surfaces if they want to.
+ */
+
+ ControlProtocolManager::instance().midi_connectivity_established ();
+
+ if (_is_new && !no_auto_connect()) {
+ Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock());
+ auto_connect_master_bus ();
+ }
+
+ _state_of_the_state = StateOfTheState (_state_of_the_state & ~(CannotSave|Dirty));
+
+ /* update latencies */
+
+ initialize_latencies ();
+
_locations->changed.connect_same_thread (*this, boost::bind (&Session::locations_changed, this));
_locations->added.connect_same_thread (*this, boost::bind (&Session::locations_added, this, _1));