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();
|
|
|
|
|
|
|
|
|
|
Entity = ConfigManager.Config.AudioInfo;
|
|
|
|
|
|
2016-01-17 22:16:20 -05:00
|
|
|
|
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);
|
2016-01-14 19:33:16 -05:00
|
|
|
|
AddBinding("SampleRate", cboSampleRate);
|
2016-01-17 22:16:20 -05:00
|
|
|
|
AddBinding("AudioDevice", cboAudioDevice);
|
2015-07-17 20:58:57 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnFormClosed(e);
|
|
|
|
|
AudioInfo.ApplyConfig();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AudioConfig_ValueChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if(!this.Updating) {
|
|
|
|
|
UpdateObject();
|
|
|
|
|
AudioInfo.ApplyConfig();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnReset_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
AudioInfo config = Entity as AudioInfo;
|
|
|
|
|
config.EnableAudio = true;
|
|
|
|
|
config.AudioLatency = 100;
|
2016-01-14 17:40:59 -05:00
|
|
|
|
config.MasterVolume = 50;
|
2016-01-14 08:42:00 -05:00
|
|
|
|
config.Square2Volume = 100;
|
|
|
|
|
config.Square1Volume = 100;
|
|
|
|
|
config.TriangleVolume = 100;
|
|
|
|
|
config.NoiseVolume = 100;
|
|
|
|
|
config.DmcVolume = 100;
|
2015-07-17 20:58:57 -04:00
|
|
|
|
UpdateUI();
|
|
|
|
|
AudioInfo.ApplyConfig();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|