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
72 virtual bool DoGet(
73 size_t iChannel, size_t nBuffers, const samplePtr buffers[],
74 sampleFormat format, sampleCount start, size_t len, bool backward,
75 fillFormat fill = FillFormat::fillZero, bool mayThrow = true,
76 // Report how many samples were copied from within clips, rather than
77 // filled according to fillFormat; but these were not necessarily one
78 // contiguous range.
79 sampleCount* pNumWithinClips = nullptr) const = 0;
80
81 virtual double GetStartTime() const = 0;
82 virtual double GetEndTime() const = 0;
83 virtual double GetRate() const = 0;
84
87
101 sampleCount TimeToLongSamples(double t0) const;
104
109 double LongSamplesToTime(sampleCount pos) const;
110
114 double SnapToSample(double t) const;
115
118
120 virtual bool HasTrivialEnvelope() const = 0;
121
124
128 virtual void GetEnvelopeValues(
129 double* buffer, size_t bufferLen, double t0, bool backwards) const = 0;
130};
131
132#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