Audacity 3.2.0
|
Typedefs | |
using | Clip = WaveClipChannel |
using | ClipPointer = std::shared_ptr< Clip > |
using | ClipPointers = std::vector< ClipPointer > |
using | ClipConstPointer = std::shared_ptr< const Clip > |
using | ClipConstPointers = std::vector< ClipConstPointer > |
Functions | |
WAVE_TRACK_API bool | CompareClipsByPlayStartTime (const Clip &x, const Clip &y) |
bool | CompareClipPointersByPlayStartTime (const ClipConstPointer x, const ClipConstPointer y) |
bool | IsSortedByPlayStartTime (const ClipPointers &clips) |
bool | IsSortedByPlayStartTime (const ClipConstPointers &clips) |
WAVE_TRACK_API ClipPointers | SortedClipArray (WaveChannel &channel) |
Get clips sorted by play start time. More... | |
WAVE_TRACK_API ClipConstPointers | SortedClipArray (const WaveChannel &channel) |
Get clips sorted by play start time. More... | |
WAVE_TRACK_API ClipPointer | GetClipAtTime (WaveChannel &channel, double time) |
WAVE_TRACK_API ClipConstPointer | GetClipAtTime (const WaveChannel &channel, double time) |
WAVE_TRACK_API Envelope * | GetEnvelopeAtTime (WaveChannel &channel, double time) |
WAVE_TRACK_API std::pair< float, float > | GetMinMax (const WaveChannel &channel, double t0, double t1, bool mayThrow=true) |
WAVE_TRACK_API float | GetRMS (const WaveChannel &channel, double t0, double t1, bool mayThrow=true) |
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 . 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 | GetFloatAtTime (const WaveChannel &channel, double t, float &value, bool mayThrow) |
WAVE_TRACK_API bool | GetFloatAtTime (const Clip &clip, double t, float &value, bool mayThrow) |
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 the same rules as GetFloatsCenteredAroundTime. Leaves the other samples untouched. More... | |
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 . More... | |
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 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 | 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 | 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 | 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 | 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 | GetAdjacentClip (const ClipPointers &clips, const Clip &clip, PlaybackDirection searchDirection) |
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. More... | |
WAVE_TRACK_API ClipPointer | GetNextClip (const ClipPointers &clips, const Clip &clip, PlaybackDirection searchDirection) |
WAVE_TRACK_API ClipPointer | GetIntervalAtTime (WaveChannel &channel, double t) |
using WaveChannelUtilities::Clip = typedef WaveClipChannel |
Definition at line 30 of file WaveChannelUtilities.h.
using WaveChannelUtilities::ClipConstPointer = typedef std::shared_ptr<const Clip> |
Definition at line 33 of file WaveChannelUtilities.h.
using WaveChannelUtilities::ClipConstPointers = typedef std::vector<ClipConstPointer> |
Definition at line 34 of file WaveChannelUtilities.h.
using WaveChannelUtilities::ClipPointer = typedef std::shared_ptr<Clip> |
Definition at line 31 of file WaveChannelUtilities.h.
using WaveChannelUtilities::ClipPointers = typedef std::vector<ClipPointer> |
Definition at line 32 of file WaveChannelUtilities.h.
|
inline |
Definition at line 39 of file WaveChannelUtilities.h.
References CompareClipsByPlayStartTime().
Referenced by IsSortedByPlayStartTime(), and SortedClipArray().
Definition at line 389 of file WaveChannelUtilities.cpp.
References WaveClipChannel::GetPlayStartTime().
Referenced by CompareClipPointersByPlayStartTime(), and anonymous_namespace{WaveChannelUtilities.cpp}::DoGetNextClip().
auto WaveChannelUtilities::GetAdjacentClip | ( | const ClipConstPointers & | clips, |
const Clip & | clip, | ||
PlaybackDirection | searchDirection | ||
) |
Similar to GetNextClip, but returns nullptr
if the neighbour clip is not adjacent.
IsSortedByPlayStartTime(clips)
Definition at line 349 of file WaveChannelUtilities.cpp.
References anonymous_namespace{WaveChannelUtilities.cpp}::DoGetAdjacentClip(), and IsSortedByPlayStartTime().
Referenced by GetFloatsFromTime(), and SetFloatsFromTime().
auto WaveChannelUtilities::GetAdjacentClip | ( | const ClipPointers & | clips, |
const Clip & | clip, | ||
PlaybackDirection | searchDirection | ||
) |
Definition at line 356 of file WaveChannelUtilities.cpp.
References anonymous_namespace{WaveChannelUtilities.cpp}::DoGetAdjacentClip(), and IsSortedByPlayStartTime().
auto WaveChannelUtilities::GetClipAtTime | ( | const WaveChannel & | channel, |
double | time | ||
) |
When the time is both the end of a clip and the start of the next clip, the latter clip is returned.
Definition at line 424 of file WaveChannelUtilities.cpp.
References GetClipAtTime().
auto WaveChannelUtilities::GetClipAtTime | ( | WaveChannel & | channel, |
double | time | ||
) |
When the time is both the end of a clip and the start of the next clip, the latter clip is returned.
Definition at line 412 of file WaveChannelUtilities.cpp.
References SortedClipArray().
Referenced by anonymous_namespace{SampleHandle.cpp}::adjustTime(), SampleHandle::Click(), GetClipAtTime(), GetEnvelopeAtTime(), GetFloatAtTime(), GetFloatsFromTime(), WaveChannelSubView::GetMenuItems(), SampleHandle::HitTest(), anonymous_namespace{WaveChannelUtilities.cpp}::RoundToNearestClipSample(), SetFloatsFromTime(), and SetFloatsWithinTimeRange().
Envelope * WaveChannelUtilities::GetEnvelopeAtTime | ( | WaveChannel & | channel, |
double | time | ||
) |
Definition at line 378 of file WaveChannelUtilities.cpp.
References WaveTrack::Channels(), GetClipAtTime(), and WaveChannel::GetTrack().
Referenced by WaveformView::DetailedHitTest(), SampleHandle::FindSampleEditingLevel(), SampleHandle::HitTest(), and EnvelopeHandle::WaveChannelHitTest().
bool WaveChannelUtilities::GetFloatAtTime | ( | const Clip & | clip, |
double | t, | ||
float & | value, | ||
bool | mayThrow | ||
) |
Definition at line 212 of file WaveChannelUtilities.cpp.
References WaveClipChannel::GetChannelIndex(), WaveClipChannel::GetClip(), WaveClipUtilities::GetFloatAtTime(), WaveClipChannel::GetPlayStartTime(), and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
bool WaveChannelUtilities::GetFloatAtTime | ( | const WaveChannel & | channel, |
double | t, | ||
float & | value, | ||
bool | mayThrow | ||
) |
GetClipAtTime(t) != nullptr
, false otherwise. Definition at line 203 of file WaveChannelUtilities.cpp.
References GetClipAtTime(), and GetFloatAtTime().
Referenced by GetFloatAtTime(), and SampleHandle::HitTest().
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
.
Definition at line 109 of file WaveChannelUtilities.cpp.
References backward, forward, and GetFloatsFromTime().
Referenced by SampleHandle::Click().
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.
Definition at line 178 of file WaveChannelUtilities.cpp.
References floatSample, forward, GetAdjacentClip(), GetClipAtTime(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), anonymous_namespace{WaveChannelUtilities.cpp}::RoundToNearestClipSample(), and SortedClipArray().
Referenced by GetFloatsCenteredAroundTime().
auto WaveChannelUtilities::GetIntervalAtTime | ( | WaveChannel & | channel, |
double | t | ||
) |
Definition at line 430 of file WaveChannelUtilities.cpp.
References WaveChannel::Intervals().
Referenced by SelectHandle::Click().
std::pair< float, float > WaveChannelUtilities::GetMinMax | ( | const WaveChannel & | channel, |
double | t0, | ||
double | t1, | ||
bool | mayThrow = true |
||
) |
Getting high-level data for one channel for screen display and clipping calculations and Contrast
Audacity: A Digital Audio Editor
Paul Licameli
Definition at line 21 of file WaveChannelUtilities.cpp.
References WaveChannel::Intervals(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by NormalizeBase::AnalyseTrack(), AmplifyBase::Init(), and NyquistBase::ProcessOne().
auto 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.
Definition at line 363 of file WaveChannelUtilities.cpp.
References anonymous_namespace{WaveChannelUtilities.cpp}::DoGetNextClip(), and IsSortedByPlayStartTime().
Referenced by anonymous_namespace{WaveChannelUtilities.cpp}::DoGetAdjacentClip(), and SetFloatsWithinTimeRange().
auto WaveChannelUtilities::GetNextClip | ( | const ClipPointers & | clips, |
const Clip & | clip, | ||
PlaybackDirection | searchDirection | ||
) |
Definition at line 371 of file WaveChannelUtilities.cpp.
References anonymous_namespace{WaveChannelUtilities.cpp}::DoGetNextClip(), and IsSortedByPlayStartTime().
float WaveChannelUtilities::GetRMS | ( | const WaveChannel & | channel, |
double | t0, | ||
double | t1, | ||
bool | mayThrow = true |
||
) |
Getting high-level data for one channel for screen display and clipping calculations and Contrast
Audacity: A Digital Audio Editor
Paul Licameli
Definition at line 61 of file WaveChannelUtilities.cpp.
References WaveChannel::Intervals(), min(), staffpad::audio::simd::sqrt(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by ContrastBase::GetDB(), LoudnessBase::GetTrackRMS(), and NyquistBase::ProcessOne().
|
inline |
Definition at line 51 of file WaveChannelUtilities.h.
References CompareClipPointersByPlayStartTime().
|
inline |
Definition at line 45 of file WaveChannelUtilities.h.
References CompareClipPointersByPlayStartTime().
Referenced by anonymous_namespace{WaveChannelUtilities.cpp}::DoGetNextClip(), GetAdjacentClip(), and GetNextClip().
void WaveChannelUtilities::SetFloatAtTime | ( | WaveChannel & | channel, |
double | t, | ||
float | value, | ||
sampleFormat | effectiveFormat | ||
) |
Sets sample nearest to t
to value
. Silently fails if GetClipAtTime(t) == nullptr
.
Definition at line 259 of file WaveChannelUtilities.cpp.
References SetFloatsCenteredAroundTime().
Referenced by SampleHandle::Click().
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.
Definition at line 221 of file WaveChannelUtilities.cpp.
References backward, forward, and SetFloatsFromTime().
Referenced by SampleHandle::Click(), and SetFloatAtTime().
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.
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.
Definition at line 233 of file WaveChannelUtilities.cpp.
References floatSample, forward, GetAdjacentClip(), GetClipAtTime(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), anonymous_namespace{WaveChannelUtilities.cpp}::RoundToNearestClipSample(), and SortedClipArray().
Referenced by SetFloatsCenteredAroundTime().
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.
producer | a function taking sample (absolute, not clip-relative) time and returning the desired value for the sample at that time. |
Definition at line 265 of file WaveChannelUtilities.cpp.
References forward, GetClipAtTime(), GetNextClip(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, min(), fast_float::round(), WaveClipUtilities::SetFloatsFromTime(), SortedClipArray(), and values.
Referenced by SampleHandle::Drag().
auto WaveChannelUtilities::SortedClipArray | ( | const WaveChannel & | channel | ) |
Get clips sorted by play start time.
Definition at line 405 of file WaveChannelUtilities.cpp.
References SortedClipArray().
auto WaveChannelUtilities::SortedClipArray | ( | WaveChannel & | channel | ) |
Get clips sorted by play start time.
Definition at line 395 of file WaveChannelUtilities.cpp.
References CompareClipPointersByPlayStartTime(), and WaveChannel::Intervals().
Referenced by SampleHandle::Drag(), WaveTrack::GetClipAtTime(), GetClipAtTime(), GetFloatsFromTime(), WaveChannelView::SelectNextClip(), SetFloatsFromTime(), SetFloatsWithinTimeRange(), and SortedClipArray().