X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=usounds.c;fp=usounds.c;h=31a0cda1d9894cb8bdfab8adc55859498c2f341d;hb=da8802ac4d06115296e0f8ba955ecf5570741d08;hp=67afdb0842673a74d5964961d8dfb4d7eed21098;hpb=7be221b22bc0e10fa8c2b71b6506398d1f42cb0f;p=xboard.git diff --git a/usounds.c b/usounds.c index 67afdb0..31a0cda 100644 --- a/usounds.c +++ b/usounds.c @@ -76,21 +76,22 @@ extern char *getenv(); #include "frontend.h" -void +int PlaySoundFile (char *name) { if (*name == NULLCHAR) { - return; + return 0; } else if (strcmp(name, "$") == 0) { putc(BELLCHAR, stderr); } else { char buf[2048]; char *prefix = "", *sep = ""; - if(appData.soundProgram[0] == NULLCHAR) return; + if(appData.soundProgram[0] == NULLCHAR) return 1; if(!strchr(name, '/')) { prefix = appData.soundDirectory; sep = "/"; } snprintf(buf, sizeof(buf), "%s '%s%s%s' &", appData.soundProgram, prefix, sep, name); system(buf); } + return 1; } void @@ -135,6 +136,12 @@ PlayTellSound () PlaySoundFile(appData.soundTell); } +int +Roar () +{ + return PlaySoundFile(appData.soundRoar); +} + void PlaySoundForColor (ColorClass cc) {