remove default volume sentinel value and just use 1.0

This commit is contained in:
Chris Danford
2005-10-18 07:32:35 +00:00
parent b2e9c616c8
commit 265a637be8
2 changed files with 4 additions and 7 deletions
+3 -6
View File
@@ -18,7 +18,6 @@
PrefsManager* PREFSMAN = NULL; // global and accessable from anywhere in our program
const float DEFAULT_SOUND_VOLUME = 1.00f;
const CString DEFAULT_LIGHTS_DRIVER = "Null";
//
@@ -343,7 +342,7 @@ PrefsManager::PrefsManager() :
m_sVideoRenderers ( "VideoRenderers", "" ), // StepMania.cpp sets these on first run:
m_bSmoothLines ( "SmoothLines", false ),
m_sSoundDrivers ( "SoundDrivers", "" ),
m_fSoundVolume ( "SoundVolume", -1 ), // default
m_fSoundVolume ( "SoundVolume", 1.0f ),
m_iSoundWriteAhead ( "SoundWriteAhead", 0 ),
m_iSoundDevice ( "SoundDevice", "" ),
m_SoundResampleQuality ( "SoundResampleQuality", RageSoundReader_Resample::RESAMP_NORMAL ),
@@ -465,10 +464,8 @@ CString PrefsManager::GetSoundDrivers()
float PrefsManager::GetSoundVolume()
{
if ( m_fSoundVolume==-1 )
return DEFAULT_SOUND_VOLUME;
else
return clamp(m_fSoundVolume.Get(),0.0f,1.0f);
// return a resonable volume to that users of this method don't have to handle invalid values
return clamp(m_fSoundVolume.Get(),0.0f,1.0f);
}
CString PrefsManager::GetInputDrivers() {
+1 -1
View File
@@ -230,7 +230,7 @@ public:
private:
Preference<CString> m_sSoundDrivers; // "" == default
public:
Preference<float> m_fSoundVolume; // -1 == default
Preference<float> m_fSoundVolume;
Preference<int> m_iSoundWriteAhead;
Preference<CString> m_iSoundDevice;
Preference<RageSoundReader_Resample::ResampleQuality> m_SoundResampleQuality;