36 #ifndef __CU_AUDIO_MIXER_H__
37 #define __CU_AUDIO_MIXER_H__
38 #include "CUAudioNode.h"
64 std::shared_ptr<AudioNode>* _inputs;
74 std::atomic<float> _knee;
77 #pragma mark Constructors
109 virtual bool init()
override;
126 bool init(Uint8 width);
141 virtual bool init(Uint8 channels, Uint32 rate)
override;
157 bool init(Uint8 width, Uint8 channels, Uint32 rate);
165 virtual void dispose()
override;
167 #pragma mark Static Constructors
183 static std::shared_ptr<AudioMixer>
alloc(Uint8 width=8) {
184 std::shared_ptr<AudioMixer> result = std::make_shared<AudioMixer>();
185 return (result->init(width) ? result :
nullptr);
202 static std::shared_ptr<AudioMixer>
alloc(Uint8 width, Uint8 channels, Uint32 rate) {
203 std::shared_ptr<AudioMixer> result = std::make_shared<AudioMixer>();
204 return (result->init(width,channels, rate) ? result :
nullptr);
207 #pragma mark Audio Graph Methods
219 std::shared_ptr<AudioNode>
attach(Uint8 slot,
const std::shared_ptr<AudioNode>& input);
230 std::shared_ptr<AudioNode>
detach(Uint8 slot);
250 virtual Uint32
read(
float* buffer, Uint32 frames)
override;
252 #pragma mark Anticlipping Methods