Fix issues related to volume getting/setting
Not adding headroom to volume in HybridDirectSoundBuffer_SetMixBinVolumes_8 caused the sound to be attenuated by the headroom value every time it was updated.
This commit is contained in:
parent
a380927fba
commit
ad6438f936
|
@ -1319,7 +1319,7 @@ static inline HRESULT HybridDirectSoundBuffer_SetMixBinVolumes_8(
|
|||
}
|
||||
if (counter > 0) {
|
||||
Xb_volumeMixBin = volume / (LONG)counter;
|
||||
int32_t Xb_volume = Xb_Voice->GetVolume();
|
||||
int32_t Xb_volume = Xb_Voice->GetVolume() + Xb_Voice->GetHeadroom();
|
||||
hRet = HybridDirectSoundBuffer_SetVolume(pDSBuffer, Xb_volume, EmuFlags,
|
||||
Xb_volumeMixBin, Xb_Voice);
|
||||
} else {
|
||||
|
|
|
@ -117,7 +117,7 @@ uint32_t GetVolume(T& settings)
|
|||
|
||||
// Interface for set volume
|
||||
template<class T>
|
||||
void SetVolume(T& settings, uint32_t volume)
|
||||
void SetVolume(T& settings, int32_t volume)
|
||||
{
|
||||
settings.volume = volume - settings.headroom;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ uint32_t GetHeadroom(T& settings)
|
|||
template<class T>
|
||||
void SetHeadroom(T& settings, uint32_t set_headroom)
|
||||
{
|
||||
settings.volume = settings.volume - set_headroom - settings.headroom;
|
||||
settings.volume = settings.volume + settings.headroom - set_headroom;
|
||||
settings.headroom = set_headroom;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue