Audacity 3.2.0
|
#include <WaveClip.h>
Public Member Functions | |
WaveClipChannel (WaveClip &clip, size_t iChannel) | |
~WaveClipChannel () override | |
WaveClip & | GetClip () |
const WaveClip & | GetClip () const |
size_t | GetChannelIndex () const |
Envelope & | GetEnvelope () |
const Envelope & | GetEnvelope () const |
bool | Intersects (double t0, double t1) const |
double | Start () const |
double | End () const |
AudioSegmentSampleView | GetSampleView (double t0, double t1, bool mayThrow) const |
Request interval samples within [t0, t1). t0 and t1 are truncated to the interval start and end. Stretching 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. The actual number of samples available from the returned view is queried through AudioSegmentSampleView::GetSampleCount() . More... | |
bool | WithinPlayRegion (double t) const |
t ∈ [...) More... | |
double | SamplesToTime (sampleCount s) const noexcept |
bool | HasPitchOrSpeed () const |
double | GetTrimLeft () const |
double | GetTrimRight () const |
bool | GetSamples (samplePtr buffer, sampleFormat format, sampleCount start, size_t len, bool mayThrow=true) const |
AudioSegmentSampleView | GetSampleView (sampleCount start, size_t length, bool mayThrow) const |
const Sequence & | GetSequence () const |
constSamplePtr | GetAppendBuffer () const |
size_t | GetAppendBufferLen () const |
const BlockArray * | GetSequenceBlockArray () const |
std::pair< float, float > | GetMinMax (double t0, double t1, bool mayThrow) const |
float | GetRMS (double t0, double t1, bool mayThrow) const |
sampleCount | GetPlayStartSample () const |
Real start time of the clip, quantized to raw sample rate (track's rate) More... | |
sampleCount | GetPlayEndSample () const |
Real end time of the clip, quantized to raw sample rate (track's rate) More... | |
void | SetSamples (constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len, sampleFormat effectiveFormat) |
void | WriteXML (XMLWriter &xmlFile) const |
sampleCount | GetVisibleSampleCount () const override |
int | GetRate () const override |
double | GetPlayStartTime () const override |
double | GetPlayEndTime () const override |
double | GetPlayDuration () const |
sampleCount | TimeToSamples (double time) const override |
double | GetStretchRatio () const override |
Public Member Functions inherited from ChannelInterval | |
virtual | ~ChannelInterval () |
Public Member Functions inherited from ClipTimes | |
virtual | ~ClipTimes () |
virtual sampleCount | GetVisibleSampleCount () const =0 |
virtual int | GetRate () const =0 |
virtual double | GetPlayStartTime () const =0 |
virtual double | GetPlayEndTime () const =0 |
virtual sampleCount | TimeToSamples (double time) const =0 |
virtual double | GetStretchRatio () const =0 |
Private Attributes | |
WaveClip & | mClip |
const size_t | miChannel |
Friends | |
bool | operator== (const WaveClipChannel &a, const WaveClipChannel &b) |
bool | operator!= (const WaveClipChannel &a, const WaveClipChannel &b) |
Definition at line 85 of file WaveClip.h.
|
inline |
Definition at line 90 of file WaveClip.h.
|
overridedefault |
double WaveClipChannel::End | ( | ) | const |
Definition at line 84 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetPlayEndTime().
constSamplePtr WaveClipChannel::GetAppendBuffer | ( | ) | const |
Definition at line 135 of file WaveClip.cpp.
References WaveClip::GetAppendBuffer(), GetClip(), and miChannel.
size_t WaveClipChannel::GetAppendBufferLen | ( | ) | const |
Definition at line 140 of file WaveClip.cpp.
References WaveClip::GetAppendBufferLen(), GetClip(), and miChannel.
|
inline |
Definition at line 99 of file WaveClip.h.
Referenced by anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawWaveform(), WaveChannelUtilities::GetFloatAtTime(), and WaveClipSpectrumCache::GetSpectrogram().
|
inline |
Definition at line 96 of file WaveClip.h.
Referenced by anonymous_namespace{WaveformView.cpp}::DrawWaveform(), End(), WaveClipSpectrumCache::Get(), WaveColorAttachment::Get(), GetAppendBuffer(), GetAppendBufferLen(), GetEnvelope(), WaveChannelUtilities::GetFloatAtTime(), GetMinMax(), GetPlayEndSample(), GetPlayEndTime(), GetPlayStartSample(), GetPlayStartTime(), GetRate(), GetRMS(), GetSamples(), GetSampleView(), GetSequence(), GetSequenceBlockArray(), GetStretchRatio(), GetTrimLeft(), GetTrimRight(), GetVisibleSampleCount(), HasPitchOrSpeed(), Intersects(), SetSamples(), Start(), TimeToSamples(), WithinPlayRegion(), and WriteXML().
|
inline |
Definition at line 97 of file WaveClip.h.
Envelope & WaveClipChannel::GetEnvelope | ( | ) |
Definition at line 64 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetEnvelope().
Referenced by anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), and anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples().
const Envelope & WaveClipChannel::GetEnvelope | ( | ) | const |
Definition at line 69 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetEnvelope().
std::pair< float, float > WaveClipChannel::GetMinMax | ( | double | t0, |
double | t1, | ||
bool | mayThrow | ||
) | const |
Getting high-level data for one channel for screen display and clipping calculations and Contrast
Definition at line 151 of file WaveClip.cpp.
References GetClip(), WaveClip::GetMinMax(), and miChannel.
double WaveClipChannel::GetPlayDuration | ( | ) | const |
Definition at line 208 of file WaveClip.cpp.
References GetPlayEndTime(), and GetPlayStartTime().
Referenced by anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs().
sampleCount WaveClipChannel::GetPlayEndSample | ( | ) | const |
Real end time of the clip, quantized to raw sample rate (track's rate)
Definition at line 166 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetPlayEndSample().
|
overridevirtual |
Implements ClipTimes.
Definition at line 203 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetPlayEndTime().
Referenced by GetPlayDuration().
sampleCount WaveClipChannel::GetPlayStartSample | ( | ) | const |
Real start time of the clip, quantized to raw sample rate (track's rate)
Definition at line 161 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetPlayStartSample().
|
overridevirtual |
Implements ClipTimes.
Definition at line 198 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetPlayStartTime().
Referenced by WaveChannelUtilities::CompareClipsByPlayStartTime(), anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), WaveChannelUtilities::GetFloatAtTime(), GetPlayDuration(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), anonymous_namespace{SpectrumView.cpp}::GetSelectedSampleIndices(), and anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest().
|
overridevirtual |
Implements ClipTimes.
Definition at line 193 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetRate().
Referenced by SpecCache::CalculateOneSpectrum(), anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), WaveClipSpectrumCache::GetSpectrogram(), SpecCache::Populate(), and anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest().
float WaveClipChannel::GetRMS | ( | double | t0, |
double | t1, | ||
bool | mayThrow | ||
) | const |
Getting high-level data for one channel for screen display and clipping calculations and Contrast
Definition at line 156 of file WaveClip.cpp.
References GetClip(), WaveClip::GetRMS(), and miChannel.
bool WaveClipChannel::GetSamples | ( | samplePtr | buffer, |
sampleFormat | format, | ||
sampleCount | start, | ||
size_t | len, | ||
bool | mayThrow = true |
||
) | const |
Definition at line 115 of file WaveClip.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, GetClip(), WaveClip::GetSamples(), and miChannel.
Referenced by anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples().
AudioSegmentSampleView WaveClipChannel::GetSampleView | ( | double | t0, |
double | t1, | ||
bool | mayThrow | ||
) | const |
Request interval samples within [t0, t1). t0
and t1
are truncated to the interval start and end. Stretching 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. The actual number of samples available from the returned view is queried through AudioSegmentSampleView::GetSampleCount()
.
size_t
Definition at line 90 of file WaveClip.cpp.
References GetClip(), WaveClip::GetSampleView(), and miChannel.
Referenced by SpecCache::CalculateOneSpectrum().
AudioSegmentSampleView WaveClipChannel::GetSampleView | ( | sampleCount | start, |
size_t | length, | ||
bool | mayThrow | ||
) | const |
Definition at line 121 of file WaveClip.cpp.
References GetClip(), WaveClip::GetSampleView(), and miChannel.
const Sequence & WaveClipChannel::GetSequence | ( | ) | const |
Definition at line 127 of file WaveClip.cpp.
References GetClip(), WaveClip::GetSequence(), and miChannel.
Referenced by SpecCache::CalculateOneSpectrum().
const BlockArray * WaveClipChannel::GetSequenceBlockArray | ( | ) | const |
Definition at line 145 of file WaveClip.cpp.
References GetClip(), WaveClip::GetSequenceBlockArray(), and miChannel.
|
overridevirtual |
Implements ClipTimes.
Definition at line 218 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetStretchRatio().
Referenced by SpecCache::CalculateOneSpectrum(), anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), WaveClipSpectrumCache::GetSpectrogram(), SpecCache::Populate(), and anonymous_namespace{SampleHandle.cpp}::SampleResolutionTest().
double WaveClipChannel::GetTrimLeft | ( | ) | const |
Definition at line 110 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetTrimLeft().
Referenced by WaveClipSpectrumCache::GetSpectrogram().
double WaveClipChannel::GetTrimRight | ( | ) | const |
Definition at line 183 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetTrimRight().
Referenced by WaveClipSpectrumCache::GetSpectrogram().
|
overridevirtual |
The number of raw audio samples not hidden by trimming.
Implements ClipTimes.
Definition at line 188 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetVisibleSampleCount().
Referenced by anonymous_namespace{WaveformView.cpp}::DrawIndividualSamples(), anonymous_namespace{WaveChannelUtilities.cpp}::GetSampleAccessArgs(), and anonymous_namespace{SpectrumView.cpp}::GetSelectedSampleIndices().
bool WaveClipChannel::HasPitchOrSpeed | ( | ) | const |
Definition at line 105 of file WaveClip.cpp.
References GetClip(), and WaveClip::HasPitchOrSpeed().
bool WaveClipChannel::Intersects | ( | double | t0, |
double | t1 | ||
) | const |
Definition at line 74 of file WaveClip.cpp.
References GetClip(), and WaveClip::IntersectsPlayRegion().
|
noexcept |
Definition at line 100 of file WaveClip.cpp.
void WaveClipChannel::SetSamples | ( | constSamplePtr | buffer, |
sampleFormat | format, | ||
sampleCount | start, | ||
size_t | len, | ||
sampleFormat | effectiveFormat | ||
) |
start | relative to clip play start sample |
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 171 of file WaveClip.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, GetClip(), miChannel, and WaveClip::SetSamples().
double WaveClipChannel::Start | ( | ) | const |
Definition at line 79 of file WaveClip.cpp.
References GetClip(), and WaveClip::GetPlayStartTime().
|
overridevirtual |
Implements ClipTimes.
Definition at line 213 of file WaveClip.cpp.
References GetClip(), and WaveClip::TimeToSamples().
Referenced by anonymous_namespace{SpectrumView.cpp}::GetSelectedSampleIndices().
bool WaveClipChannel::WithinPlayRegion | ( | double | t | ) | const |
t ∈ [...)
Definition at line 95 of file WaveClip.cpp.
References GetClip(), and WaveClip::WithinPlayRegion().
void WaveClipChannel::WriteXML | ( | XMLWriter & | xmlFile | ) | const |
Definition at line 178 of file WaveClip.cpp.
References GetClip(), miChannel, and WaveClip::WriteXML().
|
friend |
Definition at line 188 of file WaveClip.h.
|
friend |
|
private |
Definition at line 193 of file WaveClip.h.
|
private |
Definition at line 194 of file WaveClip.h.
Referenced by GetAppendBuffer(), GetAppendBufferLen(), GetMinMax(), GetRMS(), GetSamples(), GetSampleView(), GetSequence(), GetSequenceBlockArray(), SetSamples(), and WriteXML().