From: H.G. Muller Date: Sat, 18 Jun 2011 18:46:57 +0000 (+0200) Subject: Use sound for ICS tells also with engine telluser popups X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=23c979bdeba73c3b697c7c0ce87586df3c87896a;p=xboard.git Use sound for ICS tells also with engine telluser popups The telluser and tellusererror commands now can be assigned a sound. --- diff --git a/backend.c b/backend.c index 7308920..6520238 100644 --- a/backend.c +++ b/backend.c @@ -8038,6 +8038,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. if (!strncmp(message, "telluser ", 9)) { if(message[9] == '\\' && message[10] == '\\') EscapeExpand(message+9, message+11); // [HGM] esc: allow escape sequences in popup box + PlayTellSound(); DisplayNote(message + 9); return; } @@ -8045,6 +8046,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. cps->userError = 1; if(message[14] == '\\' && message[15] == '\\') EscapeExpand(message+14, message+16); // [HGM] esc: allow escape sequences in popup box + PlayTellSound(); DisplayError(message + 14, 0); return; } diff --git a/frontend.h b/frontend.h index e63f661..24d1852 100644 --- a/frontend.h +++ b/frontend.h @@ -105,6 +105,7 @@ void PlayIcsLossSound P((void)); void PlayIcsDrawSound P((void)); void PlayIcsUnfinishedSound P((void)); void PlayAlarmSound P((void)); +void PlayTellSound P((void)); void EchoOn P((void)); void EchoOff P((void)); void Raw P((void)); diff --git a/winboard/winboard.c b/winboard/winboard.c index b86a399..502e6c1 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -8604,6 +8604,12 @@ PlayAlarmSound() MyPlaySound(&sounds[(int)SoundAlarm]); } +VOID +PlayTellSound() +{ + MyPlaySound(&textAttribs[ColorTell].sound); +} + VOID EchoOn() diff --git a/xboard.c b/xboard.c index acc032d..dae38f2 100644 --- a/xboard.c +++ b/xboard.c @@ -7224,6 +7224,12 @@ PlayAlarmSound() } void +PlayTellSound() +{ + PlaySound(appData.soundTell); +} + +void EchoOn() { system("stty echo");