22 : mSource{ source }, mBuffers{ buffers }, mSink{ sink }
35 assert(mBuffers.Remaining() >= mBuffers.BlockSize());
37 }
while (status == Status::More);
38 return status == Status::Done;
43 const auto blockSize = mBuffers.BlockSize();
44 assert(mBuffers.Remaining() >= blockSize);
48 std::optional<sampleCount> oldRemaining;
50 oldRemaining.emplace(mSource.Remaining());
54 if (
auto oCurBlockSize = mSource.Acquire(mBuffers, blockSize)) {
55 const auto curBlockSize = *oCurBlockSize;
58 const auto remaining = mSource.Remaining();
60 assert(!mSource.Terminates() || !oldRemaining ||
61 *oldRemaining == remaining);
62 oldRemaining.emplace(remaining);
64 assert(blockSize == 0 || remaining == 0 || curBlockSize > 0);
66 if (curBlockSize == 0)
71 assert(curBlockSize <= blockSize);
72 if (!mSink.Release(mBuffers, curBlockSize))
76 mBuffers.Advance(curBlockSize);
80 assert(mSource.Remaining() == 0 || curBlockSize > 0);
81 if (!mSource.Release())
85 assert(!mSource.Terminates() ||
86 mSource.Remaining() == remaining - curBlockSize);
90 if (!mSink.Acquire(mBuffers))
92 assert(mBuffers.Remaining() >= blockSize);
Accumulates (non-interleaved) data during effect processing.
Downstream receiver of sample streams, taking Buffers as external context.
virtual bool AcceptsBuffers(const Buffers &buffers) const =0
Upstream producer of sample streams, taking Buffers as external context.
virtual bool AcceptsBlockSize(size_t blockSize) const =0
virtual bool AcceptsBuffers(const Buffers &buffers) const =0
Task(Source &source, Buffers &buffers, Sink &sink)
bool RunLoop()
Do the complete copy.
Status RunOnce()
Do an increment of the copy.