diff --git a/Cocoa/Document.m b/Cocoa/Document.m index 25fa66d..7f5a887 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -128,7 +128,9 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, uint8_t r, uint8_t g, uint8_t b) GB_apu_copy_buffer(&gb, buffer, nFrames); } andSampleRate:96000]; self.view.mouseHidingEnabled = (self.mainWindow.styleMask & NSFullScreenWindowMask) != 0; - [self.audioClient start]; + if (![[NSUserDefaults standardUserDefaults] boolForKey:@"Mute"]) { + [self.audioClient start]; + } NSTimer *hex_timer = [NSTimer timerWithTimeInterval:0.25 target:self selector:@selector(reloadMemoryView) userInfo:nil repeats:YES]; [[NSRunLoop mainRunLoop] addTimer:hex_timer forMode:NSDefaultRunLoopMode]; while (running) { @@ -312,6 +314,7 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, uint8_t r, uint8_t g, uint8_t b) else { [self.audioClient start]; } + [[NSUserDefaults standardUserDefaults] setBool:!self.audioClient.isPlaying forKey:@"Mute"]; } - (IBAction)toggleBlend:(id)sender