Audacity 3.2.0
|
#include <StretchingSequence.h>
Public Member Functions | |
StretchingSequence (const PlayableSequence &, int sampleRate, size_t numChannels, std::unique_ptr< AudioSegmentFactoryInterface >) | |
size_t | NChannels () const override |
A constant property. More... | |
float | GetChannelVolume (int channel) const override |
double | GetStartTime () const override |
double | GetEndTime () const override |
double | GetRate () const override |
sampleFormat | WidestEffectiveFormat () const override |
bool | HasTrivialEnvelope () const override |
void | GetEnvelopeValues (double *buffer, size_t bufferLen, double t0, bool backwards) const override |
bool | DoGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backwards, fillFormat fill=FillFormat::fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const override |
const ChannelGroup * | FindChannelGroup () const override |
Find associated ChannelGroup if any. More... | |
bool | GetSolo () const override |
May vary asynchronously. More... | |
bool | GetMute () const override |
May vary asynchronously. More... | |
AudioGraph::ChannelType | GetChannelType () const override |
Classify this channel. More... | |
bool | GetFloats (float *buffers[], sampleCount start, size_t len, bool backwards) const |
Public Member Functions inherited from PlayableSequence | |
~PlayableSequence () override | |
virtual const ChannelGroup * | FindChannelGroup () const =0 |
Find associated ChannelGroup if any. More... | |
virtual bool | GetSolo () const =0 |
May vary asynchronously. More... | |
virtual bool | GetMute () const =0 |
May vary asynchronously. More... | |
Public Member Functions inherited from WideSampleSequence | |
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... | |
Static Public Member Functions | |
static std::shared_ptr< StretchingSequence > | Create (const PlayableSequence &, const ClipConstHolders &clips) |
Private Types | |
using | AudioSegments = std::vector< std::shared_ptr< AudioSegment > > |
Private Member Functions | |
void | ResetCursor (double t, PlaybackDirection) |
bool | GetNext (float *const buffers[], size_t numChannels, size_t numSamples) |
bool | MutableGet (size_t iChannel, size_t nBuffers, const samplePtr buffers[], sampleFormat format, sampleCount start, size_t len, bool backwards) |
Private Attributes | |
const PlayableSequence & | mSequence |
const std::unique_ptr< AudioSegmentFactoryInterface > | mAudioSegmentFactory |
AudioSegments | mAudioSegments |
AudioSegments::const_iterator | mActiveAudioSegmentIt = mAudioSegments.end() |
std::optional< sampleCount > | mExpectedStart |
PlaybackDirection | mPlaybackDirection = PlaybackDirection::forward |
Definition at line 27 of file StretchingSequence.h.
|
private |
Definition at line 67 of file StretchingSequence.h.
StretchingSequence::StretchingSequence | ( | const PlayableSequence & | sequence, |
int | sampleRate, | ||
size_t | numChannels, | ||
std::unique_ptr< AudioSegmentFactoryInterface > | factory | ||
) |
Definition at line 29 of file StretchingSequence.cpp.
|
static |
Definition at line 189 of file StretchingSequence.cpp.
References WideSampleSequence::GetRate(), WideSampleSequence::NChannels(), and anonymous_namespace{ClipSegmentTest.cpp}::sampleRate.
Referenced by ExportPluginHelpers::CreateMixer(), MakeTransportTracks(), MixAndRender(), and TEST_CASE().
|
overridevirtual |
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. |
Implements WideSampleSequence.
Definition at line 97 of file StretchingSequence.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and MutableGet().
Referenced by GetFloats().
|
overridevirtual |
Find associated ChannelGroup if any.
Implements PlayableSequence.
Definition at line 106 of file StretchingSequence.cpp.
References PlayableSequence::FindChannelGroup(), and mSequence.
|
overridevirtual |
Classify this channel.
Implements AudioGraph::Channel.
Definition at line 152 of file StretchingSequence.cpp.
References AudioGraph::Channel::GetChannelType(), and mSequence.
|
overridevirtual |
Extra gain factor to apply to a channel when mixing, may change asynchronously
Implements WideSampleSequence.
Definition at line 92 of file StretchingSequence.cpp.
References WideSampleSequence::GetChannelVolume(), and mSequence.
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 126 of file StretchingSequence.cpp.
References WideSampleSequence::GetEndTime(), and mSequence.
|
overridevirtual |
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 |
Implements WideSampleSequence.
Definition at line 146 of file StretchingSequence.cpp.
References WideSampleSequence::GetEnvelopeValues(), and mSequence.
bool StretchingSequence::GetFloats | ( | float * | buffers[], |
sampleCount | start, | ||
size_t | len, | ||
bool | backwards | ||
) | const |
Definition at line 157 of file StretchingSequence.cpp.
References DoGet(), floatSample, anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and NChannels().
|
overridevirtual |
May vary asynchronously.
Implements PlayableSequence.
Definition at line 116 of file StretchingSequence.cpp.
References PlayableSequence::GetMute(), and mSequence.
|
private |
Definition at line 46 of file StretchingSequence.cpp.
References forward, anonymous_namespace{StretchingSequence.cpp}::GetOffsetBuffer(), mActiveAudioSegmentIt, mAudioSegments, mExpectedStart, mPlaybackDirection, mSequence, WideSampleSequence::NChannels(), and ResetCursor().
Referenced by MutableGet().
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 131 of file StretchingSequence.cpp.
References WideSampleSequence::GetRate(), and mSequence.
|
overridevirtual |
May vary asynchronously.
Implements PlayableSequence.
Definition at line 111 of file StretchingSequence.cpp.
References PlayableSequence::GetSolo(), and mSequence.
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 121 of file StretchingSequence.cpp.
References WideSampleSequence::GetStartTime(), and mSequence.
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 141 of file StretchingSequence.cpp.
References WideSampleSequence::HasTrivialEnvelope(), and mSequence.
|
private |
Definition at line 171 of file StretchingSequence.cpp.
References sampleCount::as_double(), backward, forward, GetNext(), WideSampleSequence::GetRate(), anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, mExpectedStart, mPlaybackDirection, mSequence, and ResetCursor().
Referenced by DoGet().
|
overridevirtual |
A constant property.
result > 0
Implements WideSampleSequence.
Definition at line 87 of file StretchingSequence.cpp.
References mSequence, and WideSampleSequence::NChannels().
Referenced by GetFloats().
|
private |
Definition at line 37 of file StretchingSequence.cpp.
References mActiveAudioSegmentIt, mAudioSegmentFactory, mAudioSegments, mExpectedStart, mPlaybackDirection, and WideSampleSequence::TimeToLongSamples().
Referenced by GetNext(), and MutableGet().
|
overridevirtual |
Implements WideSampleSequence.
Definition at line 136 of file StretchingSequence.cpp.
References mSequence, and WideSampleSequence::WidestEffectiveFormat().
|
private |
Definition at line 78 of file StretchingSequence.h.
Referenced by GetNext(), and ResetCursor().
|
private |
Definition at line 76 of file StretchingSequence.h.
Referenced by ResetCursor().
|
private |
Definition at line 77 of file StretchingSequence.h.
Referenced by GetNext(), and ResetCursor().
|
private |
Definition at line 79 of file StretchingSequence.h.
Referenced by GetNext(), MutableGet(), and ResetCursor().
|
private |
Definition at line 80 of file StretchingSequence.h.
Referenced by GetNext(), MutableGet(), and ResetCursor().
|
private |
Definition at line 75 of file StretchingSequence.h.
Referenced by FindChannelGroup(), GetChannelType(), GetChannelVolume(), GetEndTime(), GetEnvelopeValues(), GetMute(), GetNext(), GetRate(), GetSolo(), GetStartTime(), HasTrivialEnvelope(), MutableGet(), NChannels(), and WidestEffectiveFormat().