diff --git a/stepmania/Themes/default/metrics.ini b/stepmania/Themes/default/metrics.ini index 2fd2b64e24..aef7f5e079 100644 --- a/stepmania/Themes/default/metrics.ini +++ b/stepmania/Themes/default/metrics.ini @@ -2404,16 +2404,18 @@ MasterVolume= PreloadSounds=If YES, preload most sounds in advance. This increases load times,::and should normally be left OFF. ResamplingQuality=Advanced: Select the resampling quality to use. AttractSound=Set to ON to play sound during the attract screens.::Set to OFF to mute sounds durring attract. +SoundVolume= StyleIcon=0 TimerSeconds=0 PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster NextScreen=ScreenOptionsMenu@ScreenOptionsMaster -OptionMenuFlags=rows,3;together;explanations +OptionMenuFlags=rows,4;together;explanations Line1=conf,PreloadSounds Line2=conf,ResamplingQuality Line3=conf,AttractSound +Line4=conf,SoundVolume [ScreenIntroMovie] NextScreen=ScreenDemonstration diff --git a/stepmania/src/ScreenOptionsMaster.cpp b/stepmania/src/ScreenOptionsMaster.cpp index dcb40a9bba..ba4d704e8a 100644 --- a/stepmania/src/ScreenOptionsMaster.cpp +++ b/stepmania/src/ScreenOptionsMaster.cpp @@ -18,6 +18,7 @@ #include "ScreenOptionsMasterPrefs.h" #include "RageSounds.h" #include "StepMania.h" +#include "RageSoundManager.h" #define OPTION_MENU_FLAGS THEME->GetMetric (m_sName,"OptionMenuFlags") #define ROW_LINE(i) THEME->GetMetric (m_sName,ssprintf("Line%i",(i+1))) @@ -531,6 +532,11 @@ void ScreenOptionsMaster::ExportOptions() ResetGame(); m_NextScreen = ""; } + + if( ChangeMask & OPT_APPLY_SOUND ) + { + SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume ); + } } void ScreenOptionsMaster::MenuStart( PlayerNumber pn ) diff --git a/stepmania/src/ScreenOptionsMasterPrefs.cpp b/stepmania/src/ScreenOptionsMasterPrefs.cpp index 9a44ae5b17..0f508c650f 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.cpp +++ b/stepmania/src/ScreenOptionsMasterPrefs.cpp @@ -375,6 +375,12 @@ MOVE( PreloadSounds, PREFSMAN->m_bSoundPreloadAll ); MOVE( ResamplingQuality, PREFSMAN->m_iSoundResampleQuality ); MOVE( AttractSound, PREFSMAN->m_bAttractSound ); +static void SoundVolume( int &sel, bool ToSel, const CStringArray &choices ) +{ + const float mapping[] = { 0.0f,0.1f,0.2f,0.3f,0.4f,0.5f,0.6f,0.7f,0.8f,0.9f,1.0f }; + MoveMap( sel, PREFSMAN->m_fSoundVolume, ToSel, mapping, ARRAYSIZE(mapping) ); +} + static const ConfOption g_ConfOptions[] = { @@ -456,6 +462,7 @@ static const ConfOption g_ConfOptions[] = ConfOption( "Preload\nSounds", PreloadSounds, "NO","YES" ), ConfOption( "Resampling\nQuality", ResamplingQuality, "FAST","NORMAL","HIGH QUALITY" ), ConfOption( "Attract\nSound", AttractSound, "OFF","ON" ), + ConfOption( "Sound\nVolume", SoundVolume, "0%","10%","20%","30%","40%","50%","60%","70%","80%","90%","100%","10%" ), ConfOption( "", NULL ) // end marker }; @@ -475,7 +482,8 @@ int ConfOption::GetEffects() const { KeepTexturesInMemory, OPT_APPLY_GRAPHICS }, { RefreshRate, OPT_APPLY_GRAPHICS }, { WaitForVsync, OPT_APPLY_GRAPHICS }, - { GameSel, OPT_RESET_GAME } + { GameSel, OPT_RESET_GAME }, + { SoundVolume, OPT_APPLY_SOUND }, }; int ret = OPT_SAVE_PREFERENCES; diff --git a/stepmania/src/ScreenOptionsMasterPrefs.h b/stepmania/src/ScreenOptionsMasterPrefs.h index 074d3faaab..6c4da4e799 100644 --- a/stepmania/src/ScreenOptionsMasterPrefs.h +++ b/stepmania/src/ScreenOptionsMasterPrefs.h @@ -6,6 +6,7 @@ static const int MAX_OPTIONS=16; #define OPT_APPLY_GRAPHICS 0x2 #define OPT_APPLY_THEME 0x4 #define OPT_RESET_GAME 0x8 +#define OPT_APPLY_SOUND 0x16 struct ConfOption {