summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--displaychannel.c3
-rw-r--r--displayreplay.c51
-rw-r--r--displayreplay.h4
-rw-r--r--libcore/timers.c6
-rw-r--r--skins/metrixhd/xmlfiles/displaychannel.xml1
-rw-r--r--skins/metrixhd/xmlfiles/displayreplay.xml20
-rw-r--r--skinskeleton/xmlfiles/displayreplay.xml1
-rw-r--r--views/displayreplayview.c72
-rw-r--r--views/displayreplayview.h7
10 files changed, 102 insertions, 65 deletions
diff --git a/HISTORY b/HISTORY
index e918aea..35945a8 100644
--- a/HISTORY
+++ b/HISTORY
@@ -45,5 +45,7 @@ Version 0.0.3
- added tokens for current video and audio bitrate in displaychannel. Thx @rofafor for the original code
in the femon plugin and _Martin_ for extracting the code in skinflatplus
- changed skin metrixHD to display bitrate infos
+- added "active" Token for cutting marks so that a mark can be displayed in a dedicated way if current position
+ in replay exactly hits the mark
diff --git a/displaychannel.c b/displaychannel.c
index 0ddb514..5d2701a 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -46,7 +46,7 @@ void cSDDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
cString ChannelID("");
if (Channel) {
- ChannelName = Channel->Name();
+ ChannelName = Channel->Name() ? Channel->Name() : "";
ChannelID = Channel->GetChannelID().ToString();
if (!Channel->GroupSep()) {
ChannelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : "");
@@ -159,6 +159,7 @@ void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
channelView->ClearSignalBackground();
channelView->ClearScraperContent();
channelView->ClearAudioInfo();
+ channelView->ClearBitrates();
channelView->DisplayMessage(Type, Text);
groupSep = true;
}
diff --git a/displayreplay.c b/displayreplay.c
index 53a43d8..5a82eea 100644
--- a/displayreplay.c
+++ b/displayreplay.c
@@ -5,8 +5,6 @@ cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) {
doOutput = true;
initial = true;
modeOnly = ModeOnly;
- numMarksLast = 0;
- lastMarks = NULL;
if (!replayTemplate) {
doOutput = false;
esyslog("skindesigner: displayReplay no valid template - aborting");
@@ -24,9 +22,6 @@ cSDDisplayReplay::~cSDDisplayReplay() {
if (!doOutput)
return;
delete replayView;
- if (lastMarks) {
- delete[] lastMarks;
- }
}
void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
@@ -47,9 +42,7 @@ void cSDDisplayReplay::SetProgress(int Current, int Total) {
if (!doOutput)
return;
replayView->DrawProgressBar(Current, Total);
- if (MarksChanged()) {
- replayView->DrawMarks(marks, Total);
- }
+ replayView->DrawMarks(marks, Current, Total);
}
void cSDDisplayReplay::SetCurrent(const char *Current) {
@@ -87,45 +80,3 @@ void cSDDisplayReplay::Flush(void) {
replayView->Flush();
}
}
-
-/****************************************************************************************
-* Private Functions
-*****************************************************************************************/
-
-bool cSDDisplayReplay::MarksChanged(void) {
- if (!marks)
- return false;
- int numMarks = marks->Count();
- if (numMarks != numMarksLast) {
- RememberMarks();
- return true;
- }
- if (!lastMarks)
- return false;
- int i=0;
- for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
- if (m->Position() != lastMarks[i]) {
- RememberMarks();
- return true;
- }
- i++;
- }
- return false;
-}
-
-void cSDDisplayReplay::RememberMarks(void) {
- if (!marks)
- return;
- numMarksLast = marks->Count();
- if (numMarksLast < 1)
- return;
- if (lastMarks) {
- delete[] lastMarks;
- }
- lastMarks = new int[numMarksLast];
- int i=0;
- for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
- lastMarks[i] = m->Position();
- i++;
- }
-}
diff --git a/displayreplay.h b/displayreplay.h
index a63c8d8..e299e91 100644
--- a/displayreplay.h
+++ b/displayreplay.h
@@ -13,10 +13,6 @@ private:
bool initial;
bool doOutput;
bool modeOnly;
- int numMarksLast;
- int *lastMarks;
- bool MarksChanged(void);
- void RememberMarks(void);
public:
cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly);
virtual ~cSDDisplayReplay();
diff --git a/libcore/timers.c b/libcore/timers.c
index 09af69b..00f40e9 100644
--- a/libcore/timers.c
+++ b/libcore/timers.c
@@ -24,8 +24,10 @@ cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector<const cTim
initial = false;
}
- for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer))
- Append(Timer);
+ for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) {
+ if (Timer->HasFlags(tfActive))
+ Append(Timer);
+ }
//if remotetimers plugin is available, take timers also from him
if (pRemoteTimers) {
diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml
index 1e087d7..c182d21 100644
--- a/skins/metrixhd/xmlfiles/displaychannel.xml
+++ b/skins/metrixhd/xmlfiles/displaychannel.xml
@@ -266,6 +266,7 @@
-->
<message>
<area x="10%" y="45%" width="80%" height="10%" layer="1">
+ <fill color="{clrTransBlack}" />
<drawrectangle condition="{status}" x="20" y="0" width="20" height="100%" color="{clrGreen}" />
<drawrectangle condition="{info}" x="20" y="0" width="20" height="100%" color="{clrBlue}" />
<drawrectangle condition="{warning}" x="20" y="0" width="20" height="100%" color="{clrYellow}" />
diff --git a/skins/metrixhd/xmlfiles/displayreplay.xml b/skins/metrixhd/xmlfiles/displayreplay.xml
index 0b40986..244a783 100644
--- a/skins/metrixhd/xmlfiles/displayreplay.xml
+++ b/skins/metrixhd/xmlfiles/displayreplay.xml
@@ -130,16 +130,25 @@
{marks[position]} frame of current mark
{marks[endposition]} frame where startmark ends
{marks[total]} total number of frames
+ {marks[active]} true if current replay position hits exactly the mark
{marks[startmark]} true if mark is start mark
-->
<cutmarks>
<area x="5%" y="89%" width="90%" height="3%" layer="3">
<loop name="marks" x="0" y="0" orientation="absolute">
- <drawrectangle x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="1" height="100%" color="{clrWhite}" />
- <drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="5" height="1" color="{clrWhite}" />
- <drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="{areaheight}-1" width="5" height="1" color="{clrWhite}" />
- <drawrectangle condition="not{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" y="0" width="5" height="1" color="{clrWhite}" />
- <drawrectangle condition="not{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" y="{areaheight}-1" width="5" height="1" color="{clrWhite}" />
+ <!-- draw mark -->
+ <drawrectangle condition="not{marks[active]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="1" height="100%" color="{clrWhite}" />
+ <drawrectangle condition="not{marks[active]} ++ {marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="5" height="1" color="{clrWhite}" />
+ <drawrectangle condition="not{marks[active]} ++ {marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="{areaheight}-1" width="5" height="1" color="{clrWhite}" />
+ <drawrectangle condition="not{marks[active]} ++ not{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" y="0" width="5" height="1" color="{clrWhite}" />
+ <drawrectangle condition="not{marks[active]} ++ not{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" y="{areaheight}-1" width="5" height="1" color="{clrWhite}" />
+ <!-- draw active mark -->
+ <drawrectangle condition="{marks[active]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="1" height="100%" color="{clrRed}" />
+ <drawrectangle condition="{marks[active]} ++ {marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="5" height="1" color="{clrRed}" />
+ <drawrectangle condition="{marks[active]} ++ {marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="{areaheight}-1" width="5" height="1" color="{clrRed}" />
+ <drawrectangle condition="{marks[active]} ++ not{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" y="0" width="5" height="1" color="{clrRed}" />
+ <drawrectangle condition="{marks[active]} ++ not{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" y="{areaheight}-1" width="5" height="1" color="{clrRed}" />
+ <!-- draw bar to next mark if mark is startmark-->
<drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="30%" width="{marks[endposition]}/{marks[total]}*{areawidth} - {marks[position]}/{marks[total]}*{areawidth}" height="40%" color="{clrWhite}" />
</loop>
</area>
@@ -221,6 +230,7 @@
-->
<message>
<area x="10%" y="45%" width="80%" height="10%" layer="1">
+ <fill color="{clrTransBlack}" />
<drawrectangle condition="{status}" x="20" y="0" width="20" height="100%" color="{clrGreen}" />
<drawrectangle condition="{info}" x="20" y="0" width="20" height="100%" color="{clrBlue}" />
<drawrectangle condition="{warning}" x="20" y="0" width="20" height="100%" color="{clrYellow}" />
diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml
index 8911566..b6e4d6d 100644
--- a/skinskeleton/xmlfiles/displayreplay.xml
+++ b/skinskeleton/xmlfiles/displayreplay.xml
@@ -76,6 +76,7 @@
{marks[position]} frame of current mark
{marks[endposition]} frame where startmark ends
{marks[total]} total number of frames
+ {marks[active]} true if current replay position hits exactly the mark
{marks[startmark]} true if mark is start mark
-->
<cutmarks>
diff --git a/views/displayreplayview.c b/views/displayreplayview.c
index 0995dfe..7c72a90 100644
--- a/views/displayreplayview.c
+++ b/views/displayreplayview.c
@@ -6,11 +6,17 @@
cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) {
lastDate = "";
+ numMarksLast = 0;
+ lastMarks = NULL;
+ markActive = -1;
DeleteOsdOnExit();
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
}
cDisplayReplayView::~cDisplayReplayView() {
+ if (lastMarks) {
+ delete[] lastMarks;
+ }
CancelSave();
FadeOut();
}
@@ -189,10 +195,11 @@ void cDisplayReplayView::DrawProgressBar(int current, int total) {
DrawViewElement(veRecProgressBar, &stringTokens, &intTokens);
}
-void cDisplayReplayView::DrawMarks(const cMarks *marks, int total) {
+void cDisplayReplayView::DrawMarks(const cMarks *marks, int current, int total) {
if (!marks)
return;
-
+ if (!MarksChanged(marks, current))
+ return;
map < string, string > stringTokens;
map < string, int > intTokens;
map < string, vector< map< string, string > > > loopTokens;
@@ -208,6 +215,7 @@ void cDisplayReplayView::DrawMarks(const cMarks *marks, int total) {
markVals.insert(pair< string, string >("marks[position]", pos.str()));
markVals.insert(pair< string, string >("marks[total]", tot.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);
if (m2) {
stringstream posNext;
@@ -326,6 +334,66 @@ void cDisplayReplayView::DrawMessage(eMessageType type, const char *text) {
DrawViewElement(veMessage, &stringTokens, &intTokens);
}
+/****************************************************************************************
+* Private Functions
+*****************************************************************************************/
+
+bool cDisplayReplayView::MarksChanged(const cMarks *marks, int current) {
+ if (!marks)
+ return false;
+
+ bool redraw = false;
+ //if mark was active, we redraw always
+ if (markActive >= 0) {
+ markActive = -1;
+ redraw = true;
+ }
+ //check if current position in recording hits mark exactly
+ for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
+ if (m->Position() == current) {
+ markActive = current;
+ redraw = true;
+ break;
+ }
+ }
+ if (redraw)
+ return true;
+ //if number of marks has changed, redraw
+ int numMarks = marks->Count();
+ if (numMarks != numMarksLast) {
+ RememberMarks(marks);
+ return true;
+ }
+ if (!lastMarks)
+ return false;
+ //if position has changed, redraw
+ int i=0;
+ for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
+ if (m->Position() != lastMarks[i]) {
+ RememberMarks(marks);
+ return true;
+ }
+ i++;
+ }
+ return false;
+}
+
+void cDisplayReplayView::RememberMarks(const cMarks *marks) {
+ if (!marks)
+ return;
+ numMarksLast = marks->Count();
+ if (numMarksLast < 1)
+ return;
+ if (lastMarks) {
+ delete[] lastMarks;
+ }
+ lastMarks = new int[numMarksLast];
+ int i=0;
+ for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
+ lastMarks[i] = m->Position();
+ i++;
+ }
+}
void cDisplayReplayView::Action(void) {
SetInitFinished();
diff --git a/views/displayreplayview.h b/views/displayreplayview.h
index 750ec95..e637214 100644
--- a/views/displayreplayview.h
+++ b/views/displayreplayview.h
@@ -7,6 +7,11 @@
class cDisplayReplayView : public cView {
private:
cString lastDate;
+ int numMarksLast;
+ int *lastMarks;
+ int markActive;
+ bool MarksChanged(const cMarks *marks, int current);
+ void RememberMarks(const cMarks *marks);
virtual void Action(void);
public:
cDisplayReplayView(cTemplateView *tmplView);
@@ -20,7 +25,7 @@ public:
void DrawCurrent(const char *current);
void DrawTotal(const char *total);
void DrawProgressBar(int current, int total);
- void DrawMarks(const cMarks *marks, int total);
+ void DrawMarks(const cMarks *marks, int current, int total);
void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly);
void DrawJump(const char *jump);
void DrawMessage(eMessageType type, const char *text);