From 5aa23d261eab1a1eec1405e7bce058bf2c70f0fb Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 16 May 2015 11:02:09 +0200 Subject: timeshift support --- views/displayreplayview.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'views') diff --git a/views/displayreplayview.c b/views/displayreplayview.c index 3e2fd28..400807f 100644 --- a/views/displayreplayview.c +++ b/views/displayreplayview.c @@ -271,7 +271,6 @@ void cDisplayReplayView::DrawProgressBar(int current, int total) { intTokens.insert(pair("current", current)); intTokens.insert(pair("total", total)); intTokens.insert(pair("timeshift", timeShiftActive)); - if (timeShiftActive) { intTokens.insert(pair("timeshifttotal", timeShiftFramesTotal)); } @@ -288,13 +287,14 @@ void cDisplayReplayView::DrawMarks(const cMarks *marks, int current, int total) map < string, string > stringTokens; map < string, int > intTokens; + intTokens.insert(pair("timeshift", timeShiftActive)); + map < string, vector< map< string, string > > > loopTokens; vector< map< string, string > > markTokens; stringstream tot; - if (!timeShiftActive) - tot << total; - else - tot << timeShiftFramesTotal; + tot << total; + stringstream timeshifttot; + timeshifttot << timeShiftFramesTotal; bool isStartMark = true; for (const cMark *m = marks->First(); m; m = marks->Next(m)) { @@ -303,6 +303,9 @@ void cDisplayReplayView::DrawMarks(const cMarks *marks, int current, int total) pos << m->Position(); markVals.insert(pair< string, string >("marks[position]", pos.str())); markVals.insert(pair< string, string >("marks[total]", tot.str())); + if (timeShiftActive) { + markVals.insert(pair< string, string >("marks[timeshifttotal]", timeshifttot.str())); + } markVals.insert(pair< string, string >("marks[startmark]", isStartMark ? "1" : "0")); markVals.insert(pair< string, string >("marks[active]", (m->Position() == current) ? "1" : "0")); const cMark *m2 = marks->Next(m); -- cgit v1.2.3