summaryrefslogtreecommitdiff
path: root/src/activity_replay.cc
diff options
context:
space:
mode:
authorAndrew de los Reyes <adlr@chromium.org>2011-11-11 09:45:11 -0800
committerAndrew de los Reyes <adlr@chromium.org>2011-11-17 09:21:30 -0800
commit416d024bc951fceb3e845d2d785ae7176eb0bc10 (patch)
tree81bb0fd498441d759d56f7a3bd3576e417ff211d /src/activity_replay.cc
parent51812abc4cd1d1784cb24491d4e47baa885df388 (diff)
downloadlibchrome-gestures-416d024bc951fceb3e845d2d785ae7176eb0bc10.tar.gz
ActivityReplay: Log incoming finger IDs, output gestures, new log.
Every time I replay a log I find myself adding these log statements. Also, don't abort on variables missing from the log. I thought I would want failing behavior before, in retrospect I don't. BUG=chromium-os:23033 TEST=debugged log with these added Change-Id: I30abe3f0ba6ba7d44bddd90dc27b58a07ced0ccf
Diffstat (limited to 'src/activity_replay.cc')
-rw-r--r--src/activity_replay.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/activity_replay.cc b/src/activity_replay.cc
index 6da4a6e..abfcb24 100644
--- a/src/activity_replay.cc
+++ b/src/activity_replay.cc
@@ -79,7 +79,7 @@ bool ActivityReplay::ParseProperties(DictionaryValue* dict) {
Value* value = NULL;
if (!dict->Get(key, &value)) {
Err("Log doesn't have value for property %s", key);
- return false;
+ continue;
}
if (!(*it)->SetValue(value)) {
Err("Unable to restore value for property %s", key);
@@ -370,13 +370,19 @@ bool ActivityReplay::Replay(Interpreter* interpreter) {
case ActivityLog::kHardwareState: {
last_timeout_req = -1.0;
HardwareState hs = entry->details.hwstate;
+ for (size_t i = 0; i < hs.finger_cnt; i++)
+ Log("Input Finger ID: %d", hs.fingers[i].tracking_id);
last_gs = interpreter->SyncInterpret(&hs, &last_timeout_req);
+ if (last_gs)
+ Log("Ouput Gesture: %s", last_gs->String().c_str());
break;
}
case ActivityLog::kTimerCallback:
last_timeout_req = -1.0;
last_gs = interpreter->HandleTimer(entry->details.timestamp,
&last_timeout_req);
+ if (last_gs)
+ Log("Ouput Gesture: %s", last_gs->String().c_str());
break;
case ActivityLog::kCallbackRequest:
if (!DoubleEq(last_timeout_req, entry->details.timestamp)) {