make sound toggling work a little better

This commit is contained in:
zeromus 2011-03-13 19:30:56 +00:00
parent 1d73742000
commit 0eda3bd2ab
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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();
} }