updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / vdr / timercmd-0.1_1.6.0.diff
blobf45f70ac206047faa35e6d21e7418190a3c9c142
1 diff -Nru vdr-1.6.0/config.c vdr-1.6.0-patched/config.c
2 --- vdr-1.6.0/config.c 2008-02-17 14:39:00.000000000 +0100
3 +++ vdr-1.6.0-patched/config.c 2008-04-29 22:55:41.000000000 +0200
4 @@ -125,6 +125,7 @@
6 cCommands Commands;
7 cCommands RecordingCommands;
8 +cCommands TimerCommands;
10 // --- cSVDRPhosts -----------------------------------------------------------
12 diff -Nru vdr-1.6.0/config.h vdr-1.6.0-patched/config.h
13 --- vdr-1.6.0/config.h 2008-03-23 11:26:10.000000000 +0100
14 +++ vdr-1.6.0-patched/config.h 2008-04-29 22:55:41.000000000 +0200
15 @@ -168,6 +168,7 @@
17 extern cCommands Commands;
18 extern cCommands RecordingCommands;
19 +extern cCommands TimerCommands;
20 extern cSVDRPhosts SVDRPhosts;
22 class cSetupLine : public cListObject {
23 diff -Nru vdr-1.6.0/menu.c vdr-1.6.0-patched/menu.c
24 --- vdr-1.6.0/menu.c 2008-03-16 12:15:28.000000000 +0100
25 +++ vdr-1.6.0-patched/menu.c 2008-04-29 22:55:41.000000000 +0200
26 @@ -772,8 +772,20 @@
27 return state;
30 -// --- cMenuTimerItem --------------------------------------------------------
31 +// --- cMenuCommands ---------------------------------------------------------
32 +// declaration shifted so it can be used in cMenuTimers
33 +class cMenuCommands : public cOsdMenu {
34 +private:
35 + cCommands *commands;
36 + char *parameters;
37 + eOSState Execute(void);
38 +public:
39 + cMenuCommands(const char *Title, cCommands *Commands, const char *Parameters = NULL);
40 + virtual ~cMenuCommands();
41 + virtual eOSState ProcessKey(eKeys Key);
42 + };
44 +// --- cMenuTimerItem --------------------------------------------------------
45 class cMenuTimerItem : public cOsdItem {
46 private:
47 cTimer *timer;
48 @@ -836,6 +848,7 @@
49 eOSState OnOff(void);
50 eOSState Info(void);
51 cTimer *CurrentTimer(void);
52 + eOSState Commands(eKeys Key = kNone);
53 void SetHelpKeys(void);
54 public:
55 cMenuTimers(void);
56 @@ -952,6 +965,53 @@
57 return osContinue;
60 +#define CHECK_2PTR_NULL(x_,y_) ((x_)? ((y_)? y_:""):"")
62 +eOSState cMenuTimers::Commands(eKeys Key)
64 + if (HasSubMenu() || Count() == 0)
65 + return osContinue;
66 + cTimer *ti = CurrentTimer();
67 + if (ti) {
68 + char *parameter = NULL;
69 + const cEvent *pEvent = ti->Event();
70 + int iRecNumber=0;
72 + if(!pEvent) {
73 + Timers.SetEvents();
74 + pEvent = ti->Event();
75 + }
76 + if(pEvent) {
77 +// create a dummy recording to get the real filename
78 + cRecording *rc_dummy = new cRecording(ti, pEvent);
79 + Recordings.Load();
80 + cRecording *rc = Recordings.GetByName(rc_dummy->FileName());
82 + delete rc_dummy;
83 + if(rc)
84 + iRecNumber=rc->Index() + 1;
85 + }
86 +//Parameter format TimerNumber 'ChannelId' Start Stop 'Titel' 'Subtitel' 'file' RecNumer
87 +// 1 2 3 4 5 6 7 8
88 + asprintf(&parameter, "%d '%s' %d %d '%s' '%s' '%s' %d", ti->Index(),
89 + *ti->Channel()->GetChannelID().ToString(),
90 + (int)ti->StartTime(),
91 + (int)ti->StopTime(),
92 + CHECK_2PTR_NULL(pEvent, pEvent->Title()),
93 + CHECK_2PTR_NULL(pEvent, pEvent->ShortText()),
94 + ti->File(),
95 + iRecNumber);
96 + isyslog("timercmd: %s", parameter);
97 + cMenuCommands *menu;
98 + eOSState state = AddSubMenu(menu = new cMenuCommands(tr("Timer commands"), &TimerCommands, parameter));
99 + free(parameter);
100 + if (Key != kNone)
101 + state = menu->ProcessKey(Key);
102 + return state;
104 + return osContinue;
107 eOSState cMenuTimers::ProcessKey(eKeys Key)
109 int TimerNumber = HasSubMenu() ? Count() : -1;
110 @@ -966,6 +1026,8 @@
111 case kInfo:
112 case kBlue: return Info();
113 break;
114 + case k1...k9: return Commands(Key);
115 + case k0: return (TimerCommands.Count()? Commands():osContinue);
116 default: break;
119 @@ -1548,17 +1610,6 @@
121 // --- cMenuCommands ---------------------------------------------------------
123 -class cMenuCommands : public cOsdMenu {
124 -private:
125 - cCommands *commands;
126 - char *parameters;
127 - eOSState Execute(void);
128 -public:
129 - cMenuCommands(const char *Title, cCommands *Commands, const char *Parameters = NULL);
130 - virtual ~cMenuCommands();
131 - virtual eOSState ProcessKey(eKeys Key);
132 - };
134 cMenuCommands::cMenuCommands(const char *Title, cCommands *Commands, const char *Parameters)
135 :cOsdMenu(Title)
137 diff -Nru vdr-1.6.0/po/de_DE.po vdr-1.6.0-patched/po/de_DE.po
138 --- vdr-1.6.0/po/de_DE.po 2008-03-23 11:31:29.000000000 +0100
139 +++ vdr-1.6.0-patched/po/de_DE.po 2008-04-29 22:55:41.000000000 +0200
140 @@ -381,6 +381,9 @@
141 msgid "Timer still recording - really delete?"
142 msgstr "Timer zeichnet auf - trotzdem löschen?"
144 +msgid "Timer commands"
145 +msgstr "Befehle für Timer"
147 msgid "Event"
148 msgstr "Sendung"
150 diff -Nru vdr-1.6.0/vdr.c vdr-1.6.0-patched/vdr.c
151 --- vdr-1.6.0/vdr.c 2008-03-14 14:22:39.000000000 +0100
152 +++ vdr-1.6.0-patched/vdr.c 2008-04-29 22:55:41.000000000 +0200
153 @@ -569,6 +569,7 @@
154 Timers.Load(AddDirectory(ConfigDirectory, "timers.conf")) &&
155 Commands.Load(AddDirectory(ConfigDirectory, "commands.conf"), true) &&
156 RecordingCommands.Load(AddDirectory(ConfigDirectory, "reccmds.conf"), true) &&
157 + TimerCommands.Load(AddDirectory(ConfigDirectory, "timercmds.conf"), true) &&
158 SVDRPhosts.Load(AddDirectory(ConfigDirectory, "svdrphosts.conf"), true) &&
159 Keys.Load(AddDirectory(ConfigDirectory, "remote.conf")) &&
160 KeyMacros.Load(AddDirectory(ConfigDirectory, "keymacros.conf"), true)