14#ifndef __AUDACITY_MIXER_SOURCE__
15#define __AUDACITY_MIXER_SOURCE__
41 MixerSource(
const std::shared_ptr<const WideSampleSequence> &seq,
44 bool mayThrow, std::shared_ptr<TimesAndSpeed> pTimesAndSpeed
54 std::optional<size_t>
Acquire(
Buffers &data,
size_t bound)
override;
82 size_t MixSameRate(
unsigned nChannels,
size_t maxOut,
float *floatBuffers[]);
89 unsigned nChannels,
size_t maxOut,
float *floatBuffers[]);
94 void ZeroFill(
size_t produced,
size_t max,
float &floatBuffer);
96 const std::shared_ptr<const WideSampleSequence>
mpSeq;
Upstream producer of sample streams, taking Buffers as external context.
AudioGraph::Buffers Buffers
std::vector< double > mEnvValues
Gain envelopes are applied to input before other transformations.
unsigned Channels() const
int mQueueStart
Position of the start of the next block to resample.
int mQueueLen
The number of available samples after the queue start.
const ResampleParameters mResampleParameters
const BoundedEnvelope *const mEnvelope
Resampling, as needed, after gain envelope.
const std::shared_ptr< TimesAndSpeed > mTimesAndSpeed
std::vector< std::vector< float > > mSampleQueue
First intermediate buffer when resampling is needed.
MixerSource(const std::shared_ptr< const WideSampleSequence > &seq, size_t bufferSize, double rate, const MixerOptions::Warp &options, bool highQuality, bool mayThrow, std::shared_ptr< TimesAndSpeed > pTimesAndSpeed)
const std::shared_ptr< const WideSampleSequence > mpSeq
sampleCount Remaining() const override
Result includes any amount Acquired and not yet Released.
size_t MixSameRate(unsigned nChannels, size_t maxOut, float *floatBuffers[])
static constexpr size_t sQueueMaxLen
bool AcceptsBlockSize(size_t blockSize) const override
bool AcceptsBuffers(const Buffers &buffers) const override
size_t MixVariableRates(unsigned nChannels, size_t maxOut, float *floatBuffers[])
static constexpr size_t sProcessLen
bool Terminates() const override
bool VariableRates() const
bool Release() override
Caller is done examining last Acquire()d positions.
std::vector< std::unique_ptr< Resample > > mResample
void Reposition(double time, bool skipping)
unsigned mMaxChannels
Remember how many channels were passed to Acquire()
void ZeroFill(size_t produced, size_t max, float &floatBuffer)
MixerSource(MixerSource &&) noexcept=default
std::optional< size_t > Acquire(Buffers &data, size_t bound) override
Occupy vacant space in Buffers with some data.
sampleCount mSamplePos
Fetch position for source.
const WideSampleSequence & GetSequence() const
Positions or offsets within audio files need a wide type.
Immutable structure is an argument to Mixer's constructor.