12#ifndef __AUDACITY_SAMPLE_TRACK__
13#define __AUDACITY_SAMPLE_TRACK__
71 floatSample, start, len, fill, mayThrow, pNumWithinClips);
118 const TypeInfo &GetTypeInfo()
const override;
119 static const TypeInfo &ClassTypeInfo();
129 size_t len,
unsigned int stride=1) = 0;
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.
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 sampleCount GetBlockStart(sampleCount t) const =0
This returns a possibly large or negative value.
virtual float GetOldChannelGain(int channel) 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 void SetOldChannelGain(int channel, float gain)=0
virtual bool Append(constSamplePtr buffer, sampleFormat format, size_t len, unsigned int stride=1)=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.