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();
|
|
|
|
|
|
2016-02-11 18:34:55 -05:00
|
|
|
|
Icon = Properties.Resources.Audio;
|
2015-07-17 20:58:57 -04:00
|
|
|
|
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);
|
2016-01-31 11:58:41 -05:00
|
|
|
|
|
|
|
|
|
AddBinding("ReduceSoundInBackground", chkReduceSoundInBackground);
|
|
|
|
|
AddBinding("MuteSoundInBackground", chkMuteSoundInBackground);
|
2016-02-19 19:25:28 -05:00
|
|
|
|
|
|
|
|
|
AddBinding("SwapDutyCycles", chkSwapDutyCycles);
|
2016-02-21 15:31:39 -05:00
|
|
|
|
|
|
|
|
|
radStereoDisabled.Tag = InteropEmu.StereoFilter.None;
|
|
|
|
|
radStereoDelay.Tag = InteropEmu.StereoFilter.Delay;
|
|
|
|
|
radStereoPanning.Tag = InteropEmu.StereoFilter.Panning;
|
|
|
|
|
|
|
|
|
|
AddBinding("StereoFilter", tlpStereoFilter);
|
|
|
|
|
AddBinding("StereoDelay", nudStereoDelay);
|
|
|
|
|
AddBinding("StereoPanningAngle", nudStereoPanning);
|
|
|
|
|
|
|
|
|
|
AddBinding("ReverbEnabled", chkReverbEnabled);
|
|
|
|
|
AddBinding("ReverbDelay", trkReverbDelay);
|
|
|
|
|
AddBinding("ReverbStrength", trkReverbStrength);
|
2015-07-17 20:58:57 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnFormClosed(e);
|
|
|
|
|
AudioInfo.ApplyConfig();
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-31 11:58:41 -05:00
|
|
|
|
protected override bool ValidateInput()
|
2015-07-17 20:58:57 -04:00
|
|
|
|
{
|
2016-01-31 11:58:41 -05:00
|
|
|
|
UpdateObject();
|
|
|
|
|
AudioInfo.ApplyConfig();
|
|
|
|
|
|
|
|
|
|
return true;
|
2015-07-17 20:58:57 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnReset_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-01-31 11:58:41 -05:00
|
|
|
|
ConfigManager.Config.AudioInfo = new AudioInfo();
|
|
|
|
|
Entity = ConfigManager.Config.AudioInfo;
|
2015-07-17 20:58:57 -04:00
|
|
|
|
UpdateUI();
|
|
|
|
|
AudioInfo.ApplyConfig();
|
|
|
|
|
}
|
2016-01-31 11:58:41 -05:00
|
|
|
|
|
|
|
|
|
private void chkMuteWhenInBackground_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
chkReduceSoundInBackground.Enabled = !chkMuteSoundInBackground.Checked;
|
|
|
|
|
}
|
2015-07-17 20:58:57 -04:00
|
|
|
|
}
|
|
|
|
|
}
|