diff options
-rw-r--r-- | epgsearch.c | 2 | ||||
-rw-r--r-- | epgsearchservices.h | 1 | ||||
-rw-r--r-- | i18n-template.h | 5 | ||||
-rw-r--r-- | services.c | 45 | ||||
-rw-r--r-- | services.h | 2 |
5 files changed, 51 insertions, 4 deletions
diff --git a/epgsearch.c b/epgsearch.c index 086f2fe..af1f61a 100644 --- a/epgsearch.c +++ b/epgsearch.c @@ -64,7 +64,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include "menu_quicksearch.h" #include "menu_announcelist.h" -static const char VERSION[] = "0.9.24.beta18"; +static const char VERSION[] = "0.9.24.beta19"; static const char DESCRIPTION[] = trNOOP("search the EPG for repeats and more"); // globals diff --git a/epgsearchservices.h b/epgsearchservices.h index e285ca5..6e4de3e 100644 --- a/epgsearchservices.h +++ b/epgsearchservices.h @@ -44,6 +44,7 @@ class cEpgsearchServiceHandler: public cServiceHandler virtual std::set<std::string> DirectoryList(); virtual std::string ReadSetupValue(const std::string& entry); virtual bool WriteSetupValue(const std::string& entry, const std::string& value); + virtual std::list<std::string> TimerConflictList(bool relOnly=false); }; #endif diff --git a/i18n-template.h b/i18n-template.h index 16b12b8..dce205f 100644 --- a/i18n-template.h +++ b/i18n-template.h @@ -22,14 +22,13 @@ The project's page is at http://winni.vdr-developer.org/epgsearch */ /* - WARNING: automaticaly generated content. Changes will get lost! + WARNING: automatically generated content. Changes will get lost! - If this file is 'i18n-generated.h' then it *realy* is automaticaly + If this file is 'i18n-generated.h' then it *really* is automatically generated. If this file is 'i18n-template.h' then it is the base for the autogeneration of the other file. - This file is part of live. */ const tI18nPhrase Phrases[] = { @@ -23,6 +23,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include <string> #include <list> +#include <sstream> #include <vdr/plugin.h> #include "epgsearchservices.h" #include "epgsearchext.h" @@ -33,6 +34,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #include "blacklist.h" #include "menu_dirselect.h" #include "epgsearchtools.h" +#include "conflictcheck.h" std::list<std::string> cEpgsearchServiceHandler::SearchTimerList() { @@ -268,3 +270,46 @@ bool cEpgsearchServiceHandler::WriteSetupValue(const std::string& entry, const s { return true; } + +std::list<std::string> cEpgsearchServiceHandler::TimerConflictList(bool relOnly) +{ + std::list<std::string> list; + cConflictCheck conflictCheck; + conflictCheck.Check(); + + if ((relOnly && conflictCheck.numConflicts > 0) || + conflictCheck.relevantConflicts > 0) + { + string sBuffer; + cList<cConflictCheckTime>* failedList = conflictCheck.GetFailed(); + for(cConflictCheckTime* ct = failedList->First(); ct; ct = failedList->Next(ct)) + { + if (relOnly && ct->ignore) continue; + + std::ostringstream conflline; + conflline << ct->evaltime << ":"; + std::set<cConflictCheckTimerObj*,TimerObjSort>::iterator it; + + std::ostringstream timerparts; + for (it = ct->failedTimers.begin(); it != ct->failedTimers.end(); it++) + { + if (relOnly && (*it)->ignore) continue; + std::ostringstream timerpart; + int recPart = (*it)->recDuration * 100 / ((*it)->stop - (*it)->start); + timerpart << (*it)->timer->Index()+1 << "|" << recPart << "|"; + std::set<cConflictCheckTimerObj*,TimerObjSort>::iterator itcc; + if ((*it)->concurrentTimers) + { + std::ostringstream cctimers; + for (itcc = (*it)->concurrentTimers->begin(); itcc != (*it)->concurrentTimers->end(); itcc++) + cctimers << (cctimers.str().empty()?"":"#") << (*itcc)->timer->Index()+1; + timerpart << cctimers.str(); + } + timerparts << (timerparts.str().empty()?"":":") << timerpart.str(); + } + conflline << timerparts.str(); + list.push_back(conflline.str()); + } + } + return list; +} @@ -152,6 +152,8 @@ class cServiceHandler virtual std::string ReadSetupValue(const std::string& entry) = 0; // Write a setup value virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0; + // Get timer conflicts + virtual std::list<std::string> TimerConflictList(bool relOnly=false) = 0; }; struct Epgsearch_services_v1_0 |