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();