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
This commit is contained in:
Paul Davis
2007-05-10 02:23:12 +00:00
parent 1e7bcd8b0f
commit 7f64e5ac4c
8 changed files with 109 additions and 43 deletions

View File

@@ -120,6 +120,7 @@ public:
iterator& operator++() { ++_index; return *this; } // yes, prefix only
bool operator==(const iterator& other) { return (_index == other._index); }
bool operator!=(const iterator& other) { return (_index != other._index); }
iterator operator=(const iterator& other) { _set = other._set; _type = other._type; _index = other._index; return *this; }
private:
friend class BufferSet;

View File

@@ -255,19 +255,31 @@ IO::deliver_output (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame,
// Use the panner to distribute audio to output port buffers
if (_panner && !_panner->empty() && !_panner->bypassed()) {
_panner->distribute(bufs, output_buffers(), start_frame, end_frame, nframes, offset);
_panner->distribute (bufs, output_buffers(), start_frame, end_frame, nframes, offset);
} else {
const DataType type = DataType::AUDIO;
// Copy any audio 1:1 to outputs
assert(bufs.count().get(DataType::AUDIO) == output_buffers().count().get(DataType::AUDIO));
BufferSet::iterator o = output_buffers().begin(type);
for (BufferSet::iterator i = bufs.begin(type); i != bufs.end(type); ++i, ++o) {
BufferSet::iterator i = bufs.begin(type);
BufferSet::iterator prev = i;
while (i != bufs.end(type) && o != output_buffers().end (type)) {
o->read_from(*i, nframes, offset);
prev = i;
++i;
++o;
}
/* extra outputs get a copy of the last buffer */
while (o != output_buffers().end(type)) {
o->read_from(*prev, nframes, offset);
++o;
}
}
/* ********** MIDI ********** */
// No MIDI, we're done here

View File

@@ -431,7 +431,6 @@ Route::process_output_buffers (BufferSet& bufs,
} else {
co->deliver_output (bufs, start_frame, end_frame, nframes, offset);
}
}
@@ -588,7 +587,7 @@ Route::process_output_buffers (BufferSet& bufs,
(no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording()))
) {
co->silence (nframes, offset);
} else {
@@ -645,7 +644,7 @@ Route::process_output_buffers (BufferSet& bufs,
if (_meter_point == MeterPostFader) {
peak_meter().reset();
}
IO::silence (nframes, offset);
} else {
@@ -1763,11 +1762,17 @@ Route::set_control_outs (const vector<string>& ports)
{
Glib::Mutex::Lock lm (control_outs_lock);
vector<string>::const_iterator i;
size_t limit;
if (_control_outs) {
delete _control_outs;
_control_outs = 0;
}
if (control() || master()) {
/* no control outs for these two special busses */
return 0;
}
if (ports.empty()) {
return 0;
@@ -1781,8 +1786,23 @@ Route::set_control_outs (const vector<string>& ports)
/* our control outs need as many outputs as we
have audio outputs. we track the changes in ::output_change_handler().
*/
// XXX its stupid that we have to get this value twice
_control_outs->ensure_io (ChanCount::ZERO, ChanCount(DataType::AUDIO, n_outputs().get(DataType::AUDIO)), true, this);
limit = n_outputs().get(DataType::AUDIO);
if (_control_outs->ensure_io (ChanCount::ZERO, ChanCount (DataType::AUDIO, n_outputs().get (DataType::AUDIO)), true, this)) {
return -1;
}
/* now connect to the named ports */
for (size_t n = 0; n < limit; ++n) {
if (_control_outs->connect_output (_control_outs->output (n), ports[n], this)) {
error << string_compose (_("could not connect %1 to %2"), _control_outs->output(n)->name(), ports[n]) << endmsg;
return -1;
}
}
return 0;
}

View File

@@ -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) {