added setup options to configure rerun display behaviour

This commit is contained in:
louis 2014-10-11 10:39:41 +02:00
parent 7fbcc9d330
commit effc63e810
6 changed files with 65 additions and 7 deletions

View File

@ -17,3 +17,4 @@ Version 0.0.2
- added discusage icons to menu header view element so that it discusage can be displayed in every menu view - added discusage icons to menu header view element so that it discusage can be displayed in every menu view
- added numeric day, month and year tokens in different view elements - added numeric day, month and year tokens in different view elements
- support for global variables type "double" - support for global variables type "double"
- added setup options to configure rerun display behaviour

View File

@ -16,6 +16,10 @@ cDesignerConfig::cDesignerConfig() {
logoWidth = 268; logoWidth = 268;
logoHeight = 200; logoHeight = 200;
replaceDecPoint = false; replaceDecPoint = false;
//settings for rerun display
rerunAmount = 10;
rerunDistance = 2;
rerunMaxChannel = 0;
} }
cDesignerConfig::~cDesignerConfig() { cDesignerConfig::~cDesignerConfig() {
@ -107,6 +111,9 @@ bool cDesignerConfig::SetupParse(const char *Name, const char *Value) {
else if (!strcasecmp(Name, "LimitChannelLogoCache")) limitLogoCache = atoi(Value); else if (!strcasecmp(Name, "LimitChannelLogoCache")) limitLogoCache = atoi(Value);
else if (!strcasecmp(Name, "NumberLogosInitially")) numLogosPerSizeInitial = atoi(Value); else if (!strcasecmp(Name, "NumberLogosInitially")) numLogosPerSizeInitial = atoi(Value);
else if (!strcasecmp(Name, "NumberLogosMax")) numLogosMax = atoi(Value); else if (!strcasecmp(Name, "NumberLogosMax")) numLogosMax = atoi(Value);
else if (!strcasecmp(Name, "RerunAmount")) rerunAmount = atoi(Value);
else if (!strcasecmp(Name, "RerunDistance")) rerunDistance = atoi(Value);
else if (!strcasecmp(Name, "RerunMaxChannel")) rerunMaxChannel = atoi(Value);
else return false; else return false;
return true; return true;
} }

View File

@ -43,6 +43,9 @@ public:
char decPoint; char decPoint;
vector<string> skins; vector<string> skins;
vector<string>::iterator skinIterator; vector<string>::iterator skinIterator;
int rerunAmount;
int rerunDistance;
int rerunMaxChannel;
}; };
#ifdef DEFINE_CONFIG #ifdef DEFINE_CONFIG
bool firstDisplay = true; bool firstDisplay = true;

View File

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-skindesigner 0.0.1\n" "Project-Id-Version: vdr-skindesigner 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2014-09-27 11:11+0200\n" "POT-Creation-Date: 2014-10-11 07:12+0200\n"
"PO-Revision-Date: 2014-09-27 11:02+0200\n" "PO-Revision-Date: 2014-09-27 11:02+0200\n"
"Last-Translator: Louis Braun <louis.braun@gmx.de>\n" "Last-Translator: Louis Braun <louis.braun@gmx.de>\n"
"Language-Team: \n" "Language-Team: \n"
@ -15,6 +15,21 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
msgid "Reruns"
msgstr "Wiederholungen"
msgid "Maximum number of reruns to display"
msgstr "Anzahl anzuzeigender Wiederholungen"
msgid "Minimum timely distance of rerun (in hours)"
msgstr "Zeitl. Abstand der Wiederholung (in h)"
msgid "Limit Channel Numbers (0 = no limit)"
msgstr "Kanalnummern begrenzen (0 = unbegrenzt)"
msgid "Image Loading"
msgstr "Bilder"
msgid "Debug Image Loading" msgid "Debug Image Loading"
msgstr "Debugausgabe für das Laden der Bilder" msgstr "Debugausgabe für das Laden der Bilder"

17
setup.c
View File

