mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
triggerbox: better implementation of mono/stereo/nchannels mapping fix
This commit is contained in:
parent
c2004772c4
commit
187ef1c214
1 changed files with 6 additions and 3 deletions
|
|
@ -823,13 +823,16 @@ AudioTrigger::run (BufferSet& bufs, pframes_t nframes, pframes_t dest_offset, bo
|
||||||
assert (ar);
|
assert (ar);
|
||||||
assert (active());
|
assert (active());
|
||||||
|
|
||||||
const size_t chns = std::max (bufs.count().n_audio(), ar->n_channels());
|
|
||||||
|
|
||||||
while (nframes) {
|
while (nframes) {
|
||||||
|
|
||||||
pframes_t this_read = (pframes_t) std::min ((samplecnt_t) nframes, (last_sample - read_index));
|
pframes_t this_read = (pframes_t) std::min ((samplecnt_t) nframes, (last_sample - read_index));
|
||||||
|
|
||||||
for (uint64_t chn = 0; chn < chns; ++chn) {
|
/* Fill all buffers (so mono region will fill all channels),
|
||||||
|
* and discard extra channels. This models what we do in the
|
||||||
|
* timeline.
|
||||||
|
*/
|
||||||
|
|
||||||
|
for (uint64_t chn = 0; chn < bufs.count().n_audio(); ++chn) {
|
||||||
|
|
||||||
uint64_t channel = chn % data.size();
|
uint64_t channel = chn % data.size();
|
||||||
Sample* src = data[channel] + read_index;
|
Sample* src = data[channel] + read_index;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue