BizHawk/BizHawk.MultiClient/config/SoundConfig.cs

74 lines
1.7 KiB
C#
Raw Normal View History

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-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;
SoundVolBar.Value = Global.Config.SoundVolume;
SoundVolNumeric.Value = Global.Config.SoundVolume;
UpdateSoundDialog();
}
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;
Global.Sound.ChangeVolume(Global.Config.SoundVolume);
Global.Sound.UpdateSoundSettings();
Global.Sound.StartSound();
this.Close();
}
2011-06-12 00:14:19 +00:00
private void Cancel_Click(object sender, EventArgs e)
{
this.Close();
}
2011-06-12 00:14:19 +00:00
private void trackBar1_Scroll(object sender, EventArgs e)
{
SoundVolNumeric.Value = SoundVolBar.Value;
}
2011-06-12 00:14:19 +00:00
private void SoundVolNumeric_ValueChanged(object sender, EventArgs e)
{
SoundVolBar.Value = (int)SoundVolNumeric.Value;
}
2011-06-12 00:14:19 +00:00
private void SoundOnCheckBox_CheckedChanged(object sender, EventArgs e)
{
UpdateSoundDialog();
}
2011-06-12 00:14:19 +00:00
private void UpdateSoundDialog()
{
if (SoundOnCheckBox.Checked)
{
SoundVolGroup.Enabled = true;
MuteFrameAdvance.Enabled = true;
}
else
{
SoundVolGroup.Enabled = false;
MuteFrameAdvance.Enabled = false;
}
}
}
}