Audacity 3.2.0
WideSampleSequence.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WideSampleSequence.h
6
7Paul Licameli split from SampleFrame.h
8
9**********************************************************************/
10#ifndef __AUDACITY_WIDE_SAMPLE_SEQUENCE_
11#define __AUDACITY_WIDE_SAMPLE_SEQUENCE_
12
13#include "AudioGraphChannel.h"
14#include "SampleCount.h"
15#include "SampleFormat.h"
16
18
22class MIXER_API WideSampleSequence
23 : public AudioGraph::Channel
24{
25public:
27
29
32 virtual size_t NChannels() const = 0;
33
36 virtual float GetChannelGain(int channel) const = 0;
37
40
58 bool GetFloats(size_t iChannel, size_t nBuffers,
59 float *const buffers[], sampleCount start, size_t len,
60 bool backwards = false, fillFormat fill = FillFormat::fillZero,
61 bool mayThrow = true, sampleCount* pNumWithinClips = nullptr) const;
62
65
71 virtual bool DoGet(
72 size_t iChannel, size_t nBuffers, const samplePtr buffers[],
73 sampleFormat format, sampleCount start, size_t len, bool backward,
74 fillFormat fill = FillFormat::fillZero, bool mayThrow = true,
75 // Report how many samples were copied from within clips, rather than
76 // filled according to fillFormat; but these were not necessarily one
77 // contiguous range.
78 sampleCount* pNumWithinClips = nullptr) const = 0;
79
80 virtual double GetStartTime() const = 0;
81 virtual double GetEndTime() const = 0;
82 virtual double GetRate() const = 0;
83
86
100 sampleCount TimeToLongSamples(double t0) const;
103
108 double LongSamplesToTime(sampleCount pos) const;
109
113 double SnapToSample(double t) const;
114
117
119 virtual bool HasTrivialEnvelope() const = 0;
120
123
127 virtual void GetEnvelopeValues(
128 double* buffer, size_t bufferLen, double t0, bool backwards) const = 0;
129};
130
131#endif
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
char * samplePtr
Definition: SampleFormat.h:57
enum FillFormat fillFormat
virtual float GetChannelGain(int channel) const =0
virtual bool HasTrivialEnvelope() const =0
virtual double GetStartTime() const =0
virtual void GetEnvelopeValues(double *buffer, size_t bufferLen, double t0, bool backwards) const =0
virtual sampleFormat WidestEffectiveFormat() const =0
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 ~WideSampleSequence()
virtual double GetEndTime() const =0
virtual size_t NChannels() const =0
A constant property.
virtual double GetRate() const =0
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19