2003-02-19 10:58:32 +00:00
|
|
|
#include "global.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenSoundOptions
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
Kevin Slaughter
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenSoundOptions.h"
|
|
|
|
|
#include "RageTextureManager.h"
|
|
|
|
|
#include "RageUtil.h"
|
|
|
|
|
#include "RageSoundManager.h"
|
|
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "StepMania.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "RageLog.h"
|
|
|
|
|
#include "ThemeManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
SO_MASTER_VOLUME,
|
|
|
|
|
NUM_SOUND_OPTIONS_LINES
|
|
|
|
|
};
|
|
|
|
|
OptionRowData g_SoundOptionsLines[NUM_SOUND_OPTIONS_LINES] = {
|
2003-02-19 23:49:57 +00:00
|
|
|
{ "Master\nVolume", 6, {"MUTE","20%","40%","60%","80%","100%"} },
|
2003-02-19 10:58:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScreenSoundOptions::ScreenSoundOptions() :
|
|
|
|
|
ScreenOptions( THEME->GetPathTo("BGAnimations","sound options"),
|
|
|
|
|
THEME->GetPathTo("Graphics","sound options page"),
|
|
|
|
|
THEME->GetPathTo("Graphics","sound options top edge") )
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenSoundOptions::ScreenSoundOptions()" );
|
|
|
|
|
|
|
|
|
|
// fill g_InputOptionsLines with explanation text
|
|
|
|
|
for( int i=0; i<NUM_SOUND_OPTIONS_LINES; i++ )
|
|
|
|
|
{
|
|
|
|
|
CString sLineName = g_SoundOptionsLines[i].szTitle;
|
|
|
|
|
sLineName.Replace("\n","");
|
|
|
|
|
sLineName.Replace(" ","");
|
|
|
|
|
strcpy( g_SoundOptionsLines[i].szExplanation, THEME->GetMetric("ScreenSoundOptions",sLineName) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Init( INPUTMODE_BOTH, g_SoundOptionsLines, NUM_SOUND_OPTIONS_LINES, false );
|
|
|
|
|
m_Menu.StopTimer();
|
|
|
|
|
|
|
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","sound options music") );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSoundOptions::Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI )
|
|
|
|
|
{
|
|
|
|
|
this->ExportOptions();
|
|
|
|
|
Screen::Input( DeviceI, type, GameI, MenuI, StyleI );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSoundOptions::ImportOptions()
|
|
|
|
|
{
|
2003-02-19 23:49:57 +00:00
|
|
|
float fVolPercent = PREFSMAN->m_fSoundVolume;
|
|
|
|
|
m_iSelectedOption[0][SO_MASTER_VOLUME] = (int)(fVolPercent*5);
|
2003-02-19 10:58:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSoundOptions::ExportOptions()
|
|
|
|
|
{
|
2003-02-19 23:49:57 +00:00
|
|
|
float fVolPercent = m_iSelectedOption[0][SO_MASTER_VOLUME] / 5.f;
|
|
|
|
|
SOUNDMAN->SetPrefs(fVolPercent);
|
|
|
|
|
PREFSMAN->m_fSoundVolume = fVolPercent;
|
2003-02-19 10:58:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSoundOptions::GoToPrevState()
|
|
|
|
|
{
|
|
|
|
|
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenSoundOptions::GoToNextState()
|
|
|
|
|
{
|
|
|
|
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
|
|
|
|
GoToPrevState();
|
2003-02-20 02:34:41 +00:00
|
|
|
}
|
|
|
|
|
|