diff --git a/HISTORY b/HISTORY index d8cac86..2072e97 100644 --- a/HISTORY +++ b/HISTORY @@ -200,3 +200,4 @@ Version 0.2.1 Version 0.2.2 - added replay onpause view in blackhole skin +- implemented SetTitle() in displayreplay diff --git a/displayreplay.c b/displayreplay.c index d89c5e5..88d6802 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -24,13 +24,19 @@ cSDDisplayReplay::~cSDDisplayReplay() { } void cSDDisplayReplay::SetRecording(const cRecording *Recording) { - if (!doOutput) + if (!doOutput || !Recording) return; replayView->DrawTitle(Recording); replayView->DrawRecordingInformation(Recording); replayView->DrawScraperContent(Recording); } +void cSDDisplayReplay::SetTitle(const char *Title) { + if (!doOutput || !Title) + return; + replayView->DrawTitle(Title); +} + void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { if (!doOutput) return; diff --git a/displayreplay.h b/displayreplay.h index e299e91..836febb 100644 --- a/displayreplay.h +++ b/displayreplay.h @@ -17,7 +17,7 @@ public: cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly); virtual ~cSDDisplayReplay(); virtual void SetRecording(const cRecording *Recording); - virtual void SetTitle(const char *Title) {}; + virtual void SetTitle(const char *Title); virtual void SetMode(bool Play, bool Forward, int Speed); virtual void SetProgress(int Current, int Total); virtual void SetCurrent(const char *Current); diff --git a/views/displayreplayview.c b/views/displayreplayview.c index 48ebd75..dbd4cd3 100644 --- a/views/displayreplayview.c +++ b/views/displayreplayview.c @@ -96,6 +96,19 @@ void cDisplayReplayView::DrawTitle(const cRecording *recording) { DrawViewElement(veRecTitle, &stringTokens, &intTokens); } +void cDisplayReplayView::DrawTitle(const char *title) { + map < string, string > stringTokens; + map < string, int > intTokens; + + stringTokens.insert(pair("rectitle", title)); + stringTokens.insert(pair("recsubtitle", "")); + stringTokens.insert(pair("recdate", "")); + stringTokens.insert(pair("rectime", "")); + + DrawViewElement(veRecTitle, &stringTokens, &intTokens); +} + + void cDisplayReplayView::DrawRecordingInformation(const cRecording *recording) { map < string, string > stringTokens; map < string, int > intTokens; diff --git a/views/displayreplayview.h b/views/displayreplayview.h index 6104e2a..d5342c1 100644 --- a/views/displayreplayview.h +++ b/views/displayreplayview.h @@ -22,6 +22,7 @@ public: void DrawDate(void); void DrawTime(void); void DrawTitle(const cRecording *recording); + void DrawTitle(const char *title); void DrawRecordingInformation(const cRecording *recording); void DrawScraperContent(const cRecording *recording); void DrawCurrent(const char *current);