]> git.vomp.tv Git - vompserver.git/commitdiff
Shutdown VDR Patch from Yaris 0-4-1-dev
authorChris Tallon <chris@vomp.tv>
Sat, 2 Mar 2013 15:46:51 +0000 (15:46 +0000)
committerChris Tallon <chris@vomp.tv>
Sat, 2 Mar 2013 15:46:51 +0000 (15:46 +0000)
vompclient.h
vompclientrrproc.c
vompclientrrproc.h

index cab15990ec68e57591e32781ad6211fb402e3cc5..4ec905e1430858126b38b9baadc05926eabc7789 100644 (file)
@@ -78,9 +78,9 @@ class VompClient
 
   private:
     static int nr_clients;
-    void incClients();
-    void decClients();
-
+    static void incClients();
+    static void decClients();
+    
     static ULLONG ntohll(ULLONG a);
     static ULLONG htonll(ULLONG a);
     
index 588472183699ba1181f4446077cba796208d72ee..4698eb3e8469783a53e5ee43dbd7eb276257e40a 100644 (file)
@@ -27,6 +27,7 @@
 #include <vdr/plugin.h>
 #include <vdr/timers.h>
 #include <vdr/menu.h>
+#include <vdr/remote.h>
 #include "recplayer.h"
 #include "mvpreceiver.h"
 #endif
@@ -42,7 +43,7 @@
 
 bool ResumeIDLock;
 
-ULONG VompClientRRProc::VOMP_PROTOCOL_VERSION = 0x00000200;
+ULONG VompClientRRProc::VOMP_PROTOCOL_VERSION = 0x00000301;
 // format is aabbccdd
 // cc is release protocol version, increase with every release, that changes protocol
 // dd is development protocol version, set to zero at every release, 
@@ -258,7 +259,10 @@ bool VompClientRRProc::processPacket()
     case 23:
       result = processDeleteTimer();
       break;
-#endif        
+    case 666:
+      result = processVDRShutdown();
+      break;
+#endif
     case VDR_GETMEDIALIST:
       result = processGetMediaList();
       break;
@@ -1938,6 +1942,17 @@ int VompClientRRProc::processGetMarks()
   return 1;
 }
 
+int VompClientRRProc::processVDRShutdown()
+{
+  log->log("RRProc", Log::DEBUG, "Trying to shutdown VDR");
+  VompClient::decClients(); // Temporarily make this client disappear
+  cRemote::Put(kPower);
+  VompClient::incClients();
+  resp->finalise();
+  x.tcp.sendPacket(resp->getPtr(), resp->getLen());
+  return 1;
+}
+  
 #endif // !VOMPSTANDALONE
 
 
index 8e7bc7be9c0219b4e9f48272672df1ea0e327d0a..da6ef12bbc1b5f09f2ef42287c50757477bf3a3e 100644 (file)
@@ -81,6 +81,7 @@ class VompClientRRProc : public Thread
     int processGetChannelPids();
     int processDeleteTimer();
     int processReScanRecording();           // FIXME obselete
+    int processVDRShutdown();
 #endif
     int processLogin();
     int processConfigSave();
@@ -93,7 +94,7 @@ class VompClientRRProc : public Thread
     int processGetLanguageList();
     int processGetLanguageContent();
     int processSetCharset();
-
+    
     void threadMethod();
 
     VompClient& x;