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 numeric day, month and year tokens in different view elements
- support for global variables type "double"
- added setup options to configure rerun display behaviour

View File

@ -16,6 +16,10 @@ cDesignerConfig::cDesignerConfig() {
logoWidth = 268;
logoHeight = 200;
replaceDecPoint = false;
//settings for rerun display
rerunAmount = 10;
rerunDistance = 2;
rerunMaxChannel = 0;
}
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, "NumberLogosInitially")) numLogosPerSizeInitial = 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;
return true;
}

View File

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

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skindesigner 0.0.1\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"
"Last-Translator: Louis Braun <louis.braun@gmx.de>\n"
"Language-Team: \n"
@ -15,6 +15,21 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\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"
msgstr "Debugausgabe für das Laden der Bilder"

17
setup.c
View File

@ -13,6 +13,18 @@ void cSkinDesignerSetup::Setup(void) {
int current = Current();
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("Limit Channel Logo Cache"), &data.limitLogoCache));
@ -25,7 +37,7 @@ void cSkinDesignerSetup::Setup(void) {
return;
}
cString message = cString::sprintf("--------------------- %s ---------------------", tr("Cache Statistics"));
message = cString::sprintf("---------------- %s ----------------", tr("Cache Statistics"));
Add(new cOsdItem(*message));
cList<cOsdItem>::Last()->SetSelectable(false);
@ -76,4 +88,7 @@ void cSkinDesignerSetup::Store(void) {
SetupStore("LimitChannelLogoCache", config.limitLogoCache);
SetupStore("NumberLogosInitially", config.numLogosPerSizeInitial);
SetupStore("NumberLogosMax", config.numLogosMax);
SetupStore("RerunAmount", config.rerunAmount);
SetupStore("RerunDistance", config.rerunDistance);
SetupStore("RerunMaxChannel", config.rerunMaxChannel);
}

View File

@ -425,16 +425,18 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
if (isempty(event->Title()))
return false;
int maxNumReruns = 10;
int maxNumReruns = config.rerunAmount;
int rerunDistance = config.rerunDistance * 3600;
int rerunNaxChannel = config.rerunMaxChannel;
Epgsearch_searchresults_v1_0 data;
string strQuery = event->Title();
data.useSubTitle = true;
data.query = (char *)strQuery.c_str();
data.mode = 0;
data.channelNr = 0;
data.useTitle = true;
data.useSubTitle = true;
data.useDescription = false;
bool foundRerun = false;
@ -444,8 +446,24 @@ bool cDisplayMenuDetailView::LoadReruns(vector< map< string, string > > *reruns)
foundRerun = true;
int i = 0;
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;
//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++;
map< string, string > rerun;
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);
rerun.insert(pair<string, string>("reruns[channellogoexists]", logoExists ? "1" : "0"));
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
if (channel) {
stringstream channelNumber;
channelNumber << channel->Number();