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
|
diff -NaurwB streamdev-unpatched/common.h streamdev/common.h
--- streamdev-unpatched/common.h 2009-09-18 12:41:41.000000000 +0200
+++ streamdev/common.h 2009-11-23 04:54:04.000000000 +0100
@@ -57,6 +57,8 @@
si_Count
};
+#define MAX_RESPONSE_SIZE 1024
+
extern const char *VERSION;
class cMenuEditIpItem: public cMenuEditItem {
diff -NaurwB streamdev-unpatched/server/connectionVTP.c streamdev/server/connectionVTP.c
--- streamdev-unpatched/server/connectionVTP.c 2009-10-13 08:38:47.000000000 +0200
+++ streamdev/server/connectionVTP.c 2009-11-23 14:23:33.000000000 +0100
@@ -1714,3 +1714,69 @@
Code < 0 ? -Code : Code,
Code < 0 ? '-' : ' ', *str);
}
+
+void cConnectionVTP::TimerChange(const cTimer *Timer, eTimerChange Change)
+{
+ if (m_DataSocket) {
+ char buf[MAX_RESPONSE_SIZE];
+ if (Change == tcMod) {
+ snprintf(buf, MAX_RESPONSE_SIZE, "MODT %s\0", Timer ? *Timer->ToText(true) : "-");
+ }
+ if (Change == tcAdd) {
+ snprintf(buf, MAX_RESPONSE_SIZE, "ADDT %s\0", Timer ? *Timer->ToText(true) : "-");
+ }
+ if (Change == tcDel) {
+ snprintf(buf, MAX_RESPONSE_SIZE, "DELT %s\0", Timer ? *Timer->ToText(true) : "-");
+ }
+
+ m_DataSocket->SysWrite(buf, strlen(buf));
+ }
+}
+
+#ifdef USE_STATUS_EXTENSION
+void cConnectionVTP::OsdStatusMessage(eMessageType type, const char *Message)
+#else
+void cConnectionVTP::OsdStatusMessage(const char *Message)
+#endif
+{
+ if (m_DataSocket && Message) {
+ char buf[MAX_RESPONSE_SIZE];
+
+ /* Ignore this messages */
+ if (strcasecmp(Message, trVDR("Channel not available!")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete timer?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete recording?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Press any key to cancel shutdown")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Press any key to cancel restart")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Editing - shut down anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Recording - shut down anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("shut down anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Recording - restart anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Editing - restart anyway?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete channel?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Timer still recording - really delete?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete marks information?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Delete resume information?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("CAM is in use - really reset?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Really restart?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Stop recording?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Cancel editing?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("Cutter already running - Add to cutting queue?")) == 0) return;
+ else if (strcasecmp(Message, trVDR("No index-file found. Creating may take minutes. Create one?")) == 0) return;
+
+#ifdef USE_STATUS_EXTENSION
+ if (type == mtStatus)
+ snprintf(buf, MAX_RESPONSE_SIZE, "SMSG %s\0", Message);
+ else if (type == mtInfo)
+ snprintf(buf, MAX_RESPONSE_SIZE, "IMSG %s\0", Message);
+ else if (type == mtWarning)
+ snprintf(buf, MAX_RESPONSE_SIZE, "WMSG %s\0", Message);
+ else if (type == mtError)
+ snprintf(buf, MAX_RESPONSE_SIZE, "EMSG %s\0", Message);
+ else
+#endif
+ snprintf(buf, MAX_RESPONSE_SIZE, "IMSG %s\0", Message);
+
+ m_DataSocket->SysWrite(buf, strlen(buf));
+ }
+}
diff -NaurwB streamdev-unpatched/server/connectionVTP.h streamdev/server/connectionVTP.h
--- streamdev-unpatched/server/connectionVTP.h 2009-07-01 12:46:16.000000000 +0200
+++ streamdev/server/connectionVTP.h 2009-11-23 14:23:33.000000000 +0100
@@ -1,6 +1,7 @@
#ifndef VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
#define VDR_STREAMDEV_SERVERS_CONNECTIONVTP_H
+#include <vdr/status.h>
#include "server/connection.h"
#include "server/recplayer.h"
@@ -12,7 +13,8 @@
class cLSTTHandler;
class cLSTRHandler;
-class cConnectionVTP: public cServerConnection {
+class cConnectionVTP: public cServerConnection
+ , public cStatus {
friend class cLSTEHandler;
#if !defined __GNUC__ || __GNUC__ >= 3
using cServerConnection::Respond;
@@ -41,6 +43,13 @@
template<class cHandler>
bool CmdLSTX(cHandler *&Handler, char *Option);
+ virtual void TimerChange(const cTimer *Timer, eTimerChange Change);
+#ifdef USE_STATUS_EXTENSION
+ virtual void OsdStatusMessage(eMessageType type, const char *Message);
+#else
+ virtual void OsdStatusMessage(const char *Message);
+#endif
+
public:
cConnectionVTP(void);
virtual ~cConnectionVTP();
|