add sound volume menu option
This commit is contained in:
@@ -2404,16 +2404,18 @@ MasterVolume=
|
|||||||
PreloadSounds=If YES, preload most sounds in advance. This increases load times,::and should normally be left OFF.
|
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.
|
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.
|
AttractSound=Set to ON to play sound during the attract screens.::Set to OFF to mute sounds durring attract.
|
||||||
|
SoundVolume=
|
||||||
StyleIcon=0
|
StyleIcon=0
|
||||||
TimerSeconds=0
|
TimerSeconds=0
|
||||||
|
|
||||||
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
|
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
|
||||||
NextScreen=ScreenOptionsMenu@ScreenOptionsMaster
|
NextScreen=ScreenOptionsMenu@ScreenOptionsMaster
|
||||||
|
|
||||||
OptionMenuFlags=rows,3;together;explanations
|
OptionMenuFlags=rows,4;together;explanations
|
||||||
Line1=conf,PreloadSounds
|
Line1=conf,PreloadSounds
|
||||||
Line2=conf,ResamplingQuality
|
Line2=conf,ResamplingQuality
|
||||||
Line3=conf,AttractSound
|
Line3=conf,AttractSound
|
||||||
|
Line4=conf,SoundVolume
|
||||||
|
|
||||||
[ScreenIntroMovie]
|
[ScreenIntroMovie]
|
||||||
NextScreen=ScreenDemonstration
|
NextScreen=ScreenDemonstration
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "ScreenOptionsMasterPrefs.h"
|
#include "ScreenOptionsMasterPrefs.h"
|
||||||
#include "RageSounds.h"
|
#include "RageSounds.h"
|
||||||
#include "StepMania.h"
|
#include "StepMania.h"
|
||||||
|
#include "RageSoundManager.h"
|
||||||
|
|
||||||
#define OPTION_MENU_FLAGS THEME->GetMetric (m_sName,"OptionMenuFlags")
|
#define OPTION_MENU_FLAGS THEME->GetMetric (m_sName,"OptionMenuFlags")
|
||||||
#define ROW_LINE(i) THEME->GetMetric (m_sName,ssprintf("Line%i",(i+1)))
|
#define ROW_LINE(i) THEME->GetMetric (m_sName,ssprintf("Line%i",(i+1)))
|
||||||
@@ -531,6 +532,11 @@ void ScreenOptionsMaster::ExportOptions()
|
|||||||
ResetGame();
|
ResetGame();
|
||||||
m_NextScreen = "";
|
m_NextScreen = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( ChangeMask & OPT_APPLY_SOUND )
|
||||||
|
{
|
||||||
|
SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOptionsMaster::MenuStart( PlayerNumber pn )
|
void ScreenOptionsMaster::MenuStart( PlayerNumber pn )
|
||||||
|
|||||||
@@ -375,6 +375,12 @@ MOVE( PreloadSounds, PREFSMAN->m_bSoundPreloadAll );
|
|||||||
MOVE( ResamplingQuality, PREFSMAN->m_iSoundResampleQuality );
|
MOVE( ResamplingQuality, PREFSMAN->m_iSoundResampleQuality );
|
||||||
MOVE( AttractSound, PREFSMAN->m_bAttractSound );
|
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[] =
|
static const ConfOption g_ConfOptions[] =
|
||||||
{
|
{
|
||||||
@@ -456,6 +462,7 @@ static const ConfOption g_ConfOptions[] =
|
|||||||
ConfOption( "Preload\nSounds", PreloadSounds, "NO","YES" ),
|
ConfOption( "Preload\nSounds", PreloadSounds, "NO","YES" ),
|
||||||
ConfOption( "Resampling\nQuality", ResamplingQuality, "FAST","NORMAL","HIGH QUALITY" ),
|
ConfOption( "Resampling\nQuality", ResamplingQuality, "FAST","NORMAL","HIGH QUALITY" ),
|
||||||
ConfOption( "Attract\nSound", AttractSound, "OFF","ON" ),
|
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
|
ConfOption( "", NULL ) // end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -475,7 +482,8 @@ int ConfOption::GetEffects() const
|
|||||||
{ KeepTexturesInMemory, OPT_APPLY_GRAPHICS },
|
{ KeepTexturesInMemory, OPT_APPLY_GRAPHICS },
|
||||||
{ RefreshRate, OPT_APPLY_GRAPHICS },
|
{ RefreshRate, OPT_APPLY_GRAPHICS },
|
||||||
{ WaitForVsync, OPT_APPLY_GRAPHICS },
|
{ WaitForVsync, OPT_APPLY_GRAPHICS },
|
||||||
{ GameSel, OPT_RESET_GAME }
|
{ GameSel, OPT_RESET_GAME },
|
||||||
|
{ SoundVolume, OPT_APPLY_SOUND },
|
||||||
};
|
};
|
||||||
|
|
||||||
int ret = OPT_SAVE_PREFERENCES;
|
int ret = OPT_SAVE_PREFERENCES;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ static const int MAX_OPTIONS=16;
|
|||||||
#define OPT_APPLY_GRAPHICS 0x2
|
#define OPT_APPLY_GRAPHICS 0x2
|
||||||
#define OPT_APPLY_THEME 0x4
|
#define OPT_APPLY_THEME 0x4
|
||||||
#define OPT_RESET_GAME 0x8
|
#define OPT_RESET_GAME 0x8
|
||||||
|
#define OPT_APPLY_SOUND 0x16
|
||||||
|
|
||||||
struct ConfOption
|
struct ConfOption
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user