summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--baserender.c70
-rw-r--r--config.c2
-rw-r--r--config.h1
-rw-r--r--po/de_DE.po8
-rw-r--r--services/epgsearch.h167
-rw-r--r--setup.c2
7 files changed, 234 insertions, 18 deletions
diff --git a/HISTORY b/HISTORY
index 4fac24f9..5d71ee7b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -11,6 +11,8 @@ VDR Plugin 'skinflatplus' Revision History
- [add] theme color clrMenuItemExtraTextCurrentFont
- [add] logo background for channel logos (filename: logo_background.png)
- [add] show cutted length of recording in replay info
+- [add] update script to update MV-Themes (contrib/flatPlus_MV_Update.sh)
+- [add] timer conflicts in TopBar, active epgsearch is needed, configurable via menu settings
2014-02-22: Version 0.2.0
- [fix] load user decor settings
diff --git a/baserender.c b/baserender.c
index 9753f761..486ed7b0 100644
--- a/baserender.c
+++ b/baserender.c
@@ -1,6 +1,7 @@
#include "baserender.h"
#include "flat.h"
#include <vdr/menu.h>
+#include "services/epgsearch.h"
cFlatBaseRender::cFlatBaseRender(void) {
font = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize );
@@ -256,24 +257,50 @@ void cFlatBaseRender::TopBarUpdate(void) {
topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight);
topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight);
-
+ int DateRight = TopBarWidth - timeWidth - fullWidth - marginItem*2;
+
DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg);
- // look for timers
+ int RecW = 0;
int numRec = 0;
- for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) {
- if( ti->Matches(t) ) {
- numRec++;
+ if( Config.TopBarRecordingShow ) {
+ // look for timers
+ for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) {
+ if( ti->Matches(t) ) {
+ numRec++;
+ }
}
- }
+ if( numRec ) {
+ cString Rec = cString::sprintf("REC %d", numRec);
+ RecW = topBarFont->Width(*Rec);
+ TitleWidthLeft -= RecW + marginItem*2;
+ }
+ }
- int RecW = 0;
- if( numRec > 0 && Config.TopBarRecordingShow ) {
- cString Rec = cString::sprintf("REC %d", numRec);
- RecW = topBarFont->Width(*Rec);
- TitleWidthLeft -= RecW + marginItem*2;
+ int numConflicts = 0, ConW = 0;
+ if( Config.TopBarRecConflictsShow ) {
+ cPlugin *p = cPluginManager::GetPlugin("epgsearch");
+ if (p) {
+ Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0;
+ if (serviceData) {
+ serviceData->nextConflict = 0;
+ serviceData->relevantConflicts = 0;
+ serviceData->totalConflicts = 0;
+ p->Service("Epgsearch-lastconflictinfo-v1.0", serviceData);
+ if (serviceData->relevantConflicts > 0) {
+ numConflicts = serviceData->relevantConflicts;
+ }
+ delete serviceData;
+ }
+ }
}
-
+
+ if( numConflicts ) {
+ cString Con = cString::sprintf("%s %d", tr("C"), numRec);
+ ConW = topBarFont->Width(*Con);
+ TitleWidthLeft -= ConW + marginItem*2;
+ }
+
int TitleWidth = topBarFont->Width(topBarTitle);
if( TitleWidth > TitleWidthLeft ) {
int dotsWidth = topBarFont->Width("... ");
@@ -284,16 +311,25 @@ void cFlatBaseRender::TopBarUpdate(void) {
}
topBarPixmap->DrawText(cPoint(MenuIconWidth + marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont);
-
- if( numRec > 0 && Config.TopBarRecordingShow ) {
- if( TitleWidth > RecLeft )
- RecLeft = TitleWidth + marginItem*2;
-
+
+ if( TitleWidth > RecLeft )
+ RecLeft = TitleWidth + marginItem*2;
+ if( numRec > 0 && Config.TopBarRecordingShow && (RecLeft + RecW) < DateRight ) {
cString Rec = cString::sprintf("REC");
RecW = topBarFont->Width(*Rec);
cString RecNum = cString::sprintf("%d", numRec);
topBarPixmap->DrawText(cPoint(RecLeft, fontTop), Rec, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFont);
topBarPixmap->DrawText(cPoint(RecLeft + RecW + marginItem, fontSmlTop), RecNum, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFontSml);
+ RecLeft += RecW + marginItem*2 + topBarFontSml->Width(RecNum);
+ }
+
+ int ConLeft = RecLeft + marginItem;
+ if( numConflicts > 0 && Config.TopBarRecConflictsShow && (ConLeft + ConW) < DateRight ) {
+ cString Con = cString::sprintf(tr("C"));
+ ConW = topBarFont->Width(*Con);
+ cString ConNum = cString::sprintf("%d", numConflicts);
+ topBarPixmap->DrawText(cPoint(ConLeft, fontTop), Con, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFont);
+ topBarPixmap->DrawText(cPoint(ConLeft + ConW + marginItem, fontSmlTop), ConNum, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFontSml);
}
}
diff --git a/config.c b/config.c
index 3829c198..4e3b7de6 100644
--- a/config.c
+++ b/config.c
@@ -30,6 +30,7 @@ cFlatConfig::cFlatConfig(void) {
EpgAdditionalInfoShow = true;
TopBarRecordingShow = true;
+ TopBarRecConflictsShow = true;
MenuItemIconsShow = true;
TopBarMenuIconShow = true;
@@ -193,6 +194,7 @@ bool cFlatConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "MenuItemRecordingClearPercent") == 0) MenuItemRecordingClearPercent = atoi(Value);
else if (strcmp(Name, "MenuItemRecordingShowFolderDate") == 0) MenuItemRecordingShowFolderDate = atoi(Value);
else if (strcmp(Name, "MenuItemParseTilde") == 0) MenuItemParseTilde = atoi(Value);
+ else if (strcmp(Name, "TopBarRecConflictsShow") == 0) TopBarRecConflictsShow = atoi(Value);
else return false;
diff --git a/config.h b/config.h
index 020f948e..c3876b6b 100644
--- a/config.h
+++ b/config.h
@@ -172,6 +172,7 @@ class cFlatConfig
int RecordingAdditionalInfoShow;
int EpgAdditionalInfoShow;
int TopBarRecordingShow;
+ int TopBarRecConflictsShow;
int MenuItemIconsShow;
int TopBarMenuIconShow;
diff --git a/po/de_DE.po b/po/de_DE.po
index b96c7aa2..502ccd95 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-skinflat 0.2.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2014-03-13 20:26+0100\n"
+"POT-Creation-Date: 2014-03-19 20:01+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,6 +18,9 @@ msgstr ""
msgid "clock"
msgstr "Uhr"
+msgid "C"
+msgstr "K"
+
msgid "disk usage"
msgstr "Plattennutzung"
@@ -177,6 +180,9 @@ msgstr "TopBar Font Größe"
msgid "TopBar show recording"
msgstr "TopBar zeige Aufnahme"
+msgid "TopBar show conflicts"
+msgstr "TopBar zeige Konflikte"
+
msgid "Message bottom offset"
msgstr "Meldung unterer Abstand"
diff --git a/services/epgsearch.h b/services/epgsearch.h
new file mode 100644
index 00000000..de29299f
--- /dev/null
+++ b/services/epgsearch.h
@@ -0,0 +1,167 @@
+/*
+Copyright (C) 2004-2007 Christian Wieninger
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+
+The author can be reached at cwieninger@gmx.de
+
+The project's page is at http://winni.vdr-developer.org/epgsearch
+*/
+
+#ifndef EPGSEARCHSERVICES_INC
+#define EPGSEARCHSERVICES_INC
+
+// Added by Andreas Mair (mail _AT_ andreas _DOT_ vdr-developer _DOT_ org)
+#define EPGSEARCH_SEARCHRESULTS_SERVICE_STRING_ID "Epgsearch-searchresults-v1.0"
+#define EPGSEARCH_LASTCONFLICTINFO_SERVICE_STRING_ID "Epgsearch-lastconflictinfo-v1.0"
+
+#include <string>
+#include <list>
+#include <memory>
+#include <set>
+#include <vdr/osdbase.h>
+
+// Data structure for service "Epgsearch-search-v1.0"
+struct Epgsearch_search_v1_0
+{
+// in
+ char* query; // search term
+ int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
+ int channelNr; // channel number to search in (0=any)
+ bool useTitle; // search in title
+ bool useSubTitle; // search in subtitle
+ bool useDescription; // search in description
+// out
+ cOsdMenu* pResultMenu; // pointer to the menu of results
+};
+
+// Data structure for service "Epgsearch-exttimeredit-v1.0"
+struct Epgsearch_exttimeredit_v1_0
+{
+// in
+ cTimer* timer; // pointer to the timer to edit
+ bool bNew; // flag that indicates, if this is a new timer or an existing one
+ const cEvent* event; // pointer to the event corresponding to this timer (may be NULL)
+// out
+ cOsdMenu* pTimerMenu; // pointer to the menu of results
+};
+
+// Data structure for service "Epgsearch-updatesearchtimers-v1.0"
+struct Epgsearch_updatesearchtimers_v1_0
+{
+// in
+ bool showMessage; // inform via osd when finished?
+};
+
+// Data structure for service "Epgsearch-osdmessage-v1.0"
+struct Epgsearch_osdmessage_v1_0
+{
+// in
+ char* message; // the message to display
+ eMessageType type;
+};
+
+// Data structure for service "EpgsearchMenu-v1.0"
+struct EpgSearchMenu_v1_0
+{
+// in
+// out
+ cOsdMenu* Menu; // pointer to the menu
+};
+
+// Data structure for service "Epgsearch-lastconflictinfo-v1.0"
+struct Epgsearch_lastconflictinfo_v1_0
+{
+// in
+// out
+ time_t nextConflict; // next conflict date, 0 if none
+ int relevantConflicts; // number of relevant conflicts
+ int totalConflicts; // total number of conflicts
+};
+
+// Data structure for service "Epgsearch-searchresults-v1.0"
+struct Epgsearch_searchresults_v1_0
+{
+// in
+ char* query; // search term
+ int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
+ int channelNr; // channel number to search in (0=any)
+ bool useTitle; // search in title
+ bool useSubTitle; // search in subtitle
+ bool useDescription; // search in description
+// out
+
+ class cServiceSearchResult : public cListObject
+ {
+ public:
+ const cEvent* event;
+ cServiceSearchResult(const cEvent* Event) : event(Event) {}
+ };
+
+ cList<cServiceSearchResult>* pResultList; // pointer to the results
+};
+
+// Data structure for service "Epgsearch-switchtimer-v1.0"
+struct Epgsearch_switchtimer_v1_0
+{
+// in
+ const cEvent* event;
+ int mode; // mode (0=query existance, 1=add/modify, 2=delete)
+// in/out
+ int switchMinsBefore;
+ int announceOnly;
+// out
+ bool success; // result
+};
+
+// Data structures for service "Epgsearch-services-v1.0"
+class cServiceHandler
+{
+ public:
+ virtual std::list<std::string> SearchTimerList() = 0;
+ // returns a list of search timer entries in the same format as used in epgsearch.conf
+ virtual int AddSearchTimer(const std::string&) = 0;
+ // adds a new search timer and returns its ID (-1 on error)
+ virtual bool ModSearchTimer(const std::string&) = 0;
+ // edits an existing search timer and returns success
+ virtual bool DelSearchTimer(int) = 0;
+ // deletes search timer with given ID and returns success
+ virtual std::list<std::string> QuerySearchTimer(int) = 0;
+ // returns the search result of the searchtimer with given ID in the same format as used in SVDRP command 'QRYS' (->MANUAL)
+ virtual std::list<std::string> QuerySearch(std::string) = 0;
+ // returns the search result of the searchtimer with given settings in the same format as used in SVDRP command 'QRYS' (->MANUAL)
+ virtual std::list<std::string> ExtEPGInfoList() = 0;
+ // returns a list of extended EPG categories in the same format as used in epgsearchcats.conf
+ virtual std::list<std::string> ChanGrpList() = 0;
+ // returns a list of channel groups maintained by epgsearch
+ virtual std::list<std::string> BlackList() = 0;
+ // returns a list of blacklists in the same format as used in epgsearchblacklists.conf
+ virtual std::set<std::string> DirectoryList() = 0;
+ // List of all recording directories used in recordings, timers, search timers or in epgsearchdirs.conf
+ virtual ~cServiceHandler() {}
+ // Read a setup value
+ 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;
+};
+
+struct Epgsearch_services_v1_0
+{
+// in/out
+ std::auto_ptr<cServiceHandler> handler;
+};
+
+#endif
diff --git a/setup.c b/setup.c
index 9814864f..7b3d9666 100644
--- a/setup.c
+++ b/setup.c
@@ -186,6 +186,7 @@ void cFlatSetup::Store(void) {
SetupStore("MenuItemRecordingClearPercent", Config.MenuItemRecordingClearPercent);
SetupStore("MenuItemRecordingShowFolderDate", Config.MenuItemRecordingShowFolderDate);
SetupStore("MenuItemParseTilde", Config.MenuItemParseTilde);
+ SetupStore("TopBarRecConflictsShow", Config.TopBarRecConflictsShow);
Config.Init();
}
@@ -226,6 +227,7 @@ void cFlatSetupGeneral::Setup(void) {
Add(new cMenuEditIntItem(tr("OSD horizontal margin"), &SetupConfig->marginOsdHor));
Add(new cMenuEditPrcItem(tr("TopBar font size"), &SetupConfig->TopBarFontSize, 0.01, 0.2, 1));
Add(new cMenuEditBoolItem(tr("TopBar show recording"), &SetupConfig->TopBarRecordingShow));
+ Add(new cMenuEditBoolItem(tr("TopBar show conflicts"), &SetupConfig->TopBarRecConflictsShow));
Add(new cMenuEditIntItem(tr("Message bottom offset"), &SetupConfig->MessageOffset));