16 double t,
size_t iChannel,
float& value,
bool mayThrow)
27 double t,
size_t iChannel,
const float* buffer,
size_t numFloats,
31 const auto maybeOutOfBoundEnd = maybeNegativeStart + numFloats;
32 const auto effectiveStart = std::max(
sampleCount { 0 }, maybeNegativeStart);
33 const auto effectiveEnd =
35 if (effectiveStart >= effectiveEnd)
38 const auto effectiveLen = (effectiveEnd - effectiveStart).as_size_t();
40 const auto numLeadingZeros =
41 (effectiveStart - maybeNegativeStart).as_size_t();
42 const auto offsetBuffer =
43 reinterpret_cast<const char*
>(buffer + numLeadingZeros);
58 return fabs(startNext - endThis) < 0.5;
This allows multiple clips to be a part of one WaveTrack.
bool WithinPlayRegion(double t) const
t ∈ [...)
double GetStretchRatio() const override
sampleCount TimeToSamples(double time) const override
sampleCount GetVisibleSampleCount() const override
double GetPlayStartTime() const noexcept override
int GetRate() const override
void SetSamples(size_t ii, constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len, sampleFormat effectiveFormat)
bool GetSamples(size_t ii, samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool mayThrow=true) const
Get samples from one channel.
Positions or offsets within audio files need a wide type.
WAVE_TRACK_API void SetFloatsFromTime(WaveClip &clip, double t, size_t iChannel, const float *buffer, size_t numSamples, sampleFormat effectiveFormat)
Considers buffer as audio starting at TimeToSamples(t) (relative to clip play start time) and with eq...
WAVE_TRACK_API bool SharesBoundaryWithNextClip(const WaveTrack::Interval &prev, const WaveTrack::Interval &next)
used by commands which interact with clips using the keyboard
WAVE_TRACK_API bool GetFloatAtTime(const WaveClip &clip, double t, size_t iChannel, float &value, bool mayThrow)