@ -13,6 +13,18 @@ void cSkinDesignerSetup::Setup(void) {
int current = Current(); int current = Current();
Clear(); Clear();
cString message = cString::sprintf("---------------- %s ----------------", tr("Reruns"));
Add(new cOsdItem(*message));
cList<cOsdItem>::Last()->SetSelectable(false);
Add(new cMenuEditIntItem(tr("Maximum number of reruns to display"), &data.rerunAmount, 1, 100));
Add(new cMenuEditIntItem(tr("Minimum timely distance of rerun (in hours)"), &data.rerunDistance, 0, 1000));
Add(new cMenuEditIntItem(tr("Limit Channel Numbers (0 = no limit)"), &data.rerunMaxChannel, 0, 1000));
message = cString::sprintf("---------------- %s ----------------", tr("Image Loading"));
Add(new cOsdItem(*message));
cList<cOsdItem>::Last()->SetSelectable(false);
Add(new cMenuEditBoolItem(tr("Debug Image Loading"), &data.debugImageLoading)); Add(new cMenuEditBoolItem(tr("Debug Image Loading"), &data.debugImageLoading));
Add(new cMenuEditBoolItem(tr("Limit Channel Logo Cache"), &data.limitLogoCache)); Add(new cMenuEditBoolItem(tr("Limit Channel Logo Cache"), &data.limitLogoCache));
@ -25,7 +37,7 @@ void cSkinDesignerSetup::Setup(void) {
return; return;
} }
cString message = cString::sprintf("--------------------- %s ---------------------", tr("Cache Statistics")); message = cString::sprintf("---------------- %s ----------------", tr("Cache Statistics"));
Add(new cOsdItem(*message)); Add(new cOsdItem(*message));
cList<cOsdItem>::Last()->SetSelectable(false); cList<cOsdItem>::Last()->SetSelectable(false);
@ -76,4 +88,7 @@ void cSkinDesignerSetup::Store(void) {
SetupStore("LimitChannelLogoCache", config.limitLogoCache); SetupStore("LimitChannelLogoCache", config.limitLogoCache);
SetupStore("NumberLogosInitially", config.numLogosPerSizeInitial); SetupStore("NumberLogosInitially", config.numLogosPerSizeInitial);
SetupStore("NumberLogosMax", config.numLogosMax); SetupStore("NumberLogosMax", config.numLogosMax);
SetupStore("RerunAmount", config.rerunAmount);
SetupStore("RerunDistance", config.rerunDistance);
SetupStore("RerunMaxChannel", config.rerunMaxChannel);
} }

View File

@ -426,15 +426,17 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
if (isempty(event->Title())) if (isempty(event->Title()))
return false; return false;
int maxNumReruns = 10; int maxNumReruns = config.rerunAmount;
int rerunDistance = config.rerunDistance * 3600;
int rerunNaxChannel = config.rerunMaxChannel;
Epgsearch_searchresults_v1_0 data; Epgsearch_searchresults_v1_0 data;
string strQuery = event->Title(); string strQuery = event->Title();
data.useSubTitle = true;
data.query = (char *)strQuery.c_str(); data.query = (char *)strQuery.c_str();
data.mode = 0; data.mode = 0;
data.channelNr = 0; data.channelNr = 0;
data.useTitle = true; data.useTitle = true;
data.useSubTitle = true;
data.useDescription = false; data.useDescription = false;
bool foundRerun = false; bool foundRerun = false;
@ -444,8 +446,24 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
foundRerun = true; foundRerun = true;
int i = 0; int i = 0;
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < maxNumReruns; r = list->Next(r)) { for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r && i < maxNumReruns; r = list->Next(r)) {
if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime())) time_t eventStart = event->StartTime();
time_t rerunStart = r->event->StartTime();
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
//check for identical event
if ((event->ChannelID() == r->event->ChannelID()) && (eventStart == rerunStart))
continue; continue;
//check for timely distance
if (rerunDistance > 0) {
if (rerunStart - eventStart < rerunDistance) {
continue;
}
}
//check for maxchannel
if (rerunNaxChannel > 0) {
if (channel && channel->Number() > rerunNaxChannel) {
continue;
}
}
i++; i++;
map< string, string > rerun; map< string, string > rerun;
rerun.insert(pair<string, string>("reruns[title]", r->event->Title() ? r->event->Title() : "")); rerun.insert(pair<string, string>("reruns[title]", r->event->Title() ? r->event->Title() : ""));
@ -460,7 +478,6 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
bool logoExists = imgCache->LogoExists(channelID); bool logoExists = imgCache->LogoExists(channelID);
rerun.insert(pair<string, string>("reruns[channellogoexists]", logoExists ? "1" : "0")); rerun.insert(pair<string, string>("reruns[channellogoexists]", logoExists ? "1" : "0"));
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
if (channel) { if (channel) {
stringstream channelNumber; stringstream channelNumber;
channelNumber << channel->Number(); channelNumber << channel->Number();