| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by The qGo Project * |
| 3 | * * |
| 4 | * This file is part of qGo. * |
| 5 | * * |
| 6 | * qGo is free software: you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program is distributed in the hope that it will be useful, * |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 | * GNU General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/> * |
| 18 | * or write to the Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | |
| 23 | /* All the clock display stuff should be stuffed in here and taken out from |
| 24 | * all the redundant places elsewhere */ |
| 25 | /* It annoys me that clock can display 3:56 / 0 after a player has moved. It does |
| 26 | * this in observe because server hasn't sent the new time, so we don't display it. |
| 27 | * But that's a nonsencical reading and we should check it here and update it |
| 28 | * to the full time left. */ |
| 29 | |
| 30 | |
| 31 | #include "clockdisplay.h"cxx . . $ `<file>/src/board/clockdisplay.h`/ |
| 32 | #include "boardwindow.h"cxx . . $ `<file>/src/board/boardwindow.h`/ |
| 33 | #include "audio.h"cxx . . $ `<file>/src/audio/audio.h`/ |
| 34 | #include "network/messages.h"cxx . . $ `<file>/src/network/messages.h`/ //for the TimeRecord FIXME |
| 35 | |
| 36 | ClockDisplaycxx . . $ ClockDisplay#::ClockDisplaycxx . . $ ClockDisplay#ClockDisplay(be30efc1a567c79b).(BoardWindowcxx . . $ BoardWindow# *bw, TimeSystemcxx . . $ TimeSystem# s, int _maintime, int _periods, int _periodtime) : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(bw) |
| 37 | { |
| 38 | boardwindowcxx . . $ ClockDisplay#boardwindow. = bw; |
| 39 | setTimeSettingscxx . . $ ClockDisplay#setTimeSettings(e8ef19c52b7bfbf3).(s, _maintime, _periodtime, _periods); |
| 40 | |
| 41 | if(maintimecxx . . $ ClockDisplay#maintime. == 0) |
| 42 | { |
| 43 | b_timecxx . . $ ClockDisplay#b_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 44 | w_timecxx . . $ ClockDisplay#w_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 45 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 46 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 47 | } |
| 48 | else |
| 49 | { |
| 50 | b_timecxx . . $ ClockDisplay#b_time. = maintimecxx . . $ ClockDisplay#maintime.; |
| 51 | w_timecxx . . $ ClockDisplay#w_time. = maintimecxx . . $ ClockDisplay#maintime.; |
| 52 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = -1; |
| 53 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = -1; |
| 54 | } |
| 55 | QSettingscxx . . $ QSettings# settingscxx . . $ QSettings#QSettings(749de1b6ae65bddd).; |
| 56 | playWarningSoundcxx . . $ ClockDisplay#playWarningSound. = settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("BYO_SOUND_WARNING"cxx . . $ QString#QString(85c52e162fed56f9).).toBoolcxx . . $ QVariant#toBool(50ce9a9e25b4a850).(); |
| 57 | warningSecscxx . . $ ClockDisplay#warningSecs. = settings.valuecxx . . $ QSettings#value(12a1b1749da49362).("BYO_SEC_WARNING"cxx . . $ QString#QString(85c52e162fed56f9).).toIntcxx . . $ QVariant#toInt(5bd9a3493f6a7a21).(); |
| 58 | |
| 59 | warningSoundcxx . . $ ClockDisplay#warningSound. = new Soundcxx . . $ Sound#Sound(6caa6e6871ecf3b).("timer.wav"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 60 | } |
| 61 | |
| 62 | void ClockDisplaycxx . . $ ClockDisplay#::setTimeSettingscxx . . $ ClockDisplay#setTimeSettings(e8ef19c52b7bfbf3).(TimeSystemcxx . . $ TimeSystem# s, int m, int p, int o) |
| 63 | { |
| 64 | timeSystemcxx . . $ ClockDisplay#timeSystem. = s; //defaults to canadian |
| 65 | maintimecxx . . $ ClockDisplay#maintime. = m; |
| 66 | periodtimecxx . . $ ClockDisplay#periodtime. = p; |
| 67 | periodscxx . . $ ClockDisplay#periods. = o; |
| 68 | } |
| 69 | |
| 70 | /* |
| 71 | * This takes alls values coming from the time information and updates the clocks |
| 72 | */ |
| 73 | /* FIXME, change to take TimeRecords ?? or not*/ |
| 74 | void ClockDisplaycxx . . $ ClockDisplay#::setTimeInfocxx . . $ ClockDisplay#setTimeInfo(748afa4755bc9595).(int btime, int bstones_periods, int wtime, int wstones_periods) |
| 75 | { |
| 76 | /* FIXME DOUBLECHECK if this is allowed. We want to be able |
| 77 | * to pass empty records but, this may not be the way to |
| 78 | * do it */ |
| 79 | if(wtime != 0 || wstones_periods != -1) |
| 80 | { |
| 81 | w_timecxx . . $ ClockDisplay#w_time. = wtime; |
| 82 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = wstones_periods; |
| 83 | } |
| 84 | if(btime != 0 || bstones_periods != -1) |
| 85 | { |
| 86 | b_timecxx . . $ ClockDisplay#b_time. = btime; |
| 87 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = bstones_periods; |
| 88 | } |
| 89 | //printf("wb %d %d %d %d\n", w_time, b_time, w_stones_periods, b_stones_periods); |
| 90 | updateTimerscxx . . $ ClockDisplay#updateTimers(49f6e7a06ebc5aa8).(); |
| 91 | } |
| 92 | |
| 93 | /* |
| 94 | * decrease the timer info according to the step, and updates the clocks |
| 95 | */ |
| 96 | void ClockDisplaycxx . . $ ClockDisplay#::setTimeStepcxx . . $ ClockDisplay#setTimeStep(b45ddcbc8423892c).(bool black) |
| 97 | { |
| 98 | if (black) |
| 99 | { |
| 100 | b_timecxx . . $ ClockDisplay#b_time.--; |
| 101 | if(b_timecxx . . $ ClockDisplay#b_time. == 0 && b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. != 0) |
| 102 | { |
| 103 | /* FIXME, maybe we should have one clock and subclass |
| 104 | * the time system for different clocks??*/ |
| 105 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == byoyomicxx . . $ byoyomi. || (timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia. && b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. != -1)) |
| 106 | { |
| 107 | //printf("b by: %d %d %d %d\n", b_time, b_stones_periods, periodtime, periods); |
| 108 | if(b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. > -1 || timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia.) |
| 109 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods.--; |
| 110 | else |
| 111 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 112 | if(b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. != 0) |
| 113 | b_timecxx . . $ ClockDisplay#b_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 114 | } |
| 115 | else if(b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. == -1) |
| 116 | { |
| 117 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == canadiancxx . . $ canadian.) |
| 118 | { |
| 119 | b_timecxx . . $ ClockDisplay#b_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 120 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 121 | } |
| 122 | else if(timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia.) |
| 123 | { |
| 124 | b_timecxx . . $ ClockDisplay#b_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 125 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = periodscxx . . $ ClockDisplay#periods. - 1; |
| 126 | } |
| 127 | } |
| 128 | else |
| 129 | printf("other timesystem\n"); |
| 130 | /* IGS gets here a lot due to lag. I.e., canadian time steps down to 0 with stones |
| 131 | * still remainaining to be played, then opponent plays and turns out they have five |
| 132 | * seconds left or something. Would be neat to adjust for lag or something. FIXME */ |
| 133 | } |
| 134 | /* FIXME |
| 135 | * major thing, we need to get time to switch |
| 136 | * over into byoyomi time on IGS |
| 137 | * I think the issue was that IGS sends a byoyomi entering |
| 138 | * message... */ |
| 139 | } |
| 140 | else |
| 141 | { |
| 142 | w_timecxx . . $ ClockDisplay#w_time.--; |
| 143 | if(w_timecxx . . $ ClockDisplay#w_time. == 0 && w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. != 0) |
| 144 | { |
| 145 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == byoyomicxx . . $ byoyomi. || (timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia. && w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. != -1)) |
| 146 | { |
| 147 | //printf("w by: %d %d %d %d\n", w_time, w_stones_periods, periodtime, periods); |
| 148 | if(w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. > -1 || timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia.) |
| 149 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods.--; |
| 150 | else |
| 151 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 152 | if(w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. != 0) |
| 153 | w_timecxx . . $ ClockDisplay#w_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 154 | } |
| 155 | else if(w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. == -1) |
| 156 | { |
| 157 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == canadiancxx . . $ canadian.) |
| 158 | { |
| 159 | w_timecxx . . $ ClockDisplay#w_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 160 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 161 | } |
| 162 | else if(timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia.) |
| 163 | { |
| 164 | w_timecxx . . $ ClockDisplay#w_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 165 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = periodscxx . . $ ClockDisplay#periods. - 1; |
| 166 | } |
| 167 | } |
| 168 | else |
| 169 | printf("other timesystem\n"); |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | updateTimerscxx . . $ ClockDisplay#updateTimers(49f6e7a06ebc5aa8).(); |
| 174 | } |
| 175 | |
| 176 | void ClockDisplaycxx . . $ ClockDisplay#::makeMovecxx . . $ ClockDisplay#makeMove(b45ddcbc8423892c).(bool black) |
| 177 | { |
| 178 | if (black) |
| 179 | { |
| 180 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == canadiancxx . . $ canadian. && b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. != -1) |
| 181 | { |
| 182 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods.--; |
| 183 | } |
| 184 | } |
| 185 | else |
| 186 | { |
| 187 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == canadiancxx . . $ canadian. && w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. != -1) |
| 188 | { |
| 189 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods.--; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | updateTimerscxx . . $ ClockDisplay#updateTimers(49f6e7a06ebc5aa8).(); |
| 194 | } |
| 195 | |
| 196 | void ClockDisplaycxx . . $ ClockDisplay#::rerackTimecxx . . $ ClockDisplay#rerackTime(b45ddcbc8423892c).(bool black) |
| 197 | { |
| 198 | if (black) |
| 199 | { |
| 200 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == canadiancxx . . $ canadian. && b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. == 0) |
| 201 | { |
| 202 | b_timecxx . . $ ClockDisplay#b_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 203 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 204 | } |
| 205 | else if(timeSystemcxx . . $ ClockDisplay#timeSystem. == byoyomicxx . . $ byoyomi. && b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. != -1) |
| 206 | { |
| 207 | b_timecxx . . $ ClockDisplay#b_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 208 | //b_stones_periods = periods; |
| 209 | } |
| 210 | else if(timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia.) |
| 211 | { |
| 212 | b_timecxx . . $ ClockDisplay#b_time. = maintimecxx . . $ ClockDisplay#maintime.; |
| 213 | b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. = -1; |
| 214 | } |
| 215 | } |
| 216 | else |
| 217 | { |
| 218 | if(timeSystemcxx . . $ ClockDisplay#timeSystem. == canadiancxx . . $ canadian. && w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. == 0) |
| 219 | { |
| 220 | w_timecxx . . $ ClockDisplay#w_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 221 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = periodscxx . . $ ClockDisplay#periods.; |
| 222 | } |
| 223 | else if(timeSystemcxx . . $ ClockDisplay#timeSystem. == byoyomicxx . . $ byoyomi. && w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. != -1) |
| 224 | { |
| 225 | w_timecxx . . $ ClockDisplay#w_time. = periodtimecxx . . $ ClockDisplay#periodtime.; |
| 226 | //w_stones_periods = periods; |
| 227 | } |
| 228 | else if(timeSystemcxx . . $ ClockDisplay#timeSystem. == tvasiacxx . . $ tvasia.) |
| 229 | { |
| 230 | w_timecxx . . $ ClockDisplay#w_time. = maintimecxx . . $ ClockDisplay#maintime.; |
| 231 | w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. = -1; |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | updateTimerscxx . . $ ClockDisplay#updateTimers(49f6e7a06ebc5aa8).(); |
| 236 | } |
| 237 | |
| 238 | TimeRecordcxx . . $ TimeRecord# ClockDisplaycxx . . $ ClockDisplay#::getTimeRecordcxx . . $ ClockDisplay#getTimeRecord(1da1f30878cd15cd).(bool black) |
| 239 | { |
| 240 | if(black) |
| 241 | return TimeRecordcxx . . $ TimeRecord#TimeRecord(3e454b8ccf442868).(b_timecxx . . $ ClockDisplay#b_time., b_stones_periodscxx . . $ ClockDisplay#b_stones_periods.); |
| 242 | else |
| 243 | return TimeRecordcxx . . $ TimeRecord#TimeRecord(3e454b8ccf442868).(w_timecxx . . $ ClockDisplay#w_time., w_stones_periodscxx . . $ ClockDisplay#w_stones_periods.); |
| 244 | } |
| 245 | |
| 246 | /* |
| 247 | * updates the clocks display |
| 248 | */ |
| 249 | void ClockDisplaycxx . . $ ClockDisplay#::updateTimerscxx . . $ ClockDisplay#updateTimers(49f6e7a06ebc5aa8).() |
| 250 | { |
| 251 | QStringcxx . . $ QString# btcxx . . $ QString#QString(ced63f7c635d850d)., wtcxx . . $ QString#QString(ced63f7c635d850d).; |
| 252 | /* Negative stones are used to indicate main time period before byo yomi |
| 253 | * not sure about the other two, maybe just 0 minutes */ |
| 254 | /* FIXME periods appear to be unused... which is fine I suppose but |
| 255 | * its not clear */ |
| 256 | /* The below has to be first because otherwise the abs() make |
| 257 | * the time continually jump back up to one */ |
| 258 | if (b_timecxx . . $ ClockDisplay#b_time. < 0) |
| 259 | b_timecxx . . $ ClockDisplay#b_time. = 0; |
| 260 | //bt.prepend("-"); |
| 261 | if (w_timecxx . . $ ClockDisplay#w_time. < 0) |
| 262 | w_timecxx . . $ ClockDisplay#w_time. = 0; |
| 263 | //wt.prepend("-"); |
| 264 | |
| 265 | if(b_timecxx . . $ ClockDisplay#b_time. > 3600 || w_timecxx . . $ ClockDisplay#w_time. > 3600) |
| 266 | { |
| 267 | bt =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0,0).addSecscxx . . $ QTime#addSecs(902e6118dfa1a226).(abscxx . . $ abs(a1851578aea3f541).(b_timecxx . . $ ClockDisplay#b_time.)).toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("h:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) ; |
| 268 | wt =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0,0).addSecscxx . . $ QTime#addSecs(902e6118dfa1a226).(abscxx . . $ abs(a1851578aea3f541).(w_timecxx . . $ ClockDisplay#w_time.)).toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("h:mm:ss"cxx . . $ QString#QString(85c52e162fed56f9).) ; |
| 269 | } |
| 270 | else |
| 271 | { |
| 272 | bt =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0,0).addSecscxx . . $ QTime#addSecs(902e6118dfa1a226).(abscxx . . $ abs(a1851578aea3f541).(b_timecxx . . $ ClockDisplay#b_time.)).toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("m:ss"cxx . . $ QString#QString(85c52e162fed56f9).) ; |
| 273 | wt =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QTimecxx . . $ QTime#QTime(748afa4755bc9595).(0,0).addSecscxx . . $ QTime#addSecs(902e6118dfa1a226).(abscxx . . $ abs(a1851578aea3f541).(w_timecxx . . $ ClockDisplay#w_time.)).toStringcxx . . $ QTime#toString(5555d9024dcf93fb).("m:ss"cxx . . $ QString#QString(85c52e162fed56f9).) ; |
| 274 | } |
| 275 | |
| 276 | switch(timeSystemcxx . . $ ClockDisplay#timeSystem.) |
| 277 | { |
| 278 | case canadiancxx . . $ canadian.: |
| 279 | if (b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. > -1) //instead of != -1, safer for WING |
| 280 | bt.appendcxx . . $ QString#append(d02845eef0c33901).(" / ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(b_stones_periodscxx . . $ ClockDisplay#b_stones_periods.)); |
| 281 | |
| 282 | if (w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. > -1) |
| 283 | wt.appendcxx . . $ QString#append(d02845eef0c33901).(" / ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(w_stones_periodscxx . . $ ClockDisplay#w_stones_periods.)); |
| 284 | break; |
| 285 | default: |
| 286 | case byoyomicxx . . $ byoyomi.: |
| 287 | case tvasiacxx . . $ tvasia.: |
| 288 | if (b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. > -1) //instead of != -1, safer for WING |
| 289 | bt.appendcxx . . $ QString#append(d02845eef0c33901).(" / ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(b_stones_periodscxx . . $ ClockDisplay#b_stones_periods.)); |
| 290 | |
| 291 | if (w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. > -1) |
| 292 | wt.appendcxx . . $ QString#append(d02845eef0c33901).(" / ").appendcxx . . $ QString#append(6a89d0b7f4d2681c).(QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(w_stones_periodscxx . . $ ClockDisplay#w_stones_periods.)); |
| 293 | break; |
| 294 | } |
| 295 | boardwindowcxx . . $ ClockDisplay#boardwindow.->setTimeBlackcxx . . $ BoardWindow#setTimeBlack(7df51288a9ebd664).(btcxx . . $ QString#QString(132dd6869045752b).); |
| 296 | boardwindowcxx . . $ ClockDisplay#boardwindow.->setTimeWhitecxx . . $ BoardWindow#setTimeWhite(7df51288a9ebd664).(wtcxx . . $ QString#QString(132dd6869045752b).); |
| 297 | } |
| 298 | |
| 299 | /* |
| 300 | * activates the byo-time warnings |
| 301 | */ |
| 302 | bool ClockDisplaycxx . . $ ClockDisplay#::warningcxx . . $ ClockDisplay#warning(efaadfb7dc14930a).(bool black) |
| 303 | { |
| 304 | if (black) |
| 305 | { |
| 306 | if ((b_timecxx . . $ ClockDisplay#b_time. > 0) && (b_timecxx . . $ ClockDisplay#b_time. < warningSecscxx . . $ ClockDisplay#warningSecs.)) |
| 307 | { |
| 308 | boardwindowcxx . . $ ClockDisplay#boardwindow.->warnTimeBlackcxx . . $ BoardWindow#warnTimeBlack(b6ded46d2248065c).(TimeLowcxx . . $ TimeLow.); |
| 309 | if (playWarningSoundcxx . . $ ClockDisplay#playWarningSound.) |
| 310 | warningSoundcxx . . $ ClockDisplay#warningSound.->playcxx . . $ Sound#play(49f6e7a06ebc5aa8).(); |
| 311 | } |
| 312 | else if(b_timecxx . . $ ClockDisplay#b_time. == 0 && b_stones_periodscxx . . $ ClockDisplay#b_stones_periods. == 0) //FIXME for tvasia |
| 313 | { |
| 314 | boardwindowcxx . . $ ClockDisplay#boardwindow.->warnTimeBlackcxx . . $ BoardWindow#warnTimeBlack(b6ded46d2248065c).(TimeExpiredcxx . . $ TimeExpired.); |
| 315 | return false; //out of time |
| 316 | } |
| 317 | else |
| 318 | boardwindowcxx . . $ ClockDisplay#boardwindow.->warnTimeBlackcxx . . $ BoardWindow#warnTimeBlack(b6ded46d2248065c).(TimeOKcxx . . $ TimeOK.); |
| 319 | } |
| 320 | else |
| 321 | { |
| 322 | if ((w_timecxx . . $ ClockDisplay#w_time. > 0) && (w_timecxx . . $ ClockDisplay#w_time. < warningSecscxx . . $ ClockDisplay#warningSecs.)) |
| 323 | { |
| 324 | boardwindowcxx . . $ ClockDisplay#boardwindow.->warnTimeWhitecxx . . $ BoardWindow#warnTimeWhite(b6ded46d2248065c).(TimeLowcxx . . $ TimeLow.); |
| 325 | if (playWarningSoundcxx . . $ ClockDisplay#playWarningSound.) |
| 326 | warningSoundcxx . . $ ClockDisplay#warningSound.->playcxx . . $ Sound#play(49f6e7a06ebc5aa8).(); |
| 327 | } |
| 328 | else if(w_timecxx . . $ ClockDisplay#w_time. == 0 && w_stones_periodscxx . . $ ClockDisplay#w_stones_periods. == 0) |
| 329 | { |
| 330 | boardwindowcxx . . $ ClockDisplay#boardwindow.->warnTimeWhitecxx . . $ BoardWindow#warnTimeWhite(b6ded46d2248065c).(TimeExpiredcxx . . $ TimeExpired.); |
| 331 | return false; //out of time |
| 332 | } |
| 333 | else |
| 334 | boardwindowcxx . . $ ClockDisplay#boardwindow.->warnTimeWhitecxx . . $ BoardWindow#warnTimeWhite(b6ded46d2248065c).(TimeOKcxx . . $ TimeOK.); |
| 335 | } |
| 336 | return true; //still good |
| 337 | } |