Mesen-X/GUI.NET/Forms/Config/frmAudioConfig.cs

75 lines
2 KiB
C#
Raw Normal View History

2015-07-17 20:58:57 -04:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mesen.GUI.Config;
namespace Mesen.GUI.Forms.Config
{
public partial class frmAudioConfig : BaseConfigForm
{
public frmAudioConfig()
{
InitializeComponent();
Icon = Properties.Resources.music;
2015-07-17 20:58:57 -04:00
Entity = ConfigManager.Config.AudioInfo;
cboAudioDevice.Items.AddRange(InteropEmu.GetAudioDevices().ToArray());
2015-07-17 20:58:57 -04:00
AddBinding("EnableAudio", chkEnableAudio);
AddBinding("MasterVolume", trkMaster);
AddBinding("Square1Volume", trkSquare1Vol);
AddBinding("Square2Volume", trkSquare2Vol);
AddBinding("TriangleVolume", trkTriangleVol);
AddBinding("NoiseVolume", trkNoiseVol);
AddBinding("DmcVolume", trkDmcVol);
2016-01-30 14:57:50 -05:00
AddBinding("FdsVolume", trkFdsVol);
AddBinding("Mmc5Volume", trkMmc5Vol);
AddBinding("Vrc6Volume", trkVrc6Vol);
AddBinding("Vrc7Volume", trkVrc7Vol);
AddBinding("Namco163Volume", trkNamco163Vol);
AddBinding("Sunsoft5bVolume", trkSunsoft5b);
2015-07-17 20:58:57 -04:00
AddBinding("AudioLatency", nudLatency);
AddBinding("SampleRate", cboSampleRate);
AddBinding("AudioDevice", cboAudioDevice);
AddBinding("ReduceSoundInBackground", chkReduceSoundInBackground);
AddBinding("MuteSoundInBackground", chkMuteSoundInBackground);
2015-07-17 20:58:57 -04:00
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
base.OnFormClosed(e);
AudioInfo.ApplyConfig();
}
protected override bool ValidateInput()
2015-07-17 20:58:57 -04:00
{
UpdateObject();
AudioInfo.ApplyConfig();
return true;
2015-07-17 20:58:57 -04:00
}
private void btnReset_Click(object sender, EventArgs e)
{
ConfigManager.Config.AudioInfo = new AudioInfo();
Entity = ConfigManager.Config.AudioInfo;
2015-07-17 20:58:57 -04:00
UpdateUI();
AudioInfo.ApplyConfig();
}
private void chkMuteWhenInBackground_CheckedChanged(object sender, EventArgs e)
{
chkReduceSoundInBackground.Enabled = !chkMuteSoundInBackground.Checked;
}
2015-07-17 20:58:57 -04:00
}
}