Change an internal state. */
| 248 | Change an internal state. |
| 249 | */ |
| 250 | void setState(const char* key, const char* value) override |
| 251 | { |
| 252 | const bool valueOnOff = (std::strcmp(value, "true") == 0); |
| 253 | |
| 254 | // check which block changed |
| 255 | /**/ if (std::strcmp(key, "top-left") == 0) |
| 256 | fParamGrid[0] = valueOnOff; |
| 257 | else if (std::strcmp(key, "top-center") == 0) |
| 258 | fParamGrid[1] = valueOnOff; |
| 259 | else if (std::strcmp(key, "top-right") == 0) |
| 260 | fParamGrid[2] = valueOnOff; |
| 261 | else if (std::strcmp(key, "middle-left") == 0) |
| 262 | fParamGrid[3] = valueOnOff; |
| 263 | else if (std::strcmp(key, "middle-center") == 0) |
| 264 | fParamGrid[4] = valueOnOff; |
| 265 | else if (std::strcmp(key, "middle-right") == 0) |
| 266 | fParamGrid[5] = valueOnOff; |
| 267 | else if (std::strcmp(key, "bottom-left") == 0) |
| 268 | fParamGrid[6] = valueOnOff; |
| 269 | else if (std::strcmp(key, "bottom-center") == 0) |
| 270 | fParamGrid[7] = valueOnOff; |
| 271 | else if (std::strcmp(key, "bottom-right") == 0) |
| 272 | fParamGrid[8] = valueOnOff; |
| 273 | } |
| 274 | |
| 275 | /* -------------------------------------------------------------------------------------------------------- |
| 276 | * Process */ |