This is a "patch" for the Video Disk Recorder (VDR). * Description: Apply this patch to VDR if you want to see remote timers in skin LCARS' main menu view. * Installation Change into the VDR source directory, then issue patch -p0 < path/to/vdr-skinlcars.patch and recompile. --- skinlcars.c.orig 2012-06-03 12:17:00.000000000 +0200 +++ skinlcars.c 2012-06-22 22:32:55.000000000 +0200 @@ -30,6 +30,19 @@ #include "themes.h" #include "videodir.h" +// BEGIN remotetimers_skinlcars.patch +#include "plugin.h" +#include "PLUGINS/src/remotetimers/remotetimers.h" + +namespace PluginRemoteTimers { + // copy of timers.c CompareTimers + static int CompareTimers(const void *a, const void *b) + { + return (*(const cTimer **)a)->Compare(**(const cTimer **)b); + } +} +// END remotetimers_skinlcars.patch + #include "symbols/arrowdown.xpm" #include "symbols/arrowup.xpm" #include "symbols/audio.xpm" @@ -1158,12 +1171,25 @@ void cSkinLCARSDisplayMenu::DrawTimers(void) { - if (Timers.Modified(lastTimersState)) { + static cPlugin* pRemoteTimers = cPluginManager::CallFirstService("RemoteTimers::RefreshTimers-v1.0", NULL); + cString errorMsg; + bool drawRemoteTimers = false; + if (pRemoteTimers && initial) { + drawRemoteTimers = pRemoteTimers->Service("RemoteTimers::RefreshTimers-v1.0", &errorMsg); + } + + if (Timers.Modified(lastTimersState) || drawRemoteTimers) { deviceRecording.Clear(); const cFont *font = cFont::GetFont(fontOsd); osd->DrawRectangle(xs00, ys04, xs04 - 1, ys05 - 1, Theme.Color(clrBackground)); osd->DrawRectangle(xs07, ys04, xs13 - 1, ys05 - 1, Theme.Color(clrBackground)); cSortedTimers SortedTimers; + if (drawRemoteTimers) { + cTimer* timer = NULL; + while (pRemoteTimers->Service("RemoteTimers::ForEach-v1.0", &timer) && timer != NULL) + SortedTimers.Append(timer); + SortedTimers.Sort(PluginRemoteTimers::CompareTimers); + } cVector FreeDeviceSlots; int NumDevices = 0; int y = ys04; @@ -1175,7 +1201,7 @@ if (y + lineHeight > ys05) break; if (const cTimer *Timer = SortedTimers[i]) { - if (Timer->Recording()) { + if (Timer->Recording() && cRecordControls::GetRecordControl(Timer)) { if (cRecordControl *RecordControl = cRecordControls::GetRecordControl(Timer)) { if (!Device || Device == RecordControl->Device()) { DrawTimer(Timer, y, NumTimers > 0); @@ -1233,6 +1259,8 @@ } osd->DrawText(xs02, ys00, itoa(NumTimers), Theme.Color(clrMenuFrameFg), frameColor, font, xs03 - xs02, ys01 - ys00, taBottom | taLeft | taBorder); osd->DrawText(xs08, ys00, itoa(NumDevices), Theme.Color(clrMenuFrameFg), frameColor, font, xs09 - xs08, ys01 - ys00, taBottom | taRight | taBorder); + if (*errorMsg) + SetMessage(mtError, *errorMsg); lastSignalDisplay = 0; initial = true; // forces redrawing of devices }