add sound volume menu option

This commit is contained in:
Chris Danford
2003-10-12 20:34:46 +00:00
parent 24e984b444
commit 037c26e20b
4 changed files with 19 additions and 2 deletions
+3 -1
View File
@@ -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
+6
View File
@@ -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 )
+9 -1
View File
@@ -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;
+1
View File
@@ -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
{