diff options
author | Robin Gareus <robin@gareus.org> | 2017-07-19 22:05:32 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-07-19 22:15:22 +0200 |
commit | 9992ea10b35caacc2f061cd176d0dc3910eb7453 (patch) | |
tree | 71eecc5d4b97940b478857938d0e14602f9a311f /libs/ardour/export_channel.cc | |
parent | 1438086c6cdad872c138a84022dbd6d850ab424f (diff) |
Allow listening to channels being exported (w/ realtime export)
It would be nice to change get_audio_buffer() to not set
AudioBuffer::_written to false (all but one other user of this API also
only get read-only data), but that requires chaning the rationale of the
underlying ::set_data() API.
Diffstat (limited to 'libs/ardour/export_channel.cc')
-rw-r--r-- | libs/ardour/export_channel.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/export_channel.cc b/libs/ardour/export_channel.cc index 77fa80a9f6..5435d63c52 100644 --- a/libs/ardour/export_channel.cc +++ b/libs/ardour/export_channel.cc @@ -63,7 +63,9 @@ PortExportChannel::read (Sample const *& data, framecnt_t frames) const if (ports.size() == 1) { boost::shared_ptr<AudioPort> p = ports.begin()->lock (); - data = p->get_audio_buffer(frames).data(); + AudioBuffer& ab (p->get_audio_buffer(frames)); // unsets AudioBuffer::_written + data = ab.data(); + ab.set_written (true); return; } @@ -72,7 +74,9 @@ PortExportChannel::read (Sample const *& data, framecnt_t frames) const for (PortSet::const_iterator it = ports.begin(); it != ports.end(); ++it) { boost::shared_ptr<AudioPort> p = it->lock (); if (p) { - Sample* port_buffer = p->get_audio_buffer(frames).data(); + AudioBuffer& ab (p->get_audio_buffer(frames)); // unsets AudioBuffer::_written + Sample* port_buffer = ab.data(); + ab.set_written (true); for (uint32_t i = 0; i < frames; ++i) { buffer[i] += (float) port_buffer[i]; |