summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Reimer <manuel.reimer@gmx.de>2014-11-07 17:22:12 +0100
committerManuel Reimer <manuel.reimer@gmx.de>2014-11-07 17:22:12 +0100
commita1ec8cc2832443a06c4d386c0ffd1c2ca1a8fdb9 (patch)
tree00d4ce5b222b0066873534bfb6c5bf44735b972e
parent2bd5a4057b11f7056cf346a6e4c897c03ed08f9a (diff)
parent7e7d7c994caa612f8520a772c8dcc964a5207414 (diff)
downloadvdr-plugin-skindesigner-a1ec8cc2832443a06c4d386c0ffd1c2ca1a8fdb9.tar.gz
vdr-plugin-skindesigner-a1ec8cc2832443a06c4d386c0ffd1c2ca1a8fdb9.tar.bz2
Merge branch 'master' of git://projects.vdr-developer.org/vdr-plugin-skindesigner
-rw-r--r--HISTORY2
-rw-r--r--skins/metrixhd/xmlfiles/displaychannel.xml10
-rw-r--r--skins/metrixhd/xmlfiles/displaymenutimers.xml6
-rw-r--r--skins/metrixhd/xmlfiles/displayreplay.xml10
-rw-r--r--skinskeleton/xmlfiles/displaychannel.xml10
-rw-r--r--skinskeleton/xmlfiles/displaymenutimers.xml6
-rw-r--r--skinskeleton/xmlfiles/displayreplay.xml10
-rw-r--r--views/displaychannelview.c36
-rw-r--r--views/displaymenuitemcurrentview.c17
-rw-r--r--views/displaymenuitemview.c17
-rw-r--r--views/displayreplayview.c36
11 files changed, 158 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 0693f0e..bcba075 100644
--- a/HISTORY
+++ b/HISTORY
@@ -54,4 +54,6 @@ Version 0.0.3
- fixed Bug that displaychannel was not shown after closing displaymenu with "backspace" (with active
menuorg plugin)
- fixed Bug with menuselection Patch
+- added tokens {month}, {monthname} and {year} in displaymenutimers listitem and currentitem
+- added dedicated tokens for posters and banners in <srapercontent> in displaychannel and displayreplay
diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml
index d1148d5..5fb6dc0 100644
--- a/skins/metrixhd/xmlfiles/displaychannel.xml
+++ b/skins/metrixhd/xmlfiles/displaychannel.xml
@@ -209,6 +209,16 @@
</devices>
<!-- Available Variables scrapercontent:
+ {posterpath} Full Path of Poster to use in image path attribute
+ {posterwidth} width of poster in pixel
+ {posterheight} height of poster in pixel
+ {hasPoster} true if poster is available
+ {bannerpath} Full Path of banner to use in image path attribute
+ {bannerwidth} width of banner in pixel
+ {bannerheight} height of banner in pixel
+ {hasBanner} true if banner is available
+
+ Use this tokens if you want to display a banner for series and a poster for movies:
{mediapath} Full Path of Poster or Banner to use in image path attribute
{mediawidth} width of image in pixel
{mediaheight} height of image in pixel
diff --git a/skins/metrixhd/xmlfiles/displaymenutimers.xml b/skins/metrixhd/xmlfiles/displaymenutimers.xml
index d191172..8fb5856 100644
--- a/skins/metrixhd/xmlfiles/displaymenutimers.xml
+++ b/skins/metrixhd/xmlfiles/displaymenutimers.xml
@@ -7,6 +7,9 @@
{timerstop} End Time of Timer in hh::mm
{day} Day (numerical)
{dayname} Day, for repeating timers days where timer is active
+ {month} Month (two digits)
+ {monthname} Month, three letter abbrevation
+ {year} Year (4 digits)
{channelname} Name of channel which is set for the timer
{channelid} ID of channel which is set for the timer (for dispalying channel logo)
{channelnumber} Number of channel which is set for the timer
@@ -42,6 +45,9 @@
{timerstop} End Time of Timer in hh::mm
{day} Day (numerical)
{dayname} Day, for repeating timers days where timer is active
+ {month} Month (two digits)
+ {monthname} Month, three letter abbrevation
+ {year} Year (4 digits)
{channelname} Name of channel which is set for the timer
{channelid} ID of channel which is set for the timer (for dispalying channel logo)
{channelnumber} Number of channel which is set for the timer
diff --git a/skins/metrixhd/xmlfiles/displayreplay.xml b/skins/metrixhd/xmlfiles/displayreplay.xml
index 244a783..b1d5609 100644
--- a/skins/metrixhd/xmlfiles/displayreplay.xml
+++ b/skins/metrixhd/xmlfiles/displayreplay.xml
@@ -48,6 +48,16 @@
</datetime>
<!-- Available Variables scrapercontent:
+ {posterpath} Full Path of Poster to use in image path attribute
+ {posterwidth} width of poster in pixel
+ {posterheight} height of poster in pixel
+ {hasPoster} true if poster is available
+ {bannerpath} Full Path of banner to use in image path attribute
+ {bannerwidth} width of banner in pixel
+ {bannerheight} height of banner in pixel
+ {hasBanner} true if banner is available
+
+ Use this tokens if you want to display a banner for series and a poster for movies:
{mediapath} Full Path of Poster or Banner to use in image path attribute
{mediawidth} width of image in pixel
{mediaheight} height of image in pixel
diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml
index 49a1630..27fc428 100644
--- a/skinskeleton/xmlfiles/displaychannel.xml
+++ b/skinskeleton/xmlfiles/displaychannel.xml
@@ -126,6 +126,16 @@
</devices>
<!-- Available Variables scrapercontent:
+ {posterpath} Full Path of Poster to use in image path attribute
+ {posterwidth} width of poster in pixel
+ {posterheight} height of poster in pixel
+ {hasPoster} true if poster is available
+ {bannerpath} Full Path of banner to use in image path attribute
+ {bannerwidth} width of banner in pixel
+ {bannerheight} height of banner in pixel
+ {hasBanner} true if banner is available
+
+ Use this tokens if you want to display a banner for series and a poster for movies:
{mediapath} Full Path of Poster or Banner to use in image path attribute
{mediawidth} width of image in pixel
{mediaheight} height of image in pixel
diff --git a/skinskeleton/xmlfiles/displaymenutimers.xml b/skinskeleton/xmlfiles/displaymenutimers.xml
index 93b64fd..584ec73 100644
--- a/skinskeleton/xmlfiles/displaymenutimers.xml
+++ b/skinskeleton/xmlfiles/displaymenutimers.xml
@@ -7,6 +7,9 @@
{timerstop} End Time of Timer in hh::mm
{day} Day (numerical)
{dayname} Day, for repeating timers days where timer is active
+ {month} Month (two digits)
+ {monthname} Month, three letter abbrevation
+ {year} Year (4 digits)
{channelname} Name of channel which is set for the timer
{channelid} ID of channel which is set for the timer (for dispalying channel logo)
{channelnumber} Number of channel which is set for the timer
@@ -33,6 +36,9 @@
{timerstop} End Time of Timer in hh::mm
{day} Day (numerical)
{dayname} Day, for repeating timers days where timer is active
+ {month} Month (two digits)
+ {monthname} Month, three letter abbrevation
+ {year} Year (4 digits)#
{channelname} Name of channel which is set for the timer
{channelid} ID of channel which is set for the timer (for dispalying channel logo)
{channelnumber} Number of channel which is set for the timer
diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml
index b6e4d6d..e9834fc 100644
--- a/skinskeleton/xmlfiles/displayreplay.xml
+++ b/skinskeleton/xmlfiles/displayreplay.xml
@@ -24,6 +24,16 @@
</datetime>
<!-- Available Variables scrapercontent:
+ {posterpath} Full Path of Poster to use in image path attribute
+ {posterwidth} width of poster in pixel
+ {posterheight} height of poster in pixel
+ {hasPoster} true if poster is available
+ {bannerpath} Full Path of banner to use in image path attribute
+ {bannerwidth} width of banner in pixel
+ {bannerheight} height of banner in pixel
+ {hasBanner} true if banner is available
+
+ Use this tokens if you want to display a banner for series and a poster for movies:
{mediapath} Full Path of Poster or Banner to use in image path attribute
{mediawidth} width of image in pixel
{mediaheight} height of image in pixel
diff --git a/views/displaychannelview.c b/views/displaychannelview.c
index 6187753..626658f 100644
--- a/views/displaychannelview.c
+++ b/views/displaychannelview.c
@@ -328,18 +328,44 @@ void cDisplayChannelView::DrawScraperContent(const cEvent *event) {
if (pScraper->Service("GetPosterBanner", &call)) {
int mediaWidth = 0;
int mediaHeight = 0;
- std::string mediaPath = "";
+ string mediaPath = "";
bool isBanner = false;
+ int posterWidth = 0;
+ int posterHeight = 0;
+ string posterPath = "";
+ bool hasPoster = false;
+ int bannerWidth = 0;
+ int bannerHeight = 0;
+ string bannerPath = "";
+ bool hasBanner = false;
if ((call.type == tSeries) && call.banner.path.size() > 0) {
mediaWidth = call.banner.width;
mediaHeight = call.banner.height;
mediaPath = call.banner.path;
isBanner = true;
+ bannerWidth = mediaWidth;
+ bannerHeight = mediaHeight;
+ bannerPath = mediaPath;
+ hasBanner = true;
+
+ ScraperGetPoster callPoster;
+ callPoster.event = event;
+ callPoster.recording = NULL;
+ if (pScraper->Service("GetPoster", &callPoster)) {
+ posterWidth = callPoster.poster.width;
+ posterHeight = callPoster.poster.height;
+ posterPath = callPoster.poster.path;
+ hasPoster = true;
+ }
} else if (call.type == tMovie && call.poster.path.size() > 0 && call.poster.height > 0) {
mediaWidth = call.poster.width;
mediaHeight = call.poster.height;
mediaPath = call.poster.path;
+ posterWidth = call.poster.width;
+ posterHeight = call.poster.height;
+ posterPath = call.poster.path;
+ hasPoster = true;
} else
return;
@@ -349,6 +375,14 @@ void cDisplayChannelView::DrawScraperContent(const cEvent *event) {
intTokens.insert(pair<string,int>("mediaheight", mediaHeight));
intTokens.insert(pair<string,int>("isbanner", isBanner));
stringTokens.insert(pair<string,string>("mediapath", mediaPath));
+ intTokens.insert(pair<string,int>("posterwidth", posterWidth));
+ intTokens.insert(pair<string,int>("posterheight", posterHeight));
+ stringTokens.insert(pair<string,string>("posterpath", posterPath));
+ intTokens.insert(pair<string,int>("hasposter", hasPoster));
+ intTokens.insert(pair<string,int>("bannerwidth", bannerWidth));
+ intTokens.insert(pair<string,int>("bannerheight", bannerHeight));
+ stringTokens.insert(pair<string,string>("bannerpath", bannerPath));
+ intTokens.insert(pair<string,int>("hasbanner", hasBanner));
ClearViewElement(veScraperContent);
DrawViewElement(veScraperContent, &stringTokens, &intTokens);
}
diff --git a/views/displaymenuitemcurrentview.c b/views/displaymenuitemcurrentview.c
index 741c7d1..4044b4f 100644
--- a/views/displaymenuitemcurrentview.c
+++ b/views/displaymenuitemcurrentview.c
@@ -433,8 +433,25 @@ void cDisplayMenuItemCurrentTimerView::Render(void) {
strftime(buffer, sizeof(buffer), "%Y%m%d", &tm_r);
day = buffer;
}
+
+ struct tm tm_r;
+ time_t timerDate = timer->Day();
+ localtime_r(&timerDate, &tm_r);
+ char buffer[4];
+ strftime(buffer, sizeof(buffer), "%m", &tm_r);
+ int month = atoi(buffer);
+ char buffer2[6];
+ strftime(buffer2, sizeof(buffer2), "%b", &tm_r);
+ string monthName = buffer2;
+ char buffer3[6];
+ strftime(buffer3, sizeof(buffer3), "%Y", &tm_r);
+ int year = atoi(buffer3);
+
stringTokens.insert(pair<string,string>("day", day));
stringTokens.insert(pair<string,string>("dayname", dayName));
+ intTokens.insert(pair<string,int>("month", month));
+ stringTokens.insert(pair<string,string>("monthname", monthName));
+ intTokens.insert(pair<string,int>("year", year));
const cChannel *channel = timer->Channel();
if (channel) {
diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c
index 67fd641..0618363 100644
--- a/views/displaymenuitemview.c
+++ b/views/displaymenuitemview.c
@@ -537,8 +537,25 @@ void cDisplayMenuItemTimersView::SetTokens(void) {
strftime(buffer, sizeof(buffer), "%Y%m%d", &tm_r);
day = buffer;
}
+
+ struct tm tm_r;
+ time_t timerDate = timer->Day();
+ localtime_r(&timerDate, &tm_r);
+ char buffer[4];
+ strftime(buffer, sizeof(buffer), "%m", &tm_r);
+ int month = atoi(buffer);
+ char buffer2[6];
+ strftime(buffer2, sizeof(buffer2), "%b", &tm_r);
+ string monthName = buffer2;
+ char buffer3[6];
+ strftime(buffer3, sizeof(buffer3), "%Y", &tm_r);
+ int year = atoi(buffer3);
+
stringTokens.insert(pair<string,string>("day", day));
stringTokens.insert(pair<string,string>("dayname", dayName));
+ intTokens.insert(pair<string,int>("month", month));
+ stringTokens.insert(pair<string,string>("monthname", monthName));
+ intTokens.insert(pair<string,int>("year", year));
const cChannel *channel = timer->Channel();
if (channel) {
diff --git a/views/displayreplayview.c b/views/displayreplayview.c
index 7c72a90..5777590 100644
--- a/views/displayreplayview.c
+++ b/views/displayreplayview.c
@@ -141,18 +141,44 @@ void cDisplayReplayView::DrawScraperContent(const cRecording *recording) {
if (pScraper->Service("GetPosterBannerV2", &call)) {
int mediaWidth = 0;
int mediaHeight = 0;
- std::string mediaPath = "";
+ string mediaPath = "";
bool isBanner = false;
+ int posterWidth = 0;
+ int posterHeight = 0;
+ string posterPath = "";
+ bool hasPoster = false;
+ int bannerWidth = 0;
+ int bannerHeight = 0;
+ string bannerPath = "";
+ bool hasBanner = false;
if ((call.type == tSeries) && call.banner.path.size() > 0) {
mediaWidth = call.banner.width;
mediaHeight = call.banner.height;
mediaPath = call.banner.path;
isBanner = true;
+ bannerWidth = mediaWidth;
+ bannerHeight = mediaHeight;
+ bannerPath = mediaPath;
+ hasBanner = true;
+
+ ScraperGetPoster callPoster;
+ callPoster.event = NULL;
+ callPoster.recording = recording;
+ if (pScraper->Service("GetPoster", &callPoster)) {
+ posterWidth = callPoster.poster.width;
+ posterHeight = callPoster.poster.height;
+ posterPath = callPoster.poster.path;
+ hasPoster = true;
+ }
} else if (call.type == tMovie && call.poster.path.size() > 0 && call.poster.height > 0) {
mediaWidth = call.poster.width;
mediaHeight = call.poster.height;
mediaPath = call.poster.path;
+ posterWidth = call.poster.width;
+ posterHeight = call.poster.height;
+ posterPath = call.poster.path;
+ hasPoster = true;
} else
return;
@@ -162,6 +188,14 @@ void cDisplayReplayView::DrawScraperContent(const cRecording *recording) {
intTokens.insert(pair<string,int>("mediaheight", mediaHeight));
intTokens.insert(pair<string,int>("isbanner", isBanner));
stringTokens.insert(pair<string,string>("mediapath", mediaPath));
+ intTokens.insert(pair<string,int>("posterwidth", posterWidth));
+ intTokens.insert(pair<string,int>("posterheight", posterHeight));
+ stringTokens.insert(pair<string,string>("posterpath", posterPath));
+ intTokens.insert(pair<string,int>("hasposter", hasPoster));
+ intTokens.insert(pair<string,int>("bannerwidth", bannerWidth));
+ intTokens.insert(pair<string,int>("bannerheight", bannerHeight));
+ stringTokens.insert(pair<string,string>("bannerpath", bannerPath));
+ intTokens.insert(pair<string,int>("hasbanner", hasBanner));
ClearViewElement(veScraperContent);
DrawViewElement(veScraperContent, &stringTokens, &intTokens);
}