fix: master volume not updating on playing sounds. (via smx)

This commit is contained in:
Colby Klein
2019-03-15 18:10:19 -07:00
parent 567f8363e8
commit 996b69cb01
5 changed files with 21 additions and 9 deletions
+3 -4
View File
@@ -18,6 +18,7 @@
#include "Foreach.h"
#include "LocalizedString.h"
#include "Preference.h"
#include "RageSoundReader_PostBuffering.h"
#include "arch/Sound/RageSoundDriver.h"
@@ -35,7 +36,7 @@ static Preference<RString> g_sSoundDrivers( "SoundDrivers", "" ); // "" == DEFAU
RageSoundManager *SOUNDMAN = NULL;
RageSoundManager::RageSoundManager(): m_pDriver(NULL), m_fMixVolume(1.0f),
RageSoundManager::RageSoundManager(): m_pDriver(NULL),
m_fVolumeOfNonCriticalSounds(1.0f) {}
static LocalizedString COULDNT_FIND_SOUND_DRIVER( "RageSoundManager", "Couldn't find a sound driver that works" );
@@ -187,9 +188,7 @@ static Preference<float> g_fSoundVolume( "SoundVolume", 1.0f );
void RageSoundManager::SetMixVolume()
{
g_SoundManMutex.Lock(); /* lock for access to m_fMixVolume */
m_fMixVolume = clamp( g_fSoundVolume.Get(), 0.0f, 1.0f );
g_SoundManMutex.Unlock(); /* finished with m_fMixVolume */
RageSoundReader_PostBuffering::SetMasterVolume( g_fSoundVolume.Get() );
}
void RageSoundManager::SetVolumeOfNonCriticalSounds( float fVolumeOfNonCriticalSounds )