From e0a79c7c3ab8a628b4ca7d0166963b08bb62368e Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sat, 16 Nov 2013 13:44:32 -0800 Subject: [PATCH] pause/unpause audio when enter/exit menus --- src/keys.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/keys.c b/src/keys.c index 55f4d188..0114e59c 100644 --- a/src/keys.c +++ b/src/keys.c @@ -28,6 +28,7 @@ #include "cpu.h" #include "prefs.h" #include "timing.h" +#include "soundcore.h" /* from misc.c */ extern uid_t user, privileged; @@ -247,35 +248,45 @@ void c_periodic_update(int dummysig) { case kF1: pthread_mutex_lock(&interface_mutex); + SoundSystemPause(); c_interface_select_diskette( 0 ); + SoundSystemUnpause(); pthread_mutex_unlock(&interface_mutex); break; case kF2: pthread_mutex_lock(&interface_mutex); + SoundSystemPause(); c_interface_select_diskette( 1 ); + SoundSystemUnpause(); pthread_mutex_unlock(&interface_mutex); break; case kF4: pthread_mutex_lock(&interface_mutex); + SoundSystemPause(); while (c_mygetch(1) == -1) { struct timespec ts = { .tv_sec=0, .tv_nsec=1 }; nanosleep(&ts, NULL); } + SoundSystemUnpause(); pthread_mutex_unlock(&interface_mutex); break; case kF5: pthread_mutex_lock(&interface_mutex); + SoundSystemPause(); c_interface_keyboard_layout(); + SoundSystemUnpause(); pthread_mutex_unlock(&interface_mutex); break; case kF7: pthread_mutex_lock(&interface_mutex); + SoundSystemPause(); c_do_debugging(); + SoundSystemUnpause(); pthread_mutex_unlock(&interface_mutex); break; #if 0 @@ -291,7 +302,9 @@ void c_periodic_update(int dummysig) { case kF10: pthread_mutex_lock(&interface_mutex); + SoundSystemPause(); c_interface_parameters(); + SoundSystemUnpause(); pthread_mutex_unlock(&interface_mutex); break; }