summaryrefslogtreecommitdiff
path: root/cutter.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-01-02 14:02:48 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2010-01-02 14:02:48 +0100
commitb5edaaa7ccb55ae13f197be2b40c8de460233fd4 (patch)
tree1a6f3d053256becd8f05286ca862afccf2b3b753 /cutter.c
parent0faae7c3f04abc13049b1a526a3d05a36e28d014 (diff)
downloadvdr-b5edaaa7ccb55ae13f197be2b40c8de460233fd4.tar.gz
vdr-b5edaaa7ccb55ae13f197be2b40c8de460233fd4.tar.bz2
Implemented --edit and --genindex options
Diffstat (limited to 'cutter.c')
-rw-r--r--cutter.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/cutter.c b/cutter.c
index e83c5ac1..ff6b4edb 100644
--- a/cutter.c
+++ b/cutter.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: cutter.c 2.3 2009/04/19 10:56:33 kls Exp $
+ * $Id: cutter.c 2.4 2010/01/02 13:08:08 kls Exp $
*/
#include "cutter.h"
@@ -274,3 +274,31 @@ bool cCutter::Ended(void)
ended = false;
return result;
}
+
+#define CUTTINGCHECKINTERVAL 500 // ms between checks for the active cutting process
+
+bool CutRecording(const char *FileName)
+{
+ if (DirectoryOk(FileName)) {
+ cRecording Recording(FileName);
+ if (Recording.Name()) {
+ cMarks Marks;
+ if (Marks.Load(FileName, Recording.FramesPerSecond(), Recording.IsPesRecording()) && Marks.Count()) {
+ if (cCutter::Start(FileName)) {
+ while (cCutter::Active())
+ cCondWait::SleepMs(CUTTINGCHECKINTERVAL);
+ return true;
+ }
+ else
+ fprintf(stderr, "can't start editing process\n");
+ }
+ else
+ fprintf(stderr, "'%s' has no editing marks\n", FileName);
+ }
+ else
+ fprintf(stderr, "'%s' is not a recording\n", FileName);
+ }
+ else
+ fprintf(stderr, "'%s' is not a directory\n", FileName);
+ return false;
+}