FILE *serverMoves = NULL; // next two for broadcasting (/serverMoves option)
int loadFlag = 0;
int shuffleOpenings;
+int mute; // mute all sounds
ChessSquare FIDEArray[2][BOARD_SIZE] = {
{ WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen,
sscanf(message, "resign%c", &c)!=1 && sscanf(message, "feature %c", &c)!=1 &&
sscanf(message, "error %c", &c)!=1 && sscanf(message, "illegal %c", &c)!=1 &&
sscanf(message, "tell%c", &c)!=1 && sscanf(message, "0-1 %c", &c)!=1 &&
- sscanf(message, "1-0 %c", &c)!=1 && sscanf(message, "1/2-1/2 %c", &c)!=1 && start != '#')
+ sscanf(message, "1-0 %c", &c)!=1 && sscanf(message, "1/2-1/2 %c", &c)!=1 &&
+ sscanf(message, "pong %c", &c)!=1 && start != '#')
{ quote = "# "; print = (appData.engineComments == 2); }
message[0] = start; // restore original message
}
extern int gotPremove;
extern GameMode gameMode;
-extern int pausing, cmailMsgLoaded, flipView;
+extern int pausing, cmailMsgLoaded, flipView, mute;
extern char white_holding[], black_holding[];
extern int currentMove, backwardMostMove, forwardMostMove;
extern int blackPlaysFirst;
ShowWindow(hwndConsole, nCmdShow);\r
}\r
if(!appData.noGUI) UpdateWindow(hwnd); else ShowWindow(hwnd, SW_MINIMIZE);\r
+ if(gameListDialog) SetFocus(gameListDialog); // [HGM] jaws: for if we clicked multi-game game file\r
\r
return TRUE;\r
\r
DrawPosition(FALSE, NULL);\r
break;\r
\r
+ case IDM_MuteSounds:\r
+ mute = !mute; // [HGM] mute: keep track of global muting variable\r
+ CheckMenuItem(GetMenu(hwndMain),IDM_MuteSounds, \r
+ MF_BYCOMMAND|(mute?MF_CHECKED:MF_UNCHECKED));\r
+ break;\r
+\r
case IDM_GeneralOptions:\r
GeneralOptionsPopup(hwnd);\r
DrawPosition(TRUE, NULL);\r
{\r
BOOLEAN ok = FALSE;\r
\r
+ if(mute) return TRUE; // [HGM] mute: suppress all sound play when muted\r
switch (ms->name[0]) {\r
case NULLCHAR:\r
if(appData.debugMode) fprintf(debugFP, "silence\n");\r
BEGIN\r
MENUITEM "Flip &View\tF2", IDM_FlipView\r
MENUITEM "Swap &Clocks", IDM_FlipClock\r
+ MENUITEM "&Mute all Sounds", IDM_MuteSounds\r
MENUITEM SEPARATOR\r
MENUITEM "&General...", IDM_GeneralOptions\r
MENUITEM "&Board...", IDM_BoardOptions\r
SoundClass sc;
ColorClass cc;
SoundComboData *scd;
+ int oldMute;
switch (message) {
case WM_INITDIALOG:
}
}
+ mute = FALSE; // [HGM] mute: switch sounds automatically on if we select one
+ CheckMenuItem(GetMenu(hwndMain),IDM_MuteSounds,MF_BYCOMMAND|MF_UNCHECKED);
ResetSoundComboData(soundComboData);
EndDialog(hDlg, TRUE);
return TRUE;
tmp.name = strdup(SoundDialogGetName(hDlg, radio));
tmp.data = NULL;
MyLoadSound(&tmp);
+ oldMute = mute; mute = FALSE; // [HGM] mute: always sound when user presses play, ignorig mute setting
MyPlaySound(&tmp);
+ mute = oldMute;
if (tmp.data != NULL) FreeResource(tmp.data); // technically obsolete fn, but tmp.data is NOT malloc'd mem
if (tmp.name != NULL) free(tmp.name);
return TRUE;