]> git.vomp.tv Git - vompclient.git/commitdiff
Add recording 'Mark as new' functionality
authorChris Tallon <chris@vomp.tv>
Sun, 29 Sep 2019 16:13:27 +0000 (17:13 +0100)
committerChris Tallon <chris@vomp.tv>
Sun, 29 Sep 2019 16:13:27 +0000 (17:13 +0100)
recording.cc
recording.h
vdr.cc
vdr.h
vdrcommand.h
vrecording.cc
vrecording.h

index 374f3ff6e46aad021c0c0042ae9184c4bb7a9626..c50aed2b8978da28e8ba4895f4c1397c9a743ba9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2019 Chris Tallon
 
     This file is part of VOMP.
 
@@ -260,3 +260,8 @@ MarkList* Recording::getMarkList()
 {
   return markList;
 }
+
+void Recording::resetResume()
+{
+  vdr->deleteRecResume(fileName);
+}
index 745d7a0a7a99fc8954ff3ca743b5ec39b32c428d..ba6d1a897691293633e351fd658543d22b1e8449 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2019 Chris Tallon
 
     This file is part of VOMP.
 
@@ -49,6 +49,7 @@ class Recording
     void dropRecInfo();
 
     bool getNew() { return isNew; }
+    void resetResume();
     bool isRadio(bool &h264);
     bool IsPesRecording;
 
diff --git a/vdr.cc b/vdr.cc
index 611e4579934c2911f6e6dd639596e76a44ce1d91..a9bb49b2544924e17fa4f3f36889b5d12a074449 100644 (file)
--- a/vdr.cc
+++ b/vdr.cc
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2008 Chris Tallon
+    Copyright 2004-2019 Chris Tallon
 
     This file is part of VOMP.
 
@@ -45,7 +45,7 @@
 #include "tvmedia.h"
 #include <climits>
 
-#define VOMP_PROTOCOLL_VERSION 0x00000400
+#define VOMP_PROTOCOLL_VERSION 0x00000401
 
 VDR* VDR::instance = NULL;
 #ifdef VOMP_MEDIAPLAYER
@@ -833,6 +833,21 @@ int VDR::deleteRecording(char* fileName)
   return toReturn;
 }
 
+int VDR::deleteRecResume(char* fileName)
+{
+  VDR_RequestPacket vrp;
+  if (!vrp.init(VDR_DELETERECRESUME, true, strlen(fileName) + 1)) return 0;
+  if (!vrp.addString(fileName)) return 0;
+
+  VDR_ResponsePacket* vresp = RequestResponse(&vrp);
+  if (vresp->noResponse()) { delete vresp; return 0; }
+
+  int toReturn = (int)vresp->extractULONG();
+  delete vresp;
+
+  return toReturn;
+}
+
 char* VDR::moveRecording(char* fileName, char* newPath)
 {
   VDR_RequestPacket vrp;
diff --git a/vdr.h b/vdr.h
index 6a7c07289be9c4876b40ca695d03c304602b81da..0994cb0ec0247f1645073d8049448c042daf3888 100644 (file)
--- a/vdr.h
+++ b/vdr.h
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon
+    Copyright 2004-2019 Chris Tallon
 
     This file is part of VOMP.
 
@@ -177,6 +177,7 @@ public ExternLogger
     bool          getRecordingsList(RecMan* recman);
     RecInfo*      getRecInfo(char* fileName);
     int           deleteRecording(char* fileName);
+    int           deleteRecResume(char* fileName);
     char*         moveRecording(char* fileName, char* newPath);
     ULLONG        streamRecording(char* fileName, ULONG* lengthFrames, bool* IsPesRecording);
     ULLONG        positionFromFrameNumber(ULONG frameNumber);
index 28b54927f42e268318337f829ba13a94e959eb0c..b7208aef1f4939e7cabf9573f7dbfb67e918f002 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2005 Chris Tallon, Andreas Vogel
+    Copyright 2004-2019 Chris Tallon, Andreas Vogel
 
     This file is part of VOMP.
 
@@ -42,6 +42,7 @@ const static ULONG VDR_RESPONSE_FLAG =0x1000000;
 const static ULONG VDR_LOGIN               = 1;
 const static ULONG VDR_GETRECORDINGLIST    = 2;
 const static ULONG VDR_DELETERECORDING     = 3;
+const static ULONG VDR_DELETERECRESUME     = 4;
 const static ULONG VDR_GETCHANNELLIST      = 5;
 const static ULONG VDR_STREAMCHANNEL       = 6;
 const static ULONG VDR_GETBLOCK            = 7;
index 5f99d8a15daea28cf8be42c5a7531d88d8987536..837478c8158f424fb2bb9f2b8e8606ddf9a812e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2008 Chris Tallon
+    Copyright 2004-2019 Chris Tallon
 
     This file is part of VOMP.
 
@@ -129,6 +129,7 @@ VRecording::VRecording(RecMan* trecman, Recording* trec)
 
   button[PLAY].setText(tr("Play"));
   button[RESUME].setText(tr("Resume"));
+  button[MARKASNEW].setText(tr("Mark as new"));
   button[MOVE].setText(tr("Move"));
   button[A_DELETE].setText(tr("Delete"));
   
@@ -240,6 +241,12 @@ int VRecording::handleCommand(int command)
                                return 4;
                        }
 
+                       if (selected == MARKASNEW)
+            {
+              rec->resetResume();
+              return 2;
+            }
+
                        if (selected == MOVE)
                        {
                                VRecMove* vrm = new VRecMove(recman);
index ca5eac17f6380b3ee299b36a7f9ab7c4d8657997..faf8d0dac0764a2c5d4d3ef75f59960ab3949928 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright 2004-2008 Chris Tallon
+    Copyright 2004-2019 Chris Tallon
 
     This file is part of VOMP.
 
@@ -52,7 +52,7 @@ class VRecording : public TBBoxx
     Recording* rec;
     WTabBar tabbar;
 
-    enum Action { PLAY=0, RESUME, MOVE, A_DELETE, last };
+    enum Action { PLAY=0, RESUME, MARKASNEW, MOVE, A_DELETE, last };
     WButton button[last];
 //    WButton buttonPlay;        // 1
 //    WButton buttonResume;      // 2