Added possibility to search for reruns in case of a timer conflict

This commit is contained in:
louis 2013-12-29 18:13:45 +01:00
parent 06ed8b3567
commit eede61ade5
102 changed files with 722 additions and 235 deletions

View File

@ -96,3 +96,4 @@ Version 1.1.0
- Rounded Corners for color buttons (Closes Ticket 1475)
- Fixed some issues with text backgrounds in flat themes (closes
Tickets 1480 and 1486)
- Added possibility to search for reruns in case of a timer conflict

View File

@ -59,7 +59,7 @@ endif
### The object files (add further files here):
OBJS = $(PLUGIN).o channelcolumn.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o grid.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenumanager.o recmenus.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timer.o tools.o tvguideosd.o
OBJS = $(PLUGIN).o channelcolumn.o channelgroup.o channelgroups.o channeljump.o config.o detailview.o dummygrid.o epggrid.o fontmanager.o footer.o geometrymanager.o grid.o headergrid.o imagecache.o imageloader.o imagemagickwrapper.o imagescaler.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenumanager.o recmenus.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timer.o timerconflict.o tools.o tvguideosd.o
### The main target:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
icons/recmenuicons/no.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
icons/recmenuicons/yes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@ -2,10 +2,10 @@
#include <sstream>
#include <map>
#include <vdr/channels.h>
#include "imagecache.h"
#include "config.h"
#include "imagescaler.h"
#include "tools.h"
#include "imagecache.h"
cImageCache::cImageCache() : cImageMagickWrapper() {
tempStaticLogo = NULL;
@ -372,6 +372,27 @@ cImage *cImageCache::GetLogo(const cChannel *channel) {
return NULL;
}
cImage *cImageCache::GetIcon(std::string name, int width, int height) {
std::stringstream iconName;
iconName << name << width << "x" << height;
std::map<std::string, cImage*>::iterator hit = iconCache.find(iconName.str());
if (hit != iconCache.end()) {
return (cImage*)hit->second;
} else {
std::stringstream iconPath;
iconPath << "recmenuicons/" << name;
bool success = LoadIcon(iconPath.str());
if (success) {
cImage *image = CreateImage(width, height);
iconCache.insert(std::pair<std::string, cImage*>(iconName.str(), image));
hit = iconCache.find(iconName.str());
if (hit != iconCache.end()) {
return (cImage*)hit->second;
}
}
}
return NULL;
}
void cImageCache::InsertIntoOsdElementCache(eOsdElementType type, int width, int height) {
cImage *image = CreateImage(width, height, false);
@ -578,7 +599,7 @@ std::string cImageCache::GetCacheSize(eCacheType type) {
sizeByte += img->Width() * img->Height() * sizeof(tColor);
}
numImages = osdElementCache.size();
} else if ((type == ctGrid) || (type == ctLogo) || (type == ctChannelGroup)) {
} else if ((type == ctGrid) || (type == ctLogo) || (type == ctChannelGroup) || (type == ctIcon)) {
std::map<std::string, cImage*> *cache;
if (type == ctGrid)
cache = &gridCache;
@ -586,6 +607,8 @@ std::string cImageCache::GetCacheSize(eCacheType type) {
cache = &logoCache;
else if (type == ctChannelGroup)
cache = &groupsCache;
else if (type == ctIcon)
cache = &iconCache;
for(std::map<std::string, cImage*>::const_iterator it = cache->begin(); it != cache->end(); it++) {
cImage *img = (cImage*)it->second;
@ -623,6 +646,12 @@ void cImageCache::Clear(void) {
}
logoCache.clear();
for(std::map<std::string, cImage*>::const_iterator it = iconCache.begin(); it != iconCache.end(); it++) {
cImage *img = (cImage*)it->second;
delete img;
}
iconCache.clear();
if (tempStaticLogo)
delete tempStaticLogo;
if (groupsHead)

View File

@ -12,6 +12,7 @@ enum eCacheType {
ctGrid,
ctLogo,
ctChannelGroup,
ctIcon,
};
enum eOsdElementType {
@ -41,6 +42,7 @@ public:
cImage *GetGrid(int width, int height, bool active);
cImage *GetChannelGroup(int width, int height);
cImage *GetLogo(const cChannel *channel);
cImage *GetIcon(std::string name, int width, int height);
std::string GetCacheSize(eCacheType type);
void Clear(void);
private:
@ -68,6 +70,7 @@ private:
std::map<std::string, cImage*> gridCache;
std::map<std::string, cImage*> groupsCache;
std::map<std::string, cImage*> logoCache;
std::map<std::string, cImage*> iconCache;
void CreateOsdIconCache(void);
void PrepareGridIconCache(void);
void CreateGridIconCache(void);

View File

@ -77,8 +77,13 @@ bool cImageLoader::LoadPoster(const char *poster, int width, int height) {
bool cImageLoader::LoadIcon(const char *cIcon, int size) {
if (size==0)
return false;
cString iconPathTheme = cString::sprintf("%s%s/recmenuicons/", *tvguideConfig.iconPath, *tvguideConfig.themeName);
bool success = false;
success = LoadImage(cIcon, *tvguideConfig.iconPath, "png");
success = LoadImage(cIcon, *iconPathTheme, "png");
if (!success) {
cString iconPathdefault = cString::sprintf("%s/recmenuicons/", *tvguideConfig.iconPath);
success = LoadImage(cIcon, *iconPathdefault, "png");
}
if (!success)
return false;
buffer.sample(Geometry(size, size));

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-24 11:13+0100\n"
"POT-Creation-Date: 2013-12-29 17:53+0100\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n"
@ -159,6 +159,27 @@ msgstr "No s'han trobat conflictes"
msgid "Close"
msgstr "Tanca"
msgid "reruns for"
msgstr ""
msgid "rerun for"
msgstr ""
msgid "found"
msgstr ""
msgid "Ignore reruns"
msgstr ""
msgid "No reruns found for Event"
msgstr ""
msgid "Timer for"
msgstr ""
msgid "replaced by rerun"
msgstr ""
msgid "Timer Active"
msgstr "Temporitzador actiu"
@ -644,3 +665,6 @@ msgstr ""
msgid "Channel Groups Cache"
msgstr ""
msgid "Recording Menus Icon Cache"
msgstr ""

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-24 11:13+0100\n"
"POT-Creation-Date: 2013-12-29 17:53+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -156,6 +156,27 @@ msgstr "Keine Timerkonflikte gefunden"
msgid "Close"
msgstr "Schließen"
msgid "reruns for"
msgstr ""
msgid "rerun for"
msgstr ""
msgid "found"
msgstr ""
msgid "Ignore reruns"
msgstr ""
msgid "No reruns found for Event"
msgstr ""
msgid "Timer for"
msgstr ""
msgid "replaced by rerun"
msgstr ""
msgid "Timer Active"
msgstr "Timer aktiv"
@ -641,3 +662,6 @@ msgstr "EPG Grid Cache"
msgid "Channel Groups Cache"
msgstr "Kanalgruppen Cache"
msgid "Recording Menus Icon Cache"
msgstr ""

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-24 11:13+0100\n"
"POT-Creation-Date: 2013-12-29 17:53+0100\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -156,6 +156,27 @@ msgstr "Таймер-конфликты не найдены"
msgid "Close"
msgstr "Закрыть"
msgid "reruns for"
msgstr ""
msgid "rerun for"
msgstr ""
msgid "found"
msgstr ""
msgid "Ignore reruns"
msgstr ""
msgid "No reruns found for Event"
msgstr ""
msgid "Timer for"
msgstr ""
msgid "replaced by rerun"
msgstr ""
msgid "Timer Active"
msgstr "Таймер активен"
@ -641,3 +662,6 @@ msgstr ""
msgid "Channel Groups Cache"
msgstr ""
msgid "Recording Menus Icon Cache"
msgstr ""

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-12-24 11:13+0100\n"
"POT-Creation-Date: 2013-12-29 17:53+0100\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@ -156,6 +156,27 @@ msgstr "Nena
msgid "Close"
msgstr "Zavrie»"
msgid "reruns for"
msgstr ""
msgid "rerun for"
msgstr ""
msgid "found"
msgstr ""
msgid "Ignore reruns"
msgstr ""
msgid "No reruns found for Event"
msgstr ""
msgid "Timer for"
msgstr ""
msgid "replaced by rerun"
msgstr ""
msgid "Timer Active"
msgstr "Plán aktívny"
@ -641,3 +662,6 @@ msgstr ""
msgid "Channel Groups Cache"
msgstr ""
msgid "Recording Menus Icon Cache"
msgstr ""

View File

@ -9,21 +9,13 @@
#include "services/tvscraper.h"
#include "tools.h"
#include "switchtimer.h"
#include "timerconflict.h"
#include "recmanager.h"
static int CompareRecording(const void *p1, const void *p2) {
return (int)((*(cRecording **)p1)->Start() - (*(cRecording **)p2)->Start());
}
bool TVGuideTimerConflict::timerInvolved(int involvedID) {
int numConflicts = timerIDs.size();
for (int i=0; i<numConflicts; i++) {
if (timerIDs[i] == involvedID)
return true;
}
return false;
}
cRecManager::cRecManager(void) {
epgSearchPlugin = NULL;
epgSearchAvailable = false;
@ -225,100 +217,23 @@ bool cRecManager::IsRecorded(const cEvent *event) {
return timer->Recording();
}
std::vector<TVGuideTimerConflict> cRecManager::CheckTimerConflict(void) {
/* TIMERCONFLICT FORMAT:
The result list looks like this for example when we have 2 timer conflicts at one time:
1190232780:152|30|50#152#45:45|10|50#152#45
'1190232780' is the time of the conflict in seconds since 1970-01-01.
It's followed by list of timers that have a conflict at this time:
'152|30|50#1 int editTimer(cTimer *timer, bool active, int prio, int start, int stop);
52#45' is the description of the first conflicting timer. Here:
'152' is VDR's timer id of this timer as returned from VDR's LSTT command
'30' is the percentage of recording that would be done (0...100)
'50#152#45' is the list of concurrent timers at this conflict
'45|10|50#152#45' describes the next conflict
*/
std::vector<TVGuideTimerConflict> results;
cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) {
cTVGuideTimerConflicts *conflictList = new cTVGuideTimerConflicts();
if (!epgSearchAvailable)
return results;
return conflictList;
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> conflicts = epgSearch->handler->TimerConflictList();
int numConflicts = conflicts.size();
if (numConflicts > 0) {
if (numConflicts == 0)
return conflictList;
for (std::list<std::string>::iterator it=conflicts.begin(); it != conflicts.end(); ++it) {
TVGuideTimerConflict sConflict;
splitstring s(it->c_str());
std::vector<std::string> flds = s.split(':');
if (flds.size() < 2)
continue;
sConflict.time = atoi(flds[0].c_str());
splitstring s2(flds[1].c_str());
std::vector<std::string> flds2 = s2.split('|');
if (flds2.size() < 3)
continue;
sConflict.timerID = atoi(flds2[0].c_str());
sConflict.percentPossible = atoi(flds2[1].c_str());
splitstring s3(flds2[2].c_str());
std::vector<std::string> flds3 = s3.split('#');
std::vector<int> timerIDs;
for (int k = 0; k < flds3.size(); k++) {
timerIDs.push_back(atoi(flds3[k].c_str()) - 1);
}
sConflict.timerIDs = timerIDs;
results.push_back(sConflict);
}
conflictList->AddConflict(*it);
}
}
delete epgSearch;
int numConflicts = results.size();
time_t startTime = 0;
time_t endTime = 0;
for (int i=0; i < numConflicts; i++) {
cTimeInterval *unionSet = NULL;
int numTimers = results[i].timerIDs.size();
for (int j=0; j < numTimers; j++) {
const cTimer *timer = Timers.Get(results[i].timerIDs[j]);
if (timer) {
if (!unionSet) {
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
} else {
cTimeInterval *timerInterval = new cTimeInterval(timer->StartTime(), timer->StopTime());
cTimeInterval *newUnion = unionSet->Union(timerInterval);
delete unionSet;
delete timerInterval;
unionSet = newUnion;
}
}
}
results[i].timeStart = unionSet->Start();
results[i].timeStop = unionSet->Stop();
delete unionSet;
cTimeInterval *intersect = NULL;
for (int j=0; j < numTimers; j++) {
const cTimer *timer = Timers.Get(results[i].timerIDs[j]);
if (timer) {
if (!intersect) {
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());
} else {
cTimeInterval *timerInterval = new cTimeInterval(timer->StartTime(), timer->StopTime());
cTimeInterval *newIntersect = intersect->Intersect(timerInterval);
if (newIntersect) {
delete intersect;
intersect = newIntersect;
}
delete timerInterval;
}
}
}
results[i].overlapStart = intersect->Start();
results[i].overlapStop = intersect->Stop();
delete intersect;
}
return results;
conflictList->CalculateConflicts();
return conflictList;
}
cTimer *cRecManager::CreateSeriesTimer(cRecMenu *menu, std::string path) {
@ -748,3 +663,46 @@ cRecording **cRecManager::SearchForRecordings(cString searchString, int &numResu
}
return NULL;
}
const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) {
if (epgSearchAvailable && !isempty(event->Title())) {
Epgsearch_searchresults_v1_0 data;
std::string strQuery = event->Title();
if (tvguideConfig.useSubtitleRerun > 0) {
if (tvguideConfig.useSubtitleRerun == 2 || !isempty(event->ShortText()))
strQuery += "~";
if (!isempty(event->ShortText()))
strQuery += event->ShortText();
data.useSubTitle = true;
} else {
data.useSubTitle = false;
}
data.query = (char *)strQuery.c_str();
data.mode = 0;
data.channelNr = 0;
data.useTitle = true;
data.useDescription = false;
if (epgSearchPlugin->Service("Epgsearch-searchresults-v1.0", &data)) {
cList<Epgsearch_searchresults_v1_0::cServiceSearchResult>* list = data.pResultList;
if (!list)
return NULL;
const cEvent **searchResults = NULL;
int numElements = list->Count();
if (numElements > 0) {
searchResults = new const cEvent *[numElements];
int index = 0;
for (Epgsearch_searchresults_v1_0::cServiceSearchResult *r = list->First(); r; r = list->Next(r)) {
if ((event->ChannelID() == r->event->ChannelID()) && (event->StartTime() == r->event->StartTime()))
continue;
searchResults[index] = r->event;
index++;
}
delete list;
numResults = index;
return searchResults;
}
}
}
return NULL;
}

View File

@ -6,19 +6,7 @@
#include <vdr/plugin.h>
#include "detailview.h"
#include "recmenu.h"
class TVGuideTimerConflict {
public:
time_t time;
time_t timeStart;
time_t timeStop;
time_t overlapStart;
time_t overlapStop;
int percentPossible;
int timerID;
std::vector<int> timerIDs;
bool timerInvolved(int involvedID);
};
#include "timerconflict.h"
struct TVGuideEPGSearchTemplate {
public:
@ -49,7 +37,7 @@ public:
void DeleteRemoteTimer(const cEvent *event);
void SaveTimer(cTimer *timer, cRecMenu *menu);
bool IsRecorded(const cEvent *event);
std::vector<TVGuideTimerConflict> CheckTimerConflict(void);
cTVGuideTimerConflicts *CheckTimerConflict(void);
cTimer *CreateSeriesTimer(cRecMenu *menu, std::string path);
std::string BuildEPGSearchString(cString searchString, cRecMenu *menu);
std::string BuildEPGSearchString(cString searchString, std::string templValue);
@ -61,6 +49,7 @@ public:
bool CreateSwitchTimer(const cEvent *event, cRecMenu *menu);
void DeleteSwitchTimer(const cEvent *event);
cRecording **SearchForRecordings(cString searchString, int &numResults);
const cEvent **LoadReruns(const cEvent *event, int &numResults);
virtual ~cRecManager (void);
};

View File

@ -340,6 +340,7 @@ void cRecMenu::Arrange(bool scroll) {
if (!scroll) {
header->SetGeometry(xElement, yElement, widthElement);
header->SetPixmaps();
header->setBackground();
}
yElement += header->GetHeight();
}
@ -351,6 +352,7 @@ void cRecMenu::Arrange(bool scroll) {
if (footer && !scroll) {
footer->SetGeometry(xElement, yElement, widthElement);
footer->SetPixmaps();
footer->setBackground();
}
}

View File

@ -1,6 +1,7 @@
#include <math.h>
#include <vdr/remote.h>
#include "imageloader.h"
#include "imagecache.h"
#include "tools.h"
#include "recmenuitem.h"
@ -253,6 +254,7 @@ void cRecMenuItemInfo::CalculateHeight(int textWidth) {
void cRecMenuItemInfo::setBackground(void) {
pixmap->Fill(clrTransparent);
cRecMenuItem::setBackground();
}
void cRecMenuItemInfo::Draw(void) {
@ -411,14 +413,14 @@ void cRecMenuItemBool::Draw(void) {
void cRecMenuItemBool::DrawValue(void) {
pixmapVal->Fill(clrTransparent);
cString strIcon = yes?"yes":"no";
std::string strIcon = yes?"yes":"no";
int iconSize = height - 8;
int iconX = width - iconSize - 10;
int iconY = (height - iconSize) / 2;
cImageLoader imgLoader;
if (imgLoader.LoadIcon(strIcon, iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapVal->DrawImage(cPoint(iconX, iconY), icon);
cImage *imgYesNo = imgCache.GetIcon(strIcon, iconSize, iconSize);
if (imgYesNo) {
pixmapVal->DrawImage(cPoint(iconX, iconY), *imgYesNo);
}
}
@ -499,14 +501,14 @@ void cRecMenuItemSelect::DrawValue(void) {
int iconLeftX = textX - iconSize;
int iconRightX = width - iconSize;
int iconY = (height - iconSize) / 2;
cImageLoader imgLoader;
if (imgLoader.LoadIcon("arrow_left", iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapVal->DrawImage(cPoint(iconLeftX, iconY), icon);
cImage *imgLeft = imgCache.GetIcon("arrow_left", iconSize, iconSize);
if (imgLeft) {
pixmapVal->DrawImage(cPoint(iconLeftX, iconY), *imgLeft);
}
if (imgLoader.LoadIcon("arrow_right", iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapVal->DrawImage(cPoint(iconRightX, iconY), icon);
cImage *imgRight = imgCache.GetIcon("arrow_right", iconSize, iconSize);
if (imgRight) {
pixmapVal->DrawImage(cPoint(iconRightX, iconY), *imgRight);
}
}
@ -671,8 +673,7 @@ void cRecMenuItemText::ActivateKeyboard(void) {
bool draw = false;
bool drawIcon = false;
cString strNum;
cString strIcon;
cImageLoader imgLoader;
std::string strIcon;
if (num<10) {
strNum = *cString::sprintf("%d", num);
draw = true;
@ -701,10 +702,10 @@ void cRecMenuItemText::ActivateKeyboard(void) {
}
if (drawIcon) {
int iconSize = gridHeight - 10;
if (imgLoader.LoadIcon(strIcon, iconSize)) {
cImage icon = imgLoader.GetImage();
cImage *imgIcon = imgCache.GetIcon(strIcon, iconSize, iconSize);
if (imgIcon) {
int iconX = X + (gridWidth - iconSize) / 2;
pixmapKeyboardIcons->DrawImage(cPoint(iconX, Y + 5), icon);
pixmapKeyboardIcons->DrawImage(cPoint(iconX, Y + 5), *imgIcon);
}
}
num++;
@ -1306,6 +1307,7 @@ cRecMenuItemTimer::cRecMenuItemTimer(const cTimer *timer,
eRecMenuState action1,
eRecMenuState action2,
eRecMenuState action3,
eRecMenuState action4,
time_t conflictStart,
time_t conflictStop,
time_t overlapStart,
@ -1316,6 +1318,7 @@ cRecMenuItemTimer::cRecMenuItemTimer(const cTimer *timer,
this->action = action1;
this->action2 = action2;
this->action3 = action3;
this->action4 = action4;
iconActive = 0;
this->conflictStart = conflictStart;
this->conflictStop = conflictStop;
@ -1382,48 +1385,57 @@ void cRecMenuItemTimer::Draw(void) {
int textHeightLine2 = height/2 - 5 + (height/4 - fontSmall->Height()) / 2;
int textHeightLine3 = 3*height/4 - 5 + (height/4 - fontSmall->Height()) / 2;
const cEvent *event = timer->Event();
cString timerTitle("");
if (event)
std::string timerTitle = "";
if (event) {
timerTitle = event->Title();
timerTitle = CutText(timerTitle, (70 * width / 100) - textX, font);
}
cString timeStart = DayDateTime(timer->StartTime());
cString timeEnd = TimeString(timer->StopTime());
cString timerTime = cString::sprintf("%s - %s", *timeStart, *timeEnd);
cString channelInfo = cString::sprintf("%s, %s %d", *channelName, tr("Transp."), channelTransponder);
pixmap->DrawText(cPoint(textX, textHeightLine1), *timerTitle, theme.Color(clrFont), colorTextBack, font);
pixmap->DrawText(cPoint(textX, textHeightLine2), *timerTime, theme.Color(clrFont), colorTextBack, fontSmall);
pixmap->DrawText(cPoint(textX, textHeightLine3), *channelInfo, theme.Color(clrFont), colorTextBack, fontSmall);
pixmapIcons->DrawText(cPoint(textX, textHeightLine1), timerTitle.c_str(), colorText, colorTextBack, font);
pixmapIcons->DrawText(cPoint(textX, textHeightLine2), *timerTime, colorText, colorTextBack, fontSmall);
pixmapIcons->DrawText(cPoint(textX, textHeightLine3), *channelInfo, colorText, colorTextBack, fontSmall);
DrawTimerConflict();
}
int cRecMenuItemTimer::DrawIcons(void) {
int iconsX = 10;
int iconSize = 64;
int iconSize = height/2;
int iconY = (height - iconSize) / 2;
cString iconInfo, iconDelete, iconEdit;
std::string iconInfo, iconDelete, iconEdit, iconSearch;
if (active) {
iconInfo = (iconActive==0)?"info_active":"info_inactive";
iconDelete = (iconActive==1)?"delete_active":"delete_inactive";
iconEdit = (iconActive==2)?"edit_active":"edit_inactive";
iconSearch = (iconActive==3)?"search_active":"search_inactive";
} else {
iconInfo = "info_inactive";
iconDelete = "delete_inactive";
iconEdit = "edit_inactive";
iconSearch = "search_inactive";
}
cImageLoader imgLoader;
if (imgLoader.LoadIcon(iconInfo, iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(iconsX, iconY), icon);
cImage *imgInfo = imgCache.GetIcon(iconInfo, iconSize, iconSize);
if (imgInfo) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgInfo);
iconsX += iconSize + 5;
}
if (imgLoader.LoadIcon(iconDelete, iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(iconsX, iconY), icon);
cImage *imgDelete = imgCache.GetIcon(iconDelete, iconSize, iconSize);
if (imgDelete) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgDelete);
iconsX += iconSize + 5;
}
if (imgLoader.LoadIcon(iconEdit, iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(iconsX, iconY), icon);
cImage *imgEdit = imgCache.GetIcon(iconEdit, iconSize, iconSize);
if (imgEdit) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgEdit);
iconsX += iconSize + 5;
}
cImage *imgSearch = imgCache.GetIcon(iconSearch, iconSize, iconSize);
if (imgSearch) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgSearch);
iconsX += iconSize + 5;
}
return iconsX;
@ -1461,7 +1473,7 @@ eRecMenuState cRecMenuItemTimer::ProcessKey(eKeys Key) {
return rmsNotConsumed;
break;
case kRight:
if (iconActive < 2) {
if (iconActive < 3) {
iconActive++;
DrawIcons();
return rmsConsumed;
@ -1475,6 +1487,8 @@ eRecMenuState cRecMenuItemTimer::ProcessKey(eKeys Key) {
return action2;
else if (iconActive == 2)
return action3;
else if (iconActive == 3)
return action4;
break;
default:
break;
@ -1521,6 +1535,7 @@ void cRecMenuItemTimerConflictHeader::Show(void) {
void cRecMenuItemTimerConflictHeader::setBackground(void) {
pixmap->Fill(clrTransparent);
cRecMenuItem::setBackground();
}
void cRecMenuItemTimerConflictHeader::Draw(void) {
@ -1550,10 +1565,10 @@ void cRecMenuItemTimerConflictHeader::Draw(void) {
int xConflStop = width - fontSmall->Width(*strConflStop) - 2;
int xOverlapStart = xOverlap - fontSmall->Width(*strOverlapStart) - 2;
int xOverlapStop = xOverlap + widthOverlap + 2;
pixmap->DrawText(cPoint(xConflStart, y1), *strConflStart, theme.Color(clrRecMenuTimerConflictBar), colorTextBack, fontSmall);
pixmap->DrawText(cPoint(xConflStop, y1), *strConflStop, theme.Color(clrRecMenuTimerConflictBar), colorTextBack, fontSmall);
pixmap->DrawText(cPoint(xOverlapStart, y2), *strOverlapStart, theme.Color(clrRecMenuTimerConflictOverlap), colorTextBack, fontSmall);
pixmap->DrawText(cPoint(xOverlapStop, y2), *strOverlapStop, theme.Color(clrRecMenuTimerConflictOverlap), colorTextBack, fontSmall);
pixmap->DrawText(cPoint(xConflStart, y1), *strConflStart, theme.Color(clrRecMenuTimerConflictBar), theme.Color(clrRecMenuTimerConflictBackground), fontSmall);
pixmap->DrawText(cPoint(xConflStop, y1), *strConflStop, theme.Color(clrRecMenuTimerConflictBar), theme.Color(clrRecMenuTimerConflictBackground), fontSmall);
pixmap->DrawText(cPoint(xOverlapStart, y2), *strOverlapStart, theme.Color(clrRecMenuTimerConflictOverlap), theme.Color(clrRecMenuTimerConflictBackground), fontSmall);
pixmap->DrawText(cPoint(xOverlapStop, y2), *strOverlapStop, theme.Color(clrRecMenuTimerConflictOverlap), theme.Color(clrRecMenuTimerConflictBackground), fontSmall);
}
// --- cRecMenuItemEvent -------------------------------------------------------
@ -1631,9 +1646,9 @@ void cRecMenuItemEvent::Draw(void) {
int cRecMenuItemEvent::DrawIcons(void) {
pixmapIcons->Fill(clrTransparent);
int iconsX = 10;
int iconSize = 64;
int iconSize = height / 2;
int iconY = (height - iconSize) / 2;
cString iconInfo, iconRecord;
std::string iconInfo, iconRecord;
if (active) {
iconInfo = (iconActive==0)?"info_active":"info_inactive";
if (action2 != rmsDisabled)
@ -1643,17 +1658,18 @@ int cRecMenuItemEvent::DrawIcons(void) {
if (action2 != rmsDisabled)
iconRecord = "record_inactive";
}
cImageLoader imgLoader;
if (imgLoader.LoadIcon(iconInfo, iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(iconsX, iconY), icon);
cImage *imgInfo = imgCache.GetIcon(iconInfo, iconSize, iconSize);
if (imgInfo) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgInfo);
iconsX += iconSize + 5;
}
if ((action2 != rmsDisabled) && imgLoader.LoadIcon(iconRecord, iconSize)) {
cImage icon = imgLoader.GetImage();
pixmapIcons->DrawImage(cPoint(iconsX, iconY), icon);
if (action2 != rmsDisabled) {
cImage *imgRec = imgCache.GetIcon(iconRecord, iconSize, iconSize);
if (imgRec) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgRec);
iconsX += iconSize + 5;
}
}
return iconsX;
}

View File

@ -18,6 +18,7 @@ enum eRecMenuState {
rmsIgnoreTimerConflict,
rmsDeleteTimerConflictMenu,
rmsEditTimerConflictMenu,
rmsSearchRerunsTimerConflictMenu,
rmsSaveTimerConflictMenu,
rmsTimerConflictShowInfo,
rmsDeleteTimer,
@ -51,6 +52,8 @@ enum eRecMenuState {
rmsRecordingSearchResult,
rmsTimerConflict,
rmsTimerConflicts,
rmsTimerConflictIgnoreReruns,
rmsTimerConflictRecordRerun,
rmsDisabled,
};
@ -331,6 +334,7 @@ private:
const cTimer *timer;
eRecMenuState action2;
eRecMenuState action3;
eRecMenuState action4;
int iconActive;
cPixmap *pixmapIcons;
cPixmap *pixmapStatus;
@ -345,6 +349,7 @@ public:
eRecMenuState action1,
eRecMenuState action2,
eRecMenuState action3,
eRecMenuState action4,
time_t conflictStart,
time_t conflictStop,
time_t overlapStart,

View File

@ -1,6 +1,7 @@
#include "recmenu.h"
#include "recmenus.h"
#include "switchtimer.h"
#include "timerconflict.h"
#include "recmenumanager.h"
cRecMenuManager::cRecMenuManager(void) {
@ -11,10 +12,11 @@ cRecMenuManager::cRecMenuManager(void) {
recManager->SetEPGSearchPlugin();
instantRecord = false;
folderChoosen = false;
currentConflict = -1;
timerConflicts = NULL;
templateID = -1;
timer = NULL;
recFolder = "";
recFolderSeriesTimer = "";
recFolderInstantTimer = "";
searchWithOptions = false;
detailViewActive = false;
}
@ -25,6 +27,10 @@ cRecMenuManager::~cRecMenuManager(void) {
delete activeMenu;
activeMenu = NULL;
}
if (timerConflicts) {
delete timerConflicts;
timerConflicts = NULL;
}
delete recManager;
}
@ -33,10 +39,11 @@ void cRecMenuManager::Start(const cEvent *event) {
activeMenuBuffer = NULL;
instantRecord = false;
folderChoosen = false;
currentConflict = -1;
timerConflicts = NULL;
templateID = -1;
timer = NULL;
recFolder = "";
recFolderSeriesTimer = "";
recFolderInstantTimer = "";
searchWithOptions = false;
detailViewActive = false;
SetBackground();
@ -53,6 +60,10 @@ void cRecMenuManager::Close(void) {
delete activeMenu;
activeMenu = NULL;
}
if (timerConflicts) {
delete timerConflicts;
timerConflicts = NULL;
}
DeleteBackground();
}
@ -83,14 +94,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
//Creating timer for active Event
//if no conflict, confirm and exit
instantRecord = true;
cString folder = "";
recFolderInstantTimer = "";
if (folderChoosen) {
int activeItem = activeMenu->GetActive(false);
if (activeItem > 0)
folder = activeMenu->GetStringValue(activeItem);
recFolderInstantTimer = activeMenu->GetStringValue(activeItem);
}
delete activeMenu;
cTimer *timer = recManager->createTimer(event, *folder);
cTimer *timer = recManager->createTimer(event, *recFolderInstantTimer);
if (!displayTimerConflict(timer)) {
activeMenu = new cRecMenuConfirmTimer(event);
activeMenu->Display();
@ -116,7 +127,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
break;
case rmsTimerConflictShowInfo: {
int timerIndex = activeMenu->GetActive(true);
int timerID = conflictList[currentConflict].timerIDs[timerIndex];
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
cTimer *t = Timers.Get(timerID);
if (t) {
const cEvent *ev = t->Event();
@ -135,7 +146,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
//delete timer out of current timer conflict
//active menu: cRecMenuTimerConflict
int timerIndex = activeMenu->GetActive(true);
int timerID = conflictList[currentConflict].timerIDs[timerIndex];
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
recManager->DeleteTimer(timerID);
delete activeMenu;
if (!displayTimerConflict(timerID)) {
@ -146,8 +157,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
case rmsEditTimerConflictMenu: {
//edit timer out of current timer conflict
//active menu: cRecMenuTimerConflict
int activeItem = activeMenu->GetActive(true);
int timerID = conflictList[currentConflict].timerIDs[activeItem];
int timerIndex = activeMenu->GetActive(true);
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
timer = Timers.Get(timerID);
if (timer) {
delete activeMenu;
@ -201,11 +212,11 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
* --------- SERIES TIMER ---------------------------------
*/
case rmsSeriesTimer: {
recFolder = "";
recFolderSeriesTimer = "";
if (folderChoosen) {
int activeItem = activeMenu->GetActive(false);
if (activeItem > 0)
recFolder = activeMenu->GetStringValue(activeItem);
recFolderSeriesTimer = activeMenu->GetStringValue(activeItem);
}
delete activeMenu;
cChannel *channel = Channels.GetByChannelID(event->ChannelID());
@ -220,7 +231,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display();
break;
case rmsSeriesTimerCreate: {
cTimer *seriesTimer = recManager->CreateSeriesTimer(activeMenu, *recFolder);
cTimer *seriesTimer = recManager->CreateSeriesTimer(activeMenu, *recFolderSeriesTimer);
delete activeMenu;
activeMenu = new cRecMenuConfirmSeriesTimer(seriesTimer);
activeMenu->Display();
@ -438,25 +449,79 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
case rmsTimerConflicts: {
//Show timer conflict
//active menu: cRecMenuTimerConflicts
conflictList = recManager->CheckTimerConflict();
if (timerConflicts) {
delete timerConflicts;
}
timerConflicts = recManager->CheckTimerConflict();
delete activeMenu;
int numConflicts = conflictList.size();
int numConflicts = timerConflicts->NumConflicts();
if (numConflicts > 0) {
activeMenu = new cRecMenuTimerConflicts(conflictList);
activeMenu = new cRecMenuTimerConflicts(timerConflicts);
} else {
activeMenu = new cRecMenuNoTimerConflict();
}
activeMenu->Display();
break; }
case rmsTimerConflict:
case rmsTimerConflict: {
//Show timer conflict
//active menu: cRecMenuTimerConflicts
currentConflict = activeMenu->GetActive(true);
delete activeMenu;
activeMenu = new cRecMenuTimerConflict(conflictList[currentConflict]);
activeMenu->Display();
if (!timerConflicts)
break;
timerConflicts->SetCurrentConflict(activeMenu->GetActive(true));
delete activeMenu;
activeMenu = new cRecMenuTimerConflict(timerConflicts->GetCurrentConflict());
activeMenu->Display();
break; }
case rmsSearchRerunsTimerConflictMenu: {
//Show reruns for timer from timer conflict
//active menu: cRecMenuTimerConflict
if (!timerConflicts)
break;
int activeItem = activeMenu->GetActive(true);
int timerID = timerConflicts->GetCurrentConflictTimerID(activeItem);
timer = Timers.Get(timerID);
if (timer) {
const cEvent *event = timer->Event();
if (event) {
int numReruns = 0;
const cEvent **reruns = recManager->LoadReruns(event, numReruns);
if (reruns && (numReruns > 0)) {
activeMenuBuffer = activeMenu;
activeMenuBuffer->Hide();
activeMenu = new cRecMenuRerunResults(event, reruns, numReruns);
activeMenu->Display();
} else {
activeMenuBuffer = activeMenu;
activeMenuBuffer->Hide();
activeMenu = new cRecMenuNoRerunsFound((event->Title())?event->Title():"");
activeMenu->Display();
}
}
}
break; }
case rmsTimerConflictIgnoreReruns: {
delete activeMenu;
activeMenu = activeMenuBuffer;
activeMenuBuffer = NULL;
activeMenu->Show();
break; }
case rmsTimerConflictRecordRerun: {
const cEvent *replace = activeMenu->GetEventValue(activeMenu->GetActive(false));
int originalConflictIndex = activeMenuBuffer->GetActive(false);
int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex);
cTimer *timerOriginal = Timers.Get(originalTimerID);
if (replace && timerOriginal) {
recManager->DeleteTimer(timerOriginal->Event());
recManager->createTimer(replace, *recFolderInstantTimer);
delete activeMenu;
if (activeMenuBuffer) {
delete activeMenuBuffer;
activeMenuBuffer = NULL;
}
activeMenu = new cRecMenuConfirmRerunUsed(timerOriginal->Event(), replace);
activeMenu->Display();
}
break; }
/*
* --------- COMMON ---------------------------------
*/
@ -489,20 +554,18 @@ bool cRecMenuManager::displayTimerConflict(cTimer *timer) {
}
bool cRecMenuManager::displayTimerConflict(int timerID) {
conflictList = recManager->CheckTimerConflict();
int numConflicts = conflictList.size();
int showTimerConflict = -1;
if (numConflicts > 0) {
for (int i=0; i<numConflicts; i++) {
if (conflictList[i].timerInvolved(timerID)) {
showTimerConflict = i;
break;
}
}
}
if (timerConflicts)
delete timerConflicts;
timerConflicts = recManager->CheckTimerConflict();
if (!timerConflicts)
return false;
int showTimerConflict = timerConflicts->GetCorrespondingConflict(timerID);
if (showTimerConflict > -1) {
currentConflict = showTimerConflict;
activeMenu = new cRecMenuTimerConflict(conflictList[currentConflict]);
timerConflicts->SetCurrentConflict(showTimerConflict);
cTVGuideTimerConflict *conflict = timerConflicts->GetCurrentConflict();
if (!conflict)
return false;
activeMenu = new cRecMenuTimerConflict(conflict);
activeMenu->Display();
return true;
}

View File

@ -13,15 +13,15 @@ private:
cRecMenu *activeMenuBuffer;
const cEvent *event;
cRecManager *recManager;
std::vector<TVGuideTimerConflict> conflictList;
cTVGuideTimerConflicts *timerConflicts;
std::vector<TVGuideEPGSearchTemplate> epgSearchTemplates;
bool instantRecord;
bool folderChoosen;
int currentConflict;
cString recFolderInstantTimer;
int templateID;
bool searchWithOptions;
cTimer *timer;
cString recFolder;
cString recFolderSeriesTimer;
cString searchString;
cDetailView *detailView;
cPixmap *pixmapBackground;

View File

@ -177,20 +177,23 @@ cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
}
// --- cRecMenuTimerConflicts ---------------------------------------------------------
cRecMenuTimerConflicts::cRecMenuTimerConflicts(std::vector<TVGuideTimerConflict> conflicts) {
int numConflicts = conflicts.size();
cRecMenuTimerConflicts::cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts) {
int numConflicts = conflicts->NumConflicts();
cString text;
if (numConflicts == 1) {
text = cString::sprintf("%s %s %s", tr("One"), tr("Timer Conflict"), tr("detected"));
} else {
text = cString::sprintf("%d %s %s", (int)conflicts.size(), tr("Timer Conflicts"), tr("detected"));
text = cString::sprintf("%d %s %s", conflicts->NumConflicts(), tr("Timer Conflicts"), tr("detected"));
}
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
for (int i=0; i<numConflicts; i++) {
cString dateTime = DayDateTime(conflicts[i].time);
int numTimers = conflicts[i].timerIDs.size();
cTVGuideTimerConflict *conflict = conflicts->GetConflict(i);
if (!conflict)
continue;
cString dateTime = DayDateTime(conflict->time);
int numTimers = conflict->timerIDs.size();
cString textConflict = cString::sprintf("%s: %s (%d %s)", tr("Show conflict"), *dateTime, numTimers, tr("timers involved"));
bool isActive = (i==0)?true:false;
AddMenuItem(new cRecMenuItemButton(*textConflict, rmsTimerConflict, isActive));
@ -207,26 +210,27 @@ cRecMenuTimerConflicts::cRecMenuTimerConflicts(std::vector<TVGuideTimerConflict>
}
// --- cRecMenuTimerConflict ---------------------------------------------------------
cRecMenuTimerConflict::cRecMenuTimerConflict(TVGuideTimerConflict conflict) {
SetWidthPercent(80);
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
SetWidthPercent(95);
this->conflict = conflict;
SetHeader(new cRecMenuItemTimerConflictHeader(conflict.timeStart,
conflict.timeStop,
conflict.overlapStart,
conflict.overlapStop));
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
conflict->timeStop,
conflict->overlapStart,
conflict->overlapStop));
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true));
int i=0;
for(std::vector<int>::iterator it = conflict.timerIDs.begin(); it != conflict.timerIDs.end(); it++) {
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
const cTimer *timer = Timers.Get(*it);
if (timer) {
AddMenuItemScroll(new cRecMenuItemTimer( timer,
rmsTimerConflictShowInfo,
rmsDeleteTimerConflictMenu,
rmsEditTimerConflictMenu,
conflict.timeStart,
conflict.timeStop,
conflict.overlapStart,
conflict.overlapStop,
rmsSearchRerunsTimerConflictMenu,
conflict->timeStart,
conflict->timeStop,
conflict->overlapStart,
conflict->overlapStop,
(!i)?true:false)
);
i++;
@ -240,16 +244,17 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(TVGuideTimerConflict conflict) {
}
cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
if ((number >= 0) && (number < conflict.timerIDs.size())) {
const cTimer *timer = Timers.Get(conflict.timerIDs[number]);
if ((number >= 0) && (number < conflict->timerIDs.size())) {
const cTimer *timer = Timers.Get(conflict->timerIDs[number]);
cRecMenuItem *result = new cRecMenuItemTimer( timer,
rmsTimerConflictShowInfo,
rmsDeleteTimerConflictMenu,
rmsEditTimerConflictMenu,
conflict.timeStart,
conflict.timeStop,
conflict.overlapStart,
conflict.overlapStop,
rmsSearchRerunsTimerConflictMenu,
conflict->timeStart,
conflict->timeStop,
conflict->overlapStart,
conflict->overlapStop,
false);
return result;
}
@ -257,7 +262,7 @@ cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
}
int cRecMenuTimerConflict::GetTotalNumMenuItems(void) {
return conflict.timerIDs.size();
return conflict->timerIDs.size();
}
// --- cRecMenuNoTimerConflict ---------------------------------------------------------
@ -273,6 +278,90 @@ cRecMenuNoTimerConflict::cRecMenuNoTimerConflict(void) {
Arrange();
}
// --- cRecMenuRerunResults ---------------------------------------------------------
cRecMenuRerunResults::cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns) {
this->reruns = reruns;
this->numReruns = numReruns;
SetWidthPercent(70);
this->numReruns = numReruns;
cString message1 = tr("reruns for");
cString message2 = tr("rerun for");
cString message3 = tr("found");
cString infoText = cString::sprintf("%d %s:\n\"%s\" %s", numReruns, (numReruns>1)?(*message1):(*message2), original->Title(), *message3);
cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
cRecMenuItem *button = new cRecMenuItemButton(tr("Ignore reruns"), rmsTimerConflictIgnoreReruns, false);
SetFooter(button);
if (reruns && (numReruns > 0)) {
for (int i=0; i<numReruns; i++) {
AddMenuItemScroll(new cRecMenuItemEvent(reruns[i], rmsSearchShowInfo, rmsTimerConflictRecordRerun, (i==0)?true:false));
if (!CheckHeight())
break;
}
}
CalculateHeight();
CreatePixmap();
Arrange();
}
cRecMenuItem *cRecMenuRerunResults::GetMenuItem(int number) {
if ((number >= 0) && (number < numReruns)) {
cRecMenuItem *result = new cRecMenuItemEvent(reruns[number], rmsSearchShowInfo, rmsTimerConflictRecordRerun, false);
return result;
}
return NULL;
}
int cRecMenuRerunResults::GetTotalNumMenuItems(void) {
return numReruns;
}
// --- cRecMenuNoRerunsFound ---------------------------------------------------------
cRecMenuNoRerunsFound::cRecMenuNoRerunsFound(cString searchString) {
SetWidthPercent(50);
cString message = tr("No reruns found for Event");
cString text = cString::sprintf("%s\n\"%s\"",
*message,
*searchString);
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem);
AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsTimerConflictIgnoreReruns, true, true));
CalculateHeight();
CreatePixmap();
Arrange();
}
// --- cRecMenuConfirmRerunUsed ---------------------------------------------------------
cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace) {
SetWidthPercent(70);
cString channelOrig = Channels.GetByChannelID(original->ChannelID())->Name();
cString channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name();
cString message1 = tr("Timer for");
cString message2 = tr("replaced by rerun");
cString text = cString::sprintf("%s\n\"%s\", %s %s, %s\n%s\n\"%s\", %s %s, %s",
*message1,
original->Title(),
*original->GetDateString(),
*original->GetTimeString(),
*channelOrig,
*message2,
replace->Title(),
*replace->GetDateString(),
*replace->GetTimeString(),
*channelReplace);
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem);
AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsTimerConflicts, true, true));
CalculateHeight();
CreatePixmap();
Arrange();
}
// --- cRecMenuEditTimer ---------------------------------------------------------
cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState) {
SetWidthPercent(60);

View File

@ -51,16 +51,16 @@ public:
// --- cRecMenuTimerConflicts ---------------------------------------------------------
class cRecMenuTimerConflicts: public cRecMenu {
public:
cRecMenuTimerConflicts(std::vector<TVGuideTimerConflict> conflicts);
cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts);
virtual ~cRecMenuTimerConflicts(void) {};
};
// --- cRecMenuTimerConflict ---------------------------------------------------------
class cRecMenuTimerConflict: public cRecMenu {
private:
TVGuideTimerConflict conflict;
cTVGuideTimerConflict *conflict;
public:
cRecMenuTimerConflict(TVGuideTimerConflict conflict);
cRecMenuTimerConflict(cTVGuideTimerConflict *conflict);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuTimerConflict(void) {};
@ -73,6 +73,34 @@ public:
virtual ~cRecMenuNoTimerConflict(void) {};
};
// --- cRecMenuRerunResults ---------------------------------------------------------
class cRecMenuRerunResults: public cRecMenu {
private:
const cEvent **reruns;
int numReruns;
public:
cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns);
cRecMenuItem *GetMenuItem(int number);
int GetTotalNumMenuItems(void);
virtual ~cRecMenuRerunResults(void) {
delete[] reruns;
};
};
// --- cRecMenuNoRerunsFound ---------------------------------------------------------
class cRecMenuNoRerunsFound: public cRecMenu {
public:
cRecMenuNoRerunsFound(cString searchString);
virtual ~cRecMenuNoRerunsFound(void) {};
};
// --- cRecMenuConfirmRerunUsed ---------------------------------------------------------
class cRecMenuConfirmRerunUsed: public cRecMenu {
public:
cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace);
virtual ~cRecMenuConfirmRerunUsed(void) {};
};
// --- cRecMenuEditTimer ---------------------------------------------------------
class cRecMenuEditTimer: public cRecMenu {
public:
@ -229,8 +257,6 @@ public:
virtual ~cRecMenuSearchNothingFound(void) {};
};
// --- cRecMenuRecordingSearch ---------------------------------------------------------
class cRecMenuRecordingSearch: public cRecMenu {
private:

View File

@ -364,6 +364,7 @@ void cMenuSetupImageCache::Set(void) {
Add(InfoItem(tr("Logo cache"), (imgCache.GetCacheSize(ctLogo)).c_str()));
Add(InfoItem(tr("EPG Grid Cache"), (imgCache.GetCacheSize(ctGrid)).c_str()));
Add(InfoItem(tr("Channel Groups Cache"), (imgCache.GetCacheSize(ctChannelGroup)).c_str()));
Add(InfoItem(tr("Recording Menus Icon Cache"), (imgCache.GetCacheSize(ctIcon)).c_str()));
SetCurrent(Get(currentItem));
Display();

Some files were not shown because too many files have changed in this diff Show More