When a Lion double-move is animated, the roaring sound is played.
It can be selected through the new -soundRoar persistent option.
A wav file with a suitable roar is added, and configured for use.
soundsdir = $(gamedatadir)/sounds
dist_sounds_DATA = \
sounds/cymbal.wav sounds/pop2.wav sounds/slap.wav sounds/ding1.wav sounds/laser.wav \
- sounds/woodthunk.wav sounds/gong.wav sounds/penalty.wav sounds/honkhonk.wav sounds/phone.wav
+ sounds/woodthunk.wav sounds/gong.wav sounds/penalty.wav sounds/honkhonk.wav sounds/phone.wav sounds/roar.wav
### set correct dir in xboard.conf
{ "soundSeek", ArgFilename, (void *) &appData.soundSeek, TRUE, (ArgIniType) "" },
{ "soundMove", ArgFilename, (void *) &appData.soundMove, TRUE, (ArgIniType) "" },
{ "soundBell", ArgFilename, (void *) &appData.soundBell, TRUE, (ArgIniType) SOUND_BELL },
+ { "soundRoar", ArgFilename, (void *) &appData.soundRoar, TRUE, (ArgIniType) "" },
{ "soundIcsWin", ArgFilename, (void *) &appData.soundIcsWin, TRUE, (ArgIniType) "" },
{ "soundIcsLoss", ArgFilename, (void *) &appData.soundIcsLoss, TRUE, (ArgIniType) "" },
{ "soundIcsDraw", ArgFilename, (void *) &appData.soundIcsDraw, TRUE, (ArgIniType) "" },
char realname[MSG_SIZ];
int fromX, fromY, toX, toY;
ChessMove moveType;
- char promoChar;
+ char promoChar, roar;
char *p, *pv=buf1;
int machineWhite, oldError;
char *bookHit;
cps->other->maybeThinking = TRUE;
}
+ roar = (killX >= 0 && IS_LION(boards[forwardMostMove][toY][toX]));
+
ShowMove(fromX, fromY, toX, toY); /*updates currentMove*/
if (!pausing && appData.ringBellAfterMoves) {
- RingBell();
+ if(!roar) RingBell();
}
/*
Pnt frames[kFactor * 2 + 1];
int nFrames, startColor, endColor;
+ if(killX >= 0 && IS_LION(board[fromY][fromX])) Roar();
+
/* Are we animating? */
if (!appData.animate || appData.blindfold)
return;
#define SHOGI (int)EmptySquare + (int)
#define CHUPROMOTED ((int)WhitePDragon - (int)WhiteDragon)*(gameInfo.variant == VariantChu) + PROMOTED
#define IS_SHOGI(V) ((V) == VariantShogi || (V) == VariantChu)
+#define IS_LION(V) ((V) == WhiteLion || (V) == BlackLion)
typedef ChessSquare Board[BOARD_RANKS][BOARD_FILES];
char *soundSeek;
char *soundMove; // [HGM] IMPORTANT: order must be as in SoundClass
char *soundBell;
+ char *soundRoar;
char *soundIcsAlarm;
char *soundIcsWin;
char *soundIcsLoss;
N_("Penalty"),
N_("Phone"),
N_("Pop"),
+ N_("Roar"),
N_("Slap"),
N_("Wood Thunk"),
NULL,
"penalty.wav",
"phone.wav",
"pop2.wav",
+ "roar.wav",
"slap.wav",
"woodthunk.wav",
NULL,
{ 0, 0, 0, NULL, (void*) &appData.soundTell, (char*) soundFiles, soundNames, ComboBox, N_("Tell:") },
{ 0, 0, 0, NULL, (void*) &appData.soundKibitz, (char*) soundFiles, soundNames, ComboBox, N_("Kibitz:") },
{ 0, 0, 0, NULL, (void*) &appData.soundRequest, (char*) soundFiles, soundNames, ComboBox, N_("Request:") },
+{ 0, 0, 0, NULL, (void*) &appData.soundRoar, (char*) soundFiles, soundNames, ComboBox, N_("Lion roar:") },
{ 0, 0, 0, NULL, (void*) &appData.soundSeek, (char*) soundFiles, soundNames, ComboBox, N_("Seek:") },
{ 0, SAME_ROW, 0, NULL, NULL, "", NULL, EndMark , "" }
};
void PopUpMoveDialog P((char first));
void RingBell P((void));
+int Roar P((void));
void PlayIcsWinSound P((void));
void PlayIcsLossSound P((void));
void PlayIcsDrawSound P((void));
void PlayIcsUnfinishedSound P((void));
void PlayAlarmSound P((void));
void PlayTellSound P((void));
-void PlaySoundFile P((char *name));
+int PlaySoundFile P((char *name));
void PlaySoundByColor P((void));
void EchoOn P((void));
void EchoOff P((void));
#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
PlaySoundFile(appData.soundTell);
}
+int
+Roar ()
+{
+ return PlaySoundFile(appData.soundRoar);
+}
+
void
PlaySoundForColor (ColorClass cc)
{
-soundTell phone.wav
-soundChallenge gong.wav
-soundMove woodthunk.wav
+-soundRoar roar.wav
-soundIcsAlarm penalty.wav
-pasteSelection false
-keepLineBreaksICS false