Mixer: Devirtualize

Nothing in the codebase inherits from this class
This commit is contained in:
Lioncash 2016-01-14 00:58:01 -05:00
parent 48b60649af
commit 531a3ed09a
2 changed files with 14 additions and 9 deletions

View File

@ -31,6 +31,10 @@ CMixer::CMixer(unsigned int BackendSampleRate)
INFO_LOG(AUDIO_INTERFACE, "Mixer is initialized"); INFO_LOG(AUDIO_INTERFACE, "Mixer is initialized");
} }
CMixer::~CMixer()
{
}
// Executed from sound stream thread // Executed from sound stream thread
unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, bool consider_framelimit) unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, bool consider_framelimit)
{ {

View File

@ -18,19 +18,19 @@
#define CONTROL_FACTOR 0.2f // in freq_shift per fifo size offset #define CONTROL_FACTOR 0.2f // in freq_shift per fifo size offset
#define CONTROL_AVG 32 #define CONTROL_AVG 32
class CMixer class CMixer final
{ {
public: public:
CMixer(unsigned int BackendSampleRate); explicit CMixer(unsigned int BackendSampleRate);
virtual ~CMixer() {} ~CMixer();
// Called from audio threads // Called from audio threads
virtual unsigned int Mix(short* samples, unsigned int numSamples, bool consider_framelimit = true); unsigned int Mix(short* samples, unsigned int numSamples, bool consider_framelimit = true);
// Called from main thread // Called from main thread
virtual void PushSamples(const short* samples, unsigned int num_samples); void PushSamples(const short* samples, unsigned int num_samples);
virtual void PushStreamingSamples(const short* samples, unsigned int num_samples); void PushStreamingSamples(const short* samples, unsigned int num_samples);
virtual void PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples, unsigned int sample_rate); void PushWiimoteSpeakerSamples(const short* samples, unsigned int num_samples, unsigned int sample_rate);
unsigned int GetSampleRate() const { return m_sampleRate; } unsigned int GetSampleRate() const { return m_sampleRate; }
void SetDMAInputSampleRate(unsigned int rate); void SetDMAInputSampleRate(unsigned int rate);
@ -47,8 +47,9 @@ public:
float GetCurrentSpeed() const { return m_speed.load(); } float GetCurrentSpeed() const { return m_speed.load(); }
void UpdateSpeed(float val) { m_speed.store(val); } void UpdateSpeed(float val) { m_speed.store(val); }
protected: private:
class MixerFifo { class MixerFifo final
{
public: public:
MixerFifo(CMixer *mixer, unsigned sample_rate) MixerFifo(CMixer *mixer, unsigned sample_rate)
: m_mixer(mixer) : m_mixer(mixer)