summaryrefslogtreecommitdiffhomepage
path: root/Stars45/AudDlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/AudDlg.cpp')
-rw-r--r--Stars45/AudDlg.cpp164
1 files changed, 82 insertions, 82 deletions
diff --git a/Stars45/AudDlg.cpp b/Stars45/AudDlg.cpp
index 30d3c67..d1cd1b0 100644
--- a/Stars45/AudDlg.cpp
+++ b/Stars45/AudDlg.cpp
@@ -1,15 +1,15 @@
/* Project Starshatter 4.5
- Destroyer Studios LLC
- Copyright © 1997-2004. All Rights Reserved.
+ Destroyer Studios LLC
+ Copyright © 1997-2004. All Rights Reserved.
- SUBSYSTEM: Stars.exe
- FILE: AudDlg.cpp
- AUTHOR: John DiCamillo
+ SUBSYSTEM: Stars.exe
+ FILE: AudDlg.cpp
+ AUTHOR: John DiCamillo
- OVERVIEW
- ========
- Main Menu Dialog Active Window class
+ OVERVIEW
+ ========
+ Main Menu Dialog Active Window class
*/
#include "MemDebug.h"
@@ -40,11 +40,11 @@ DEF_MAP_CLIENT(AudDlg, OnMod);
// +--------------------------------------------------------------------+
AudDlg::AudDlg(Screen* s, FormDef& def, BaseScreen* mgr)
- : FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr),
- apply(0), cancel(0), vid_btn(0), aud_btn(0), ctl_btn(0), opt_btn(0), mod_btn(0),
- closed(true)
+: FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr),
+apply(0), cancel(0), vid_btn(0), aud_btn(0), ctl_btn(0), opt_btn(0), mod_btn(0),
+closed(true)
{
- Init(def);
+ Init(def);
}
AudDlg::~AudDlg()
@@ -56,39 +56,39 @@ AudDlg::~AudDlg()
void
AudDlg::RegisterControls()
{
- if (apply)
- return;
+ if (apply)
+ return;
- efx_volume_slider = (Slider*) FindControl(201);
- gui_volume_slider = (Slider*) FindControl(202);
- wrn_volume_slider = (Slider*) FindControl(203);
- vox_volume_slider = (Slider*) FindControl(204);
+ efx_volume_slider = (Slider*) FindControl(201);
+ gui_volume_slider = (Slider*) FindControl(202);
+ wrn_volume_slider = (Slider*) FindControl(203);
+ vox_volume_slider = (Slider*) FindControl(204);
- menu_music_slider = (Slider*) FindControl(205);
- game_music_slider = (Slider*) FindControl(206);
+ menu_music_slider = (Slider*) FindControl(205);
+ game_music_slider = (Slider*) FindControl(206);
- apply = (Button*) FindControl(1);
- REGISTER_CLIENT(EID_CLICK, apply, AudDlg, OnApply);
+ apply = (Button*) FindControl(1);
+ REGISTER_CLIENT(EID_CLICK, apply, AudDlg, OnApply);
- cancel = (Button*) FindControl(2);
- REGISTER_CLIENT(EID_CLICK, cancel, AudDlg, OnCancel);
+ cancel = (Button*) FindControl(2);
+ REGISTER_CLIENT(EID_CLICK, cancel, AudDlg, OnCancel);
- vid_btn = (Button*) FindControl(901);
- REGISTER_CLIENT(EID_CLICK, vid_btn, AudDlg, OnVideo);
+ vid_btn = (Button*) FindControl(901);
+ REGISTER_CLIENT(EID_CLICK, vid_btn, AudDlg, OnVideo);
- aud_btn = (Button*) FindControl(902);
- REGISTER_CLIENT(EID_CLICK, aud_btn, AudDlg, OnAudio);
+ aud_btn = (Button*) FindControl(902);
+ REGISTER_CLIENT(EID_CLICK, aud_btn, AudDlg, OnAudio);
- ctl_btn = (Button*) FindControl(903);
- REGISTER_CLIENT(EID_CLICK, ctl_btn, AudDlg, OnControls);
+ ctl_btn = (Button*) FindControl(903);
+ REGISTER_CLIENT(EID_CLICK, ctl_btn, AudDlg, OnControls);
- opt_btn = (Button*) FindControl(904);
- REGISTER_CLIENT(EID_CLICK, opt_btn, AudDlg, OnOptions);
+ opt_btn = (Button*) FindControl(904);
+ REGISTER_CLIENT(EID_CLICK, opt_btn, AudDlg, OnOptions);
- mod_btn = (Button*) FindControl(905);
- if (mod_btn) {
- REGISTER_CLIENT(EID_CLICK, mod_btn, AudDlg, OnMod);
- }
+ mod_btn = (Button*) FindControl(905);
+ if (mod_btn) {
+ REGISTER_CLIENT(EID_CLICK, mod_btn, AudDlg, OnMod);
+ }
}
// +--------------------------------------------------------------------+
@@ -96,37 +96,37 @@ AudDlg::RegisterControls()
void
AudDlg::Show()
{
- FormWindow::Show();
+ FormWindow::Show();
- if (closed && AudioConfig::GetInstance()) {
- AudioConfig* audio = AudioConfig::GetInstance();
+ if (closed && AudioConfig::GetInstance()) {
+ AudioConfig* audio = AudioConfig::GetInstance();
- if (efx_volume_slider)
- efx_volume_slider->SetValue(audio->GetEfxVolume());
+ if (efx_volume_slider)
+ efx_volume_slider->SetValue(audio->GetEfxVolume());
- if (gui_volume_slider)
- gui_volume_slider->SetValue(audio->GetGuiVolume());
+ if (gui_volume_slider)
+ gui_volume_slider->SetValue(audio->GetGuiVolume());
- if (wrn_volume_slider)
- wrn_volume_slider->SetValue(audio->GetWrnVolume());
+ if (wrn_volume_slider)
+ wrn_volume_slider->SetValue(audio->GetWrnVolume());
- if (vox_volume_slider)
- vox_volume_slider->SetValue(audio->GetVoxVolume());
+ if (vox_volume_slider)
+ vox_volume_slider->SetValue(audio->GetVoxVolume());
- if (menu_music_slider)
- menu_music_slider->SetValue(audio->GetMenuMusic());
+ if (menu_music_slider)
+ menu_music_slider->SetValue(audio->GetMenuMusic());
- if (game_music_slider)
- game_music_slider->SetValue(audio->GetGameMusic());
- }
+ if (game_music_slider)
+ game_music_slider->SetValue(audio->GetGameMusic());
+ }
- if (vid_btn) vid_btn->SetButtonState(0);
- if (aud_btn) aud_btn->SetButtonState(1);
- if (ctl_btn) ctl_btn->SetButtonState(0);
- if (opt_btn) opt_btn->SetButtonState(0);
- if (mod_btn) mod_btn->SetButtonState(0);
+ if (vid_btn) vid_btn->SetButtonState(0);
+ if (aud_btn) aud_btn->SetButtonState(1);
+ if (ctl_btn) ctl_btn->SetButtonState(0);
+ if (opt_btn) opt_btn->SetButtonState(0);
+ if (mod_btn) mod_btn->SetButtonState(0);
- closed = false;
+ closed = false;
}
// +--------------------------------------------------------------------+
@@ -134,9 +134,9 @@ AudDlg::Show()
void
AudDlg::ExecFrame()
{
- if (Keyboard::KeyDown(VK_RETURN)) {
- OnApply(0);
- }
+ if (Keyboard::KeyDown(VK_RETURN)) {
+ OnApply(0);
+ }
}
// +--------------------------------------------------------------------+
@@ -152,14 +152,14 @@ void AudDlg::OnMod(AWEvent* event) { manager->ShowModDlg(); }
void
AudDlg::OnApply(AWEvent* event)
{
- if (manager)
- manager->ApplyOptions();
+ if (manager)
+ manager->ApplyOptions();
}
void
AudDlg::OnCancel(AWEvent* event)
{
- manager->CancelOptions();
+ manager->CancelOptions();
}
// +--------------------------------------------------------------------+
@@ -167,35 +167,35 @@ AudDlg::OnCancel(AWEvent* event)
void
AudDlg::Apply()
{
- if (!closed && AudioConfig::GetInstance()) {
- AudioConfig* audio = AudioConfig::GetInstance();
+ if (!closed && AudioConfig::GetInstance()) {
+ AudioConfig* audio = AudioConfig::GetInstance();
- if (efx_volume_slider)
- audio->SetEfxVolume(efx_volume_slider->GetValue());
+ if (efx_volume_slider)
+ audio->SetEfxVolume(efx_volume_slider->GetValue());
- if (gui_volume_slider)
- audio->SetGuiVolume(gui_volume_slider->GetValue());
+ if (gui_volume_slider)
+ audio->SetGuiVolume(gui_volume_slider->GetValue());
- if (wrn_volume_slider)
- audio->SetWrnVolume(wrn_volume_slider->GetValue());
+ if (wrn_volume_slider)
+ audio->SetWrnVolume(wrn_volume_slider->GetValue());
- if (vox_volume_slider)
- audio->SetVoxVolume(vox_volume_slider->GetValue());
+ if (vox_volume_slider)
+ audio->SetVoxVolume(vox_volume_slider->GetValue());
- if (menu_music_slider)
- audio->SetMenuMusic(menu_music_slider->GetValue());
+ if (menu_music_slider)
+ audio->SetMenuMusic(menu_music_slider->GetValue());
- if (game_music_slider)
- audio->SetGameMusic(game_music_slider->GetValue());
+ if (game_music_slider)
+ audio->SetGameMusic(game_music_slider->GetValue());
- audio->Save();
- }
+ audio->Save();
+ }
- closed = true;
+ closed = true;
}
void
AudDlg::Cancel()
{
- closed = true;
+ closed = true;
}