40 , mPlaybackDirection { direction }
45 float*
const* buffers,
size_t samplesPerChannel)
48 const auto remainingSamplesInClip =
51 const auto numSamplesToRead =
53 if (numSamplesToRead > 0u)
55 constexpr auto mayThrow =
false;
60 for (
auto i = 0u; i < nChannels; ++i)
65 channelView.
Copy(buffers[i], samplesPerChannel);
66 newViews.push_back(std::move(channelView));
86 std::fill(buffers[i], buffers[i] + samplesPerChannel, 0.f);
std::vector< AudioSegmentSampleView > ChannelSampleViews
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
void Copy(float *buffer, size_t bufferSize) const
Copies up to GetSampleCount() or bufferSize samples, whichever is less, into buffer....
virtual size_t NChannels() const =0
virtual AudioSegmentSampleView GetSampleView(size_t iChannel, sampleCount start, size_t length, bool mayThrow=true) const =0
ChannelSampleViews mChannelSampleViews
const PlaybackDirection mPlaybackDirection
ClipTimeAndPitchSource(const ClipInterface &, double durationToDiscard, PlaybackDirection)
const ClipInterface & mClip
void Pull(float *const *, size_t samplesPerChannel) override
sampleCount mLastReadSample
virtual int GetRate() const =0
virtual double GetStretchRatio() const =0
virtual sampleCount GetVisibleSampleCount() const =0
Positions or offsets within audio files need a wide type.
sampleCount GetLastReadSample(const ClipInterface &clip, double durationToDiscard, PlaybackDirection direction)