diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2010-01-02 14:02:48 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2010-01-02 14:02:48 +0100 |
commit | b5edaaa7ccb55ae13f197be2b40c8de460233fd4 (patch) | |
tree | 1a6f3d053256becd8f05286ca862afccf2b3b753 /cutter.c | |
parent | 0faae7c3f04abc13049b1a526a3d05a36e28d014 (diff) | |
download | vdr-b5edaaa7ccb55ae13f197be2b40c8de460233fd4.tar.gz vdr-b5edaaa7ccb55ae13f197be2b40c8de460233fd4.tar.bz2 |
Implemented --edit and --genindex options
Diffstat (limited to 'cutter.c')
-rw-r--r-- | cutter.c | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -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; +} |