1 #ifndef __AMUSE_SUBMIX_HPP__ 2 #define __AMUSE_SUBMIX_HPP__ 5 #include "SoundMacroState.hpp" 6 #include "IBackendSubmix.hpp" 7 #include "IBackendVoice.hpp" 8 #include "EffectBase.hpp" 9 #include "EffectChorus.hpp" 10 #include "EffectDelay.hpp" 11 #include "EffectReverb.hpp" 12 #include <unordered_set> 26 Submix* m_submix =
nullptr;
27 std::list<Submix>::iterator m_engineIt;
28 std::unique_ptr<IBackendSubmix> m_backendSubmix;
29 std::vector<std::unique_ptr<EffectBaseTypeless>> m_effectStack;
30 bool m_destroyed =
false;
47 template <
class T,
class ...Args>
50 switch (m_backendSubmix->getSampleFormat())
52 case SubmixFormat::Int16:
54 using ImpType =
typename T::template ImpType<int16_t>;
55 m_effectStack.emplace_back(
new ImpType(args..., m_backendSubmix->getSampleRate()));
56 return static_cast<ImpType&
>(*m_effectStack.back());
58 case SubmixFormat::Int32:
60 using ImpType =
typename T::template ImpType<int32_t>;
61 m_effectStack.emplace_back(
new ImpType(args..., m_backendSubmix->getSampleRate()));
62 return static_cast<ImpType&
>(*m_effectStack.back());
64 case SubmixFormat::Float:
66 using ImpType =
typename T::template ImpType<float>;
67 m_effectStack.emplace_back(
new ImpType(args..., m_backendSubmix->getSampleRate()));
68 return static_cast<ImpType&
>(*m_effectStack.back());
81 float damping,
float preDelay);
85 float damping,
float preDelay,
float crosstalk);
102 Engine& getEngine() {
return m_root;}
107 #endif // __AMUSE_SUBMIX_HPP__ void applyEffect(int16_t *audio, size_t frameCount, const ChannelMap &chanMap) const
EffectReverbStd & makeReverbStd(float coloration, float mix, float time, float damping, float preDelay)
EffectChorus & makeChorus(uint32_t baseDelay, uint32_t variation, uint32_t period)
EffectReverbHi & makeReverbHi(float coloration, float mix, float time, float damping, float preDelay, float crosstalk)
Submix * getParentSubmix()
bool canApplyEffect() const
T & makeEffect(Args...args)
EffectDelay & makeDelay(uint32_t initDelay, uint32_t initFeedback, uint32_t initOutput)