13#ifndef __AUDACITY_WAVE_CHANNEL_UTILITIES__
14#define __AUDACITY_WAVE_CHANNEL_UTILITIES__
82 double t0,
double t1,
bool mayThrow =
true);
88 double t0,
double t1,
bool mayThrow =
true);
100WAVE_TRACK_API std::pair<size_t, size_t>
102 double t,
float* buffer,
size_t numSideSamples,
109 double t,
float& value,
bool mayThrow);
115 double t,
float& value,
bool mayThrow);
124 double t,
const float* buffer,
size_t numSideSamples,
142 double t0,
double t1,
143 const std::function<
float(
double sampleTime)>& producer,
154 double t,
float* buffer,
size_t numSamples,
163 double t,
const float* buffer,
size_t numSamples,
171 double t,
const float* buffer,
size_t numSamples,
Piecewise linear or piecewise exponential function from double to double.
bool CompareClipPointersByPlayStartTime(const ClipConstPointer x, const ClipConstPointer y)
WAVE_TRACK_API void SetFloatsCenteredAroundTime(WaveChannel &channel, double t, const float *buffer, size_t numSideSamples, sampleFormat effectiveFormat)
Similar to GetFloatsCenteredAroundTime, but for writing. Sets as many samples as it can according to ...
std::vector< ClipPointer > ClipPointers
WAVE_TRACK_API std::pair< float, float > GetMinMax(const WaveChannel &channel, double t0, double t1, bool mayThrow=true)
bool IsSortedByPlayStartTime(const ClipPointers &clips)
WAVE_TRACK_API ClipPointer GetIntervalAtTime(WaveChannel &channel, double t)
std::shared_ptr< const Clip > ClipConstPointer
std::vector< ClipConstPointer > ClipConstPointers
WAVE_TRACK_API bool CompareClipsByPlayStartTime(const Clip &x, const Clip &y)
WAVE_TRACK_API void SetFloatsWithinTimeRange(WaveChannel &channel, double t0, double t1, const std::function< float(double sampleTime)> &producer, sampleFormat effectiveFormat)
Provides a means of setting clip values as a function of time. Included are closest sample to t0 up t...
WAVE_TRACK_API float GetRMS(const WaveChannel &channel, double t0, double t1, bool mayThrow=true)
std::shared_ptr< Clip > ClipPointer
WAVE_TRACK_API std::pair< size_t, size_t > GetFloatsCenteredAroundTime(const WaveChannel &channel, double t, float *buffer, size_t numSideSamples, bool mayThrow)
Gets as many samples as it can, but no more than 2 * numSideSamples + 1, centered around t....
WAVE_TRACK_API void SetFloatsFromTime(WaveChannel &channel, double t, const float *buffer, size_t numSamples, sampleFormat effectiveFormat, PlaybackDirection direction)
Similar to GetFloatsFromTime, but for writing. Sets as many samples as it can according to the same r...
WAVE_TRACK_API size_t GetFloatsFromTime(const WaveChannel &channel, double t, float *buffer, size_t numSamples, bool mayThrow, PlaybackDirection direction)
Helper for GetFloatsCenteredAroundTime. If direction == PlaybackDirection::Backward,...
WAVE_TRACK_API ClipPointer GetClipAtTime(WaveChannel &channel, double time)
WAVE_TRACK_API ClipConstPointer GetAdjacentClip(const ClipConstPointers &clips, const Clip &clip, PlaybackDirection searchDirection)
Similar to GetNextClip, but returns nullptr if the neighbour clip is not adjacent.
WAVE_TRACK_API bool GetFloatAtTime(const WaveChannel &channel, double t, float &value, bool mayThrow)
WAVE_TRACK_API Envelope * GetEnvelopeAtTime(WaveChannel &channel, double time)
WAVE_TRACK_API void SetFloatAtTime(WaveChannel &channel, double t, float value, sampleFormat effectiveFormat)
Sets sample nearest to t to value. Silently fails if GetClipAtTime(t) == nullptr.
WAVE_TRACK_API ClipPointers SortedClipArray(WaveChannel &channel)
Get clips sorted by play start time.
WAVE_TRACK_API ClipConstPointer GetNextClip(const ClipConstPointers &clips, const Clip &clip, PlaybackDirection searchDirection)
Returns clips next to clip in the given direction, or nullptr if there is none.