summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGnapheus <solevita50@googlemail.com>2010-09-30 17:21:33 +0200
committerGnapheus <solevita50@googlemail.com>2010-09-30 17:21:33 +0200
commita9e158b72c47f57f10b2d1690d05c69f0c4b84c4 (patch)
tree1bebe3271fcca8914702c87ea68e572ddc644093
parentc9b7209f89d76e6509c82bbcae9ea27ceb89f1ee (diff)
downloadvdr-plugin-zappilot-a9e158b72c47f57f10b2d1690d05c69f0c4b84c4.tar.gz
vdr-plugin-zappilot-a9e158b72c47f57f10b2d1690d05c69f0c4b84c4.tar.bz2
reformated code; added support for epgsearch switch timer; in fast browse mode yellow and blue buttons now change the channel group
-rw-r--r--HISTORY7
-rw-r--r--Makefile2
-rw-r--r--README31
-rw-r--r--config.h5
-rw-r--r--po/de_DE.po19
-rw-r--r--po/es_ES.po14
-rw-r--r--po/fi_FI.po16
-rw-r--r--po/fr_FR.po20
-rw-r--r--zappilot.c12
-rw-r--r--zappilotosd.c164
-rw-r--r--zappilotosd.h2
-rw-r--r--zappilotsetup.c19
-rw-r--r--zappilotsetup.h2
13 files changed, 251 insertions, 62 deletions
diff --git a/HISTORY b/HISTORY
index 2c53187..d0cc20c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,8 +1,9 @@
VDR Plugin 'zappilot' Revision History
-----------------------------------
-20??-??-??:Version 0.0.?
- - Added italian translation
- - Changed README
+2010-??-??:Version 0.0.5
+ - reformated code
+ - added support for epgsearch switch timer
+ - in fast browse mode yellow and blue buttons now change the channel group
2010-08-06:Version 0.0.4
- Renamed plugin to zappilot
diff --git a/Makefile b/Makefile
index 265cc33..ef879f2 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
### The object files (add further files here):
-OBJS = $(PLUGIN).o zappilotosd.o zappilotsetup.o
+OBJS = $(PLUGIN).o zappilotosd.o zappilotsetup.o
### The main target:
diff --git a/README b/README
index 34a0b88..ff09ad8 100644
--- a/README
+++ b/README
@@ -14,12 +14,12 @@ See the file COPYING for more information.
Description:
-----------
-ZapPilot is a plugin for VDR forked from the plugin pilotskin created by
-Christophe Nouhet (original idea Olivier Jacques). With this plugin you can
-fast browse the EPG information without switching through the
-channels. It makes it easy to see what is going on on other channels while
-still watching the current channel. You can also get the event description
-and set timers.
+Zappilot is a plugin for VDR forked from the plugin pilotskin created by
+Christophe Nouhet (original idea Olivier Jacques). It brings the ability
+to browse fast the EPG information without being forced to switch to a
+channel. It makes it easy to see what is going on on other channels while
+still watching the current channel. The plugin adds the possibility of
+having detailed information of the event and launching timers
Installation:
------------
@@ -27,22 +27,26 @@ Installation:
- Edit the keymacros.conf
cd "VDR_CONFIG_DIR"
vi keymacros.conf
-
----------------keymacros.conf
Blue Timers
User1 @zappilot
----------------
+ Please check VDR manual (man 5 vdr) for more informations on keymacros.conf
-Please check VDR manual (man 5 vdr) for more information on keymacros.conf
-
-Setup menu:
+Customization:
-------------
+Pilot plugin can be tuned to your own preferences.
+Go to Configuration/Plugins/zappilot to access the setup menu.
Hide main menu entry : Hide the plugin entry in the main menu
Close on OK : Close the Pilot plugin when pressing OK button
(in addition to switch to the selected channel).
Otherwise, switch to the channel but keep
the pilot opened.
Fast browse : Changes keys for faster EPG browsing
+Switch timer : If the plugin epgsearch is found, switch timer can
+ be set by pressing 0.
+Switch ... minutes
+before start : lead time for switch timer.
Usage normal:
-------------
@@ -57,6 +61,7 @@ RED : edit a timer
GREEN : Show extra infos
YELLOW : previous event
BLUE : next event
+0 : adds/deletes epgsearch switch timer
Usage fast browse:
-----------------
@@ -68,9 +73,9 @@ OK : switch to the selected channel
BACK : exit Pilotskin plugin
RED : edit a timer
GREEN : Show extra infos
-YELLOW : previous event
-BLUE : next event
-
+YELLOW : go prev group
+BLUE : go next group
+0 : adds/deletes epgsearch switch timer
To do:
diff --git a/config.h b/config.h
index 06256f7..42ca882 100644
--- a/config.h
+++ b/config.h
@@ -1,11 +1,16 @@
#ifndef __ZAPPILOTCONFIG_H
#define __ZAPPILOTCONFIG_H
+#include <vdr/plugin.h>
+
struct sZappilotConfig
{
int closeonswitch;
int hidemenu;
int fastbrowse;
+ int switchtimer;
+ int switchminsbefore;
+ cPlugin* pEPGSearch;
};
extern sZappilotConfig config;
diff --git a/po/de_DE.po b/po/de_DE.po
index edc3137..cc7d9e5 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-08-04 22:06+0200\n"
+"POT-Creation-Date: 2010-09-30 17:11+0200\n"
"PO-Revision-Date: 2007-08-21 23:24+0200\n"
"Last-Translator: Klaus Schmidinger <kls@cadsoft.de>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -21,18 +21,23 @@ msgstr "Ein Zapping-Kopilot"
msgid "ZapPilot"
msgstr ""
+msgid "Switch timer added!"
+msgstr "Umschalttimer angelegt!"
+
+msgid "Switch timer deleted!"
+msgstr "Umschalttimer gelöscht!"
+
msgid "Close on OK"
msgstr "Schließen bei OK"
msgid "Hide main menu entry"
msgstr "Hauptmenüeintrag verstecken"
-msgid "no"
-msgstr "nein"
-
-msgid "yes"
-msgstr "ja"
-
msgid "Fast browse"
msgstr "Schnell navigieren"
+msgid "Switch timer"
+msgstr "Umschalttimer"
+
+msgid "Switch ... minutes before start"
+msgstr "Umschalten ... Minuten vor Start"
diff --git a/po/es_ES.po b/po/es_ES.po
index 1a8a834..4ba850a 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-08-11 20:30+0200\n"
+"POT-Creation-Date: 2010-09-30 17:11+0200\n"
"PO-Revision-Date: 2007-08-21 23:24+0200\n"
"Last-Translator: Ruben Nunez Francisco <ruben.nunez@tang-it.com>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -21,17 +21,23 @@ msgstr ""
msgid "ZapPilot"
msgstr ""
+msgid "Switch timer added!"
+msgstr ""
+
+msgid "Switch timer deleted!"
+msgstr ""
+
msgid "Close on OK"
msgstr ""
msgid "Hide main menu entry"
msgstr "Ocultar en el menú principal"
-msgid "no"
+msgid "Fast browse"
msgstr ""
-msgid "yes"
+msgid "Switch timer"
msgstr ""
-msgid "Fast browse"
+msgid "Switch ... minutes before start"
msgstr ""
diff --git a/po/fi_FI.po b/po/fi_FI.po
index 5dd0332..0159de6 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-08-11 20:30+0200\n"
+"POT-Creation-Date: 2010-09-30 17:11+0200\n"
"PO-Revision-Date: 2007-08-21 23:24+0200\n"
"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -24,17 +24,23 @@ msgstr ""
msgid "ZapPilot"
msgstr ""
+msgid "Switch timer added!"
+msgstr ""
+
+msgid "Switch timer deleted!"
+msgstr ""
+
msgid "Close on OK"
msgstr "Sulje painamalla OK"
msgid "Hide main menu entry"
msgstr "Piilota valinta päävalikosta"
-msgid "no"
+msgid "Fast browse"
msgstr ""
-msgid "yes"
+msgid "Switch timer"
msgstr ""
-msgid "Fast browse"
-msgstr ""
+msgid "Switch ... minutes before start"
+msgstr "Vaihda ... minuuttia ennen alkua"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index e6e2a46..e8deaec 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: VDR 1.5.7\n"
"Report-Msgid-Bugs-To: <see README>\n"
-"POT-Creation-Date: 2010-08-11 20:30+0200\n"
+"POT-Creation-Date: 2010-09-30 17:11+0200\n"
"PO-Revision-Date: 2007-08-21 23:24+0200\n"
"Last-Translator: Nicolas Huillard <nhuillard@e-dition.fr>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -24,17 +24,23 @@ msgstr "Co-pilote de zapping"
msgid "ZapPilot"
msgstr ""
+msgid "Switch timer added!"
+msgstr ""
+
+msgid "Switch timer deleted!"
+msgstr ""
+
msgid "Close on OK"
msgstr "Fermer le menu sur OK"
msgid "Hide main menu entry"
msgstr "Masquer dans le menu principal"
-msgid "no"
-msgstr "non"
-
-msgid "yes"
-msgstr "oui"
-
msgid "Fast browse"
msgstr ""
+
+msgid "Switch timer"
+msgstr ""
+
+msgid "Switch ... minutes before start"
+msgstr "Changer ... minutes avant le début"
diff --git a/zappilot.c b/zappilot.c
index f9253c4..3cbdd95 100644
--- a/zappilot.c
+++ b/zappilot.c
@@ -48,7 +48,9 @@ cPluginZappilot::cPluginZappilot(void)
config.closeonswitch=1;
config.hidemenu=0;
config.fastbrowse=0;
-
+ config.switchtimer=0;
+ config.switchminsbefore=1;
+ config.pEPGSearch=NULL;
}
@@ -76,6 +78,12 @@ bool cPluginZappilot::Start(void)
{
// Start any background activities the plugin shall perform.
// Default values for setup
+ config.pEPGSearch = cPluginManager::GetPlugin("epgsearch");
+ if (!config.pEPGSearch)
+ {
+ config.switchtimer=0;
+ esyslog("[ZapPilot] EPGSearch does not exist; switch timers are disabled!");
+ }
return true;
}
@@ -106,6 +114,8 @@ bool cPluginZappilot::SetupParse(const char *Name, const char *Value)
if (!strcasecmp(Name, "CloseOnSwitch")) config.closeonswitch = atoi(Value);
else if (!strcasecmp(Name, "HideMenu")) config.hidemenu = atoi(Value);
else if (!strcasecmp(Name, "FastBrowse")) config.fastbrowse = atoi(Value);
+ else if (!strcasecmp(Name, "SwitchTimer")) config.switchtimer = atoi(Value);
+ else if (!strcasecmp(Name, "SwitchMinsBefore")) config.switchminsbefore = atoi(Value);
else
return false;
diff --git a/zappilotosd.c b/zappilotosd.c
index 20ccc9a..eb5036a 100644
--- a/zappilotosd.c
+++ b/zappilotosd.c
@@ -13,6 +13,19 @@
extern int PilotChannelNumber;
+// 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
+};
+
cZappilotOsd::cZappilotOsd(void):cOsdObject(true)
{
osd = cOsdProvider::NewOsd(0, 0);
@@ -79,6 +92,77 @@ static int CompareEventTime(const void *p1, const void *p2)
}
+void cZappilotOsd::AddDelSwitchTimer(const cEvent *event)
+{
+ bool SwitchTimerExits = false;
+ if (config.pEPGSearch && event)
+ {
+ Epgsearch_switchtimer_v1_0* serviceData = new Epgsearch_switchtimer_v1_0;
+ serviceData->event = event;
+ serviceData->mode = 0;
+ if (config.pEPGSearch->Service("Epgsearch-switchtimer-v1.0", serviceData))
+ {
+ SwitchTimerExits=serviceData->success;
+ delete serviceData;
+ }
+ else
+ {
+ esyslog("[ZapPilot] EPGSearch does not support Epgsearch-switchtimer-v1.0 service!");
+ delete serviceData;
+
+ }
+ if (!SwitchTimerExits)
+ {
+ serviceData = new Epgsearch_switchtimer_v1_0;
+ serviceData->event = event;
+ serviceData->mode = 1;
+ serviceData->switchMinsBefore = config.switchminsbefore;
+ serviceData->announceOnly = 0;
+ if (config.pEPGSearch->Service("Epgsearch-switchtimer-v1.0", serviceData))
+ {
+ if (serviceData->success)
+ {
+ Skins.Message(mtInfo, tr("Switch timer added!"));
+ delete serviceData;
+ }
+ }
+ else
+ {
+ esyslog("[ZapPilot] EPGSearch does not support Epgsearch-switchtimer-v1.0 service!");
+ delete serviceData;
+ return;
+ }
+ }
+ else
+ {
+ serviceData = new Epgsearch_switchtimer_v1_0;
+ serviceData->event = event;
+ serviceData->mode = 2;
+ serviceData->switchMinsBefore = 1;
+ serviceData->announceOnly = false;
+ if (config.pEPGSearch->Service("Epgsearch-switchtimer-v1.0", serviceData))
+ {
+ if (serviceData->success)
+ {
+ Skins.Message(mtInfo, tr("Switch timer deleted!"));
+ delete serviceData;
+ }
+ }
+ else
+ {
+ esyslog("[ZapPilot] EPGSearch does not support Epgsearch-switchtimer-v1.0 service!");
+ delete serviceData;
+ return;
+ }
+ }
+ }
+ else
+ {
+ esyslog("[ZapPilot] EPGSearch does not exist; switch timer is not possible!");
+ }
+}
+
+
void cZappilotOsd::UpdateEPGInfo(int NowNextPrev)
{
// Start to reset all previous info
@@ -238,12 +322,13 @@ eOSState cZappilotOsd::ProcessKey(eKeys Key)
return osEnd;
}
case k0:
- if (number == 0)
+ {
+ if (number == 0 && config.switchtimer)
{
- // keep the "Toggle channels" function working
- //cRemote::Put(Key);
+ AddDelSwitchTimer(Present);
return osContinue;
}
+ }
case k1 ... k9:
if (number >= 0)
{
@@ -430,21 +515,70 @@ eOSState cZappilotOsd::ProcessKey(eKeys Key)
case kYellow|k_Repeat:
case kYellow:
{
- // Scroll back in time
- UpdateEPGInfo(3);
- DrawMenu(0,0);
- return osContinue;
+ if (!config.fastbrowse)
+ {
+ // Scroll back in time
+ UpdateEPGInfo(3);
+ DrawMenu(0,0);
+ return osContinue;
+ break;
+ }
}
- break;
case kBlue|k_Repeat:
case kBlue:
- {
- // Scroll back in time
- UpdateEPGInfo(2);
- DrawMenu(0,0);
- return osContinue;
- }
- break;
+ if (!config.fastbrowse)
+ {
+ // Scroll back in time
+ UpdateEPGInfo(2);
+ DrawMenu(0,0);
+ return osContinue;
+ break;
+ }
+ else
+ {
+ if (group < 0)
+ {
+ cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
+ if (channel)
+ group = channel->Index();
+ }
+ if (group >= 0)
+ {
+ int SaveGroup = group;
+ if (NORMALKEY(Key) == kBlue)
+ {
+ group = Channels.GetNextGroup(group);
+ }
+ else
+ {
+ group = Channels.GetPrevGroup(group < 1 ? 1 : group);
+ }
+ if (group < 0)
+ group = SaveGroup;
+ cChannel *channel = Channels.Get(group);
+ if (channel)
+ {
+ //DisplayChannel(channel);
+ if (!channel->GroupSep())
+ group = -1;
+ else
+ {
+ const char *groupName;
+ groupName = channel->Name();
+ channel = (cChannel *)channel->Next();
+ while (channel->GroupSep())
+ {
+ channel = (cChannel *)channel->Next();
+ }
+ PilotChannelNumber = channel->Number();
+ UpdateEPGInfo(1);
+ DrawMenu(-16,1);
+ }
+ }
+ }
+ lastTime = cTimeMs::Now();
+ break;
+ }
default:
return state;
};
diff --git a/zappilotosd.h b/zappilotosd.h
index 4b4fe89..3f5aef5 100644
--- a/zappilotosd.h
+++ b/zappilotosd.h
@@ -50,6 +50,7 @@ class cZappilotOsd : public cOsdObject
void CursorDown();
void CursorOK();
+ void AddDelSwitchTimer(const cEvent *event);
void UpdateEPGInfo(int NowPrevNext);
void DrawMenu(int delta, int highlight);
void DisplayBitmap(void);
@@ -58,5 +59,4 @@ class cZappilotOsd : public cOsdObject
void DisplayTimer(void);
void DisplayChannel(const cChannel *Channel);
};
-
#endif //__ZAPPILOTOSD_H
diff --git a/zappilotsetup.c b/zappilotsetup.c
index e0cb11c..7b6f5a6 100644
--- a/zappilotsetup.c
+++ b/zappilotsetup.c
@@ -15,16 +15,25 @@ cZappilotSetup::cZappilotSetup(void)
CloseOnSwitch = config.closeonswitch;
Hidemenu = config.hidemenu;
FastBrowse = config.fastbrowse;
+ SwitchTimer = config.switchtimer;
+ SwitchMinsBefore = config.switchminsbefore;
- Add(new cMenuEditBoolItem(tr("Close on OK"), &CloseOnSwitch));
- Add(new cMenuEditBoolItem( tr("Hide main menu entry"), &Hidemenu, tr("no"), tr("yes")));
- Add(new cMenuEditBoolItem( tr("Fast browse"), &FastBrowse, tr("no"), tr("yes")));
+ Add(new cMenuEditBoolItem( tr("Close on OK"), &CloseOnSwitch));
+ Add(new cMenuEditBoolItem( tr("Hide main menu entry"), &Hidemenu, trVDR("no"), trVDR("yes")));
+ Add(new cMenuEditBoolItem( tr("Fast browse"), &FastBrowse, trVDR("no"), trVDR("yes")));
+ if (config.pEPGSearch)
+ {
+ Add(new cMenuEditBoolItem( tr("Switch timer"), &SwitchTimer, trVDR("no"), trVDR("yes")));
+ Add(new cMenuEditIntItem( tr("Switch ... minutes before start"), &SwitchMinsBefore));
+ }
}
void cZappilotSetup::Store(void)
{
SetupStore("CloseOnSwitch", config.closeonswitch = CloseOnSwitch);
- SetupStore("Hidemenu", config.hidemenu = Hidemenu);
- SetupStore("FastBrowse", config.fastbrowse = FastBrowse);
+ SetupStore("Hidemenu", config.hidemenu = Hidemenu);
+ SetupStore("FastBrowse", config.fastbrowse = FastBrowse);
+ SetupStore("SwitchTimer", config.switchtimer = SwitchTimer);
+ SetupStore("SwitchMinsBefore", config.switchminsbefore = SwitchMinsBefore);
}
diff --git a/zappilotsetup.h b/zappilotsetup.h
index 422ae18..98d0b43 100644
--- a/zappilotsetup.h
+++ b/zappilotsetup.h
@@ -9,6 +9,8 @@ class cZappilotSetup : public cMenuSetupPage
int CloseOnSwitch;
int Hidemenu;
int FastBrowse;
+ int SwitchTimer;
+ int SwitchMinsBefore;
protected:
virtual void Store(void);
public: