21 float** offsetBuffer,
float*
const* buffer,
size_t numChannels,
24 for (
auto i = 0u; i < numChannels; ++i)
25 offsetBuffer[i] = buffer[i] + offset;
31 std::unique_ptr<AudioSegmentFactoryInterface>
factory)
32 : mSequence { sequence }
47 float*
const buffers[],
size_t numChannels,
size_t numSamples)
51 auto numProcessedSamples = 0u;
52 while (numProcessedSamples < numSamples &&
58 float* offsetBuffers[2] {};
61 numProcessedSamples += segment->GetFloats(
63 numSamples - numProcessedSamples);
69 const auto remaining = numSamples - numProcessedSamples;
74 float* offsetBuffers[2] {};
78 std::fill(offsetBuffers[i], offsetBuffers[i] + remaining, 0.f);
147 double* buffer,
size_t bufferLen,
double t0,
bool backwards)
const
158 float* buffers[],
sampleCount start,
size_t len,
bool backwards)
const
160 std::vector<samplePtr> charBuffers;
162 charBuffers.reserve(nChannels);
163 for (
auto i = 0u; i < nChannels; ++i)
164 charBuffers.push_back(
reinterpret_cast<samplePtr>(buffers[i]));
186 return GetNext(
reinterpret_cast<float* const*
>(buffers), nBuffers, len);
193 return std::make_shared<StretchingSequence>(
195 std::make_unique<AudioSegmentFactory>(
std::vector< std::shared_ptr< const ClipInterface > > ClipConstHolders
AudioSegments mAudioSegments
StretchingSequence(const PlayableSequence &, int sampleRate, size_t numChannels, std::unique_ptr< AudioSegmentFactoryInterface >)
const PlayableSequence & mSequence
AudioGraph::ChannelType GetChannelType() const override
Classify this channel.
void GetEnvelopeValues(double *buffer, size_t bufferLen, double t0, bool backwards) const override
bool GetFloats(float *buffers[], sampleCount start, size_t len, bool backwards) const
const std::unique_ptr< AudioSegmentFactoryInterface > mAudioSegmentFactory
bool MutableGet(size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backwards)
double GetRate() const override
bool GetMute() const override
May vary asynchronously.
static std::shared_ptr< StretchingSequence > Create(const PlayableSequence &, const ClipConstHolders &clips)
size_t NChannels() const override
A constant property.
double GetStartTime() const override
const ChannelGroup * FindChannelGroup() const override
Find associated ChannelGroup if any.
PlaybackDirection mPlaybackDirection
bool GetNext(float *const buffers[], size_t numChannels, size_t numSamples)
bool DoGet(size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backwards, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const override
std::optional< sampleCount > mExpectedStart
AudioSegments::const_iterator mActiveAudioSegmentIt
sampleFormat WidestEffectiveFormat() const override
bool GetSolo() const override
May vary asynchronously.
float GetChannelVolume(int channel) const override
double GetEndTime() const override
bool HasTrivialEnvelope() const override
void ResetCursor(double t, PlaybackDirection)
sampleCount TimeToLongSamples(double t0) const
virtual bool HasTrivialEnvelope() const =0
virtual double GetStartTime() const =0
virtual void GetEnvelopeValues(double *buffer, size_t bufferLen, double t0, bool backwards) const =0
virtual sampleFormat WidestEffectiveFormat() const =0
virtual double GetEndTime() const =0
virtual float GetChannelVolume(int channel) const =0
virtual size_t NChannels() const =0
A constant property.
virtual double GetRate() const =0
Positions or offsets within audio files need a wide type.
ChannelType
Mutually exclusive channel classifications.
constexpr auto sampleRate
void GetOffsetBuffer(float **offsetBuffer, float *const *buffer, size_t numChannels, size_t offset)
virtual ChannelType GetChannelType() const =0
Classify this channel.
virtual const ChannelGroup * FindChannelGroup() const =0
Find associated ChannelGroup if any.
virtual bool GetSolo() const =0
May vary asynchronously.
virtual bool GetMute() const =0
May vary asynchronously.