From: H.G.Muller Date: Thu, 24 Mar 2016 22:46:01 +0000 (+0100) Subject: Add -analysisBell option to use move sound in analysis mode X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=d84fcdd7b911514302200ce9edfde2c8c8f2d66e Add -analysisBell option to use move sound in analysis mode The persistent integer option -analysisBell can be used to let the move sound play in analysis mode for every PV that arrives after the dely (in seconds) it specifies has elapsed since the current analysis search started. --- diff --git a/args.h b/args.h index 30ffe16..67d195e 100644 --- a/args.h +++ b/args.h @@ -716,6 +716,7 @@ ArgDescriptor argDescriptors[] = { { "messageSuppress", ArgString, (void *) &appData.suppress, XBOARD, (ArgIniType) "" }, { "fen", ArgString, (void *) &appData.fen, FALSE, (ArgIniType) "" }, { "men", ArgString, (void *) &appData.men, FALSE, (ArgIniType) "" }, + { "analysisBell", ArgInt, (void *) &appData.analysisBell, TRUE, (ArgIniType) 0 }, #if ZIPPY { "zippyTalk", ArgBoolean, (void *) &appData.zippyTalk, FALSE, (ArgIniType) ZIPPY_TALK }, diff --git a/backend.c b/backend.c index 216afc8..4a97a87 100644 --- a/backend.c +++ b/backend.c @@ -8057,6 +8057,9 @@ SendProgramStatsToFrontend (ChessProgramState * cps, ChessProgramStats * cpstats if(stats.pv && stats.pv[0]) safeStrCpy(lastPV[stats.which], stats.pv, sizeof(lastPV[stats.which])/sizeof(lastPV[stats.which][0])); // [HGM] pv: remember last PV of each + if( gameMode == AnalyzeMode && stats.pv && stats.pv[0] + && appData.analysisBell && stats.time >= 100*appData.analysisBell ) RingBell(); + SetProgramStats( &stats ); } diff --git a/common.h b/common.h index b0a30c3..c557257 100644 --- a/common.h +++ b/common.h @@ -553,6 +553,7 @@ typedef struct { char *historyFont; char *gameListFont; char *icsFont; + int analysisBell; Boolean ringBellAfterMoves; Boolean autoCallFlag; Boolean flipView; diff --git a/xboard.texi b/xboard.texi index 2f7f3f4..32a7630 100644 --- a/xboard.texi +++ b/xboard.texi @@ -3459,6 +3459,11 @@ Default: false. Sets the Move Sound menu option. @xref{Options Menu}. Default: false. For compatibility with old XBoard versions, -bell/-xbell are also accepted as abbreviations for this option. +@item -analysisBell N +@cindex analysisBell, option +When N is non-zero, the Move Sound will be played whenever a new +PV arrives in analysis mode after more than N seconds of analysis. +Default: 0. @item -exit/-xexit or -popupExitMessage true/false @cindex exit, option @cindex popupExitMessage, option