summaryrefslogtreecommitdiff
path: root/myreplaycontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'myreplaycontrol.c')
-rw-r--r--myreplaycontrol.c58
1 files changed, 46 insertions, 12 deletions
diff --git a/myreplaycontrol.c b/myreplaycontrol.c
index 5305746..d929272 100644
--- a/myreplaycontrol.c
+++ b/myreplaycontrol.c
@@ -2,16 +2,21 @@
* See the README file for copyright information and how to reach the author.
*/
+#include <string>
#include <vdr/interface.h>
#include <vdr/status.h>
#include <vdr/menu.h>
+#include <vdr/cutter.h>
#include "myreplaycontrol.h"
#include "mymenusetup.h"
+#include "tools.h"
using namespace std;
-char *myReplayControl::Cut=NULL;
-char *myReplayControl::Cutted=NULL;
+myReplayControl::myReplayControl()
+{
+ timesearchactive=false;
+}
myReplayControl::~myReplayControl()
{
@@ -21,18 +26,47 @@ myReplayControl::~myReplayControl()
eOSState myReplayControl::ProcessKey(eKeys Key)
{
- if(Key==kBack)
- return osEnd;
-
- if(Key==kEditCut)
+ if(Key!=kNone)
{
- free(Cut);
- Cut=strdup(LastReplayed());
+ if(Key==kBack)
+ return osEnd;
+
+ if(timesearchactive)
+ {
+ if(Key<k0 && Key>k9)
+ timesearchactive=false;
+ }
+ else
+ {
+ if(Key==kEditCut)
+ {
+ const char *filename=NowReplaying();
- cRecording recording(LastReplayed());
- free(Cutted);
- Cutted=strdup(recording.PrefixFileName('%'));
+ if(filename)
+ {
+ if(MoveCutterThread->IsCutting(filename))
+ Skins.Message(mtError,tr("Recording already in cutter queue!"));
+ else
+ {
+ cMarks marks;
+ marks.Load(filename);
+
+ if(!marks.Count())
+ Skins.Message(mtError,tr("No editing marks defined!"));
+ else
+ {
+ MoveCutterThread->AddToCutterQueue(filename);
+ Skins.Message(mtInfo,tr("Added recording to cutter queue"));
+ }
+ }
+ }
+ return osContinue;
+ }
+
+ if(Key==kRed)
+ timesearchactive=true;
+ }
}
-
+
return cReplayControl::ProcessKey(Key);
}