14#ifndef __AUDACITY_MIXER_SOURCE__
15#define __AUDACITY_MIXER_SOURCE__
40 bool mayThrow, std::shared_ptr<TimesAndSpeed> pTimesAndSpeed,
50 const bool *
MixerSpec(
unsigned iChannel)
const;
54 std::optional<size_t>
Acquire(
Buffers &data,
size_t bound)
override;
81 size_t MixSameRate(
unsigned iChannel,
size_t maxOut,
float &floatBuffer);
87 unsigned iChannel,
size_t maxOut,
float &floatBuffer);
92 void ZeroFill(
size_t produced,
size_t max,
float &floatBuffer);
94 const std::shared_ptr<const SampleTrack>
mpLeader;
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
const ResampleParameters mResampleParameters
size_t MixVariableRates(unsigned iChannel, size_t maxOut, float &floatBuffer)
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.
sampleCount Remaining() const override
Result includes any amount Acquired and not yet Released.
MixerSource & operator=(MixerSource &&)=delete
MixerSource(const SampleTrack &leader, size_t bufferSize, double rate, const MixerOptions::Warp &options, bool highQuality, bool mayThrow, std::shared_ptr< TimesAndSpeed > pTimesAndSpeed, const ArrayOf< bool > *pMap)
const SampleTrack * GetChannel(unsigned iChannel) const
static constexpr size_t sQueueMaxLen
bool AcceptsBlockSize(size_t blockSize) const override
std::vector< sampleCount > mSamplePos
Fetch position for source.
std::vector< SampleTrackCache > mInputTrack
SampleTrackCaches are the source of data.
bool AcceptsBuffers(const Buffers &buffers) const override
static constexpr size_t sProcessLen
bool Terminates() const override
const ArrayOf< bool > *const mpMap
bool VariableRates() const
bool Release() override
Caller is done examining last Acquire()d positions.
std::vector< std::unique_ptr< Resample > > mResample
std::vector< int > mQueueLen
For each queue, the number of available samples after the queue start.
std::vector< int > mQueueStart
Position in each queue of the start of the next block to resample.
MixerSource(MixerSource &&)=default
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)
const bool * MixerSpec(unsigned iChannel) const
std::optional< size_t > Acquire(Buffers &data, size_t bound) override
Occupy vacant space in Buffers with some data.
size_t MixSameRate(unsigned iChannel, size_t maxOut, float &floatBuffer)
const std::shared_ptr< const SampleTrack > mpLeader
A short-lived object, during whose lifetime, the contents of the WaveTrack are assumed not to change.
Positions or offsets within audio files need a wide type.
Immutable structure is an argument to Mixer's constructor.