Audacity 3.2.0
WaveTrackSink.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file WaveTrackSink.h
6 @brief Adapter of WaveTrack to the interface AudioGraph::Sink
7
8 Dominic Mazzoni
9 Vaughan Johnson
10
11 Paul Licameli split from PerTrackEffect.h
12
13**********************************************************************/
14
15#ifndef __AUDACITY_WAVE_TRACK_SINK__
16#define __AUDACITY_WAVE_TRACK_SINK__
17
18#include "AudioGraphSink.h" // to inherit
19#include "SampleCount.h"
20#include "SampleFormat.h"
21#include <memory>
22
23class WaveTrack;
24
25class WaveTrackSink final : public AudioGraph::Sink {
26public:
27 WaveTrackSink(WaveTrack &left, WaveTrack *pRight,
28 sampleCount start, bool isGenerator, bool isProcessor,
30 sampleFormat effectiveFormat);
31 ~WaveTrackSink() override;
32
34 bool AcceptsBuffers(const Buffers &buffers) const override;
35
36 bool Acquire(Buffers &data) override;
37 bool Release(const Buffers &data, size_t curBlockSize) override;
38
42 void Flush(Buffers &data, double t0, double t1);
43
44private:
49 void DoConsume(Buffers &data);
50
53 const std::shared_ptr<WaveTrack> mGenLeft, mGenRight;
54 const bool mIsProcessor;
56
58};
59#endif
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
Accumulates (non-interleaved) data during effect processing.
Downstream receiver of sample streams, taking Buffers as external context.
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
const sampleFormat mEffectiveFormat
Definition: WaveTrackSink.h:55
~WaveTrackSink() override
WaveTrackSink(WaveTrack &left, WaveTrack *pRight, sampleCount start, bool isGenerator, bool isProcessor, sampleFormat effectiveFormat)
void DoConsume(Buffers &data)
bool Acquire(Buffers &data) override
Guarantee empty space in Buffers before they are written.
bool Release(const Buffers &data, size_t curBlockSize) override
Acknowledge receipt of data in Buffers, which caller may then Advance()
void Flush(Buffers &data, double t0, double t1)
WaveTrack & mLeft
Definition: WaveTrackSink.h:51
const bool mIsProcessor
Definition: WaveTrackSink.h:54
sampleCount mOutPos
Definition: WaveTrackSink.h:57
const std::shared_ptr< WaveTrack > mGenLeft
Definition: WaveTrackSink.h:53
bool AcceptsBuffers(const Buffers &buffers) const override
Accepts buffers only if there is at least one channel.
WaveTrack *const mpRight
Definition: WaveTrackSink.h:52
const std::shared_ptr< WaveTrack > mGenRight
Definition: WaveTrackSink.h:53
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19