1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../vdr-pin/pin-vdr-dev.diff
5 # Copyright (C) 2007 - 2008 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 --- vdr-1.5.11/osd.c.orig 2007-10-12 14:38:36.000000000 +0200
18 +++ vdr-1.5.11/osd.c 2007-11-15 17:41:53.000000000 +0100
21 int cOsd::osdWidth = 0;
22 int cOsd::osdHeight = 0;
23 +bool cOsd::pinValid = false; // PIN PATCH
24 cVector<cOsd *> cOsd::Osds;
26 cOsd::cOsd(int Left, int Top, uint Level)
27 --- vdr-1.5.11/vdr.c.orig 2007-11-03 15:46:29.000000000 +0100
28 +++ vdr-1.5.11/vdr.c 2007-11-15 17:45:53.000000000 +0100
30 cOsdObject *Interact = Menu ? Menu : cControl::Control();
31 eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());
33 + cStatus::MsgUserAction(key, Interact); // PIN PATCH
34 EITScanner.Activity();
35 // Cancel shutdown countdown:
36 if (ShutdownHandler.countdown)
38 cControl::Control()->Hide();
39 cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
41 + if (!cStatus::MsgPluginProtected(plugin)) { // PIN PATCH
42 Menu = plugin->MainMenuAction();
48 esyslog("ERROR: unknown plugin '%s'", PluginName);
50 --- vdr-1.5.11/menu.c.orig 2007-11-15 01:20:44.000000000 +0100
51 +++ vdr-1.5.11/menu.c 2007-11-15 17:38:34.000000000 +0100
53 Add(new cMenuEditBitItem( tr("VPS"), &data.flags, tfVps));
54 Add(new cMenuEditIntItem( tr("Priority"), &data.priority, 0, MAXPRIORITY));
55 Add(new cMenuEditIntItem( tr("Lifetime"), &data.lifetime, 0, MAXLIFETIME));
56 + Add(new cMenuEditBoolItem(tr("Child protection"), &data.fskProtection)); // PIN PATCH
57 Add(new cMenuEditStrItem( tr("File"), data.file, sizeof(data.file)));
62 cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
64 + if (cStatus::MsgReplayProtected(GetRecording(ri), ri->Name(), base,
65 + ri->IsDirectory()) == true) // PIN PATCH
66 + return osContinue; // PIN PATCH
67 if (ri->IsDirectory())
72 cPlugin *p = cPluginManager::GetPlugin(item->PluginIndex());
74 + if (!cStatus::MsgPluginProtected(p)) { // PIN PATCH
75 cOsdObject *menu = p->MainMenuAction();
87 for (int i = 0; i < MAXRECORDCONTROLS; i++) {
88 if (!RecordControls[i]) {
89 RecordControls[i] = new cRecordControl(device, Timer, Pause);
90 + cStatus::MsgRecordingFile(RecordControls[i]->FileName()); // PIN PATCH
91 return RecordControls[i]->Process(time(NULL));
94 --- vdr/timers.c.orig 2008-02-16 15:47:40.000000000 +0100
95 +++ vdr/timers.c 2008-03-07 20:41:54.000000000 +0100
98 priority = Pause ? Setup.PausePriority : Setup.DefaultPriority;
99 lifetime = Pause ? Setup.PauseLifetime : Setup.DefaultLifetime;
100 + fskProtection = 0; // PIN PATCH
105 Utf8Strn0Cpy(file, Event->Title(), sizeof(file));
107 event = NULL; // let SetEvent() be called to get a log message
108 + cStatus::MsgTimerCreation(this, Event); // PIN PATCH
111 cTimer::cTimer(const cTimer &Timer)
114 priority = Timer.priority;
115 lifetime = Timer.lifetime;
116 + fskProtection = Timer.fskProtection; // PIN PATCH
117 strncpy(file, Timer.file, sizeof(file));
119 aux = Timer.aux ? strdup(Timer.aux) : NULL;
124 + fskProtection = aux && strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>"); // PIN PATCH
129 Matches(); // refresh start and end time
132 +void cTimer::SetFskProtection(int aFlag) // PIN PATCH
137 + fskProtection = aFlag;
139 + if (fskProtection && (!aux || !strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
141 + // add protection info to aux
143 + if (aux) { tmp = strdup(aux); free(aux); }
144 + asprintf(&aux,"%s<pin-plugin><protected>yes</protected></pin-plugin>", tmp ? tmp : "");
146 + else if (!fskProtection && aux && (p = strstr(aux, "<pin-plugin><protected>yes</protected></pin-plugin>")))
148 + // remove protection info to aux
150 + asprintf(&tmp, "%.*s%s", p-aux, aux, p+strlen("<pin-plugin><protected>yes</protected></pin-plugin>"));
159 // --- cTimers ---------------------------------------------------------------
162 --- vdr-1.5.11/device.c.orig 2007-11-03 14:30:09.000000000 +0100
163 +++ vdr-1.5.11/device.c 2007-11-15 17:35:40.000000000 +0100
165 if (NumUsableSlots && !CamSlots.Get(j)->Assign(device[i], true))
166 continue; // CAM slot can't be used with this device
168 + if (cStatus::MsgChannelProtected(0, Channel) == false) // PIN PATCH
169 if (device[i]->ProvidesChannel(Channel, Priority, &ndr)) { // this device is basicly able to do the job
170 if (NumUsableSlots && device[i]->CamSlot() && device[i]->CamSlot() != CamSlots.Get(j))
171 ndr = true; // using a different CAM slot requires detaching receivers
174 eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
176 + // I hope 'LiveView = false' indicates a channel switch for recording, // PIN PATCH
177 + // I really don't know, but it works ... // PIN PATCH
178 + if (LiveView && cStatus::MsgChannelProtected(this, Channel) == true) // PIN PATCH
179 + return scrNotAvailable; // PIN PATCH
183 DELETENULL(liveSubtitle);
184 --- vdr-1.5.11/osd.h.orig 2007-10-12 16:28:44.000000000 +0200
185 +++ vdr-1.5.11/osd.h 2007-11-15 01:20:44.000000000 +0100
187 ///< 7: vertical, falling, upper
188 virtual void Flush(void);
189 ///< Actually commits all data to the OSD hardware.
190 + static bool pinValid; // PIN PATCH
194 --- vdr-1.5.11/status.c.orig 2005-12-31 16:10:10.000000000 +0100
195 +++ vdr-1.5.11/status.c 2007-11-15 01:20:44.000000000 +0100
197 for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
198 sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle);
201 +bool cStatus::MsgChannelProtected(const cDevice* Device, const cChannel* Channel) // PIN PATCH
203 + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
204 + if (sm->ChannelProtected(Device, Channel) == true)
210 +bool cStatus::MsgReplayProtected(const cRecording* Recording, const char* Name,
211 + const char* Base, bool isDirectory) // PIN PATCH
213 + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
214 + if (sm->ReplayProtected(Recording, Name, Base, isDirectory) == true)
220 +void cStatus::MsgRecordingFile(const char* FileName)
222 + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
223 + sm->RecordingFile(FileName);
226 +void cStatus::MsgTimerCreation(cTimer* Timer, const cEvent *Event)
228 + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) // PIN PATCH
229 + sm->TimerCreation(Timer, Event);
232 +bool cStatus::MsgPluginProtected(cPlugin* Plugin) // PIN PATCH
234 + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
235 + if (sm->PluginProtected(Plugin) == true)
241 +void cStatus::MsgUserAction(const eKeys key, const cOsdObject* Interact) // PIN PATCH
243 + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
244 + sm->UserAction(key, Interact);
246 --- vdr-1.5.11/status.h.orig 2007-08-12 12:34:40.000000000 +0200
247 +++ vdr-1.5.11/status.h 2007-11-15 01:20:44.000000000 +0100
254 class cStatus : public cListObject {
257 // The OSD displays the single line Text with the current channel information.
258 virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {}
259 // The OSD displays the given programme information.
260 + virtual bool ChannelProtected(const cDevice *Device, const cChannel* Channel) { return false; } // PIN PATCH
261 + // Checks if a channel is protected.
262 + virtual bool ReplayProtected(const cRecording* Recording, const char* Name,
263 + const char* Base, bool isDirectory) { return false; } // PIN PATCH
264 + // Checks if a recording is protected.
265 + virtual void RecordingFile(const char* FileName) {} // PIN PATCH
266 + // The given DVB device has started recording to FileName. FileName is the name of the
267 + // recording directory
268 + virtual void TimerCreation(cTimer* Timer, const cEvent *Event) {} // PIN PATCH
269 + // The given timer is created
270 + virtual bool PluginProtected(cPlugin* Plugin) { return false; } // PIN PATCH
271 + // Checks if a plugin is protected.
272 + virtual void UserAction(const eKeys key, const cOsdObject* Interact) {} // PIN PATCH
273 + // report user action
280 static void MsgOsdTextItem(const char *Text, bool Scroll = false);
281 static void MsgOsdChannel(const char *Text);
282 static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle);
283 + static bool MsgChannelProtected(const cDevice* Device, const cChannel* Channel); // PIN PATCH
284 + static bool MsgReplayProtected(const cRecording* Recording, const char* Name,
285 + const char* Base, bool isDirectory); // PIN PATCH
286 + static void MsgRecordingFile(const char* FileName); // PIN PATCH
287 + static void MsgTimerCreation(cTimer* Timer, const cEvent *Event); // PIN PATCH
288 + static bool MsgPluginProtected(cPlugin* Plugin); // PIN PATCH
289 + static void MsgUserAction(const eKeys key, const cOsdObject* Interact); // PIN PATCH
293 --- vdr-1.5.11/timers.h.orig 2007-06-03 15:24:58.000000000 +0200
294 +++ vdr-1.5.11/timers.h 2007-11-15 01:20:44.000000000 +0100
299 + int fskProtection; // PIN PATCH
301 char file[MaxFileName];
304 int Start(void) const { return start; }
305 int Stop(void) const { return stop; }
306 int Priority(void) const { return priority; }
307 + int FskProtection(void) const { return fskProtection; } // PIN PATCH
308 int Lifetime(void) const { return lifetime; }
309 const char *File(void) const { return file; }
310 time_t FirstDay(void) const { return weekdays ? day : 0; }
312 void SetInVpsMargin(bool InVpsMargin);
313 void SetPriority(int Priority);
314 void SetFlags(uint Flags);
315 + void SetFskProtection(int aFlag); // PIN PATCH
316 void ClrFlags(uint Flags);
317 void InvFlags(uint Flags);
318 bool HasFlags(uint Flags) const;