mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
Merge branch 'master' of git://projects.vdr-developer.org/vdr-plugin-skindesigner
This commit is contained in:
commit
9609e183f2
2
HISTORY
2
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
|
- 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
|
in the femon plugin and _Martin_ for extracting the code in skinflatplus
|
||||||
- changed skin metrixHD to display bitrate infos
|
- 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
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ void cSDDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
|
|||||||
cString ChannelID("");
|
cString ChannelID("");
|
||||||
|
|
||||||
if (Channel) {
|
if (Channel) {
|
||||||
ChannelName = Channel->Name();
|
ChannelName = Channel->Name() ? Channel->Name() : "";
|
||||||
ChannelID = Channel->GetChannelID().ToString();
|
ChannelID = Channel->GetChannelID().ToString();
|
||||||
if (!Channel->GroupSep()) {
|
if (!Channel->GroupSep()) {
|
||||||
ChannelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : "");
|
ChannelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : "");
|
||||||
@ -159,6 +159,7 @@ void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
|
|||||||
channelView->ClearSignalBackground();
|
channelView->ClearSignalBackground();
|
||||||
channelView->ClearScraperContent();
|
channelView->ClearScraperContent();
|
||||||
channelView->ClearAudioInfo();
|
channelView->ClearAudioInfo();
|
||||||
|
channelView->ClearBitrates();
|
||||||
channelView->DisplayMessage(Type, Text);
|
channelView->DisplayMessage(Type, Text);
|
||||||
groupSep = true;
|
groupSep = true;
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@ cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) {
|
|||||||
doOutput = true;
|
doOutput = true;
|
||||||
initial = true;
|
initial = true;
|
||||||
modeOnly = ModeOnly;
|
modeOnly = ModeOnly;
|
||||||
numMarksLast = 0;
|
|
||||||
lastMarks = NULL;
|
|
||||||
if (!replayTemplate) {
|
if (!replayTemplate) {
|
||||||
doOutput = false;
|
doOutput = false;
|
||||||
esyslog("skindesigner: displayReplay no valid template - aborting");
|
esyslog("skindesigner: displayReplay no valid template - aborting");
|
||||||
@ -24,9 +22,6 @@ cSDDisplayReplay::~cSDDisplayReplay() {
|
|||||||
if (!doOutput)
|
if (!doOutput)
|
||||||
return;
|
return;
|
||||||
delete replayView;
|
delete replayView;
|
||||||
if (lastMarks) {
|
|
||||||
delete[] lastMarks;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
|
void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
|
||||||
@ -47,9 +42,7 @@ void cSDDisplayReplay::SetProgress(int Current, int Total) {
|
|||||||
if (!doOutput)
|
if (!doOutput)
|
||||||
return;
|
return;
|
||||||
replayView->DrawProgressBar(Current, Total);
|
replayView->DrawProgressBar(Current, Total);
|
||||||
if (MarksChanged()) {
|
replayView->DrawMarks(marks, Current, Total);
|
||||||
replayView->DrawMarks(marks, Total);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSDDisplayReplay::SetCurrent(const char *Current) {
|
void cSDDisplayReplay::SetCurrent(const char *Current) {
|
||||||
@ -87,45 +80,3 @@ void cSDDisplayReplay::Flush(void) {
|
|||||||
replayView->Flush();
|
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++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -13,10 +13,6 @@ private:
|
|||||||
bool initial;
|
bool initial;
|
||||||
bool doOutput;
|
bool doOutput;
|
||||||
bool modeOnly;
|
bool modeOnly;
|
||||||
int numMarksLast;
|
|
||||||
int *lastMarks;
|
|
||||||
bool MarksChanged(void);
|
|
||||||
void RememberMarks(void);
|
|
||||||
public:
|
public:
|
||||||
cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly);
|
cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly);
|
||||||
virtual ~cSDDisplayReplay();
|
virtual ~cSDDisplayReplay();
|
||||||
|
@ -24,8 +24,10 @@ cGlobalSortedTimers::cGlobalSortedTimers(bool forceRefresh) : cVector<const cTim
|
|||||||
initial = false;
|
initial = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer))
|
for (cTimer *Timer = Timers.First(); Timer; Timer = Timers.Next(Timer)) {
|
||||||
Append(Timer);
|
if (Timer->HasFlags(tfActive))
|
||||||
|
Append(Timer);
|
||||||
|
}
|
||||||
|
|
||||||
//if remotetimers plugin is available, take timers also from him
|
//if remotetimers plugin is available, take timers also from him
|
||||||
if (pRemoteTimers) {
|
if (pRemoteTimers) {
|
||||||
|
@ -266,6 +266,7 @@
|
|||||||
-->
|
-->
|
||||||
<message>
|
<message>
|
||||||
<area x="10%" y="45%" width="80%" height="10%" layer="1">
|
<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="{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="{info}" x="20" y="0" width="20" height="100%" color="{clrBlue}" />
|
||||||
<drawrectangle condition="{warning}" x="20" y="0" width="20" height="100%" color="{clrYellow}" />
|
<drawrectangle condition="{warning}" x="20" y="0" width="20" height="100%" color="{clrYellow}" />
|
||||||
|
@ -130,16 +130,25 @@
|
|||||||
{marks[position]} frame of current mark
|
{marks[position]} frame of current mark
|
||||||
{marks[endposition]} frame where startmark ends
|
{marks[endposition]} frame where startmark ends
|
||||||
{marks[total]} total number of frames
|
{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
|
{marks[startmark]} true if mark is start mark
|
||||||
-->
|
-->
|
||||||
<cutmarks>
|
<cutmarks>
|
||||||
<area x="5%" y="89%" width="90%" height="3%" layer="3">
|
<area x="5%" y="89%" width="90%" height="3%" layer="3">
|
||||||
<loop name="marks" x="0" y="0" orientation="absolute">
|
<loop name="marks" x="0" y="0" orientation="absolute">
|
||||||
<drawrectangle x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="1" height="100%" color="{clrWhite}" />
|
<!-- draw mark -->
|
||||||
<drawrectangle condition="{marks[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth}" y="0" width="5" height="1" color="{clrWhite}" />
|
<drawrectangle condition="not{marks[active]}" 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="{areaheight}-1" width="5" height="1" 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[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" 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[startmark]}" x="{marks[position]}/{marks[total]}*{areawidth} - 5" 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}" />
|
<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>
|
</loop>
|
||||||
</area>
|
</area>
|
||||||
@ -221,6 +230,7 @@
|
|||||||
-->
|
-->
|
||||||
<message>
|
<message>
|
||||||
<area x="10%" y="45%" width="80%" height="10%" layer="1">
|
<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="{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="{info}" x="20" y="0" width="20" height="100%" color="{clrBlue}" />
|
||||||
<drawrectangle condition="{warning}" x="20" y="0" width="20" height="100%" color="{clrYellow}" />
|
<drawrectangle condition="{warning}" x="20" y="0" width="20" height="100%" color="{clrYellow}" />
|
||||||
|
@ -76,6 +76,7 @@
|
|||||||
{marks[position]} frame of current mark
|
{marks[position]} frame of current mark
|
||||||
{marks[endposition]} frame where startmark ends
|
{marks[endposition]} frame where startmark ends
|
||||||
{marks[total]} total number of frames
|
{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
|
{marks[startmark]} true if mark is start mark
|
||||||
-->
|
-->
|
||||||
<cutmarks>
|
<cutmarks>
|
||||||
|
@ -6,11 +6,17 @@
|
|||||||
|
|
||||||
cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) {
|
cDisplayReplayView::cDisplayReplayView(cTemplateView *tmplView) : cView(tmplView) {
|
||||||
lastDate = "";
|
lastDate = "";
|
||||||
|
numMarksLast = 0;
|
||||||
|
lastMarks = NULL;
|
||||||
|
markActive = -1;
|
||||||
DeleteOsdOnExit();
|
DeleteOsdOnExit();
|
||||||
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
|
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
cDisplayReplayView::~cDisplayReplayView() {
|
cDisplayReplayView::~cDisplayReplayView() {
|
||||||
|
if (lastMarks) {
|
||||||
|
delete[] lastMarks;
|
||||||
|
}
|
||||||
CancelSave();
|
CancelSave();
|
||||||
FadeOut();
|
FadeOut();
|
||||||
}
|
}
|
||||||
@ -189,10 +195,11 @@ void cDisplayReplayView::DrawProgressBar(int current, int total) {
|
|||||||
DrawViewElement(veRecProgressBar, &stringTokens, &intTokens);
|
DrawViewElement(veRecProgressBar, &stringTokens, &intTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cDisplayReplayView::DrawMarks(const cMarks *marks, int total) {
|
void cDisplayReplayView::DrawMarks(const cMarks *marks, int current, int total) {
|
||||||
if (!marks)
|
if (!marks)
|
||||||
return;
|
return;
|
||||||
|
if (!MarksChanged(marks, current))
|
||||||
|
return;
|
||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
map < string, vector< map< string, string > > > loopTokens;
|
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[position]", pos.str()));
|
||||||
markVals.insert(pair< string, string >("marks[total]", tot.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[startmark]", isStartMark ? "1" : "0"));
|
||||||
|
markVals.insert(pair< string, string >("marks[active]", (m->Position() == current) ? "1" : "0"));
|
||||||
const cMark *m2 = marks->Next(m);
|
const cMark *m2 = marks->Next(m);
|
||||||
if (m2) {
|
if (m2) {
|
||||||
stringstream posNext;
|
stringstream posNext;
|
||||||
@ -326,6 +334,66 @@ void cDisplayReplayView::DrawMessage(eMessageType type, const char *text) {
|
|||||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
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) {
|
void cDisplayReplayView::Action(void) {
|
||||||
SetInitFinished();
|
SetInitFinished();
|
||||||
|
@ -7,6 +7,11 @@
|
|||||||
class cDisplayReplayView : public cView {
|
class cDisplayReplayView : public cView {
|
||||||
private:
|
private:
|
||||||
cString lastDate;
|
cString lastDate;
|
||||||
|
int numMarksLast;
|
||||||
|
int *lastMarks;
|
||||||
|
int markActive;
|
||||||
|
bool MarksChanged(const cMarks *marks, int current);
|
||||||
|
void RememberMarks(const cMarks *marks);
|
||||||
virtual void Action(void);
|
virtual void Action(void);
|
||||||
public:
|
public:
|
||||||
cDisplayReplayView(cTemplateView *tmplView);
|
cDisplayReplayView(cTemplateView *tmplView);
|
||||||
@ -20,7 +25,7 @@ public:
|
|||||||
void DrawCurrent(const char *current);
|
void DrawCurrent(const char *current);
|
||||||
void DrawTotal(const char *total);
|
void DrawTotal(const char *total);
|
||||||
void DrawProgressBar(int current, int 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 DrawControlIcons(bool play, bool forward, int speed, bool modeOnly);
|
||||||
void DrawJump(const char *jump);
|
void DrawJump(const char *jump);
|
||||||
void DrawMessage(eMessageType type, const char *text);
|
void DrawMessage(eMessageType type, const char *text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user