make sound toggling work a little better
This commit is contained in:
parent
1d73742000
commit
0eda3bd2ab
|
@ -7,7 +7,6 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
public class Sound : IDisposable
|
public class Sound : IDisposable
|
||||||
{
|
{
|
||||||
public bool SoundEnabled = true;
|
|
||||||
public bool Muted = false;
|
public bool Muted = false;
|
||||||
private bool disposed = false;
|
private bool disposed = false;
|
||||||
|
|
||||||
|
@ -44,7 +43,7 @@ namespace BizHawk.MultiClient
|
||||||
public void StartSound()
|
public void StartSound()
|
||||||
{
|
{
|
||||||
if (disposed) throw new ObjectDisposedException("Sound");
|
if (disposed) throw new ObjectDisposedException("Sound");
|
||||||
if (SoundEnabled == false) return;
|
if (Global.Config.SoundEnabled == false) return;
|
||||||
|
|
||||||
if(IsPlaying)
|
if(IsPlaying)
|
||||||
return;
|
return;
|
||||||
|
@ -112,7 +111,7 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public void UpdateSound(ISoundProvider soundProvider)
|
public void UpdateSound(ISoundProvider soundProvider)
|
||||||
{
|
{
|
||||||
if (SoundEnabled == false || disposed)
|
if (Global.Config.SoundEnabled == false || disposed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int samplesNeeded = SNDDXGetAudioSpace()*2;
|
int samplesNeeded = SNDDXGetAudioSpace()*2;
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
Global.Config.SoundEnabled = SoundOnCheckBox.Checked;
|
Global.Config.SoundEnabled = SoundOnCheckBox.Checked;
|
||||||
Global.Config.MuteFrameAdvance = MuteFrameAdvance.Checked;
|
Global.Config.MuteFrameAdvance = MuteFrameAdvance.Checked;
|
||||||
|
Global.Sound.StartSound();
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue