From: <man...@us...> - 2013-06-06 18:42:41
|
Revision: 2309 http://sourceforge.net/p/modplug/code/2309 Author: manxorist Date: 2013-06-06 18:42:34 +0000 (Thu, 06 Jun 2013) Log Message: ----------- [Fix] In quad channel output mode, also apply equalizer to rear channels. Modified Paths: -------------- trunk/OpenMPT/sounddsp/EQ.cpp trunk/OpenMPT/sounddsp/EQ.h trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/sounddsp/EQ.cpp =================================================================== --- trunk/OpenMPT/sounddsp/EQ.cpp 2013-06-06 18:09:24 UTC (rev 2308) +++ trunk/OpenMPT/sounddsp/EQ.cpp 2013-06-06 18:42:34 UTC (rev 2309) @@ -513,3 +513,34 @@ Initialize(bReset, MixingFreq); } + + +void CQuadEQ::Initialize(BOOL bReset, DWORD MixingFreq) +//----------------------------------------------------- +{ + front.Initialize(bReset, MixingFreq); + rear.Initialize(bReset, MixingFreq); +} + +void CQuadEQ::SetEQGains(const UINT *pGains, UINT nGains, const UINT *pFreqs, BOOL bReset, DWORD MixingFreq) +//---------------------------------------------------------------------------------------------------------- +{ + front.SetEQGains(pGains, nGains, pFreqs, bReset, MixingFreq); + rear.SetEQGains(pGains, nGains, pFreqs, bReset, MixingFreq); +} + +void CQuadEQ::Process(int *frontBuffer, int *rearBuffer, float *tempFloatBuffer, UINT nCount, UINT nChannels) +//----------------------------------------------------------------------------------------------------------- +{ + if(nChannels == 1) + { + front.ProcessMono(frontBuffer, tempFloatBuffer, nCount); + } else if(nChannels == 2) + { + front.ProcessStereo(frontBuffer, tempFloatBuffer, nCount); + } else if(nChannels == 4) + { + front.ProcessStereo(frontBuffer, tempFloatBuffer, nCount); + rear.ProcessStereo(rearBuffer, tempFloatBuffer, nCount); + } +} Modified: trunk/OpenMPT/sounddsp/EQ.h =================================================================== --- trunk/OpenMPT/sounddsp/EQ.h 2013-06-06 18:09:24 UTC (rev 2308) +++ trunk/OpenMPT/sounddsp/EQ.h 2013-06-06 18:42:34 UTC (rev 2309) @@ -45,3 +45,17 @@ void SetEQGains(const UINT *pGains, UINT nGains, const UINT *pFreqs, BOOL bReset, DWORD MixingFreq); }; + +//=========== +class CQuadEQ +//=========== +{ +private: + CEQ front; + CEQ rear; +public: + void Initialize(BOOL bReset, DWORD MixingFreq); + void Process(int *frontBuffer, int *rearBuffer, float *tempFloatBuffer, UINT nCount, UINT nChannels); + void SetEQGains(const UINT *pGains, UINT nGains, const UINT *pFreqs, BOOL bReset, DWORD MixingFreq); +}; + Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-06-06 18:09:24 UTC (rev 2308) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-06-06 18:42:34 UTC (rev 2309) @@ -311,7 +311,7 @@ CDSP m_DSP; #endif #ifndef NO_EQ - CEQ m_EQ; + CQuadEQ m_EQ; #endif #ifndef NO_AGC CAGC m_AGC; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2013-06-06 18:09:24 UTC (rev 2308) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2013-06-06 18:42:34 UTC (rev 2309) @@ -338,10 +338,7 @@ // Graphic Equalizer if (m_MixerSettings.DSPMask & SNDDSP_EQ) { - if (m_MixerSettings.gnChannels >= 2) - m_EQ.ProcessStereo(MixSoundBuffer, MixFloatBuffer, lCount); - else - m_EQ.ProcessMono(MixSoundBuffer, MixFloatBuffer, lCount); + m_EQ.Process(MixSoundBuffer, MixRearBuffer, MixFloatBuffer, lCount, m_MixerSettings.gnChannels); } #endif // NO_EQ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |