| 390 | } |
| 391 | |
| 392 | int FilterEvent( wxEvent &event ) override |
| 393 | { |
| 394 | if (!IsWatching()) |
| 395 | // Previously encountered error stopped recording of any more events |
| 396 | return Event_Skip; |
| 397 | |
| 398 | static const auto &catalog = Events::ByType(); |
| 399 | const auto type = event.GetEventType(); |
| 400 | if (const auto iter = catalog.find(type); iter != catalog.end()) { |
| 401 | // Try to write a representation to the journal |
| 402 | const auto &info = iter->second; |
| 403 | auto pStrings = info.serializer(event); |
| 404 | if (!pStrings) |
| 405 | return Event_Skip; |
| 406 | else { |
| 407 | pStrings->insert(pStrings->begin(), info.code.GET()); |
| 408 | Journal::Output(*pStrings); |
| 409 | } |
| 410 | } |
| 411 | else |
| 412 | // Just ignore this un-catalogued event type |
| 413 | ; |
| 414 | |
| 415 | return Event_Skip; |
| 416 | } |
| 417 | }; |
| 418 | |
| 419 | } |