manicksan
Well-known member
Hi Paul,
I did some changes to the AudioMixer so that is uses C++ template,
so that it can be instanced with:
AudioMixer<N> mixer; // N defines the number of inputs.
To make the code easier to maintain
I removed the AudioMixer4 class and replaced it with:
#define AudioMixer4 AudioMixer<4>
also all code is removed in Mixer.cpp and moved to
Mixer.h because templates don't work that way (compiler limitations), as described at:
https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl
also to share the function applyGain between AudioMixer<N> and AudioAmplifier.
the changed files are at
https://github.com/manicken/Audio/blob/master/mixer.h
https://github.com/manicken/Audio/blob/master/mixer.cpp
I hope that they can be merged to the official branch so that we don't need to make special classes for every number of inputs that is needed.
I did some changes to the AudioMixer so that is uses C++ template,
so that it can be instanced with:
AudioMixer<N> mixer; // N defines the number of inputs.
To make the code easier to maintain
I removed the AudioMixer4 class and replaced it with:
#define AudioMixer4 AudioMixer<4>
also all code is removed in Mixer.cpp and moved to
Mixer.h because templates don't work that way (compiler limitations), as described at:
https://isocpp.org/wiki/faq/templates#templates-defn-vs-decl
also to share the function applyGain between AudioMixer<N> and AudioAmplifier.
the changed files are at
https://github.com/manicken/Audio/blob/master/mixer.h
https://github.com/manicken/Audio/blob/master/mixer.cpp
I hope that they can be merged to the official branch so that we don't need to make special classes for every number of inputs that is needed.