-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvdr-remote_instant_recordings.diff
207 lines (200 loc) · 8.78 KB
/
vdr-remote_instant_recordings.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
diff -Nur vdr-1.7.35.orig/config.h vdr-1.7.35/config.h
--- vdr-1.7.35.orig/config.h 2013-01-06 15:47:15.614512393 +0100
+++ vdr-1.7.35/config.h 2013-01-06 15:54:59.851117859 +0100
@@ -42,6 +42,8 @@
#define JUMPPLAYVERSNUM 110
+#define REMOTEINSTANTVERSION 1.0
+
#define MAXPRIORITY 99
#define MINPRIORITY (-MAXPRIORITY)
#define LIVEPRIORITY 0 // priority used when selecting a device for live viewing
diff -Nur vdr-1.7.35.orig/config.h.orig vdr-1.7.35/config.h.orig
--- vdr-1.7.35.orig/config.h.orig 2013-01-06 14:51:32.684416009 +0100
+++ vdr-1.7.35/config.h.orig 2013-01-06 15:47:15.614512393 +0100
@@ -256,6 +256,7 @@
char OSDLanguage[I18N_MAX_LOCALE_LEN];
char OSDSkin[MaxSkinName];
char OSDTheme[MaxThemeName];
+ int WarEagleIcons;
int PrimaryDVB;
int ShowInfoOnChSwitch;
int TimeoutRequChInfo;
@@ -276,6 +277,7 @@
int MarginStart, MarginStop;
int AudioLanguages[I18N_MAX_LANGUAGES + 1];
int DisplaySubtitles;
+ int SupportTeletext;
int SubtitleLanguages[I18N_MAX_LANGUAGES + 1];
int SubtitleOffset;
int SubtitleFgTransparency, SubtitleBgTransparency;
diff -Nur vdr-1.7.35.orig/menu.c vdr-1.7.35/menu.c
--- vdr-1.7.35.orig/menu.c 2013-01-06 15:47:15.617845736 +0100
+++ vdr-1.7.35/menu.c 2013-01-06 15:54:59.851117859 +0100
@@ -35,6 +35,8 @@
#include "videodir.h"
#include "menuorgpatch.h"
+#include "remotetimers.h"
+
#define MAXWAIT4EPGINFO 3 // seconds
#define MODETIMEOUT 3 // seconds
#define NEWTIMERLIMIT 120 // seconds until the start time of a new timer created from the Schedule menu,
@@ -4786,6 +4788,50 @@
bool cRecordControls::Start(cTimer *Timer, bool Pause)
{
+ if (!Timer) {
+ cTimer *t = new cTimer(true, Pause);
+
+ //get event
+ cSchedulesLock SchedulesLock;
+ const cEvent *event = NULL;;
+ const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
+ if (Schedules) {
+ const cSchedule *Schedule = Schedules->GetSchedule(t->Channel());
+ if (Schedule) {
+ event = Schedule->GetEventAround(t->StartTime() + INSTANT_REC_EPG_LOOKAHEAD);
+ }
+ }
+
+ if (cPluginManager::GetPlugin("timersync")) {
+ // sets the file name
+ cRecording recording(t, event);
+ Timers.Add(t);
+ Timers.SetModified();
+ if (!cReplayControl::LastReplayed())
+ cReplayControl::SetRecording(recording.FileName());
+ return true;
+ }
+ else {
+ RemoteTimers_InstantRecording_v1_0 ir;
+ ir.timer = t;
+ ir.pause = Pause;
+ ir.event = event;
+ ir.name = NULL;
+ ir.fileName = NULL;
+
+ if (cPluginManager::CallFirstService("RemoteTimers::InstantRecording-v1.0", &ir)) {
+ if (!cReplayControl::LastReplayed())
+ cReplayControl::SetRecording(ir.fileName);
+ delete t;
+ // empty names indicate an error
+ return *ir.fileName && *ir.name;
+ }
+ // service disabled or an error occured and the user confirmed local recording
+ // fall through to local instant recording
+ }
+ delete t;
+ }
+
static time_t LastNoDiskSpaceMessage = 0;
int FreeMB = 0;
if (Timer) {
diff -Nur vdr-1.7.35.orig/menu.c.orig vdr-1.7.35/menu.c.orig
--- vdr-1.7.35.orig/menu.c.orig 2013-01-06 15:42:16.374485187 +0100
+++ vdr-1.7.35/menu.c.orig 2013-01-06 15:47:15.617845736 +0100
@@ -8,6 +8,7 @@
*/
#include "menu.h"
+#include "iconpatch.h"
#include <ctype.h>
#include <limits.h>
#include <math.h>
@@ -319,6 +320,14 @@
if (!channel->GroupSep()) {
if (sortMode == csmProvider)
buffer = cString::sprintf("%d\t%s - %s", channel->Number(), channel->Provider(), channel->Name());
+ else if (Setup.WarEagleIcons) {
+ if (channel->Vpid() == 1 || channel->Vpid() == 0)
+ buffer = cString::sprintf("%d\t%s %-30s", channel->Number(), IsLangUtf8() ? ICON_RADIO_UTF8 : ICON_RADIO, channel->Name());
+ else if (channel->Ca() == 0)
+ buffer = cString::sprintf("%d\t%s %-30s", channel->Number(), IsLangUtf8() ? ICON_TV_UTF8 : ICON_TV, channel->Name());
+ else
+ buffer = cString::sprintf("%d\t%s %-30s", channel->Number(), IsLangUtf8() ? ICON_TV_CRYPTED_UTF8 : ICON_TV_CRYPTED, channel->Name());
+ }
else
buffer = cString::sprintf("%d\t%s", channel->Number(), channel->Name());
}
@@ -1053,9 +1062,9 @@
File = timer->File();
cCharSetConv csc("ISO-8859-1", cCharSetConv::SystemCharacterTable());
char diskStatusString[2] = { diskStatus, 0 };
- SetText(cString::sprintf("%s%c\t%d\t%s%s%s\t%02d:%02d\t%02d:%02d\t%s",
+ SetText(cString::sprintf("%s%s\t%d\t%s%s%s\t%02d:%02d\t%02d:%02d\t%s",
csc.Convert(diskStatusString),
- !(timer->HasFlags(tfActive)) ? ' ' : timer->FirstDay() ? '!' : timer->Recording() ? '#' : '>',
+ !(timer->HasFlags(tfActive)) ? " " : timer->FirstDay() ? Setup.WarEagleIcons ? IsLangUtf8() ? ICON_ARROW_UTF8 : ICON_ARROW : "!" : timer->Recording() ? Setup.WarEagleIcons ? IsLangUtf8() ? ICON_REC_UTF8 : ICON_REC : "#" : Setup.WarEagleIcons ? IsLangUtf8() ? ICON_CLOCK_UTF8 : ICON_CLOCK : ">",
timer->Channel()->Number(),
*name,
*name && **name ? " " : "",
@@ -1451,7 +1460,12 @@
return r;
}
-static const char *TimerMatchChars = " tT";
+static const char *TimerMatchChars[9] =
+{
+ " ", "t", "T",
+ ICON_BLANK, ICON_CLOCK_UH, ICON_CLOCK,
+ ICON_BLANK_UTF8, ICON_CLOCK_UH_UTF8, ICON_CLOCK_UTF8
+};
bool cMenuScheduleItem::Update(bool Force)
{
@@ -1460,17 +1474,17 @@
Timers.GetMatch(event, &timerMatch);
if (Force || timerMatch != OldTimerMatch) {
cString buffer;
- char t = TimerMatchChars[timerMatch];
- char v = event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' ';
- char r = event->SeenWithin(30) && event->IsRunning() ? '*' : ' ';
+ const char *t = Setup.WarEagleIcons ? IsLangUtf8() ? TimerMatchChars[timerMatch+6] : TimerMatchChars[timerMatch+3] : TimerMatchChars[timerMatch];
+ const char *v = event->Vps() && (event->Vps() - event->StartTime()) ? Setup.WarEagleIcons ? IsLangUtf8() ? ICON_VPS_UTF8 : ICON_VPS : "V" : " ";
+ const char *r = event->SeenWithin(30) && event->IsRunning() ? Setup.WarEagleIcons ? IsLangUtf8() ? ICON_RUNNING_UTF8 : ICON_RUNNING : "*" : " ";
const char *csn = channel ? channel->ShortName(true) : NULL;
cString eds = event->GetDateString();
if (channel && withDate)
- buffer = cString::sprintf("%d\t%.*s\t%.*s\t%s\t%c%c%c\t%s", channel->Number(), Utf8SymChars(csn, 999), csn, Utf8SymChars(eds, 6), *eds, *event->GetTimeString(), t, v, r, event->Title());
+ buffer = cString::sprintf("%d\t%.*s\t%.*s\t%s\t%s%s%s\t%s", channel->Number(), Utf8SymChars(csn, 999), csn, Utf8SymChars(eds, 6), *eds, *event->GetTimeString(), t, v, r, event->Title());
else if (channel)
- buffer = cString::sprintf("%d\t%.*s\t%s\t%c%c%c\t%s", channel->Number(), Utf8SymChars(csn, 999), csn, *event->GetTimeString(), t, v, r, event->Title());
+ buffer = cString::sprintf("%d\t%.*s\t%s\t%s%s%s\t%s", channel->Number(), Utf8SymChars(csn, 999), csn, *event->GetTimeString(), t, v, r, event->Title());
else
- buffer = cString::sprintf("%.*s\t%s\t%c%c%c\t%s", Utf8SymChars(eds, 6), *eds, *event->GetTimeString(), t, v, r, event->Title());
+ buffer = cString::sprintf("%.*s\t%s\t%s%s%s\t%s", Utf8SymChars(eds, 6), *eds, *event->GetTimeString(), t, v, r, event->Title());
SetText(buffer);
result = true;
}
@@ -2912,6 +2926,7 @@
Add(new cMenuEditStraItem(tr("Setup.OSD$Skin"), &skinIndex, numSkins, skinDescriptions));
if (themes.NumThemes())
Add(new cMenuEditStraItem(tr("Setup.OSD$Theme"), &themeIndex, themes.NumThemes(), themes.Descriptions()));
+ Add(new cMenuEditBoolItem(tr("Setup.OSD$WarEagle icons"), &data.WarEagleIcons));
Add(new cMenuEditPrcItem( tr("Setup.OSD$Left (%)"), &data.OSDLeftP, 0.0, 0.5));
Add(new cMenuEditPrcItem( tr("Setup.OSD$Top (%)"), &data.OSDTopP, 0.0, 0.5));
Add(new cMenuEditPrcItem( tr("Setup.OSD$Width (%)"), &data.OSDWidthP, 0.5, 1.0));
diff -Nur vdr-1.7.35.orig/remotetimers.h vdr-1.7.35/remotetimers.h
--- vdr-1.7.35.orig/remotetimers.h 1970-01-01 01:00:00.000000000 +0100
+++ vdr-1.7.35/remotetimers.h 2013-01-06 15:54:59.851117859 +0100
@@ -0,0 +1,25 @@
+/*
+ * remotetimers.h: Public interface of the plugin's services
+ *
+ * See the README file for copyright information and how to reach the author.
+ */
+
+#ifndef _SERVICE__H
+#define _SERVICE__H
+
+#ifndef __TIMERS_H
+#include <vdr/timer.h>
+#include <vdr/epg.h>
+#endif
+
+struct RemoteTimers_InstantRecording_v1_0 {
+//in
+ const cTimer *timer;
+ bool pause;
+ const cEvent *event;
+//out
+ cString name;
+ cString fileName;
+};
+
+#endif //_SERVICE__H