Audacity 3.2.0
DownmixSource.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 DownmixSource.h
6
7*******************************************************************/
8
9#pragma once
10#include "MemoryX.h"
11
13
14namespace AudioGraph
15{
16 class Source;
17}
18
25{
26public:
27 DownmixSource() = default;
28
29 virtual ~DownmixSource() = default;
31 virtual AudioGraph::Source& GetDownstream() const = 0;
33 virtual size_t NChannels() const = 0;
35 virtual float GetChannelGain(size_t channel) const = 0;
38 virtual void FindChannelFlags(unsigned char *channelFlags, size_t numChannels, size_t iChannel) = 0;
40 virtual bool CanMakeMono() const = 0;
41};
42
46{
51 const ArrayOf<bool> * mpMap {};
52public:
53
55 const WideSampleSequence& sequence,
57 const ArrayOf<bool> *channelMap);
58
59 AudioGraph::Source& GetDownstream() const override;
60 size_t NChannels() const override;
61 float GetChannelGain(size_t channel) const override;
62 void FindChannelFlags(unsigned char *channelFlags, size_t numChannels, size_t iChannel) override;
63 bool CanMakeMono() const override;
64};
65
69{
71 size_t mNChannels;
72public:
73
74 SimpleDonwmixSource(AudioGraph::Source& downstream, size_t channels);
75
76 AudioGraph::Source& GetDownstream() const override;
77 size_t NChannels() const override;
78 float GetChannelGain(size_t channel) const override;
79 void FindChannelFlags(unsigned char* channelFlags, size_t numChannels, size_t iChannel) override;
80 bool CanMakeMono() const override;
81};
Upstream producer of sample streams, taking Buffers as external context.
Describes an input source for DownmixStage Decorates an AudioGraph::Source with operations that are n...
Definition: DownmixSource.h:25
virtual AudioGraph::Source & GetDownstream() const =0
Returns underlying AudioGraph::Source processed by Mixer.
virtual bool CanMakeMono() const =0
Returns true if source channels could be combined into mono if needed.
virtual float GetChannelGain(size_t channel) const =0
Gain multiplier that should be applied to the channel.
virtual size_t NChannels() const =0
Number of output channels of the underlying Source.
DownmixSource()=default
virtual void FindChannelFlags(unsigned char *channelFlags, size_t numChannels, size_t iChannel)=0
virtual ~DownmixSource()=default
void FindChannelFlags(unsigned char *channelFlags, size_t numChannels, size_t iChannel) override
bool CanMakeMono() const override
Returns true if source channels could be combined into mono if needed.
const WideSampleSequence & mSequence
Definition: DownmixSource.h:48
SequenceDownmixSource(AudioGraph::Source &downstream, const WideSampleSequence &sequence, const ArrayOf< bool > *channelMap)
size_t NChannels() const override
Number of output channels of the underlying Source.
AudioGraph::Source & mDownstream
Definition: DownmixSource.h:47
const ArrayOf< bool > * mpMap
Definition: DownmixSource.h:51
float GetChannelGain(size_t channel) const override
Gain multiplier that should be applied to the channel.
AudioGraph::Source & GetDownstream() const override
Returns underlying AudioGraph::Source processed by Mixer.
AudioGraph::Source & GetDownstream() const override
Returns underlying AudioGraph::Source processed by Mixer.
SimpleDonwmixSource(AudioGraph::Source &downstream, size_t channels)
size_t NChannels() const override
Number of output channels of the underlying Source.
float GetChannelGain(size_t channel) const override
Gain multiplier that should be applied to the channel.
void FindChannelFlags(unsigned char *channelFlags, size_t numChannels, size_t iChannel) override
AudioGraph::Source & mDownstream
Definition: DownmixSource.h:70
bool CanMakeMono() const override
Returns true if source channels could be combined into mono if needed.