![]() |
Audacity 3.2.0
|
#include <WaveTrack.h>
Public Member Functions | |
~WaveChannel () override | |
WaveTrack & | GetTrack () |
const WaveTrack & | GetTrack () const |
auto | GetInterval (size_t iInterval) |
auto | GetInterval (size_t iInterval) const |
auto | Intervals () |
auto | Intervals () const |
bool | GetFloats (float *buffer, sampleCount start, size_t len, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
"narrow" overload fetches from the unique channel More... | |
ChannelSampleView | GetSampleView (double t0, double t1, bool mayThrow) const |
Request channel samples within [t0, t1), not knowing in advance how many this will be. More... | |
bool | Set (constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len, sampleFormat effectiveFormat=widestSampleFormat) |
Random-access assignment of a range of samples. More... | |
bool | AppendBuffer (constSamplePtr buffer, sampleFormat format, size_t len, unsigned stride, sampleFormat effectiveFormat) |
bool | Append (constSamplePtr buffer, sampleFormat format, size_t len) |
std::pair< float, float > | GetMinMax (double t0, double t1, bool mayThrow=true) const |
float | GetRMS (double t0, double t1, bool mayThrow=true) const |
Get root-mean-square. More... | |
size_t | GetBestBlockSize (sampleCount t) const |
A hint for sizing of well aligned fetches. More... | |
size_t | GetIdealBlockSize () |
A hint for sizing of well aligned fetches. More... | |
size_t | GetMaxBlockSize () const |
bool | GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
![]() | |
virtual | ~Channel () |
ChannelGroup & | GetChannelGroup () |
Channel object's lifetime is assumed to be nested in its Track's. More... | |
const ChannelGroup & | GetChannelGroup () const |
Channel object's lifetime is assumed to be nested in its Track's. More... | |
size_t | GetChannelIndex () const |
size_t | ReallyGetChannelIndex () const |
size_t | NIntervals () const |
Report the number of intervals. More... | |
template<typename IntervalType = Interval> | |
std::shared_ptr< IntervalType > | GetInterval (size_t iInterval) |
Retrieve an interval, cast to the given type. More... | |
template<typename IntervalType = const Interval> | |
auto | GetInterval (size_t iInterval) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > > |
template<typename IntervalType = Interval> | |
IteratorRange< IntervalIterator< IntervalType > > | Intervals () |
Get range of intervals with mutative access. More... | |
template<typename IntervalType = const Interval> | |
auto | Intervals () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< IntervalIterator< IntervalType > > > |
Get range of intervals with read-only access. More... | |
![]() | |
virtual | ~WideSampleSequence () |
virtual size_t | NChannels () const =0 |
A constant property. More... | |
virtual float | GetChannelGain (int channel) const =0 |
bool | GetFloats (size_t iChannel, size_t nBuffers, float *const buffers[], sampleCount start, size_t len, bool backwards=false, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const |
virtual bool | DoGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backward, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const =0 |
virtual double | GetStartTime () const =0 |
virtual double | GetEndTime () const =0 |
virtual double | GetRate () const =0 |
sampleCount | TimeToLongSamples (double t0) const |
double | LongSamplesToTime (sampleCount pos) const |
double | SnapToSample (double t) const |
virtual sampleFormat | WidestEffectiveFormat () const =0 |
virtual bool | HasTrivialEnvelope () const =0 |
virtual void | GetEnvelopeValues (double *buffer, size_t bufferLen, double t0, bool backwards) const =0 |
![]() | |
virtual | ~Channel () |
virtual ChannelType | GetChannelType () const =0 |
Classify this channel. More... | |
Additional Inherited Members | |
![]() | |
using | Interval = ChannelInterval |
![]() | |
virtual ChannelGroup & | DoGetChannelGroup () const =0 |
Subclass must override. More... | |
virtual ChannelGroup & | ReallyDoGetChannelGroup () const |
This is temporary! It defaults to call the above. More... | |
Definition at line 131 of file WaveTrack.h.
|
overridedefault |
bool WaveChannel::Append | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
size_t | len | ||
) |
If there is an existing WaveClip in the WaveTrack that owns the channel, then the data are appended to that clip. If there are no WaveClips in the track, then a new one is created.
Definition at line 2656 of file WaveTrack.cpp.
References WaveTrack::Append(), anonymous_namespace{ExportPCM.cpp}::format, GetTrack(), and widestSampleFormat.
Referenced by EffectEqualization::Task::AccumulateSamples(), WaveTrackSink::DoConsume(), TrackSpectrumTransformer::DoOutput(), EffectSBSMS::Process(), EffectPaulstretch::ProcessOne(), EffectChangeSpeed::ProcessOne(), and EffectTwoPassSimpleMono::ProcessOne().
bool WaveChannel::AppendBuffer | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
size_t | len, | ||
unsigned | stride, | ||
sampleFormat | effectiveFormat | ||
) |
Definition at line 2647 of file WaveTrack.cpp.
References WaveTrack::Append(), anonymous_namespace{ExportPCM.cpp}::format, and GetTrack().
|
inline |
A hint for sizing of well aligned fetches.
Definition at line 1216 of file WaveTrack.h.
References WaveTrack::GetBestBlockSize(), and GetTrack().
Referenced by EffectNormalize::AnalyseTrackData(), TrackSpectrumTransformer::Process(), EffectChangeSpeed::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectNormalize::ProcessOne(), EffectLoudness::ProcessOne(), and resampleCB().
|
inline |
"narrow" overload fetches from the unique channel
Definition at line 154 of file WaveTrack.h.
Referenced by EffectNormalize::AnalyseTrackData(), EffectAutoDuck::ApplyDuckFade(), TrackSpectrumTransformer::Process(), EffectPaulstretch::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectClickRemoval::ProcessOne(), EffectRepair::ProcessOne(), EffectFindClipping::ProcessOne(), EffectEqualization::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectNormalize::ProcessOne(), and resampleCB().
bool WideSampleSequence::GetFloats | ( | size_t | iChannel, |
size_t | nBuffers, | ||
float *const | buffers[], | ||
sampleCount | start, | ||
size_t | len, | ||
bool | backwards = false , |
||
fillFormat | fill = FillFormat::fillZero , |
||
bool | mayThrow = true , |
||
sampleCount * | pNumWithinClips = nullptr |
||
) | const |
Retrieve samples from a sequence in floating-point format, regardless of the storage format
iChannel | index of first channel to fetch | |
nBuffers | counts buffers | |
buffers | receive the samples | |
start | starting sample, relative to absolute time zero | |
len | how many samples to get. buffers are assumed sufficiently large | |
fill | how to assign values for sample positions between clips | |
mayThrow | if false, fill buffer with zeros when there is failure to retrieve samples; else throw | |
[out] | pNumWithinClips | Report how many samples were copied from within clips, rather than filled according to fillFormat; but these were not necessarily one contiguous range. |
iChannel + nBuffers <= NChannels()
mayThrow
is false and not all samples could be retrieved Definition at line 58 of file WideSampleSequence.cpp.
|
inline |
A hint for sizing of well aligned fetches.
Definition at line 1220 of file WaveTrack.h.
References WaveTrack::GetIdealBlockSize(), and GetTrack().
|
inline |
Definition at line 142 of file WaveTrack.h.
|
inline |
Definition at line 144 of file WaveTrack.h.
|
inline |
A hint for maximum returned by either of GetBestBlockSize, GetIdealBlockSize
Definition at line 1224 of file WaveTrack.h.
References WaveTrack::GetMaxBlockSize(), and GetTrack().
Referenced by EffectNormalize::AnalyseTrackData(), TrackSpectrumTransformer::Process(), EffectChangeSpeed::ProcessOne(), EffectClickRemoval::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), and EffectNormalize::ProcessOne().
std::pair< float, float > WaveChannel::GetMinMax | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
t0 <= t1
Definition at line 3060 of file WaveTrack.cpp.
References GetTrack(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EffectNormalize::AnalyseTrack().
float WaveChannel::GetRMS | ( | double | t0, |
double | t1, | ||
bool | mayThrow = true |
||
) | const |
Get root-mean-square.
t0 <= t1
Definition at line 3100 of file WaveTrack.cpp.
References GetTrack(), min(), staffpad::audio::simd::sqrt(), and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EffectLoudness::GetTrackRMS().
ChannelSampleView WaveChannel::GetSampleView | ( | double | t0, |
double | t1, | ||
bool | mayThrow | ||
) | const |
Request channel samples within [t0, t1), not knowing in advance how many this will be.
The stretching of intersecting intervals influences the number of samples fitting into [t0, t1), i.e., half as many for twice as large a stretch ratio, due to a larger spacing of the raw samples.
size_t
Definition at line 3462 of file WaveTrack.cpp.
References Intervals(), min(), and WideSampleSequence::TimeToLongSamples().
|
inline |
Definition at line 1202 of file WaveTrack.h.
References Channel::DoGetChannelGroup().
Referenced by Append(), AppendBuffer(), GetBestBlockSize(), GetIdealBlockSize(), GetMaxBlockSize(), GetMinMax(), GetRMS(), EffectLoudness::LoadBufferBlock(), EffectPaulstretch::ProcessOne(), SpectralDataManager::Worker::ProcessOvertones(), SpectralDataManager::Worker::ProcessSnapping(), Set(), and EffectLoudness::StoreBufferBlock().
|
inline |
Definition at line 1209 of file WaveTrack.h.
References Channel::DoGetChannelGroup().
|
inline |
Definition at line 147 of file WaveTrack.h.
Referenced by GetSampleView().
|
inline |
Definition at line 148 of file WaveTrack.h.
bool WaveChannel::Set | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
sampleCount | start, | ||
size_t | len, | ||
sampleFormat | effectiveFormat = widestSampleFormat |
||
) |
Random-access assignment of a range of samples.
effectiveFormat | Make the effective format of the data at least the minumum of this value and `format`. (Maybe wider, if merging with preexistent data.) If the data are later narrowed from stored format, but not narrower than the effective, then no dithering will occur. |
Definition at line 3506 of file WaveTrack.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, GetTrack(), min(), and SAMPLE_SIZE.
Referenced by EffectAutoDuck::ApplyDuckFade(), WaveTrackSink::DoConsume(), WaveTrackMenuTable::OnSwapChannels(), EffectClickRemoval::ProcessOne(), EffectRepair::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectNormalize::ProcessOne(), and WaveTrack::ReverseOneClip().