Audacity 3.2.0
|
Functions | |
WAVE_TRACK_API bool | GetFloatAtTime (const WaveClip &clip, double t, size_t iChannel, float &value, bool mayThrow) |
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 equal stretch ratio. Samples at intersecting indices are then copied, leaving non-intersecting clip samples untouched. E.g., buffer: [a b c d e] clip : [x y z] result: [d e z]. More... | |
WAVE_TRACK_API bool | SharesBoundaryWithNextClip (const WaveTrack::Interval &prev, const WaveTrack::Interval &next) |
used by commands which interact with clips using the keyboard More... | |
bool WaveClipUtilities::GetFloatAtTime | ( | const WaveClip & | clip, |
double | t, | ||
size_t | iChannel, | ||
float & | value, | ||
bool | mayThrow | ||
) |
t | relative to clip start sample |
Audacity: A Digital Audio Editor
Paul Licameli split from WaveClip.cpp
Definition at line 15 of file WaveClipUtilities.cpp.
References floatSample, WaveClip::GetSamples(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, WaveClip::TimeToSamples(), and WaveClip::WithinPlayRegion().
Referenced by WaveChannelUtilities::GetFloatAtTime().
void WaveClipUtilities::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 equal stretch ratio. Samples at intersecting indices are then copied, leaving non-intersecting clip samples untouched. E.g., buffer: [a b c d e] clip : [x y z] result: [d e z].
Succeed with out-of-bounds requests, only changing what is in bounds.
Definition at line 26 of file WaveClipUtilities.cpp.
References floatSample, WaveClip::GetVisibleSampleCount(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, min(), WaveClip::SetSamples(), and WaveClip::TimeToSamples().
Referenced by WaveChannelUtilities::SetFloatsWithinTimeRange().
bool WaveClipUtilities::SharesBoundaryWithNextClip | ( | const WaveTrack::Interval & | prev, |
const WaveTrack::Interval & | next | ||
) |
used by commands which interact with clips using the keyboard
When two clips are immediately next to each other, the GetPlayEndTime() of the first clip and the GetPlayStartTime() of the second clip may not be exactly equal due to rounding errors.
Definition at line 49 of file WaveClipUtilities.cpp.
References sampleCount::as_double(), WaveClip::GetPlayStartTime(), WaveClip::GetRate(), WaveClip::GetStretchRatio(), and WaveClip::GetVisibleSampleCount().
Referenced by anonymous_namespace{ClipMenus.cpp}::AdjustForFindingEndTimes(), anonymous_namespace{ClipMenus.cpp}::AdjustForFindingStartTimes(), anonymous_namespace{ClipMenus.cpp}::FindNextClipBoundary(), and anonymous_namespace{ClipMenus.cpp}::FindPrevClipBoundary().