summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-09-16 22:11:06 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-09-16 22:11:06 -0400
commitfb45fdc052b23f4b2210c71a03a14bdb5986098a (patch)
treeb61c6331bc7699669834600c09dcf1dc3dccd109 /libs/ardour/session_state.cc
parent0da34e65e3470b1c2298ddf571df6356d0d42bd8 (diff)
parentc8b32e2f8bed225b8f5ceac130eea6632f595492 (diff)
fix conflicts and merge with master
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc53
1 files changed, 41 insertions, 12 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 2d91bdd4c2..1a605d2fd5 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -211,16 +211,6 @@ Session::post_engine_init ()
set_block_size (_engine.samples_per_cycle());
set_frame_rate (_engine.sample_rate());
- if (how_many_dsp_threads () > 1) {
- /* For now, only create the graph if we are using >1 DSP threads, as
- it is a bit slower than the old code with 1 thread.
- */
- _process_graph.reset (new Graph (*this));
- }
-
- n_physical_outputs = _engine.n_physical_outputs ();
- n_physical_inputs = _engine.n_physical_inputs ();
-
BootMessage (_("Using configuration"));
_midi_ports = new MidiPortManager;
@@ -281,8 +271,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));