Audacity 3.2.0
SampleTrack.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5SampleTrack.h
6@brief abstract Track sub-type that maps times to sample values
7
8Paul Licameli split from WaveTrack.h
9
10**********************************************************************/
11
12#ifndef __AUDACITY_SAMPLE_TRACK__
13#define __AUDACITY_SAMPLE_TRACK__
14
15#include "AudioIOSequences.h"
16#include "PlayableTrack.h"
17#include "SampleCount.h"
18#include "SampleFormat.h"
19
20enum class sampleFormat : unsigned;
21
22class SampleTrack;
23
24class SAMPLE_TRACK_API SampleTrack /* not final */
25 : public PlayableTrack
26 , public PlayableSequence
27{
28public:
31 ~SampleTrack() override;
32
33 // Fix the otherwise ambiguous lookup of these virtual function names
36
37 const TypeInfo &GetTypeInfo() const override;
38 static const TypeInfo &ClassTypeInfo();
39
40 virtual sampleFormat GetSampleFormat() const = 0;
41
43};
44
46
47class SAMPLE_TRACK_API WritableSampleTrack /* not final */
48 : public SampleTrack
49 , public RecordableSequence
50{
51public:
56
57 // Resolve ambiguous lookups
59
60 // Needed to resolve ambiguity with WideSampleSequence::GetRate, when this
61 // abstract interface is used directly.
62 // Expect the concrete subclass to define a common override for them.
64
65 const TypeInfo &GetTypeInfo() const override;
66 static const TypeInfo &ClassTypeInfo();
67};
68
70
71#endif
Extends Track with notions of mute and solo setting.
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
#define ENUMERATE_TRACK_TYPE(T)
Empty class which will have subclasses.
Definition: Track.h:56
double GetEndTime() const
Get the maximum of End() values of intervals, or 0 when none.
Definition: Channel.cpp:61
double GetStartTime() const
Get the minimum of Start() values of intervals, or 0 when none.
Definition: Channel.cpp:50
virtual size_t NChannels() const =0
Report the number of channels.
AudioTrack subclass that can also be audibly replayed by the program.
Definition: PlayableTrack.h:40
static const TypeInfo & ClassTypeInfo()
~SampleTrack() override
virtual sampleFormat GetSampleFormat() const =0
virtual const TypeInfo & GetTypeInfo() 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
~WritableSampleTrack() override
virtual double GetRate() const =0
Empty argument passed to some public constructors.
Definition: Track.h:117