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
|
|
|
|
|
};
|
2003-03-15 19:25:37 +00:00
|
|
|
OptionRow g_SoundOptionsLines[NUM_SOUND_OPTIONS_LINES] = {
|
|
|
|
|
OptionRow( "Master\nVolume", "MUTE","20%","40%","60%","80%","100%" ),
|
2003-02-19 10:58:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScreenSoundOptions::ScreenSoundOptions() :
|
2003-03-09 00:55:49 +00:00
|
|
|
ScreenOptions("ScreenSoundOptions",false)
|
2003-02-19 10:58:32 +00:00
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenSoundOptions::ScreenSoundOptions()" );
|
|
|
|
|
|
2003-03-15 19:25:37 +00:00
|
|
|
Init( INPUTMODE_BOTH, g_SoundOptionsLines, NUM_SOUND_OPTIONS_LINES, false, true );
|
2003-03-11 21:33:11 +00:00
|
|
|
m_Menu.m_MenuTimer.Disable();
|
2003-02-19 10:58:32 +00:00
|
|
|
|
2003-03-09 00:55:49 +00:00
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","ScreenSoundOptions music") );
|
2003-02-19 10:58:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|