Cleanup Sound ctor
This commit is contained in:
parent
0326bf63d3
commit
347ed0d404
|
@ -22,25 +22,23 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public Sound(IntPtr mainWindowHandle)
|
public Sound(IntPtr mainWindowHandle)
|
||||||
{
|
{
|
||||||
if (GlobalWin.Config.SoundOutputMethod != ESoundOutputMethod.Dummy)
|
if (OSTailoredCode.IsUnixHost)
|
||||||
{
|
{
|
||||||
if (OSTailoredCode.IsUnixHost)
|
// if DirectSound or XAudio is chosen, use OpenAL, otherwise comply with the user's choice
|
||||||
{
|
_outputDevice = GlobalWin.Config.SoundOutputMethod == ESoundOutputMethod.Dummy
|
||||||
// at the moment unix/mono can only support OpenAL (so ignore whatever is set in the config)
|
? (ISoundOutput) new DummySoundOutput(this)
|
||||||
_outputDevice = new OpenALSoundOutput(this);
|
: new OpenALSoundOutput(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GlobalWin.Config.SoundOutputMethod == ESoundOutputMethod.OpenAL)
|
_outputDevice = GlobalWin.Config.SoundOutputMethod switch
|
||||||
_outputDevice = new OpenALSoundOutput(this);
|
{
|
||||||
if (GlobalWin.Config.SoundOutputMethod == ESoundOutputMethod.DirectSound)
|
ESoundOutputMethod.DirectSound => new DirectSoundSoundOutput(this, mainWindowHandle, GlobalWin.Config.SoundDevice),
|
||||||
_outputDevice = new DirectSoundSoundOutput(this, mainWindowHandle, GlobalWin.Config.SoundDevice);
|
ESoundOutputMethod.XAudio2 => new XAudio2SoundOutput(this),
|
||||||
if (GlobalWin.Config.SoundOutputMethod == ESoundOutputMethod.XAudio2)
|
ESoundOutputMethod.OpenAL => new OpenALSoundOutput(this),
|
||||||
_outputDevice = new XAudio2SoundOutput(this);
|
_ => new DummySoundOutput(this)
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
if (_outputDevice == null)
|
|
||||||
_outputDevice = new DummySoundOutput(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue