summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorhorchi <vdr@jwendel.de>2017-03-05 16:48:30 +0100
committerhorchi <vdr@jwendel.de>2017-03-05 16:48:30 +0100
commitbf558fd824c7ab8c794448f718b364ad403a706a (patch)
treee0ba2269c08ccc9c9bd9c336df06b1fa6fce5ec6 /patches
downloadvdr-plugin-pin-bf558fd824c7ab8c794448f718b364ad403a706a.tar.gz
vdr-plugin-pin-bf558fd824c7ab8c794448f718b364ad403a706a.tar.bz2
git init0.1.16
Diffstat (limited to 'patches')
-rw-r--r--patches/epgsearch-0.9.19.diff85
-rw-r--r--patches/epgsearch-0.9.20.diff221
-rw-r--r--patches/epgsearch-0.9.21.diff194
-rw-r--r--patches/vdr-1.4.5.diff454
-rw-r--r--patches/vdr-1.7.17.diff416
-rw-r--r--patches/vdr-1.7.32.diff426
-rw-r--r--patches/vdr-1.7.33.diff427
-rw-r--r--patches/vdr-2.0.2.diff420
-rw-r--r--patches/vdr-2.3.1.diff432
9 files changed, 3075 insertions, 0 deletions
diff --git a/patches/epgsearch-0.9.19.diff b/patches/epgsearch-0.9.19.diff
new file mode 100644
index 0000000..75d6d29
--- /dev/null
+++ b/patches/epgsearch-0.9.19.diff
@@ -0,0 +1,85 @@
+--- ../epgsearch-0.9.19/menu_myedittimer.c 2006-09-24 20:05:41.000000000 +0200
++++ menu_myedittimer.c 2006-11-28 13:50:41.000000000 +0100
+@@ -29,6 +29,7 @@
+ stop = Timer->Stop();
+ priority = Timer->Priority();
+ lifetime = Timer->Lifetime();
++ fskProtection = Timer->FskProtection(); // PIN PATCH
+ strcpy(file, Timer->File());
+ channel = Timer->Channel()->Number();
+ if (forcechannel)
+@@ -94,6 +95,14 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &lifetime, 0, MAXLIFETIME));
++ // PIN PATCH
++ if (cOsd::pinValid || !fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&fskProtection));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Childlock"), fskProtection ? tr("yes") : tr("no"));
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
+ Add(new cMenuEditStrItem( tr("File"), file, MaxFileName, tr(FileNameChars)));
+ Add(new cMenuEditStrItem( tr("Directory"), directory, MaxFileName, tr(AllowedChars)));
+
+@@ -204,6 +213,33 @@
+ return osContinue;
+ }
+
++char* cMenuMyEditTimer::SetFskProtection(int fskProtection, char* aux) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ asprintf(&aux,"%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info to aux
++
++ asprintf(&tmp, "%.*s%s", p-aux, aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (tmp)
++ free(tmp);
++
++ return aux;
++}
++
+ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
+ {
+ eOSState state = cOsdMenu::ProcessKey(Key);
+@@ -284,6 +320,7 @@
+ char* tmpSummary = NULL;
+ if (timer && timer->Aux())
+ tmpSummary = strdup(timer->Aux());
++ tmpSummary = SetFskProtection(fskProtection, tmpSummary); // PIN PATCH
+ if (timer)
+ {
+ char* cmdbuf = NULL;
+--- ../epgsearch-0.9.19/menu_myedittimer.h 2006-09-24 20:05:41.000000000 +0200
++++ menu_myedittimer.h 2006-11-28 13:48:45.000000000 +0100
+@@ -15,6 +15,7 @@
+ cMenuEditDateItem *firstday;
+ void SetFirstDayItem(void);
+ cMenuEditStrItem* m_DirItem;
++ char* SetFskProtection(int fskProtection, char* aux); // PIN PATCH
+
+ uint flags;
+ time_t day;
+@@ -25,6 +26,7 @@
+ int lifetime;
+ char file[MaxFileName];
+ char directory[MaxFileName];
++ int fskProtection; // PIN PATCH
+ public:
+ cMenuMyEditTimer(cTimer *Timer, bool New, const cEvent* event, const cChannel* forcechannel=NULL);
+ virtual ~cMenuMyEditTimer();
diff --git a/patches/epgsearch-0.9.20.diff b/patches/epgsearch-0.9.20.diff
new file mode 100644
index 0000000..c1c2602
--- /dev/null
+++ b/patches/epgsearch-0.9.20.diff
@@ -0,0 +1,221 @@
+--- ../plain/epgsearch-0.9.20//i18n.c 2007-01-28 16:29:57.000000000 +0100
++++ i18n.c 2007-02-03 16:54:11.000000000 +0100
+@@ -7327,6 +7327,28 @@
+ "",// TODO
+ "",// TODO
+ },
++ { "Childlock",
++ "Kindersicherung",
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "Adulte",
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ },
+ { NULL }
+ };
+
+--- ../plain/epgsearch-0.9.20//menu_commands.c 2007-01-13 15:20:59.000000000 +0100
++++ menu_commands.c 2007-02-10 09:38:32.000000000 +0100
+@@ -135,11 +135,11 @@
+ else
+ {
+ string fullaux = "";
++ string aux = "";
+ if (event)
+ {
+ int bstart = event->StartTime() - timer->StartTime();
+ int bstop = timer->StopTime() - event->EndTime();
+- string aux = "";
+ int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
+ aux = UpdateAuxValue(aux, "update", checkmode);
+ aux = UpdateAuxValue(aux, "eventid", event->EventID());
+@@ -147,6 +147,12 @@
+ aux = UpdateAuxValue(aux, "bstop", bstop);
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
++
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
++
+ SetAux(timer, fullaux);
+ Timers.Add(timer);
+ timer->Matches();
+--- ../plain/epgsearch-0.9.20//menu_main.c 2007-01-16 23:38:11.000000000 +0100
++++ menu_main.c 2007-02-10 09:38:47.000000000 +0100
+@@ -159,12 +159,12 @@
+ else
+ {
+ string fullaux = "";
++ string aux = "";
+ if (item->event)
+ {
+ const cEvent* event = item->event;
+ int bstart = event->StartTime() - timer->StartTime();
+ int bstop = timer->StopTime() - event->EndTime();
+- string aux = "";
+ int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
+ aux = UpdateAuxValue(aux, "update", checkmode);
+ aux = UpdateAuxValue(aux, "eventid", event->EventID());
+@@ -172,6 +172,12 @@
+ aux = UpdateAuxValue(aux, "bstop", bstop);
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
++
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
++
+ SetAux(timer, fullaux);
+ Timers.Add(timer);
+ timer->Matches();
+--- ../plain/epgsearch-0.9.20//menu_myedittimer.c 2007-01-23 20:26:12.000000000 +0100
++++ menu_myedittimer.c 2007-02-10 09:40:33.000000000 +0100
+@@ -36,6 +36,7 @@
+ stop = Timer->Stop();
+ priority = Timer->Priority();
+ lifetime = Timer->Lifetime();
++ fskProtection = Timer->FskProtection(); // PIN PATCH
+ strcpy(file, Timer->File());
+ channel = Timer->Channel()->Number();
+ if (forcechannel)
+@@ -107,6 +108,14 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &lifetime, 0, MAXLIFETIME));
++ // PIN PATCH
++ if (cOsd::pinValid || !fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&fskProtection));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Childlock"), fskProtection ? tr("yes") : tr("no"));
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
+ Add(new cMenuEditStrItem( tr("File"), file, MaxFileName, tr(FileNameChars)));
+ Add(new cMenuEditStrItem( tr("Directory"), directory, MaxFileName, tr(AllowedChars)));
+
+@@ -211,6 +220,33 @@
+ return osContinue;
+ }
+
++char* cMenuMyEditTimer::SetFskProtection(int fskProtection, char* aux) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ asprintf(&aux,"%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info to aux
++
++ asprintf(&tmp, "%.*s%s", p-aux, aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (tmp)
++ free(tmp);
++
++ return aux;
++}
++
+ eOSState cMenuMyEditTimer::ProcessKey(eKeys Key)
+ {
+ bool bWasSingleEvent = IsSingleEvent();
+@@ -290,6 +326,7 @@
+ }
+
+ string fullaux = "";
++ string aux = "";
+ if (timer && timer->Aux())
+ fullaux = timer->Aux();
+
+@@ -307,7 +344,6 @@
+ bstop = stopTime - event->EndTime();
+
+ char* epgsearchaux = GetAuxValue(timer, "epgsearch");
+- string aux = "";
+ if (epgsearchaux)
+ {
+ aux = epgsearchaux;
+@@ -320,6 +356,10 @@
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
+
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
+
+ char* tmpFile = strdup(file);
+ tmpFile = strreplace(tmpFile, ':', '|');
+--- ../plain/epgsearch-0.9.20//menu_myedittimer.h 2006-12-08 21:50:22.000000000 +0100
++++ menu_myedittimer.h 2007-02-03 16:40:11.000000000 +0100
+@@ -13,6 +13,7 @@
+ bool addIfConfirmed;
+ int UserDefDaysOfWeek;
+ cMenuEditStrItem* m_DirItem;
++ char* SetFskProtection(int fskProtection, char* aux); // PIN PATCH
+
+ uint flags;
+ time_t day;
+@@ -23,6 +24,7 @@
+ int lifetime;
+ char file[MaxFileName];
+ char directory[MaxFileName];
++ int fskProtection; // PIN PATCH
+ int checkmode;
+ public:
+ cMenuMyEditTimer(cTimer *Timer, bool New, const cEvent* event, const cChannel* forcechannel=NULL);
+--- ../plain/epgsearch-0.9.20//menu_whatson.c 2007-01-27 14:30:52.000000000 +0100
++++ menu_whatson.c 2007-02-10 09:39:52.000000000 +0100
+@@ -450,12 +450,12 @@
+ else
+ {
+ string fullaux = "";
++ string aux = "";
+ if (item->event)
+ {
+ const cEvent* event = item->event;
+ int bstart = event->StartTime() - timer->StartTime();
+ int bstop = timer->StopTime() - event->EndTime();
+- string aux = "";
+ int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
+ aux = UpdateAuxValue(aux, "update", checkmode);
+ aux = UpdateAuxValue(aux, "eventid", event->EventID());
+@@ -463,6 +463,12 @@
+ aux = UpdateAuxValue(aux, "bstop", bstop);
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
++
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
++
+ SetAux(timer, fullaux);
+ Timers.Add(timer);
+ timer->Matches();
diff --git a/patches/epgsearch-0.9.21.diff b/patches/epgsearch-0.9.21.diff
new file mode 100644
index 0000000..f5d49e7
--- /dev/null
+++ b/patches/epgsearch-0.9.21.diff
@@ -0,0 +1,194 @@
+--- ../epgsearch-0.9.21-plain//i18n.c 2007-04-28 11:42:43.000000000 +0200
++++ i18n.c 2007-05-28 09:33:29.000000000 +0200
+@@ -9,6 +9,28 @@
+ #include "i18n.h"
+
+ const tI18nPhrase Phrases[] = {
++ { "Childlock",
++ "Kindersicherung",
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "Adulte",
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ },
+ { "search the EPG for repeats and more",
+ "Suche im EPG nach Wiederholungen und anderem",// Deutsch
+ "",// TODO Slovenski
+--- ../epgsearch-0.9.21-plain//menu_commands.c 2007-03-28 21:17:40.000000000 +0200
++++ menu_commands.c 2007-05-28 09:33:29.000000000 +0200
+@@ -135,11 +135,11 @@
+ else
+ {
+ string fullaux = "";
++ string aux = "";
+ if (event)
+ {
+ int bstart = event->StartTime() - timer->StartTime();
+ int bstop = timer->StopTime() - event->EndTime();
+- string aux = "";
+ int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
+ aux = UpdateAuxValue(aux, "update", checkmode);
+ aux = UpdateAuxValue(aux, "eventid", event->EventID());
+@@ -147,6 +147,11 @@
+ aux = UpdateAuxValue(aux, "bstop", bstop);
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
++
+ SetAux(timer, fullaux);
+ Timers.Add(timer);
+ timer->Matches();
+--- ../epgsearch-0.9.21-plain//menu_main.c 2007-03-20 19:35:50.000000000 +0100
++++ menu_main.c 2007-05-28 09:33:29.000000000 +0200
+@@ -159,12 +159,12 @@
+ else
+ {
+ string fullaux = "";
++ string aux = "";
+ if (item->event)
+ {
+ const cEvent* event = item->event;
+ int bstart = event->StartTime() - timer->StartTime();
+ int bstop = timer->StopTime() - event->EndTime();
+- string aux = "";
+ int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
+ aux = UpdateAuxValue(aux, "update", checkmode);
+ aux = UpdateAuxValue(aux, "eventid", event->EventID());
+@@ -172,6 +172,12 @@
+ aux = UpdateAuxValue(aux, "bstop", bstop);
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
++
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
++
+ SetAux(timer, fullaux);
+ Timers.Add(timer);
+ timer->Matches();
+--- ../epgsearch-0.9.21-plain//menu_myedittimer.c 2007-03-28 20:43:21.000000000 +0200
++++ menu_myedittimer.c 2007-06-02 22:48:46.000000000 +0200
+@@ -36,6 +36,7 @@
+ stop = Timer->Stop();
+ priority = Timer->Priority();
+ lifetime = Timer->Lifetime();
++ fskProtection = Timer->FskProtection(); // PIN PATCH
+ strcpy(file, Timer->File());
+ channel = Timer->Channel()->Number();
+ if (forcechannel)
+@@ -96,7 +97,14 @@
+ cSearchExt* search = TriggeredFromSearchTimer(timer);
+
+ Add(new cMenuEditBitItem( tr("Active"), &flags, tfActive));
+- Add(new cMenuEditChanItem(tr("Channel"), &channel));
++ // PIN PATCH
++ if (cOsd::pinValid) Add(new cMenuEditChanItem(tr("Channel"), &channel));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Channel"), Channels.GetByNumber(channel)->Name());
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
+ Add(new cMenuEditDateItem(tr("Day"), &day, &weekdays));
+
+ if (!IsSingleEvent())
+@@ -107,6 +115,14 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &lifetime, 0, MAXLIFETIME));
++ // PIN PATCH
++ if (cOsd::pinValid || !fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&fskProtection));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Childlock"), fskProtection ? tr("yes") : tr("no"));
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
+ Add(new cMenuEditStrItem( tr("File"), file, MaxFileName, tr(FileNameChars)));
+ Add(new cMenuEditStrItem( tr("Directory"), directory, MaxFileName, tr(AllowedChars)));
+
+@@ -290,6 +306,7 @@
+ }
+
+ string fullaux = "";
++ string aux = "";
+ if (timer && timer->Aux())
+ fullaux = timer->Aux();
+
+@@ -307,7 +324,6 @@
+ bstop = stopTime - event->EndTime();
+
+ char* epgsearchaux = GetAuxValue(timer, "epgsearch");
+- string aux = "";
+ if (epgsearchaux)
+ {
+ aux = epgsearchaux;
+@@ -321,6 +337,10 @@
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
+
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
+
+ char* tmpFile = strdup(file);
+ tmpFile = strreplace(tmpFile, ':', '|');
+--- ../epgsearch-0.9.21-plain//menu_myedittimer.h 2007-02-07 19:55:36.000000000 +0100
++++ menu_myedittimer.h 2007-05-28 09:33:29.000000000 +0200
+@@ -23,6 +23,7 @@
+ int lifetime;
+ char file[MaxFileName];
+ char directory[MaxFileName];
++ int fskProtection; // PIN PATCH
+ int checkmode;
+ public:
+ cMenuMyEditTimer(cTimer *Timer, bool New, const cEvent* event, const cChannel* forcechannel=NULL);
+--- ../epgsearch-0.9.21-plain//menu_whatson.c 2007-03-24 13:20:54.000000000 +0100
++++ menu_whatson.c 2007-05-28 09:34:19.000000000 +0200
+@@ -450,12 +450,12 @@
+ else
+ {
+ string fullaux = "";
++ string aux = "";
+ if (item->event)
+ {
+ const cEvent* event = item->event;
+ int bstart = event->StartTime() - timer->StartTime();
+ int bstop = timer->StopTime() - event->EndTime();
+- string aux = "";
+ int checkmode = DefTimerCheckModes.GetMode(timer->Channel());
+ aux = UpdateAuxValue(aux, "update", checkmode);
+ aux = UpdateAuxValue(aux, "eventid", event->EventID());
+@@ -463,6 +463,12 @@
+ aux = UpdateAuxValue(aux, "bstop", bstop);
+ fullaux = UpdateAuxValue(fullaux, "epgsearch", aux);
+ }
++
++ // #PIN PATCH
++ aux = "";
++ aux = UpdateAuxValue(aux, "protected", timer->FskProtection() ? "yes" : "no");
++ fullaux = UpdateAuxValue(fullaux, "pin-plugin", aux);
++
+ SetAux(timer, fullaux);
+ Timers.Add(timer);
+ timer->Matches();
diff --git a/patches/vdr-1.4.5.diff b/patches/vdr-1.4.5.diff
new file mode 100644
index 0000000..59972e1
--- /dev/null
+++ b/patches/vdr-1.4.5.diff
@@ -0,0 +1,454 @@
+--- ../vdr-1.4.5//device.c 2006-09-03 12:13:25.000000000 +0200
++++ device.c 2007-01-28 19:24:06.000000000 +0100
+@@ -581,8 +581,10 @@
+ int n = CurrentChannel() + Direction;
+ int first = n;
+ cChannel *channel;
+- while ((channel = Channels.GetByNumber(n, Direction)) != NULL) {
++ while ((channel = Channels.GetByNumber(n, Direction)) != NULL)
++ {
+ // try only channels which are currently available
++ if (cStatus::MsgChannelProtected(0, channel) == false) // PIN PATCH
+ if (PrimaryDevice()->ProvidesChannel(channel, Setup.PrimaryLimit) || PrimaryDevice()->CanReplay() && GetDevice(channel, 0))
+ break;
+ n = channel->Number() + Direction;
+@@ -604,6 +606,11 @@
+
+ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
+ {
++ // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
++ // I really don't know, but it works ... // PIN PATCH
++ if (LiveView && cStatus::MsgChannelProtected(this, Channel) == true) // PIN PATCH
++ return scrNotAvailable; // PIN PATCH
++
+ if (LiveView)
+ StopReplay();
+
+--- ../vdr-1.4.5//i18n.c 2006-10-14 11:26:41.000000000 +0200
++++ i18n.c 2007-01-28 19:24:06.000000000 +0100
+@@ -6126,6 +6126,27 @@
+ "Ingen titel",
+ "Bez názvu",
+ },
++ { "Childlock", // PIN PATCH
++ "Kindersicherung",
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "Adulte",
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ "",//TODO
++ },
+ { NULL }
+ };
+
+--- ../vdr-1.4.5//menu.c 2006-12-02 12:12:02.000000000 +0100
++++ menu.c 2007-02-03 12:16:23.000000000 +0100
+@@ -664,6 +664,16 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
++
++ // PIN PATCH
++ if (cOsd::pinValid || !data.fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&data.fskProtection));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Childlock"), data.fskProtection ? tr("yes") : tr("no"));
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
++
+ Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file), tr(FileNameChars)));
+ SetFirstDayItem();
+ }
+@@ -1913,7 +1923,9 @@
+ for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
+ if (!base || (strstr(recording->Name(), base) == recording->Name() && recording->Name()[strlen(base)] == '~')) {
+ cMenuRecordingItem *Item = new cMenuRecordingItem(recording, level);
+- if (*Item->Text() && (!LastItem || strcmp(Item->Text(), LastItemText) != 0)) {
++ if ((*Item->Text() && (!LastItem || strcmp(Item->Text(), LastItemText) != 0))
++ && (!cStatus::MsgReplayProtected(GetRecording(Item), Item->Name(), base,
++ Item->IsDirectory(), true))) { // PIN PATCH
+ Add(Item);
+ LastItem = Item;
+ free(LastItemText);
+@@ -1963,6 +1975,9 @@
+ {
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
+ if (ri) {
++ if (cStatus::MsgReplayProtected(GetRecording(ri), ri->Name(), base,
++ ri->IsDirectory()) == true) // PIN PATCH
++ return osContinue; // PIN PATCH
+ if (ri->IsDirectory())
+ Open();
+ else {
+@@ -2818,28 +2833,32 @@
+
+ // Basic menu items:
+
+- Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
+- Add(new cOsdItem(hk(tr("Channels")), osChannels));
+- Add(new cOsdItem(hk(tr("Timers")), osTimers));
+- Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
++ // PIN PATCH
++ if (!cStatus::MsgMenuItemProtected("Schedule", true)) Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
++ if (!cStatus::MsgMenuItemProtected("Channels", true)) Add(new cOsdItem(hk(tr("Channels")), osChannels));
++ if (!cStatus::MsgMenuItemProtected("Timers", true)) Add(new cOsdItem(hk(tr("Timers")), osTimers));
++ if (!cStatus::MsgMenuItemProtected("Recordings", true)) Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
+
+ // Plugins:
+
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p, true)) { // PIN PATCH
+ const char *item = p->MainMenuEntry();
+ if (item)
+ Add(new cMenuPluginItem(hk(item), i));
+ }
++ }
+ else
+ break;
+ }
+
+ // More basic menu items:
+
+- Add(new cOsdItem(hk(tr("Setup")), osSetup));
++ if (!cStatus::MsgMenuItemProtected("Setup", true)) Add(new cOsdItem(hk(tr("Setup")), osSetup)); // PIN PATCH
+ if (Commands.Count())
++ if (!cStatus::MsgMenuItemProtected("Commands", true)) // PIN PATCH
+ Add(new cOsdItem(hk(tr("Commands")), osCommands));
+
+ Update(true);
+@@ -2927,6 +2946,14 @@
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ HadSubMenu |= HasSubMenu();
+
++ // > PIN PATCH
++ cOsdItem* item = Get(Current());
++
++ if (item && item->Text() && state != osContinue && state != osUnknown && state != osBack)
++ if (cStatus::MsgMenuItemProtected(item->Text()))
++ return osContinue;
++ // PIN PATCH <
++
+ switch (state) {
+ case osSchedule: return AddSubMenu(new cMenuSchedule);
+ case osChannels: return AddSubMenu(new cMenuChannels);
+@@ -2952,6 +2979,7 @@
+ if (item) {
+ cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
+ cOsdObject *menu = p->MainMenuAction();
+ if (menu) {
+ if (menu->IsMenu())
+@@ -2963,6 +2991,7 @@
+ }
+ }
+ }
++ }
+ state = osEnd;
+ }
+ break;
+@@ -3126,6 +3155,7 @@
+ if (Direction) {
+ while (Channel) {
+ Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
++ if (cStatus::MsgChannelProtected(0, Channel) == false) // PIN PATCH
+ if (Channel && !Channel->GroupSep() && (cDevice::PrimaryDevice()->ProvidesChannel(Channel, Setup.PrimaryLimit) || cDevice::GetDevice(Channel, 0)))
+ return Channel;
+ }
+@@ -3663,6 +3693,7 @@
+ for (int i = 0; i < MAXRECORDCONTROLS; i++) {
+ if (!RecordControls[i]) {
+ RecordControls[i] = new cRecordControl(device, Timer, Pause);
++ cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
+ return RecordControls[i]->Process(time(NULL));
+ }
+ }
+--- ../vdr-1.4.5//osd.c 2006-02-26 15:31:31.000000000 +0100
++++ osd.c 2007-01-28 19:24:06.000000000 +0100
+@@ -594,6 +594,7 @@
+ // --- cOsd ------------------------------------------------------------------
+
+ int cOsd::isOpen = 0;
++bool cOsd::pinValid = false; // PIN PATCH
+
+ cOsd::cOsd(int Left, int Top)
+ {
+--- ../vdr-1.4.5//osd.h 2006-02-26 15:45:05.000000000 +0100
++++ osd.h 2007-01-28 19:24:06.000000000 +0100
+@@ -324,6 +324,7 @@
+ ///< 7: vertical, falling, upper
+ virtual void Flush(void);
+ ///< Actually commits all data to the OSD hardware.
++ static bool pinValid; // PIN PATCH
+ };
+
+ class cOsdProvider {
+--- ../vdr-1.4.5//status.c 2005-12-31 16:10:10.000000000 +0100
++++ status.c 2007-02-03 12:04:26.000000000 +0100
+@@ -112,3 +112,55 @@
+ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+ sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
+ }
++
++bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ChannelProtected(Device, Channel) == true)
++ return true;
++
++ return false;
++}
++
++bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ReplayProtected(Recording, Name, Base, isDirectory, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgRecordingFile(const char* FileName)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->RecordingFile(FileName);
++}
++
++void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->TimerCreation(Timer, Event);
++}
++
++bool cStatus::MsgPluginProtected(cPlugin* Plugin, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->PluginProtected(Plugin, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgUserAction(const eKeys key, const cOsdObject* Interact) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ sm->UserAction(key, Interact);
++}
++
++bool cStatus::MsgMenuItemProtected(const char* Name, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->MenuItemProtected(Name, menuView) == true)
++ return true;
++ return false;
++}
+--- ../vdr-1.4.5//status.h 2005-12-31 16:15:25.000000000 +0100
++++ status.h 2007-02-03 12:03:19.000000000 +0100
+@@ -14,6 +14,7 @@
+ #include "device.h"
+ #include "player.h"
+ #include "tools.h"
++#include "plugin.h"
+
+ class cStatus : public cListObject {
+ private:
+@@ -67,6 +68,24 @@
+ // The OSD displays the single line Text with the current channel information.
+ virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
+ // The OSD displays the given programme information.
++ virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
++ // Checks if a channel is protected.
++ virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a recording is protected.
++ virtual void RecordingFile(const char* FileName) {} // PIN PATCH
++ // The given DVB device has started recording to FileName. FileName is the name of the
++ // recording directory
++ virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
++ // The given timer is created
++ virtual bool PluginProtected(cPlugin* Plugin, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a plugin is protected.
++ virtual void UserAction(const eKeys key, const cOsdObject* Interact) {} // PIN PATCH
++ // report user action
++ virtual bool MenuItemProtected(const char* Name, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a menu entry is protected.
++
++
+ public:
+ cStatus(void);
+ virtual ~cStatus();
+@@ -86,6 +105,15 @@
+ static void MsgOsdTextItem(const char *Text, bool Scroll = false);
+ static void MsgOsdChannel(const char *Text);
+ static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
++ static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
++ static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false); // PIN PATCH
++ static void MsgRecordingFile(const char* FileName); // PIN PATCH
++ static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
++ static bool MsgPluginProtected(cPlugin* Plugin, int menuView = false); // PIN PATCH
++ static void MsgUserAction(const eKeys key, const cOsdObject* Interact);
++ static bool MsgMenuItemProtected(const char* Name, int menuView = false); // PIN PATCH
++
+ };
+
+ #endif //__STATUS_H
+--- ../vdr-1.4.5//timers.c 2006-09-15 16:15:53.000000000 +0200
++++ timers.c 2007-01-28 19:24:06.000000000 +0100
+@@ -14,6 +14,7 @@
+ #include "i18n.h"
+ #include "libsi/si.h"
+ #include "remote.h"
++#include "status.h" // PIN PATCH
+
+ // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
+ // format characters in order to allow any number of blanks after a numeric
+@@ -42,6 +43,7 @@
+ stop -= 2400;
+ priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
+ lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ *file = 0;
+ aux = NULL;
+ event = NULL;
+@@ -75,12 +77,14 @@
+ stop -= 2400;
+ priority = Setup.DefaultPriority;
+ lifetime = Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ *file = 0;
+ const char *Title = Event->Title();
+ if (!isempty(Title))
+ strn0cpy(file, Event->Title(), sizeof(file));
+ aux = NULL;
+ event = NULL; // let SetEvent() be called to get a log message
++ cStatus::MsgTimerCreation(this, Event); // PIN PATCH
+ }
+
+ cTimer::cTimer(const cTimer &Timer)
+@@ -113,6 +117,7 @@
+ stop = Timer.stop;
+ priority = Timer.priority;
+ lifetime = Timer.lifetime;
++ fskProtection = Timer.fskProtection; // PIN PATCH
+ strncpy(file, Timer.file, sizeof(file));
+ free(aux);
+ aux = Timer.aux ? strdup(Timer.aux) : NULL;
+@@ -288,6 +293,7 @@
+ result = false;
+ }
+ }
++ fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
+ free(channelbuffer);
+ free(daybuffer);
+ free(filebuffer);
+@@ -597,6 +603,33 @@
+ Matches(); // refresh start and end time
+ }
+
++void cTimer::SetFskProtection(int aFlag) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++
++ fskProtection = aFlag;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ asprintf(&aux,"%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info to aux
++
++ asprintf(&tmp, "%.*s%s", p-aux, aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (tmp)
++ free(tmp);
++}
++
+ // -- cTimers ----------------------------------------------------------------
+
+ cTimers Timers;
+--- ../vdr-1.4.5//timers.h 2006-09-04 19:07:39.000000000 +0200
++++ timers.h 2007-01-28 19:24:06.000000000 +0100
+@@ -37,6 +37,7 @@
+ int start;
+ int stop;
+ int priority;
++ int fskProtection; // PIN PATCH
+ int lifetime;
+ char file[MaxFileName];
+ char *aux;
+@@ -58,6 +59,7 @@
+ int Start(void) const { return start; }
+ int Stop(void) const { return stop; }
+ int Priority(void) const { return priority; }
++ int FskProtection(void) const { return fskProtection; } // PIN PATCH
+ int Lifetime(void) const { return lifetime; }
+ const char *File(void) const { return file; }
+ time_t FirstDay(void) const { return weekdays ? day : 0; }
+@@ -86,6 +88,7 @@
+ void SetInVpsMargin(bool InVpsMargin);
+ void SetPriority(int Priority);
+ void SetFlags(uint Flags);
++ void SetFskProtection(int aFlag); // PIN PATCH
+ void ClrFlags(uint Flags);
+ void InvFlags(uint Flags);
+ bool HasFlags(uint Flags) const;
+--- ../vdr-1.4.5//vdr.c 2006-12-02 17:22:12.000000000 +0100
++++ vdr.c 2007-01-28 19:32:00.000000000 +0100
+@@ -865,6 +865,7 @@
+ cOsdObject *Interact = Menu ? Menu : cControl::Control();
+ eKeys key = Interface->GetKey((!Interact || !Interact->NeedsFastResponse()) && time(NULL) - LastCamMenu > LASTCAMMENUTIMEOUT);
+ if (NORMALKEY(key) != kNone) {
++ cStatus::MsgUserAction(key, Interact); // PIN PATCH
+ EITScanner.Activity();
+ LastActivity = time(NULL);
+ }
+@@ -930,10 +931,12 @@
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
++ if (!cStatus::MsgPluginProtected(plugin)) {
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
++ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
+ }
+@@ -1137,9 +1140,11 @@
+ // Instant resume of the last viewed recording:
+ case kPlay:
+ if (cReplayControl::LastReplayed()) {
++ if (cStatus::MsgReplayProtected(0, cReplayControl::LastReplayed(), 0, false) == false) { // PIN PATCH
+ cControl::Shutdown();
+ cControl::Launch(new cReplayControl);
+ }
++ }
+ break;
+ default: break;
+ }
diff --git a/patches/vdr-1.7.17.diff b/patches/vdr-1.7.17.diff
new file mode 100644
index 0000000..5909652
--- /dev/null
+++ b/patches/vdr-1.7.17.diff
@@ -0,0 +1,416 @@
+--- ../vdr-1.7.17.plain//device.c 2011-02-25 16:12:03.000000000 +0100
++++ device.c 2011-03-31 11:47:58.122037275 +0200
+@@ -665,6 +665,7 @@
+ cChannel *channel;
+ while ((channel = Channels.GetByNumber(n, Direction)) != NULL) {
+ // try only channels which are currently available
++ if (!cStatus::MsgChannelProtected(0, channel)) // PIN PATCH
+ if (GetDevice(channel, 0, true))
+ break;
+ n = channel->Number() + Direction;
+@@ -686,6 +687,12 @@
+
+ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
+ {
++ // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
++ // I really don't know, but it works ... // PIN PATCH
++
++ if (LiveView && cStatus::MsgChannelProtected(this, Channel)) // PIN PATCH
++ return scrNotAvailable; // PIN PATCH
++
+ if (LiveView) {
+ StopReplay();
+ DELETENULL(liveSubtitle);
+--- ../vdr-1.7.17.plain//menu.c 2011-02-27 13:37:48.000000000 +0100
++++ menu.c 2011-03-31 12:17:34.903691287 +0200
+@@ -918,6 +918,16 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
++
++ // PIN PATCH
++ if (cOsd::pinValid || !data.fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&data.fskProtection));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Childlock"), data.fskProtection ? tr("yes") : tr("no"));
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
++
+ Add(file = new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file)));
+ SetFirstDayItem();
+ }
+@@ -2276,7 +2286,10 @@
+ for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
+ if (!base || (strstr(recording->Name(), base) == recording->Name() && recording->Name()[strlen(base)] == FOLDERDELIMCHAR)) {
+ cMenuRecordingItem *Item = new cMenuRecordingItem(recording, level);
+- if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))) {
++
++ if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))
++ && (!cStatus::MsgReplayProtected(GetRecording(Item), Item->Name(), base,
++ Item->IsDirectory(), true))) { // PIN PATCH
+ Add(Item);
+ LastItem = Item;
+ free(LastItemText);
+@@ -2326,6 +2339,9 @@
+ {
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
+ if (ri) {
++ if (cStatus::MsgReplayProtected(GetRecording(ri), ri->Name(), base,
++ ri->IsDirectory()) == true) // PIN PATCH
++ return osContinue; // PIN PATCH
+ if (ri->IsDirectory())
+ Open();
+ else {
+@@ -3305,28 +3321,32 @@
+
+ // Basic menu items:
+
+- Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
+- Add(new cOsdItem(hk(tr("Channels")), osChannels));
+- Add(new cOsdItem(hk(tr("Timers")), osTimers));
+- Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
++ // PIN PATCH
++ if (!cStatus::MsgMenuItemProtected("Schedule", true)) Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
++ if (!cStatus::MsgMenuItemProtected("Channels", true)) Add(new cOsdItem(hk(tr("Channels")), osChannels));
++ if (!cStatus::MsgMenuItemProtected("Timers", true)) Add(new cOsdItem(hk(tr("Timers")), osTimers));
++ if (!cStatus::MsgMenuItemProtected("Recordings", true)) Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
+
+ // Plugins:
+
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p, true)) { // PIN PATCH
+ const char *item = p->MainMenuEntry();
+ if (item)
+ Add(new cMenuPluginItem(hk(item), i));
+ }
++ }
+ else
+ break;
+ }
+
+ // More basic menu items:
+
+- Add(new cOsdItem(hk(tr("Setup")), osSetup));
++ if (!cStatus::MsgMenuItemProtected("Setup", true)) Add(new cOsdItem(hk(tr("Setup")), osSetup)); // PIN PATCH
+ if (Commands.Count())
++ if (!cStatus::MsgMenuItemProtected("Commands", true)) // PIN PATCH
+ Add(new cOsdItem(hk(tr("Commands")), osCommands));
+
+ Update(true);
+@@ -3402,6 +3422,14 @@
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ HadSubMenu |= HasSubMenu();
+
++ // > PIN PATCH
++ cOsdItem* item = Get(Current());
++
++ if (item && item->Text() && state != osContinue && state != osUnknown && state != osBack)
++ if (cStatus::MsgMenuItemProtected(item->Text()))
++ return osContinue;
++ // PIN PATCH <
++
+ switch (state) {
+ case osSchedule: return AddSubMenu(new cMenuSchedule);
+ case osChannels: return AddSubMenu(new cMenuChannels);
+@@ -3427,6 +3455,7 @@
+ if (item) {
+ cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
+ cOsdObject *menu = p->MainMenuAction();
+ if (menu) {
+ if (menu->IsMenu())
+@@ -3438,6 +3467,7 @@
+ }
+ }
+ }
++ }
+ state = osEnd;
+ }
+ break;
+@@ -3608,6 +3638,8 @@
+ Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
+ if (!Channel && Setup.ChannelsWrap)
+ Channel = Direction > 0 ? Channels.First() : Channels.Last();
++
++ if (!cStatus::MsgChannelProtected(0, Channel)) // PIN PATCH
+ if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, 0, true))
+ return Channel;
+ }
+@@ -4241,6 +4273,7 @@
+ for (int i = 0; i < MAXRECORDCONTROLS; i++) {
+ if (!RecordControls[i]) {
+ RecordControls[i] = new cRecordControl(device, Timer, Pause);
++ cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
+ return RecordControls[i]->Process(time(NULL));
+ }
+ }
+--- ../vdr-1.7.17.plain//osd.c 2011-03-12 16:32:33.000000000 +0100
++++ osd.c 2011-03-31 11:57:37.102037290 +0200
+@@ -1576,6 +1576,7 @@
+ int cOsd::osdWidth = 0;
+ int cOsd::osdHeight = 0;
+ cVector<cOsd *> cOsd::Osds;
++bool cOsd::pinValid = false; // PIN PATCH
+
+ cOsd::cOsd(int Left, int Top, uint Level)
+ {
+--- ../vdr-1.7.17.plain//osd.h 2011-03-12 17:06:48.000000000 +0100
++++ osd.h 2011-03-31 11:58:26.802037290 +0200
+@@ -917,6 +917,7 @@
+ ///< MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d);
+ ///< delete pm;
+ ///< }
++ static bool pinValid; // PIN PATCH
+ };
+
+ #define MAXOSDIMAGES 64
+--- ../vdr-1.7.17.plain//status.c 2008-02-16 15:46:31.000000000 +0100
++++ status.c 2011-03-31 11:40:45.532037296 +0200
+@@ -124,3 +124,55 @@
+ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+ sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
+ }
++
++bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ChannelProtected(Device, Channel) == true)
++ return true;
++
++ return false;
++}
++
++bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ReplayProtected(Recording, Name, Base, isDirectory, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgRecordingFile(const char* FileName)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->RecordingFile(FileName);
++}
++
++void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->TimerCreation(Timer, Event);
++}
++
++bool cStatus::MsgPluginProtected(cPlugin* Plugin, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->PluginProtected(Plugin, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgUserAction(const eKeys key, const cOsdObject* Interact) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ sm->UserAction(key, Interact);
++}
++
++bool cStatus::MsgMenuItemProtected(const char* Name, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->MenuItemProtected(Name, menuView) == true)
++ return true;
++ return false;
++}
+--- ../vdr-1.7.17.plain//status.h 2008-02-16 16:00:33.000000000 +0100
++++ status.h 2011-03-31 11:40:45.532037296 +0200
+@@ -14,6 +14,7 @@
+ #include "device.h"
+ #include "player.h"
+ #include "tools.h"
++#include "plugin.h"
+
+ enum eTimerChange { tcMod, tcAdd, tcDel };
+
+@@ -80,6 +81,24 @@
+ // The OSD displays the single line Text with the current channel information.
+ virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
+ // The OSD displays the given programme information.
++ virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
++ // Checks if a channel is protected.
++ virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a recording is protected.
++ virtual void RecordingFile(const char* FileName) {} // PIN PATCH
++ // The given DVB device has started recording to FileName. FileName is the name of the
++ // recording directory
++ virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
++ // The given timer is created
++ virtual bool PluginProtected(cPlugin* Plugin, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a plugin is protected.
++ virtual void UserAction(const eKeys key, const cOsdObject* Interact) {} // PIN PATCH
++ // report user action
++ virtual bool MenuItemProtected(const char* Name, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a menu entry is protected.
++
++
+ public:
+ cStatus(void);
+ virtual ~cStatus();
+@@ -101,6 +120,15 @@
+ static void MsgOsdTextItem(const char *Text, bool Scroll = false);
+ static void MsgOsdChannel(const char *Text);
+ static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
++ static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
++ static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false); // PIN PATCH
++ static void MsgRecordingFile(const char* FileName); // PIN PATCH
++ static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
++ static bool MsgPluginProtected(cPlugin* Plugin, int menuView = false); // PIN PATCH
++ static void MsgUserAction(const eKeys key, const cOsdObject* Interact);
++ static bool MsgMenuItemProtected(const char* Name, int menuView = false); // PIN PATCH
++
+ };
+
+ #endif //__STATUS_H
+--- ../vdr-1.7.17.plain//timers.c 2010-01-16 12:18:53.000000000 +0100
++++ timers.c 2011-03-31 12:07:34.363691286 +0200
+@@ -46,6 +46,7 @@
+ stop -= 2400;
+ priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
+ lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ *file = 0;
+ aux = NULL;
+ event = NULL;
+@@ -84,6 +85,7 @@
+ stop -= 2400;
+ priority = Setup.DefaultPriority;
+ lifetime = Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ *file = 0;
+ const char *Title = Event->Title();
+ if (!isempty(Title))
+@@ -95,6 +97,7 @@
+ }
+ aux = NULL;
+ event = NULL; // let SetEvent() be called to get a log message
++ cStatus::MsgTimerCreation(this, Event);
+ }
+
+ cTimer::cTimer(const cTimer &Timer)
+@@ -129,6 +132,7 @@
+ stop = Timer.stop;
+ priority = Timer.priority;
+ lifetime = Timer.lifetime;
++ fskProtection = Timer.fskProtection; // PIN PATCH
+ strncpy(file, Timer.file, sizeof(file));
+ free(aux);
+ aux = Timer.aux ? strdup(Timer.aux) : NULL;
+@@ -323,6 +327,7 @@
+ result = false;
+ }
+ }
++ fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
+ free(channelbuffer);
+ free(daybuffer);
+ free(filebuffer);
+@@ -632,6 +637,33 @@
+ Matches(); // refresh start and end time
+ }
+
++void cTimer::SetFskProtection(int aFlag)
++{
++ char* p;
++ char* tmp = 0;
++
++ fskProtection = aFlag;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ asprintf(&aux,"%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info to aux
++
++ asprintf(&tmp, "%.*s%s", p-aux, aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (tmp)
++ free(tmp);
++}
++
+ // --- cTimers ---------------------------------------------------------------
+
+ cTimers Timers;
+--- ../vdr-1.7.17.plain//timers.h 2008-02-16 15:33:23.000000000 +0100
++++ timers.h 2011-03-31 11:40:45.532037296 +0200
+@@ -37,6 +37,7 @@
+ int start;
+ int stop;
+ int priority;
++ int fskProtection; // PIN PATCH
+ int lifetime;
+ mutable char file[MaxFileName];
+ char *aux;
+@@ -58,6 +59,7 @@
+ int Start(void) const { return start; }
+ int Stop(void) const { return stop; }
+ int Priority(void) const { return priority; }
++ int FskProtection(void) const { return fskProtection; } // PIN PATCH
+ int Lifetime(void) const { return lifetime; }
+ const char *File(void) const { return file; }
+ time_t FirstDay(void) const { return weekdays ? day : 0; }
+@@ -86,6 +88,7 @@
+ void SetInVpsMargin(bool InVpsMargin);
+ void SetPriority(int Priority);
+ void SetFlags(uint Flags);
++ void SetFskProtection(int aFlag); // PIN PATCH
+ void ClrFlags(uint Flags);
+ void InvFlags(uint Flags);
+ bool HasFlags(uint Flags) const;
+--- ../vdr-1.7.17.plain//vdr.c 2010-12-12 14:42:00.000000000 +0100
++++ vdr.c 2011-03-31 12:09:31.913691288 +0200
+@@ -929,6 +929,7 @@
+ cOsdObject *Interact = Menu ? Menu : cControl::Control();
+ eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());
+ if (ISREALKEY(key)) {
++ cStatus::MsgUserAction(key, Interact); // PIN PATCH
+ EITScanner.Activity();
+ // Cancel shutdown countdown:
+ if (ShutdownHandler.countdown)
+@@ -1001,10 +1002,12 @@
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
++ if (!cStatus::MsgPluginProtected(plugin)) {
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
++ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
+ }
+@@ -1218,9 +1221,11 @@
+ // Instant resume of the last viewed recording:
+ case kPlay:
+ if (cReplayControl::LastReplayed()) {
++ if (cStatus::MsgReplayProtected(0, cReplayControl::LastReplayed(), 0, false) == false) { // PIN PATCH
+ cControl::Shutdown();
+ cControl::Launch(new cReplayControl);
+ }
++ }
+ break;
+ default: break;
+ }
diff --git a/patches/vdr-1.7.32.diff b/patches/vdr-1.7.32.diff
new file mode 100644
index 0000000..35d4219
--- /dev/null
+++ b/patches/vdr-1.7.32.diff
@@ -0,0 +1,426 @@
+--- ../vdr-1.7.32.plain//device.c 2012-11-13 10:11:43.000000000 +0100
++++ device.c 2012-12-07 11:15:14.952979954 +0100
+@@ -721,6 +721,7 @@
+ cChannel *channel;
+ while ((channel = Channels.GetByNumber(n, Direction)) != NULL) {
+ // try only channels which are currently available
++ if (!cStatus::MsgChannelProtected(0, channel)) // PIN PATCH
+ if (GetDevice(channel, LIVEPRIORITY, true, true))
+ break;
+ n = channel->Number() + Direction;
+@@ -742,6 +743,12 @@
+
+ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
+ {
++ // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
++ // I really don't know, but it works ... // PIN PATCH
++
++ if (LiveView && cStatus::MsgChannelProtected(this, Channel)) // PIN PATCH
++ return scrNotAvailable; // PIN PATCH
++
+ cStatus::MsgChannelSwitch(this, 0, LiveView);
+
+ if (LiveView) {
+--- ../vdr-1.7.32.plain//menu.c 2012-11-18 14:07:53.000000000 +0100
++++ menu.c 2012-12-07 10:42:08.664909711 +0100
+@@ -889,6 +889,16 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
++
++ // PIN PATCH
++ if (cOsd::pinValid || !data.fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&data.fskProtection));
++ else {
++ char* buf = 0;
++ asprintf(&buf, "%s\t%s", tr("Childlock"), data.fskProtection ? tr("yes") : tr("no"));
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
++
+ Add(file = new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file)));
+ SetFirstDayItem();
+ }
+@@ -2261,7 +2271,10 @@
+ for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
+ if (!base || (strstr(recording->Name(), base) == recording->Name() && recording->Name()[strlen(base)] == FOLDERDELIMCHAR)) {
+ cMenuRecordingItem *Item = new cMenuRecordingItem(recording, level);
+- if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))) {
++
++ if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))
++ && (!cStatus::MsgReplayProtected(GetRecording(Item), Item->Name(), base,
++ Item->IsDirectory(), true))) { // PIN PATCH
+ Add(Item);
+ LastItem = Item;
+ free(LastItemText);
+@@ -2321,6 +2334,9 @@
+ {
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
+ if (ri) {
++ if (cStatus::MsgReplayProtected(GetRecording(ri), ri->Name(), base,
++ ri->IsDirectory()) == true) // PIN PATCH
++ return osContinue; // PIN PATCH
+ if (ri->IsDirectory())
+ Open();
+ else {
+@@ -3373,28 +3389,32 @@
+
+ // Basic menu items:
+
+- Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
+- Add(new cOsdItem(hk(tr("Channels")), osChannels));
+- Add(new cOsdItem(hk(tr("Timers")), osTimers));
+- Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
++ // PIN PATCH
++ if (!cStatus::MsgMenuItemProtected("Schedule", true)) Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
++ if (!cStatus::MsgMenuItemProtected("Channels", true)) Add(new cOsdItem(hk(tr("Channels")), osChannels));
++ if (!cStatus::MsgMenuItemProtected("Timers", true)) Add(new cOsdItem(hk(tr("Timers")), osTimers));
++ if (!cStatus::MsgMenuItemProtected("Recordings", true)) Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
+
+ // Plugins:
+
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p, true)) { // PIN PATCH
+ const char *item = p->MainMenuEntry();
+ if (item)
+ Add(new cMenuPluginItem(hk(item), i));
+ }
++ }
+ else
+ break;
+ }
+
+ // More basic menu items:
+
+- Add(new cOsdItem(hk(tr("Setup")), osSetup));
++ if (!cStatus::MsgMenuItemProtected("Setup", true)) Add(new cOsdItem(hk(tr("Setup")), osSetup)); // PIN PATCH
+ if (Commands.Count())
++ if (!cStatus::MsgMenuItemProtected("Commands", true)) // PIN PATCH
+ Add(new cOsdItem(hk(tr("Commands")), osCommands));
+
+ Update(true);
+@@ -3463,6 +3483,14 @@
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ HadSubMenu |= HasSubMenu();
+
++ // > PIN PATCH
++ cOsdItem* item = Get(Current());
++
++ if (item && item->Text() && state != osContinue && state != osUnknown && state != osBack)
++ if (cStatus::MsgMenuItemProtected(item->Text()))
++ return osContinue;
++ // PIN PATCH <
++
+ switch (state) {
+ case osSchedule: return AddSubMenu(new cMenuSchedule);
+ case osChannels: return AddSubMenu(new cMenuChannels);
+@@ -3488,6 +3516,7 @@
+ if (item) {
+ cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
+ cOsdObject *menu = p->MainMenuAction();
+ if (menu) {
+ if (menu->IsMenu())
+@@ -3499,6 +3528,7 @@
+ }
+ }
+ }
++ }
+ state = osEnd;
+ }
+ break;
+@@ -3669,6 +3699,7 @@
+ Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
+ if (!Channel && Setup.ChannelsWrap)
+ Channel = Direction > 0 ? Channels.First() : Channels.Last();
++ if (!cStatus::MsgChannelProtected(0, Channel)) // PIN PATCH
+ if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, LIVEPRIORITY, true, true))
+ return Channel;
+ }
+@@ -4318,6 +4349,7 @@
+ for (int i = 0; i < MAXRECORDCONTROLS; i++) {
+ if (!RecordControls[i]) {
+ RecordControls[i] = new cRecordControl(device, Timer, Pause);
++ cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
+ return RecordControls[i]->Process(time(NULL));
+ }
+ }
+--- ../vdr-1.7.32.plain//osd.c 2012-06-09 16:37:24.000000000 +0200
++++ osd.c 2012-12-07 10:44:54.184915564 +0100
+@@ -1623,6 +1623,7 @@
+ int cOsd::osdHeight = 0;
+ cVector<cOsd *> cOsd::Osds;
+ cMutex cOsd::mutex;
++bool cOsd::pinValid = false; // PIN PATCH
+
+ cOsd::cOsd(int Left, int Top, uint Level)
+ {
+--- ../vdr-1.7.32.plain//osd.h 2012-06-02 12:32:38.000000000 +0200
++++ osd.h 2012-12-07 10:38:33.248902093 +0100
+@@ -931,6 +931,7 @@
+ ///< MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d);
+ ///< delete pm;
+ ///< }
++ static bool pinValid; // PIN PATCH
+ };
+
+ #define MAXOSDIMAGES 64
+--- ../vdr-1.7.32.plain//status.c 2012-03-07 15:17:24.000000000 +0100
++++ status.c 2012-12-07 10:38:33.248902093 +0100
+@@ -124,3 +124,55 @@
+ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+ sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
+ }
++
++bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ChannelProtected(Device, Channel) == true)
++ return true;
++
++ return false;
++}
++
++bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ReplayProtected(Recording, Name, Base, isDirectory, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgRecordingFile(const char* FileName)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->RecordingFile(FileName);
++}
++
++void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->TimerCreation(Timer, Event);
++}
++
++bool cStatus::MsgPluginProtected(cPlugin* Plugin, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->PluginProtected(Plugin, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgUserAction(const eKeys key, const cOsdObject* Interact) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ sm->UserAction(key, Interact);
++}
++
++bool cStatus::MsgMenuItemProtected(const char* Name, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->MenuItemProtected(Name, menuView) == true)
++ return true;
++ return false;
++}
+--- ../vdr-1.7.32.plain//status.h 2012-03-07 15:16:57.000000000 +0100
++++ status.h 2012-12-07 10:38:33.248902093 +0100
+@@ -14,6 +14,7 @@
+ #include "device.h"
+ #include "player.h"
+ #include "tools.h"
++#include "plugin.h"
+
+ enum eTimerChange { tcMod, tcAdd, tcDel };
+
+@@ -81,6 +82,24 @@
+ // The OSD displays the single line Text with the current channel information.
+ virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
+ // The OSD displays the given programme information.
++ virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
++ // Checks if a channel is protected.
++ virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a recording is protected.
++ virtual void RecordingFile(const char* FileName) {} // PIN PATCH
++ // The given DVB device has started recording to FileName. FileName is the name of the
++ // recording directory
++ virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
++ // The given timer is created
++ virtual bool PluginProtected(cPlugin* Plugin, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a plugin is protected.
++ virtual void UserAction(const eKeys key, const cOsdObject* Interact) {} // PIN PATCH
++ // report user action
++ virtual bool MenuItemProtected(const char* Name, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a menu entry is protected.
++
++
+ public:
+ cStatus(void);
+ virtual ~cStatus();
+@@ -102,6 +121,15 @@
+ static void MsgOsdTextItem(const char *Text, bool Scroll = false);
+ static void MsgOsdChannel(const char *Text);
+ static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
++ static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
++ static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false); // PIN PATCH
++ static void MsgRecordingFile(const char* FileName); // PIN PATCH
++ static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
++ static bool MsgPluginProtected(cPlugin* Plugin, int menuView = false); // PIN PATCH
++ static void MsgUserAction(const eKeys key, const cOsdObject* Interact);
++ static bool MsgMenuItemProtected(const char* Name, int menuView = false); // PIN PATCH
++
+ };
+
+ #endif //__STATUS_H
+--- ../vdr-1.7.32.plain//timers.c 2012-10-16 10:22:39.000000000 +0200
++++ timers.c 2012-12-07 11:07:02.344962535 +0100
+@@ -78,6 +78,7 @@
+ stop -= 2400;
+ priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
+ lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ if (Instant && channel)
+ snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : channel->Name());
+ if (VfatFileSystem && (Utf8StrLen(file) > VFAT_MAX_FILENAME)) {
+@@ -117,6 +118,7 @@
+ stop -= 2400;
+ priority = Setup.DefaultPriority;
+ lifetime = Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ const char *Title = Event->Title();
+ if (!isempty(Title))
+ Utf8Strn0Cpy(file, Event->Title(), sizeof(file));
+@@ -126,6 +128,7 @@
+ dsyslog("timer file name truncated to '%s'", file);
+ }
+ SetEvent(Event);
++ cStatus::MsgTimerCreation(this, Event); // PIN PATCH
+ }
+
+ cTimer::cTimer(const cTimer &Timer)
+@@ -161,6 +164,7 @@
+ stop = Timer.stop;
+ priority = Timer.priority;
+ lifetime = Timer.lifetime;
++ fskProtection = Timer.fskProtection; // PIN PATCH
+ strncpy(file, Timer.file, sizeof(file));
+ free(aux);
+ aux = Timer.aux ? strdup(Timer.aux) : NULL;
+@@ -355,6 +359,7 @@
+ result = false;
+ }
+ }
++ fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
+ free(channelbuffer);
+ free(daybuffer);
+ free(filebuffer);
+@@ -713,6 +718,36 @@
+ Matches(); // refresh start and end time
+ }
+
++void cTimer::SetFskProtection(int aFlag) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++ int res = 0;
++
++ fskProtection = aFlag;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ res = asprintf(&aux, "%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info from aux
++
++ res = asprintf(&tmp, "%.*s%s", (int)(p-aux), aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (res < 0) ; // memory problems :o
++
++ if (tmp)
++ free(tmp);
++}
++
+ // --- cTimers ---------------------------------------------------------------
+
+ cTimers Timers;
+--- ../vdr-1.7.32.plain//timers.h 2012-04-15 15:21:31.000000000 +0200
++++ timers.h 2012-12-07 10:38:33.248902093 +0100
+@@ -38,6 +38,7 @@
+ int start;
+ int stop;
+ int priority;
++ int fskProtection; // PIN PATCH
+ int lifetime;
+ mutable char file[MaxFileName];
+ char *aux;
+@@ -59,6 +60,7 @@
+ int Start(void) const { return start; }
+ int Stop(void) const { return stop; }
+ int Priority(void) const { return priority; }
++ int FskProtection(void) const { return fskProtection; } // PIN PATCH
+ int Lifetime(void) const { return lifetime; }
+ const char *File(void) const { return file; }
+ time_t FirstDay(void) const { return weekdays ? day : 0; }
+@@ -95,6 +97,7 @@
+ void SetAux(const char *Aux);
+ void SetDeferred(int Seconds);
+ void SetFlags(uint Flags);
++ void SetFskProtection(int aFlag); // PIN PATCH
+ void ClrFlags(uint Flags);
+ void InvFlags(uint Flags);
+ bool HasFlags(uint Flags) const;
+--- ../vdr-1.7.32.plain//vdr.c 2012-10-13 14:48:56.000000000 +0200
++++ vdr.c 2012-12-07 11:07:50.728964248 +0100
+@@ -65,6 +65,7 @@
+ #include "tools.h"
+ #include "transfer.h"
+ #include "videodir.h"
++#include "status.h" // PIN PATCH
+
+ #define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
+ #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
+@@ -948,6 +949,7 @@
+ cOsdObject *Interact = Menu ? Menu : cControl::Control();
+ eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());
+ if (ISREALKEY(key)) {
++ cStatus::MsgUserAction(key, Interact); // PIN PATCH
+ EITScanner.Activity();
+ // Cancel shutdown countdown:
+ if (ShutdownHandler.countdown)
+@@ -1020,10 +1022,12 @@
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
++ if (!cStatus::MsgPluginProtected(plugin)) {
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
++ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
+ }
+@@ -1235,9 +1239,11 @@
+ // Instant resume of the last viewed recording:
+ case kPlay:
+ if (cReplayControl::LastReplayed()) {
++ if (cStatus::MsgReplayProtected(0, cReplayControl::LastReplayed(), 0, false) == false) { // PIN PATCH
+ cControl::Shutdown();
+ cControl::Launch(new cReplayControl);
+ }
++ }
+ else
+ DirectMainFunction(osRecordings); // no last viewed recording, so enter the Recordings menu
+ break;
diff --git a/patches/vdr-1.7.33.diff b/patches/vdr-1.7.33.diff
new file mode 100644
index 0000000..38ba45f
--- /dev/null
+++ b/patches/vdr-1.7.33.diff
@@ -0,0 +1,427 @@
+--- ../vdr-1.7.33/device.c 2012-11-19 10:59:09.000000000 +0100
++++ device.c 2012-12-10 10:14:03.106016736 +0100
+@@ -721,6 +721,7 @@
+ cChannel *channel;
+ while ((channel = Channels.GetByNumber(n, Direction)) != NULL) {
+ // try only channels which are currently available
++ if (!cStatus::MsgChannelProtected(0, channel)) // PIN PATCH
+ if (GetDevice(channel, LIVEPRIORITY, true, true))
+ break;
+ n = channel->Number() + Direction;
+@@ -742,6 +743,12 @@
+
+ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
+ {
++ // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
++ // I really don't know, but it works ... // PIN PATCH
++
++ if (LiveView && cStatus::MsgChannelProtected(this, Channel)) // PIN PATCH
++ return scrNotAvailable; // PIN PATCH
++
+ cStatus::MsgChannelSwitch(this, 0, LiveView);
+
+ if (LiveView) {
+--- ../vdr-1.7.33/menu.c 2012-12-07 14:48:15.000000000 +0100
++++ menu.c 2012-12-10 10:21:12.498031920 +0100
+@@ -896,6 +896,17 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
++
++ // PIN PATCH
++ if (cOsd::pinValid || !data.fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&data.fskProtection));
++ else {
++ char* buf = 0;
++ if (asprintf(&buf, "%s\t%s", tr("Childlock"), data.fskProtection ? tr("yes") : tr("no")) >= 0){
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
++ }
++
+ Add(file = new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file)));
+ SetFirstDayItem();
+ }
+@@ -2285,7 +2296,10 @@
+ for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
+ if (!base || (strstr(recording->Name(), base) == recording->Name() && recording->Name()[strlen(base)] == FOLDERDELIMCHAR)) {
+ cMenuRecordingItem *Item = new cMenuRecordingItem(recording, level);
+- if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))) {
++
++ if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))
++ && (!cStatus::MsgReplayProtected(Item->Recording(), Item->Name(), base,
++ Item->IsDirectory(), true))) { // PIN PATCH
+ Add(Item);
+ LastItem = Item;
+ free(LastItemText);
+@@ -2337,6 +2351,9 @@
+ {
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
+ if (ri) {
++ if (cStatus::MsgReplayProtected(ri->Recording(), ri->Name(), base,
++ ri->IsDirectory()) == true) // PIN PATCH
++ return osContinue; // PIN PATCH
+ if (ri->IsDirectory())
+ Open();
+ else {
+@@ -3379,28 +3396,32 @@
+
+ // Basic menu items:
+
+- Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
+- Add(new cOsdItem(hk(tr("Channels")), osChannels));
+- Add(new cOsdItem(hk(tr("Timers")), osTimers));
+- Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
++ // PIN PATCH
++ if (!cStatus::MsgMenuItemProtected("Schedule", true)) Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
++ if (!cStatus::MsgMenuItemProtected("Channels", true)) Add(new cOsdItem(hk(tr("Channels")), osChannels));
++ if (!cStatus::MsgMenuItemProtected("Timers", true)) Add(new cOsdItem(hk(tr("Timers")), osTimers));
++ if (!cStatus::MsgMenuItemProtected("Recordings", true)) Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
+
+ // Plugins:
+
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p, true)) { // PIN PATCH
+ const char *item = p->MainMenuEntry();
+ if (item)
+ Add(new cMenuPluginItem(hk(item), i));
+ }
++ }
+ else
+ break;
+ }
+
+ // More basic menu items:
+
+- Add(new cOsdItem(hk(tr("Setup")), osSetup));
++ if (!cStatus::MsgMenuItemProtected("Setup", true)) Add(new cOsdItem(hk(tr("Setup")), osSetup)); // PIN PATCH
+ if (Commands.Count())
++ if (!cStatus::MsgMenuItemProtected("Commands", true)) // PIN PATCH
+ Add(new cOsdItem(hk(tr("Commands")), osCommands));
+
+ Update(true);
+@@ -3469,6 +3490,14 @@
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ HadSubMenu |= HasSubMenu();
+
++ // > PIN PATCH
++ cOsdItem* item = Get(Current());
++
++ if (item && item->Text() && state != osContinue && state != osUnknown && state != osBack)
++ if (cStatus::MsgMenuItemProtected(item->Text()))
++ return osContinue;
++ // PIN PATCH <
++
+ switch (state) {
+ case osSchedule: return AddSubMenu(new cMenuSchedule);
+ case osChannels: return AddSubMenu(new cMenuChannels);
+@@ -3494,6 +3523,7 @@
+ if (item) {
+ cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
+ cOsdObject *menu = p->MainMenuAction();
+ if (menu) {
+ if (menu->IsMenu())
+@@ -3505,6 +3535,7 @@
+ }
+ }
+ }
++ }
+ state = osEnd;
+ }
+ break;
+@@ -3675,6 +3706,7 @@
+ Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
+ if (!Channel && Setup.ChannelsWrap)
+ Channel = Direction > 0 ? Channels.First() : Channels.Last();
++ if (!cStatus::MsgChannelProtected(0, Channel)) // PIN PATCH
+ if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, LIVEPRIORITY, true, true))
+ return Channel;
+ }
+@@ -4324,6 +4356,7 @@
+ for (int i = 0; i < MAXRECORDCONTROLS; i++) {
+ if (!RecordControls[i]) {
+ RecordControls[i] = new cRecordControl(device, Timer, Pause);
++ cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
+ return RecordControls[i]->Process(time(NULL));
+ }
+ }
+--- ../vdr-1.7.33/osd.c 2012-06-09 16:37:24.000000000 +0200
++++ osd.c 2012-12-10 10:14:03.110016736 +0100
+@@ -1623,6 +1623,7 @@
+ int cOsd::osdHeight = 0;
+ cVector<cOsd *> cOsd::Osds;
+ cMutex cOsd::mutex;
++bool cOsd::pinValid = false; // PIN PATCH
+
+ cOsd::cOsd(int Left, int Top, uint Level)
+ {
+--- ../vdr-1.7.33/osd.h 2012-12-03 14:49:02.000000000 +0100
++++ osd.h 2012-12-10 10:14:03.114016736 +0100
+@@ -931,6 +931,7 @@
+ ///< MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d);
+ ///< delete pm;
+ ///< }
++ static bool pinValid; // PIN PATCH
+ };
+
+ #define MAXOSDIMAGES 64
+--- ../vdr-1.7.33/status.c 2012-03-07 15:17:24.000000000 +0100
++++ status.c 2012-12-10 10:14:03.114016736 +0100
+@@ -124,3 +124,55 @@
+ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+ sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
+ }
++
++bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ChannelProtected(Device, Channel) == true)
++ return true;
++
++ return false;
++}
++
++bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ReplayProtected(Recording, Name, Base, isDirectory, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgRecordingFile(const char* FileName)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->RecordingFile(FileName);
++}
++
++void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->TimerCreation(Timer, Event);
++}
++
++bool cStatus::MsgPluginProtected(cPlugin* Plugin, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->PluginProtected(Plugin, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgUserAction(const eKeys key, const cOsdObject* Interact) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ sm->UserAction(key, Interact);
++}
++
++bool cStatus::MsgMenuItemProtected(const char* Name, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->MenuItemProtected(Name, menuView) == true)
++ return true;
++ return false;
++}
+--- ../vdr-1.7.33/status.h 2012-03-07 15:16:57.000000000 +0100
++++ status.h 2012-12-10 10:14:03.114016736 +0100
+@@ -14,6 +14,7 @@
+ #include "device.h"
+ #include "player.h"
+ #include "tools.h"
++#include "plugin.h"
+
+ enum eTimerChange { tcMod, tcAdd, tcDel };
+
+@@ -81,6 +82,24 @@
+ // The OSD displays the single line Text with the current channel information.
+ virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
+ // The OSD displays the given programme information.
++ virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
++ // Checks if a channel is protected.
++ virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a recording is protected.
++ virtual void RecordingFile(const char* FileName) {} // PIN PATCH
++ // The given DVB device has started recording to FileName. FileName is the name of the
++ // recording directory
++ virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
++ // The given timer is created
++ virtual bool PluginProtected(cPlugin* Plugin, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a plugin is protected.
++ virtual void UserAction(const eKeys key, const cOsdObject* Interact) {} // PIN PATCH
++ // report user action
++ virtual bool MenuItemProtected(const char* Name, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a menu entry is protected.
++
++
+ public:
+ cStatus(void);
+ virtual ~cStatus();
+@@ -102,6 +121,15 @@
+ static void MsgOsdTextItem(const char *Text, bool Scroll = false);
+ static void MsgOsdChannel(const char *Text);
+ static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
++ static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
++ static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false); // PIN PATCH
++ static void MsgRecordingFile(const char* FileName); // PIN PATCH
++ static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
++ static bool MsgPluginProtected(cPlugin* Plugin, int menuView = false); // PIN PATCH
++ static void MsgUserAction(const eKeys key, const cOsdObject* Interact);
++ static bool MsgMenuItemProtected(const char* Name, int menuView = false); // PIN PATCH
++
+ };
+
+ #endif //__STATUS_H
+--- ../vdr-1.7.33/timers.c 2012-12-07 14:14:00.000000000 +0100
++++ timers.c 2012-12-10 10:14:03.114016736 +0100
+@@ -78,6 +78,7 @@
+ stop -= 2400;
+ priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
+ lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ if (Instant && channel)
+ snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : channel->Name());
+ if (VfatFileSystem && (Utf8StrLen(file) > VFAT_MAX_FILENAME)) {
+@@ -117,6 +118,7 @@
+ stop -= 2400;
+ priority = Setup.DefaultPriority;
+ lifetime = Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ const char *Title = Event->Title();
+ if (!isempty(Title))
+ Utf8Strn0Cpy(file, Event->Title(), sizeof(file));
+@@ -126,6 +128,7 @@
+ dsyslog("timer file name truncated to '%s'", file);
+ }
+ SetEvent(Event);
++ cStatus::MsgTimerCreation(this, Event); // PIN PATCH
+ }
+
+ cTimer::cTimer(const cTimer &Timer)
+@@ -161,6 +164,7 @@
+ stop = Timer.stop;
+ priority = Timer.priority;
+ lifetime = Timer.lifetime;
++ fskProtection = Timer.fskProtection; // PIN PATCH
+ strncpy(file, Timer.file, sizeof(file));
+ free(aux);
+ aux = Timer.aux ? strdup(Timer.aux) : NULL;
+@@ -355,6 +359,7 @@
+ result = false;
+ }
+ }
++ fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
+ free(channelbuffer);
+ free(daybuffer);
+ free(filebuffer);
+@@ -713,6 +718,36 @@
+ Matches(); // refresh start and end time
+ }
+
++void cTimer::SetFskProtection(int aFlag) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++ int res = 0;
++
++ fskProtection = aFlag;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ res = asprintf(&aux, "%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info from aux
++
++ res = asprintf(&tmp, "%.*s%s", (int)(p-aux), aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (res < 0) ; // memory problems :o
++
++ if (tmp)
++ free(tmp);
++}
++
+ // --- cTimers ---------------------------------------------------------------
+
+ cTimers Timers;
+--- ../vdr-1.7.33/timers.h 2012-12-07 14:13:40.000000000 +0100
++++ timers.h 2012-12-10 10:14:03.114016736 +0100
+@@ -38,6 +38,7 @@
+ int start;
+ int stop;
+ int priority;
++ int fskProtection; // PIN PATCH
+ int lifetime;
+ mutable char file[MaxFileName];
+ char *aux;
+@@ -59,6 +60,7 @@
+ int Start(void) const { return start; }
+ int Stop(void) const { return stop; }
+ int Priority(void) const { return priority; }
++ int FskProtection(void) const { return fskProtection; } // PIN PATCH
+ int Lifetime(void) const { return lifetime; }
+ const char *File(void) const { return file; }
+ time_t FirstDay(void) const { return weekdays ? day : 0; }
+@@ -95,6 +97,7 @@
+ void SetAux(const char *Aux);
+ void SetDeferred(int Seconds);
+ void SetFlags(uint Flags);
++ void SetFskProtection(int aFlag); // PIN PATCH
+ void ClrFlags(uint Flags);
+ void InvFlags(uint Flags);
+ bool HasFlags(uint Flags) const;
+--- ../vdr-1.7.33/vdr.c 2012-12-06 11:29:23.000000000 +0100
++++ vdr.c 2012-12-10 10:14:03.114016736 +0100
+@@ -65,6 +65,7 @@
+ #include "tools.h"
+ #include "transfer.h"
+ #include "videodir.h"
++#include "status.h" // PIN PATCH
+
+ #define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
+ #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
+@@ -947,6 +948,7 @@
+ cOsdObject *Interact = Menu ? Menu : cControl::Control();
+ eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());
+ if (ISREALKEY(key)) {
++ cStatus::MsgUserAction(key, Interact); // PIN PATCH
+ EITScanner.Activity();
+ // Cancel shutdown countdown:
+ if (ShutdownHandler.countdown)
+@@ -1019,10 +1021,12 @@
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
++ if (!cStatus::MsgPluginProtected(plugin)) {
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
++ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
+ }
+@@ -1235,9 +1239,11 @@
+ // Instant resume of the last viewed recording:
+ case kPlay:
+ if (cReplayControl::LastReplayed()) {
++ if (cStatus::MsgReplayProtected(0, cReplayControl::LastReplayed(), 0, false) == false) { // PIN PATCH
+ cControl::Shutdown();
+ cControl::Launch(new cReplayControl);
+ }
++ }
+ else
+ DirectMainFunction(osRecordings); // no last viewed recording, so enter the Recordings menu
+ break;
diff --git a/patches/vdr-2.0.2.diff b/patches/vdr-2.0.2.diff
new file mode 100644
index 0000000..81dcd22
--- /dev/null
+++ b/patches/vdr-2.0.2.diff
@@ -0,0 +1,420 @@
+--- ../vdr-2.0.2/device.c 2013-04-05 12:47:38.000000000 +0200
++++ device.c 2013-05-22 10:17:56.758196352 +0200
+@@ -722,6 +722,7 @@
+ cChannel *channel;
+ while ((channel = Channels.GetByNumber(n, Direction)) != NULL) {
+ // try only channels which are currently available
++ if (!cStatus::MsgChannelProtected(0, channel)) // PIN PATCH
+ if (GetDevice(channel, LIVEPRIORITY, true, true))
+ break;
+ n = channel->Number() + Direction;
+@@ -743,6 +744,12 @@
+
+ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
+ {
++ // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
++ // I really don't know, but it works ... // PIN PATCH
++
++ if (LiveView && cStatus::MsgChannelProtected(this, Channel)) // PIN PATCH
++ return scrNotAvailable; // PIN PATCH
++
+ cStatus::MsgChannelSwitch(this, 0, LiveView);
+
+ if (LiveView) {
+--- ../vdr-2.0.2/menu.c 2013-04-27 12:32:28.000000000 +0200
++++ menu.c 2013-05-22 10:26:55.198215394 +0200
+@@ -896,6 +896,18 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
++
++ // PIN PATCH
++ if (cOsd::pinValid || !data.fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&data.fskProtection));
++ else {
++ char* buf = 0;
++ int res = 0;
++ res = asprintf(&buf, "%s\t%s", tr("Childlock"), data.fskProtection ? tr("yes") : tr("no"));
++ if (res < 0) ; // memory problems :o
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
++
+ Add(file = new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file)));
+ SetFirstDayItem();
+ }
+@@ -2294,7 +2306,8 @@
+ }
+ }
+ }
+- if (*Item->Text() && !LastDir) {
++ if (*Item->Text() && !LastDir
++ && (!cStatus::MsgReplayProtected(Item->Recording(), Item->Name(), base, Item->IsDirectory(), true))) { // PIN PATCH
+ Add(Item);
+ LastItem = Item;
+ if (Item->IsDirectory())
+@@ -2345,6 +2358,9 @@
+ {
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
+ if (ri) {
++ if (cStatus::MsgReplayProtected(ri->Recording(), ri->Name(), base,
++ ri->IsDirectory()) == true) // PIN PATCH
++ return osContinue; // PIN PATCH
+ if (ri->IsDirectory())
+ Open();
+ else {
+@@ -3403,28 +3419,32 @@
+
+ // Basic menu items:
+
+- Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
+- Add(new cOsdItem(hk(tr("Channels")), osChannels));
+- Add(new cOsdItem(hk(tr("Timers")), osTimers));
+- Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
++ // PIN PATCH
++ if (!cStatus::MsgMenuItemProtected("Schedule", true)) Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
++ if (!cStatus::MsgMenuItemProtected("Channels", true)) Add(new cOsdItem(hk(tr("Channels")), osChannels));
++ if (!cStatus::MsgMenuItemProtected("Timers", true)) Add(new cOsdItem(hk(tr("Timers")), osTimers));
++ if (!cStatus::MsgMenuItemProtected("Recordings", true)) Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
+
+ // Plugins:
+
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p, true)) { // PIN PATCH
+ const char *item = p->MainMenuEntry();
+ if (item)
+ Add(new cMenuPluginItem(hk(item), i));
+ }
++ }
+ else
+ break;
+ }
+
+ // More basic menu items:
+
+- Add(new cOsdItem(hk(tr("Setup")), osSetup));
++ if (!cStatus::MsgMenuItemProtected("Setup", true)) Add(new cOsdItem(hk(tr("Setup")), osSetup)); // PIN PATCH
+ if (Commands.Count())
++ if (!cStatus::MsgMenuItemProtected("Commands", true)) // PIN PATCH
+ Add(new cOsdItem(hk(tr("Commands")), osCommands));
+
+ Update(true);
+@@ -3493,6 +3513,14 @@
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ HadSubMenu |= HasSubMenu();
+
++ // > PIN PATCH
++ cOsdItem* item = Get(Current());
++
++ if (item && item->Text() && state != osContinue && state != osUnknown && state != osBack)
++ if (cStatus::MsgMenuItemProtected(item->Text()))
++ return osContinue;
++ // PIN PATCH <
++
+ switch (state) {
+ case osSchedule: return AddSubMenu(new cMenuSchedule);
+ case osChannels: return AddSubMenu(new cMenuChannels);
+@@ -3518,6 +3546,7 @@
+ if (item) {
+ cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
+ cOsdObject *menu = p->MainMenuAction();
+ if (menu) {
+ if (menu->IsMenu())
+@@ -3529,6 +3558,7 @@
+ }
+ }
+ }
++ }
+ state = osEnd;
+ }
+ break;
+@@ -3699,6 +3729,7 @@
+ Channel = Direction > 0 ? Channels.Next(Channel) : Channels.Prev(Channel);
+ if (!Channel && Setup.ChannelsWrap)
+ Channel = Direction > 0 ? Channels.First() : Channels.Last();
++ if (!cStatus::MsgChannelProtected(0, Channel)) // PIN PATCH
+ if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, LIVEPRIORITY, true, true))
+ return Channel;
+ }
+@@ -4348,6 +4379,7 @@
+ for (int i = 0; i < MAXRECORDCONTROLS; i++) {
+ if (!RecordControls[i]) {
+ RecordControls[i] = new cRecordControl(device, Timer, Pause);
++ cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
+ return RecordControls[i]->Process(time(NULL));
+ }
+ }
+--- ../vdr-2.0.2/osd.c 2013-05-18 14:41:48.000000000 +0200
++++ osd.c 2013-05-22 10:17:56.758196352 +0200
+@@ -1623,6 +1623,7 @@
+ int cOsd::osdHeight = 0;
+ cVector<cOsd *> cOsd::Osds;
+ cMutex cOsd::mutex;
++bool cOsd::pinValid = false; // PIN PATCH
+
+ cOsd::cOsd(int Left, int Top, uint Level)
+ {
+--- ../vdr-2.0.2/osd.h 2013-02-12 14:39:08.000000000 +0100
++++ osd.h 2013-05-22 10:24:49.822210960 +0200
+@@ -926,6 +926,7 @@
+ ///< MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d);
+ ///< delete pm;
+ ///< }
++ static bool pinValid; // PIN PATCH
+ };
+
+ #define MAXOSDIMAGES 64
+--- ../vdr-2.0.2/status.c 2012-03-07 15:17:24.000000000 +0100
++++ status.c 2013-05-22 10:17:56.758196352 +0200
+@@ -124,3 +124,55 @@
+ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+ sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
+ }
++
++bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ChannelProtected(Device, Channel) == true)
++ return true;
++
++ return false;
++}
++
++bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ReplayProtected(Recording, Name, Base, isDirectory, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgRecordingFile(const char* FileName)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->RecordingFile(FileName);
++}
++
++void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->TimerCreation(Timer, Event);
++}
++
++bool cStatus::MsgPluginProtected(cPlugin* Plugin, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->PluginProtected(Plugin, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgUserAction(const eKeys key, const cOsdObject* Interact) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ sm->UserAction(key, Interact);
++}
++
++bool cStatus::MsgMenuItemProtected(const char* Name, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->MenuItemProtected(Name, menuView) == true)
++ return true;
++ return false;
++}
+--- ../vdr-2.0.2/status.h 2012-03-07 15:16:57.000000000 +0100
++++ status.h 2013-05-22 10:20:19.902201414 +0200
+@@ -14,6 +14,7 @@
+ #include "device.h"
+ #include "player.h"
+ #include "tools.h"
++#include "plugin.h"
+
+ enum eTimerChange { tcMod, tcAdd, tcDel };
+
+@@ -81,6 +82,22 @@
+ // The OSD displays the single line Text with the current channel information.
+ virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
+ // The OSD displays the given programme information.
++ virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
++ // Checks if a channel is protected.
++ virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a recording is protected.
++ virtual void RecordingFile(const char* FileName) {} // PIN PATCH
++ // The given DVB device has started recording to FileName. FileName is the name of the
++ // recording directory
++ virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
++ // The given timer is created
++ virtual bool PluginProtected(cPlugin* Plugin, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a plugin is protected.
++ virtual void UserAction(const eKeys key, const cOsdObject* Interact) {} // PIN PATCH
++ // report user action
++ virtual bool MenuItemProtected(const char* Name, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a menu entry is protected.
+ public:
+ cStatus(void);
+ virtual ~cStatus();
+@@ -102,6 +119,14 @@
+ static void MsgOsdTextItem(const char *Text, bool Scroll = false);
+ static void MsgOsdChannel(const char *Text);
+ static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
++ static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
++ static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false); // PIN PATCH
++ static void MsgRecordingFile(const char* FileName); // PIN PATCH
++ static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
++ static bool MsgPluginProtected(cPlugin* Plugin, int menuView = false); // PIN PATCH
++ static void MsgUserAction(const eKeys key, const cOsdObject* Interact);
++ static bool MsgMenuItemProtected(const char* Name, int menuView = false); // PIN PATCH
+ };
+
+ #endif //__STATUS_H
+--- ../vdr-2.0.2/timers.c 2013-03-29 16:37:16.000000000 +0100
++++ timers.c 2013-05-22 10:17:56.762196352 +0200
+@@ -76,6 +76,7 @@
+ stop -= 2400;
+ priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
+ lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ if (Instant && channel)
+ snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : channel->Name());
+ }
+@@ -110,10 +111,12 @@
+ stop -= 2400;
+ priority = Setup.DefaultPriority;
+ lifetime = Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ const char *Title = Event->Title();
+ if (!isempty(Title))
+ Utf8Strn0Cpy(file, Event->Title(), sizeof(file));
+ SetEvent(Event);
++ cStatus::MsgTimerCreation(this, Event); // PIN PATCH
+ }
+
+ cTimer::cTimer(const cTimer &Timer)
+@@ -149,6 +152,7 @@
+ stop = Timer.stop;
+ priority = Timer.priority;
+ lifetime = Timer.lifetime;
++ fskProtection = Timer.fskProtection; // PIN PATCH
+ strncpy(file, Timer.file, sizeof(file));
+ free(aux);
+ aux = Timer.aux ? strdup(Timer.aux) : NULL;
+@@ -331,6 +335,7 @@
+ result = false;
+ }
+ }
++ fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
+ free(channelbuffer);
+ free(daybuffer);
+ free(filebuffer);
+@@ -689,6 +694,36 @@
+ Matches(); // refresh start and end time
+ }
+
++void cTimer::SetFskProtection(int aFlag) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++ int res = 0;
++
++ fskProtection = aFlag;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ res = asprintf(&aux, "%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info from aux
++
++ res = asprintf(&tmp, "%.*s%s", (int)(p-aux), aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (res < 0) ; // memory problems :o
++
++ if (tmp)
++ free(tmp);
++}
++
+ // --- cTimers ---------------------------------------------------------------
+
+ cTimers Timers;
+--- ../vdr-2.0.2/timers.h 2013-03-11 11:35:53.000000000 +0100
++++ timers.h 2013-05-22 10:17:56.762196352 +0200
+@@ -38,6 +38,7 @@
+ int start;
+ int stop;
+ int priority;
++ int fskProtection; // PIN PATCH
+ int lifetime;
+ mutable char file[NAME_MAX * 2 + 1]; // *2 to be able to hold 'title' and 'episode', which can each be up to 255 characters long
+ char *aux;
+@@ -59,6 +60,7 @@
+ int Start(void) const { return start; }
+ int Stop(void) const { return stop; }
+ int Priority(void) const { return priority; }
++ int FskProtection(void) const { return fskProtection; } // PIN PATCH
+ int Lifetime(void) const { return lifetime; }
+ const char *File(void) const { return file; }
+ time_t FirstDay(void) const { return weekdays ? day : 0; }
+@@ -95,6 +97,7 @@
+ void SetAux(const char *Aux);
+ void SetDeferred(int Seconds);
+ void SetFlags(uint Flags);
++ void SetFskProtection(int aFlag); // PIN PATCH
+ void ClrFlags(uint Flags);
+ void InvFlags(uint Flags);
+ bool HasFlags(uint Flags) const;
+--- ../vdr-2.0.2/vdr.c 2013-03-15 11:44:54.000000000 +0100
++++ vdr.c 2013-05-22 10:17:56.762196352 +0200
+@@ -65,6 +65,7 @@
+ #include "tools.h"
+ #include "transfer.h"
+ #include "videodir.h"
++#include "status.h" // PIN PATCH
+
+ #define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
+ #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
+@@ -1015,6 +1016,7 @@
+ cOsdObject *Interact = Menu ? Menu : cControl::Control();
+ eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());
+ if (ISREALKEY(key)) {
++ cStatus::MsgUserAction(key, Interact); // PIN PATCH
+ EITScanner.Activity();
+ // Cancel shutdown countdown:
+ if (ShutdownHandler.countdown)
+@@ -1087,10 +1089,12 @@
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
++ if (!cStatus::MsgPluginProtected(plugin)) { // PIN PATCH
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
++ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
+ }
+@@ -1303,9 +1307,11 @@
+ // Instant resume of the last viewed recording:
+ case kPlay:
+ if (cReplayControl::LastReplayed()) {
++ if (cStatus::MsgReplayProtected(0, cReplayControl::LastReplayed(), 0, false) == false) { // PIN PATCH
+ cControl::Shutdown();
+ cControl::Launch(new cReplayControl);
+ }
++ }
+ else
+ DirectMainFunction(osRecordings); // no last viewed recording, so enter the Recordings menu
+ break;
diff --git a/patches/vdr-2.3.1.diff b/patches/vdr-2.3.1.diff
new file mode 100644
index 0000000..4ec4be9
--- /dev/null
+++ b/patches/vdr-2.3.1.diff
@@ -0,0 +1,432 @@
+--- ../vdr-2.3.1.plain//device.c 2015-09-05 13:42:17.000000000 +0200
++++ device.c 2015-10-09 16:43:27.982132231 +0200
+@@ -726,6 +726,7 @@
+ const cChannel *Channel;
+ while ((Channel = Channels->GetByNumber(n, Direction)) != NULL) {
+ // try only channels which are currently available
++ if (!cStatus::MsgChannelProtected(0, Channel)) // PIN PATCH
+ if (GetDevice(Channel, LIVEPRIORITY, true, true))
+ break;
+ n = Channel->Number() + Direction;
+@@ -747,6 +748,12 @@
+
+ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
+ {
++ // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
++ // I really don't know, but it works ... // PIN PATCH
++
++ if (LiveView && cStatus::MsgChannelProtected(this, Channel)) // PIN PATCH
++ return scrNotAvailable; // PIN PATCH
++
+ cStatus::MsgChannelSwitch(this, 0, LiveView);
+
+ if (LiveView) {
+--- ../vdr-2.3.1.plain//Makefile 2015-02-09 13:28:24.000000000 +0100
++++ Makefile 2015-10-12 08:49:55.734546896 +0200
+@@ -324,7 +324,7 @@
+ clean:
+ @$(MAKE) --no-print-directory -C $(LSIDIR) clean
+ @-rm -f $(OBJS) $(DEPFILE) vdr vdr.pc core* *~
+- @-rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot
++ @-rm -rf $(LOCALEDIR) $(PODIR)/*~ $(PODIR)/*.mo $(PODIR)/*.pot
+ @-rm -rf include
+ @-rm -rf srcdoc
+ CLEAN: clean
+--- ../vdr-2.3.1.plain//menu.c 2015-09-14 15:22:49.000000000 +0200
++++ menu.c 2015-10-09 16:26:16.481017293 +0200
+@@ -997,6 +997,18 @@
+ Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
+ Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
+ Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
++
++ // PIN PATCH
++ if (cOsd::pinValid || !data.fskProtection) Add(new cMenuEditBoolItem(tr("Childlock"),&data.fskProtection));
++ else {
++ char* buf = 0;
++ int res = 0;
++ res = asprintf(&buf, "%s\t%s", tr("Childlock"), data.fskProtection ? tr("yes") : tr("no"));
++ if (res < 0) ; // memory problems :o
++ Add(new cOsdItem(buf));
++ free(buf);
++ }
++
+ Add(file = new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file)));
+ SetFirstDayItem();
+ if (data.remote)
+@@ -2973,7 +2985,8 @@
+ }
+ }
+ }
+- if (*Item->Text() && !LastDir) {
++ if (*Item->Text() && !LastDir
++ && (!cStatus::MsgReplayProtected(Item->Recording(), Item->Name(), base, Item->IsDirectory(), true))) { // PIN PATCH
+ Add(Item);
+ LastItem = Item;
+ if (Item->IsDirectory())
+@@ -3041,6 +3054,9 @@
+ {
+ cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
+ if (ri) {
++ if (cStatus::MsgReplayProtected(ri->Recording(), ri->Name(), base,
++ ri->IsDirectory()) == true) // PIN PATCH
++ return osContinue; // PIN PATCH
+ if (ri->IsDirectory())
+ Open();
+ else {
+@@ -4282,28 +4298,32 @@
+
+ // Basic menu items:
+
+- Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
+- Add(new cOsdItem(hk(tr("Channels")), osChannels));
+- Add(new cOsdItem(hk(tr("Timers")), osTimers));
+- Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
++ // PIN PATCH
++ if (!cStatus::MsgMenuItemProtected("Schedule", true)) Add(new cOsdItem(hk(tr("Schedule")), osSchedule));
++ if (!cStatus::MsgMenuItemProtected("Channels", true)) Add(new cOsdItem(hk(tr("Channels")), osChannels));
++ if (!cStatus::MsgMenuItemProtected("Timers", true)) Add(new cOsdItem(hk(tr("Timers")), osTimers));
++ if (!cStatus::MsgMenuItemProtected("Recordings", true)) Add(new cOsdItem(hk(tr("Recordings")), osRecordings));
+
+ // Plugins:
+
+ for (int i = 0; ; i++) {
+ cPlugin *p = cPluginManager::GetPlugin(i);
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p, true)) { // PIN PATCH
+ const char *item = p->MainMenuEntry();
+ if (item)
+ Add(new cMenuPluginItem(hk(item), i));
+ }
++ }
+ else
+ break;
+ }
+
+ // More basic menu items:
+
+- Add(new cOsdItem(hk(tr("Setup")), osSetup));
++ if (!cStatus::MsgMenuItemProtected("Setup", true)) Add(new cOsdItem(hk(tr("Setup")), osSetup)); // PIN PATCH
+ if (Commands.Count())
++ if (!cStatus::MsgMenuItemProtected("Commands", true)) // PIN PATCH
+ Add(new cOsdItem(hk(tr("Commands")), osCommands));
+
+ Update(true);
+@@ -4372,6 +4392,14 @@
+ eOSState state = cOsdMenu::ProcessKey(Key);
+ HadSubMenu |= HasSubMenu();
+
++ // > PIN PATCH
++ cOsdItem* item = Get(Current());
++
++ if (item && item->Text() && state != osContinue && state != osUnknown && state != osBack)
++ if (cStatus::MsgMenuItemProtected(item->Text()))
++ return osContinue;
++ // PIN PATCH <
++
+ switch (state) {
+ case osSchedule: return AddSubMenu(new cMenuSchedule);
+ case osChannels: return AddSubMenu(new cMenuChannels);
+@@ -4396,6 +4424,7 @@
+ if (item) {
+ cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
+ if (p) {
++ if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
+ cOsdObject *menu = p->MainMenuAction();
+ if (menu) {
+ if (menu->IsMenu())
+@@ -4407,6 +4436,7 @@
+ }
+ }
+ }
++ }
+ state = osEnd;
+ }
+ break;
+@@ -4576,6 +4606,7 @@
+ Channel = Direction > 0 ? Channels->Next(Channel) : Channels->Prev(Channel);
+ if (!Channel && Setup.ChannelsWrap)
+ Channel = Direction > 0 ? Channels->First() : Channels->Last();
++ if (!cStatus::MsgChannelProtected(0, Channel)) // PIN PATCH
+ if (Channel && !Channel->GroupSep() && cDevice::GetDevice(Channel, LIVEPRIORITY, true, true))
+ return Channel;
+ }
+@@ -5226,6 +5257,7 @@
+ for (int i = 0; i < MAXRECORDCONTROLS; i++) {
+ if (!RecordControls[i]) {
+ RecordControls[i] = new cRecordControl(device, Timers, Timer, Pause);
++ cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
+ return RecordControls[i]->Process(time(NULL));
+ }
+ }
+--- ../vdr-2.3.1.plain//osd.c 2015-09-10 16:12:06.000000000 +0200
++++ osd.c 2015-10-09 16:10:13.400241634 +0200
+@@ -1644,6 +1644,7 @@
+ cSize cOsd::maxPixmapSize(2048, 2048);
+ cVector<cOsd *> cOsd::Osds;
+ cMutex cOsd::mutex;
++bool cOsd::pinValid = false; // PIN PATCH
+
+ cOsd::cOsd(int Left, int Top, uint Level)
+ {
+--- ../vdr-2.3.1.plain//osd.h 2015-04-19 14:18:25.000000000 +0200
++++ osd.h 2015-10-09 16:10:13.400241634 +0200
+@@ -952,6 +952,7 @@
+ ///<
+ ///< If a plugin uses a derived cPixmap implementation, it needs to use that
+ ///< type instead of cPixmapMemory.
++ static bool pinValid; // PIN PATCH
+ };
+
+ #define MAXOSDIMAGES 64
+--- ../vdr-2.3.1.plain//status.c 2014-01-25 11:47:39.000000000 +0100
++++ status.c 2015-10-12 10:41:28.695735498 +0200
+@@ -130,3 +130,55 @@
+ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+ sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
+ }
++
++bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ChannelProtected(Device, Channel) == true)
++ return true;
++
++ return false;
++}
++
++bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->ReplayProtected(Recording, Name, Base, isDirectory, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgRecordingFile(const char* FileName)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->RecordingFile(FileName);
++}
++
++void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
++ sm->TimerCreation(Timer, Event);
++}
++
++bool cStatus::MsgPluginProtected(cPlugin* Plugin, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->PluginProtected(Plugin, menuView) == true)
++ return true;
++ return false;
++}
++
++void cStatus::MsgUserAction(const eKeys key) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ sm->UserAction(key);
++}
++
++bool cStatus::MsgMenuItemProtected(const char* Name, int menuView) // PIN PATCH
++{
++ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
++ if (sm->MenuItemProtected(Name, menuView) == true)
++ return true;
++ return false;
++}
+--- ../vdr-2.3.1.plain//status.h 2015-08-02 12:34:44.000000000 +0200
++++ status.h 2015-10-12 10:41:15.287669011 +0200
+@@ -14,6 +14,7 @@
+ #include "device.h"
+ #include "player.h"
+ #include "tools.h"
++#include "plugin.h"
+
+ enum eTimerChange { tcMod, tcAdd, tcDel }; // tcMod is obsolete and no longer used!
+
+@@ -81,6 +82,23 @@
+ // The OSD displays the single line Text with the current channel information.
+ virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
+ // The OSD displays the given programme information.
++ virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
++ // Checks if a channel is protected.
++ virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a recording is protected.
++ virtual void RecordingFile(const char* FileName) {} // PIN PATCH
++ // The given DVB device has started recording to FileName. FileName is the name of the
++ // recording directory
++ virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
++ // The given timer is created
++ virtual bool PluginProtected(cPlugin* Plugin, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a plugin is protected.
++ virtual void UserAction(const eKeys key) {} // PIN PATCH
++ // report user action
++ virtual bool MenuItemProtected(const char* Name, int menuView = false) { return false; } // PIN PATCH
++ // Checks if a menu entry is protected.
++
+ public:
+ cStatus(void);
+ virtual ~cStatus();
+@@ -103,6 +121,14 @@
+ static void MsgOsdTextItem(const char *Text, bool Scroll = false);
+ static void MsgOsdChannel(const char *Text);
+ static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
++ static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
++ static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
++ const char* Base, bool isDirectory, int menuView = false); // PIN PATCH
++ static void MsgRecordingFile(const char* FileName); // PIN PATCH
++ static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
++ static bool MsgPluginProtected(cPlugin* Plugin, int menuView = false); // PIN PATCH
++ static void MsgUserAction(const eKeys key); // PIN PATCH
++ static bool MsgMenuItemProtected(const char* Name, int menuView = false); // PIN PATCH
+ };
+
+ #endif //__STATUS_H
+--- ../vdr-2.3.1.plain//timers.c 2015-09-13 15:10:24.000000000 +0200
++++ timers.c 2015-10-09 16:10:13.404241653 +0200
+@@ -77,6 +77,7 @@
+ stop -= 2400;
+ priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
+ lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ if (Instant && channel)
+ snprintf(file, sizeof(file), "%s%s", Setup.MarkInstantRecord ? "@" : "", *Setup.NameInstantRecord ? Setup.NameInstantRecord : channel->Name());
+ }
+@@ -114,10 +115,12 @@
+ stop -= 2400;
+ priority = Setup.DefaultPriority;
+ lifetime = Setup.DefaultLifetime;
++ fskProtection = 0; // PIN PATCH
+ const char *Title = Event->Title();
+ if (!isempty(Title))
+ Utf8Strn0Cpy(file, Event->Title(), sizeof(file));
+ SetEvent(Event);
++ cStatus::MsgTimerCreation(this, Event); // PIN PATCH
+ }
+
+ cTimer::cTimer(const cTimer &Timer)
+@@ -156,6 +159,7 @@
+ stop = Timer.stop;
+ priority = Timer.priority;
+ lifetime = Timer.lifetime;
++ fskProtection = Timer.fskProtection; // PIN PATCH
+ strncpy(file, Timer.file, sizeof(file));
+ free(aux);
+ aux = Timer.aux ? strdup(Timer.aux) : NULL;
+@@ -344,6 +348,7 @@
+ result = false;
+ }
+ }
++ fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
+ free(channelbuffer);
+ free(daybuffer);
+ free(filebuffer);
+@@ -708,6 +713,36 @@
+ Matches(); // refresh start and end time
+ }
+
++void cTimer::SetFskProtection(int aFlag) // PIN PATCH
++{
++ char* p;
++ char* tmp = 0;
++ int res = 0;
++
++ fskProtection = aFlag;
++
++ if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // add protection info to aux
++
++ if (aux) { tmp = strdup(aux); free(aux); }
++ res = asprintf(&aux, "%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
++ }
++ else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
++ {
++ // remove protection info from aux
++
++ res = asprintf(&tmp, "%.*s%s", (int)(p-aux), aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
++ free(aux);
++ aux = strdup(tmp);
++ }
++
++ if (res < 0) ; // memory problems :o
++
++ if (tmp)
++ free(tmp);
++}
++
+ // --- cTimers ---------------------------------------------------------------
+
+ cTimers cTimers::timers;
+--- ../vdr-2.3.1.plain//timers.h 2015-09-09 12:40:24.000000000 +0200
++++ timers.h 2015-10-09 16:10:13.404241653 +0200
+@@ -39,6 +39,7 @@
+ int start;
+ int stop;
+ int priority;
++ int fskProtection; // PIN PATCH
+ int lifetime;
+ mutable char file[NAME_MAX * 2 + 1]; // *2 to be able to hold 'title' and 'episode', which can each be up to 255 characters long
+ char *aux;
+@@ -62,6 +63,7 @@
+ int Start(void) const { return start; }
+ int Stop(void) const { return stop; }
+ int Priority(void) const { return priority; }
++ int FskProtection(void) const { return fskProtection; } // PIN PATCH
+ int Lifetime(void) const { return lifetime; }
+ const char *File(void) const { return file; }
+ time_t FirstDay(void) const { return weekdays ? day : 0; }
+@@ -102,6 +104,7 @@
+ void SetRemote(const char *Remote);
+ void SetDeferred(int Seconds);
+ void SetFlags(uint Flags);
++ void SetFskProtection(int aFlag); // PIN PATCH
+ void ClrFlags(uint Flags);
+ void InvFlags(uint Flags);
+ bool HasFlags(uint Flags) const;
+--- ../vdr-2.3.1.plain//vdr.c 2015-09-11 10:02:50.000000000 +0200
++++ vdr.c 2015-10-12 10:40:33.159460108 +0200
+@@ -71,6 +71,7 @@
+ #include "tools.h"
+ #include "transfer.h"
+ #include "videodir.h"
++#include "status.h" // PIN PATCH
+
+ #define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
+ #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
+@@ -1153,6 +1154,7 @@
+ cOsdObject *Interact = Menu ? Menu : cControl::Control();
+ eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());
+ if (ISREALKEY(key)) {
++ cStatus::MsgUserAction(key); // PIN PATCH
+ EITScanner.Activity();
+ // Cancel shutdown countdown:
+ if (ShutdownHandler.countdown)
+@@ -1225,10 +1227,12 @@
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
++ if (!cStatus::MsgPluginProtected(plugin)) { // PIN PATCH
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
++ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
+ }
+@@ -1446,9 +1450,11 @@
+ // Instant resume of the last viewed recording:
+ case kPlay:
+ if (cReplayControl::LastReplayed()) {
++ if (cStatus::MsgReplayProtected(0, cReplayControl::LastReplayed(), 0, false) == false) { // PIN PATCH
+ cControl::Shutdown();
+ cControl::Launch(new cReplayControl);
+ }
++ }
+ else
+ DirectMainFunction(osRecordings); // no last viewed recording, so enter the Recordings menu
+ break;