Audacity 3.2.0
Namespaces | Typedefs | Functions
WaveChannelUtilities.h File Reference
#include <algorithm>
#include <functional>
#include <memory>
#include <utility>
#include <vector>
Include dependency graph for WaveChannelUtilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  WaveChannelUtilities
 

Typedefs

using WaveChannelUtilities::Clip = WaveClipChannel
 
using WaveChannelUtilities::ClipPointer = std::shared_ptr< Clip >
 
using WaveChannelUtilities::ClipPointers = std::vector< ClipPointer >
 
using WaveChannelUtilities::ClipConstPointer = std::shared_ptr< const Clip >
 
using WaveChannelUtilities::ClipConstPointers = std::vector< ClipConstPointer >
 

Functions

WAVE_TRACK_API bool WaveChannelUtilities::CompareClipsByPlayStartTime (const Clip &x, const Clip &y)
 
bool WaveChannelUtilities::CompareClipPointersByPlayStartTime (const ClipConstPointer x, const ClipConstPointer y)
 
bool WaveChannelUtilities::IsSortedByPlayStartTime (const ClipPointers &clips)
 
bool WaveChannelUtilities::IsSortedByPlayStartTime (const ClipConstPointers &clips)
 
WAVE_TRACK_API ClipPointers WaveChannelUtilities::SortedClipArray (WaveChannel &channel)
 Get clips sorted by play start time. More...
 
WAVE_TRACK_API ClipConstPointers WaveChannelUtilities::SortedClipArray (const WaveChannel &channel)
 Get clips sorted by play start time. More...
 
WAVE_TRACK_API ClipPointer WaveChannelUtilities::GetClipAtTime (WaveChannel &channel, double time)
 
WAVE_TRACK_API ClipConstPointer WaveChannelUtilities::GetClipAtTime (const WaveChannel &channel, double time)
 
WAVE_TRACK_API EnvelopeWaveChannelUtilities::GetEnvelopeAtTime (WaveChannel &channel, double time)
 
WAVE_TRACK_API std::pair< float, float > WaveChannelUtilities::GetMinMax (const WaveChannel &channel, double t0, double t1, bool mayThrow=true)
 
WAVE_TRACK_API float WaveChannelUtilities::GetRMS (const WaveChannel &channel, double t0, double t1, bool mayThrow=true)
 
WAVE_TRACK_API std::pair< size_t, size_t > WaveChannelUtilities::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. Reads nothing if GetClipAtTime(t) == nullptr. Useful to access samples across clip boundaries, as it spreads the read to adjacent clips, i.e., not separated by silence from clip at t. More...
 
WAVE_TRACK_API bool WaveChannelUtilities::GetFloatAtTime (const WaveChannel &channel, double t, float &value, bool mayThrow)
 
WAVE_TRACK_API bool WaveChannelUtilities::GetFloatAtTime (const Clip &clip, double t, float &value, bool mayThrow)
 
WAVE_TRACK_API void WaveChannelUtilities::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 the same rules as GetFloatsCenteredAroundTime. Leaves the other samples untouched. More...
 
WAVE_TRACK_API void WaveChannelUtilities::SetFloatAtTime (WaveChannel &channel, double t, float value, sampleFormat effectiveFormat)
 Sets sample nearest to t to value. Silently fails if GetClipAtTime(t) == nullptr. More...
 
WAVE_TRACK_API void WaveChannelUtilities::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 to closest sample to t1, exclusively. If the given interval is empty, i.e., t0 >= t1, no action is taken. More...
 
WAVE_TRACK_API size_t WaveChannelUtilities::GetFloatsFromTime (const WaveChannel &channel, double t, float *buffer, size_t numSamples, bool mayThrow, PlaybackDirection direction)
 Helper for GetFloatsCenteredAroundTime. If direction == PlaybackDirection::Backward, fetches samples to the left of t, excluding t, without reversing. More...
 
WAVE_TRACK_API void WaveChannelUtilities::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 rules as GetFloatsFromTime. Leaves the other samples untouched. More...
 
WAVE_TRACK_API void WaveChannelUtilities::SetFloatsFromTime (Clip &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 rules as GetFloatsFromTime. Leaves the other samples untouched. More...
 
WAVE_TRACK_API ClipConstPointer WaveChannelUtilities::GetAdjacentClip (const ClipConstPointers &clips, const Clip &clip, PlaybackDirection searchDirection)
 Similar to GetNextClip, but returns nullptr if the neighbour clip is not adjacent. More...
 
WAVE_TRACK_API ClipPointer WaveChannelUtilities::GetAdjacentClip (const ClipPointers &clips, const Clip &clip, PlaybackDirection searchDirection)
 
WAVE_TRACK_API ClipConstPointer WaveChannelUtilities::GetNextClip (const ClipConstPointers &clips, const Clip &clip, PlaybackDirection searchDirection)
 Returns clips next to clip in the given direction, or nullptr if there is none. More...
 
WAVE_TRACK_API ClipPointer WaveChannelUtilities::GetNextClip (const ClipPointers &clips, const Clip &clip, PlaybackDirection searchDirection)
 
WAVE_TRACK_API ClipPointer WaveChannelUtilities::GetIntervalAtTime (WaveChannel &channel, double t)