Audacity 3.2.0
AudioGraphSource.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file AudioGraphSource.h
6 @brief abstract producer of sample streams, taking Buffers as external context
7
8 Dominic Mazzoni
9 Vaughan Johnson
10
11 Paul Licameli split from PerTrackEffect.h
12
13**********************************************************************/
14
15#ifndef __AUDACITY_AUDIO_GRAPH_SOURCE__
16#define __AUDACITY_AUDIO_GRAPH_SOURCE__
17
18#include <optional>
19
20class sampleCount;
21
22namespace AudioGraph {
23
24class Buffers;
25
27class AUDIO_GRAPH_API Source {
28public:
30
31 virtual ~Source();
32
33 virtual bool AcceptsBuffers(const Buffers &buffers) const = 0;
34 virtual bool AcceptsBlockSize(size_t blockSize) const = 0;
35
37
57 virtual std::optional<size_t> Acquire(Buffers &data, size_t bound) = 0;
58
60
64 virtual sampleCount Remaining() const = 0;
65
67
73 virtual bool Release() = 0;
74
76 virtual bool Terminates() const;
77};
78
79}
80#endif
Accumulates (non-interleaved) data during effect processing.
Upstream producer of sample streams, taking Buffers as external context.
virtual sampleCount Remaining() const =0
Result includes any amount Acquired and not yet Released.
virtual bool AcceptsBlockSize(size_t blockSize) const =0
virtual bool AcceptsBuffers(const Buffers &buffers) const =0
virtual std::optional< size_t > Acquire(Buffers &data, size_t bound)=0
Occupy vacant space in Buffers with some data.
virtual bool Release()=0
Caller is done examining last Acquire()d positions.
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19