diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-10 02:23:12 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-10 02:23:12 +0000 |
commit | 7f64e5ac4cec85859aa162fcdad0cc91cb015561 (patch) | |
tree | 2da263177b2d5386fcf234fb20884bcaa755501a /libs/ardour/session.cc | |
parent | 1e7bcd8b0fd451117e241bf49660684314b5757f (diff) |
merge changes for 2.0.1/2.0.2, plus some fixes to issues made apparent by conflicts
git-svn-id: svn://localhost/ardour2/branches/midi@1812 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ff549f9896..d29795904e 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -913,6 +913,7 @@ Session::hookup_io () if (_control_out) { uint32_t n; + vector<string> cports; while (_control_out->n_inputs().get(DataType::AUDIO) < _control_out->input_maximum().get(DataType::AUDIO)) { if (_control_out->add_input_port ("", this)) { @@ -930,7 +931,20 @@ Session::hookup_io () } n++; } - } + + + uint32_t ni = _control_out->n_inputs().get (DataType::AUDIO); + + for (n = 0; n < ni; ++n) { + cports.push_back (_control_out->input(n)->name()); + } + + boost::shared_ptr<RouteList> r = routes.reader (); + + for (RouteList::iterator x = r->begin(); x != r->end(); ++x) { + (*x)->set_control_outs (cports); + } + } /* Tell all IO objects to connect themselves together */ @@ -1793,19 +1807,6 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod channels_used += track->n_inputs ().get(DataType::AUDIO); - if (_control_out) { - vector<string> cports; - uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO); - - for (n = 0; n < ni; ++n) { - cports.push_back (_control_out->input(n)->name()); - } - - track->set_control_outs (cports); - } - - // assert (current_thread != RT_thread) - track->audio_diskstream()->non_realtime_input_change(); track->DiskstreamChanged.connect (mem_fun (this, &Session::resort_routes)); @@ -1968,16 +1969,6 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_ } } - if (_control_out) { - vector<string> cports; - uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO); - - for (uint32_t n = 0; n < ni; ++n) { - cports.push_back (_control_out->input(n)->name()); - } - bus->set_control_outs (cports); - } - bus->set_remote_control_id (control_id); ++control_id; @@ -2034,9 +2025,23 @@ Session::add_routes (RouteList& new_routes, bool save) if ((*x)->control()) { _control_out = (*x); - } + } } + if (_control_out && IO::connecting_legal) { + + vector<string> cports; + uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO); + + for (uint32_t n = 0; n < ni; ++n) { + cports.push_back (_control_out->input(n)->name()); + } + + for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) { + (*x)->set_control_outs (cports); + } + } + set_dirty(); if (save) { |