From: <man...@us...> - 2013-03-25 15:13:45
|
Revision: 1669 http://sourceforge.net/p/modplug/code/1669 Author: manxorist Date: 2013-03-25 15:13:37 +0000 (Mon, 25 Mar 2013) Log Message: ----------- [Ref] Move reverb-related state and setup code from sounddsp/DSP.cpp to soundlib/Snd_rvb.cpp and soundlib/Sndmix.cpp. Modified Paths: -------------- trunk/OpenMPT/sounddsp/DSP.cpp trunk/OpenMPT/soundlib/Snd_rvb.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/sounddsp/DSP.cpp =================================================================== --- trunk/OpenMPT/sounddsp/DSP.cpp 2013-03-25 15:03:37 UTC (rev 1668) +++ trunk/OpenMPT/sounddsp/DSP.cpp 2013-03-25 15:13:37 UTC (rev 1669) @@ -26,8 +26,6 @@ // DSP Effects: PUBLIC members UINT CSoundFile::m_nXBassDepth = DEFAULT_XBASS_DEPTH; UINT CSoundFile::m_nXBassRange = DEFAULT_XBASS_RANGE; -UINT CSoundFile::gnReverbType = 0; -UINT CSoundFile::m_nReverbDepth = 8; // 50% UINT CSoundFile::m_nProLogicDepth = 12; UINT CSoundFile::m_nProLogicDelay = 20; @@ -74,8 +72,6 @@ extern int MixSoundBuffer[MIXBUFFERSIZE * 4]; extern int MixRearBuffer[MIXBUFFERSIZE * 2]; -extern VOID InitializeReverb(BOOL bReset); -extern VOID ProcessReverb(UINT nSamples); extern VOID MPPASMCALL X86_InitMixBuffer(int *pBuffer, UINT nSamples); extern VOID MPPASMCALL X86_StereoFill(int *pBuffer, UINT nSamples, LPLONG lpROfs, LPLONG lpLOfs); extern VOID MPPASMCALL X86_StereoDCRemoval(int *, UINT count); @@ -160,7 +156,6 @@ void CSoundFile::InitializeDSP(BOOL bReset) //----------------------------------------- { - if (gnReverbType >= NUM_REVERBTYPES) gnReverbType = 0; if (!m_nProLogicDelay) m_nProLogicDelay = 20; if (bReset) { @@ -189,10 +184,6 @@ nDolbyLP_B0 *= 2; nDolbyLP_B1 *= 2; } - // Reverb Setup -#ifndef NO_REVERB - InitializeReverb(bReset); -#endif // Bass Expansion Reset if (gdwSoundSetup & SNDMIX_MEGABASS) { @@ -473,20 +464,6 @@ ///////////////////////////////////////////////////////////////// // Clean DSP Effects interface -// [Reverb level 0(quiet)-100(loud)], [type = REVERBTYPE_XXXX] -BOOL CSoundFile::SetReverbParameters(UINT nDepth, UINT nType) -//----------------------------------------------------------- -{ - if (nDepth > 100) nDepth = 100; - UINT gain = (nDepth * 16) / 100; - if (gain > 16) gain = 16; - if (gain < 1) gain = 1; - m_nReverbDepth = gain; - if (nType < NUM_REVERBTYPES) gnReverbType = nType; - return TRUE; -} - - // [XBass level 0(quiet)-100(loud)], [cutoff in Hz 20-100] BOOL CSoundFile::SetXBassParameters(UINT nDepth, UINT nRange) //----------------------------------------------------------- Modified: trunk/OpenMPT/soundlib/Snd_rvb.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_rvb.cpp 2013-03-25 15:03:37 UTC (rev 1668) +++ trunk/OpenMPT/soundlib/Snd_rvb.cpp 2013-03-25 15:13:37 UTC (rev 1669) @@ -34,6 +34,9 @@ LONG gnRvbROfsVol = 0; LONG gnRvbLOfsVol = 0; +UINT CSoundFile::gnReverbType = 0; +UINT CSoundFile::m_nReverbDepth = 8; // 50% + // Internal reverb state static BOOL g_bLastInPresent = 0; static BOOL g_bLastOutPresent = 0; @@ -243,6 +246,7 @@ VOID InitializeReverb(BOOL bReset) //-------------------------------- { + if (CSoundFile::gnReverbType >= NUM_REVERBTYPES) CSoundFile::gnReverbType = 0; static PSNDMIX_REVERB_PROPERTIES spCurrentPreset = NULL; PSNDMIX_REVERB_PROPERTIES pRvbPreset = &gRvbPresets[CSoundFile::gnReverbType].Preset; @@ -351,6 +355,20 @@ } +// [Reverb level 0(quiet)-100(loud)], [type = REVERBTYPE_XXXX] +BOOL CSoundFile::SetReverbParameters(UINT nDepth, UINT nType) +//----------------------------------------------------------- +{ + if (nDepth > 100) nDepth = 100; + UINT gain = (nDepth * 16) / 100; + if (gain > 16) gain = 16; + if (gain < 1) gain = 1; + m_nReverbDepth = gain; + if (nType < NUM_REVERBTYPES) gnReverbType = nType; + return TRUE; +} + + // Reverb VOID ProcessReverb(UINT nSamples) //------------------------------- Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2013-03-25 15:03:37 UTC (rev 1668) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2013-03-25 15:13:37 UTC (rev 1669) @@ -81,6 +81,7 @@ extern LONG gnRvbROfsVol; extern LONG gnRvbLOfsVol; +extern VOID InitializeReverb(BOOL bReset); extern void ProcessReverb(UINT nSamples); #endif @@ -164,6 +165,9 @@ gnRvbROfsVol = gnRvbLOfsVol = 0; #endif if (bReset) gnCPUUsage = 0; +#ifndef NO_REVERB + InitializeReverb(bReset); +#endif InitializeDSP(bReset); #ifdef ENABLE_EQ InitializeEQ(bReset); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |