12#ifndef __AUDACITY_SAMPLE_TRACK__
13#define __AUDACITY_SAMPLE_TRACK__
88 floatSample, start, len, fill, mayThrow, pNumWithinClips);
103 sampleCount * pNumWithinClips =
nullptr)
const = 0;
138 const TypeInfo &GetTypeInfo()
const override;
139 static const TypeInfo &ClassTypeInfo();
147 size_t len,
unsigned int stride=1,
ClientData::Site< SampleTrack, ClientData::Cloneable< ClientData::UniquePtr >, ClientData::DeepCopying > SampleTrackAttachments
declares abstract base class Track, TrackList, and iterators over TrackList
#define ENUMERATE_TRACK_TYPE(T)
This macro should be called immediately after each definition of a track subtype.
Utility to register hooks into a host class that attach client data.
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
AudioTrack subclass that can also be audibly replayed by the program.
static const TypeInfo & ClassTypeInfo()
virtual double GetRate() const =0
bool GetFloats(float *buffer, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
Retrieve samples from a track in floating-point format, regardless of the storage format.
virtual float GetChannelGain(int channel) const =0
Takes gain and pan into account.
virtual bool Get(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const =0
Retrieve samples from a track in a specified format.
virtual void GetEnvelopeValues(double *buffer, size_t bufferLen, double t0) const =0
Fetch envelope values corresponding to uniformly separated sample times starting at the given time.
virtual size_t GetMaxBlockSize() const =0
This returns a nonnegative number of samples meant to size a memory buffer.
virtual bool HasTrivialEnvelope() const =0
virtual sampleCount GetBlockStart(sampleCount t) const =0
This returns a possibly large or negative value.
virtual sampleFormat WidestEffectiveFormat() const =0
virtual size_t GetBestBlockSize(sampleCount t) const =0
This returns a nonnegative number of samples meant to size a memory buffer.
virtual ChannelType GetChannelIgnoringPan() const =0
virtual sampleFormat GetSampleFormat() const =0
virtual const TypeInfo & GetTypeInfo() const =0
virtual void Flush()=0
Flush must be called after last Append.
virtual bool Append(constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1, sampleFormat effectiveFormat=widestSampleFormat)=0
Append the sample data to the track. You must call Flush() after the last Append.
~WritableSampleTrack() override
Positions or offsets within audio files need a wide type.
@ DeepCopying
point to new sub-objects; these must define a Clone() member; won't compile for std::weak_ptr
Empty argument passed to some public constructors.