2011-02-15 19:05:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.MultiClient
|
|
|
|
|
{
|
2011-06-12 00:14:19 +00:00
|
|
|
|
public partial class SoundConfig : Form
|
|
|
|
|
{
|
|
|
|
|
public SoundConfig()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2011-02-15 19:05:21 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void SoundConfig_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SoundOnCheckBox.Checked = Global.Config.SoundEnabled;
|
|
|
|
|
MuteFrameAdvance.Checked = Global.Config.MuteFrameAdvance;
|
2012-10-01 15:20:41 +00:00
|
|
|
|
ThrottlecheckBox.Checked = Global.Config.SoundThrottle;
|
2011-06-12 00:14:19 +00:00
|
|
|
|
SoundVolBar.Value = Global.Config.SoundVolume;
|
|
|
|
|
SoundVolNumeric.Value = Global.Config.SoundVolume;
|
|
|
|
|
UpdateSoundDialog();
|
2012-10-04 02:05:07 +00:00
|
|
|
|
|
2012-11-12 17:57:11 +00:00
|
|
|
|
// to be removed
|
2012-12-25 20:36:04 +00:00
|
|
|
|
//if (MainForm.INTERIM)
|
2012-11-12 17:57:11 +00:00
|
|
|
|
//{
|
|
|
|
|
// ThrottlecheckBox.Visible = true;
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
2012-10-04 02:05:07 +00:00
|
|
|
|
ThrottlecheckBox.Visible = false;
|
2012-11-12 17:57:11 +00:00
|
|
|
|
//}
|
2011-06-12 00:14:19 +00:00
|
|
|
|
}
|
2011-02-15 19:05:21 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void OK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Global.Config.SoundEnabled = SoundOnCheckBox.Checked;
|
|
|
|
|
Global.Config.MuteFrameAdvance = MuteFrameAdvance.Checked;
|
|
|
|
|
Global.Config.SoundVolume = SoundVolBar.Value;
|
2012-10-01 15:20:41 +00:00
|
|
|
|
Global.Config.SoundThrottle = ThrottlecheckBox.Checked;
|
2011-06-12 00:14:19 +00:00
|
|
|
|
Global.Sound.ChangeVolume(Global.Config.SoundVolume);
|
|
|
|
|
Global.Sound.UpdateSoundSettings();
|
|
|
|
|
Global.Sound.StartSound();
|
2012-09-26 01:28:48 +00:00
|
|
|
|
Global.OSD.AddMessage("Sound settings saved");
|
2011-06-12 00:14:19 +00:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2011-02-15 20:18:12 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void Cancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2012-09-27 00:14:51 +00:00
|
|
|
|
Global.OSD.AddMessage("Sound config aborted");
|
2011-06-12 00:14:19 +00:00
|
|
|
|
this.Close();
|
|
|
|
|
}
|
2011-05-23 21:31:29 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void trackBar1_Scroll(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SoundVolNumeric.Value = SoundVolBar.Value;
|
|
|
|
|
}
|
2011-05-23 21:31:29 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void SoundVolNumeric_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SoundVolBar.Value = (int)SoundVolNumeric.Value;
|
|
|
|
|
}
|
2011-05-25 01:33:54 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void SoundOnCheckBox_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
UpdateSoundDialog();
|
|
|
|
|
}
|
2011-05-25 01:33:54 +00:00
|
|
|
|
|
2011-06-12 00:14:19 +00:00
|
|
|
|
private void UpdateSoundDialog()
|
|
|
|
|
{
|
|
|
|
|
if (SoundOnCheckBox.Checked)
|
|
|
|
|
{
|
|
|
|
|
SoundVolGroup.Enabled = true;
|
|
|
|
|
MuteFrameAdvance.Enabled = true;
|
2012-10-01 15:20:41 +00:00
|
|
|
|
ThrottlecheckBox.Enabled = true;
|
2011-06-12 00:14:19 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SoundVolGroup.Enabled = false;
|
|
|
|
|
MuteFrameAdvance.Enabled = false;
|
2012-10-01 15:20:41 +00:00
|
|
|
|
ThrottlecheckBox.Enabled = false;
|
2011-06-12 00:14:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-02-15 19:05:21 +00:00
|
|
|
|
}
|