Audacity 3.2.0
|
#include <WideSampleSequence.h>
Public Member Functions | |
virtual | ~WideSampleSequence () |
virtual size_t | NChannels () const =0 |
A constant property. More... | |
virtual float | GetChannelVolume (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 |
Public Member Functions inherited from AudioGraph::Channel | |
virtual | ~Channel () |
virtual ChannelType | GetChannelType () const =0 |
Classify this channel. More... | |
An interface for random-access fetches from a collection of streams of samples, associated with the same time; also defines an envelope that applies to all the streams.
Definition at line 22 of file WideSampleSequence.h.
|
virtualdefault |
|
pure virtual |
Retrieve samples of one of the channels from a sequence in a specified format
format | sample format of the destination buffer |
backward | retrieves samples from start (inclusive) to start + len if false, else from start (exclusive) to start - len in reverse order. |
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by GetFloats().
|
pure virtual |
Extra gain factor to apply to a channel when mixing, may change asynchronously
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by SequenceDownmixSource::GetChannelGain(), and StretchingSequence::GetChannelVolume().
|
pure virtual |
Implemented in SampleTrack, StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by StretchingSequence::GetEndTime().
|
pure virtual |
Fetch envelope values corresponding to uniformly separated sample times starting at the given time
backwards | if true, fetch values in reverse order, from t0 to t0 - bufferLen / rate |
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by StretchingSequence::GetEnvelopeValues().
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 30 of file WideSampleSequence.cpp.
References ClearSamples(), DoGet(), floatSample, and anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
Referenced by WideSampleSource::Acquire(), and WaveChannel::GetFloats().
|
pure virtual |
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, WaveTrack, and WritableSampleTrack.
Referenced by MixerSource::Acquire(), StretchingSequence::Create(), StretchingSequence::GetRate(), LongSamplesToTime(), StretchingSequence::MutableGet(), and TimeToLongSamples().
|
pure virtual |
Implemented in SampleTrack, StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by StretchingSequence::GetStartTime().
|
pure virtual |
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by StretchingSequence::HasTrivialEnvelope().
double WideSampleSequence::LongSamplesToTime | ( | sampleCount | pos | ) | const |
Convert correctly between a number of samples and an (absolute) time in seconds.
pos | The time number of samples from the start of the sequence to convert |
Definition at line 20 of file WideSampleSequence.cpp.
References sampleCount::as_double(), and GetRate().
Referenced by AUPImportFileHandle::AddSilence(), TruncSilenceBase::Analyze(), CompareAudioCommand::Apply(), AutoDuckBase::ApplyDuckFade(), TruncSilenceBase::DoRemoval(), TrackSpectrumTransformer::PostProcess(), AutoDuckBase::Process(), FindClippingBase::ProcessOne(), WaveTrackUtilities::Reverse(), and SnapToSample().
|
pure virtual |
A constant property.
result > 0
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, WaveTrack, and WritableSampleTrack.
Referenced by StretchingSequence::Create(), StretchingSequence::GetNext(), SequenceDownmixSource::NChannels(), StretchingSequence::NChannels(), and WideSampleSource::WideSampleSource().
double WideSampleSequence::SnapToSample | ( | double | t | ) | const |
LongSamplesToTime(TimeToLongSamples(t))
Definition at line 25 of file WideSampleSequence.cpp.
References LongSamplesToTime(), and TimeToLongSamples().
Referenced by anonymous_namespace{SampleHandle.cpp}::adjustTime(), WaveTrack::ApplyPitchAndSpeed(), WaveTrack::CanInsertClip(), WaveTrack::ClearAndPasteAtSameTempo(), TruncSilenceBase::DoRemoval(), anonymous_namespace{WaveformView.cpp}::DrawClipWaveform(), SBSMSBase::Finalize(), WaveTrack::HandleClear(), anonymous_namespace{EditMenus.cpp}::OnSplitNew(), and WaveTrackUtilities::Reverse().
sampleCount WideSampleSequence::TimeToLongSamples | ( | double | t0 | ) | const |
Convert correctly between an (absolute) time in seconds and a number of samples.
This method will not give the correct results if used on a relative time (difference of two times). Each absolute time must be converted and the numbers of samples differenced: sampleCount start = sequence->TimeToLongSamples(t0); sampleCount end = sequence->TimeToLongSamples(t1); sampleCount len = (sampleCount)(end - start); NOT the likes of: sampleCount len = sequence->TimeToLongSamples(t1 - t0); See also WideSampleSequence::TimeToLongSamples().
t0 | The time (floating point seconds) to convert |
Definition at line 15 of file WideSampleSequence.cpp.
References GetRate().
Referenced by NormalizeBase::AnalyseTrackData(), TruncSilenceBase::Analyze(), CompareAudioCommand::Apply(), AutoDuckBase::ApplyDuckFade(), WaveTrack::Disjoin(), TruncSilenceBase::DoRemoval(), Effect::GetBounds(), WaveChannel::GetSampleView(), MixerSource::MixerSource(), anonymous_namespace{BrushHandle.cpp}::PositionToLongSample(), AutoDuckBase::Process(), Reverse::Process(), StereoToMono::Process(), PaulstretchBase::ProcessOne(), NormalizeBase::ProcessOne(), LoudnessBase::ProcessOne(), PerTrackEffect::ProcessPass(), MixerSource::Reposition(), StretchingSequence::ResetCursor(), WaveTrack::Silence(), SnapToSample(), and SelectHandle::StartSnappingFreqSelection().
|
pure virtual |
Implemented in StretchingSequence, MockPlayableSequence, WaveChannel, and WaveTrack.
Referenced by StretchingSequence::WidestEffectiveFormat().