From patchwork Tue Jul 5 06:13:03 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Milz X-Patchwork-Id: 11936 Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de ident=qmailr) by www.linuxtv.org with esmtp (Exim 4.34) id 1Dpgxg-0003My-G5 for vdr@linuxtv.org; Tue, 05 Jul 2005 08:31:16 +0200 Received: (qmail 41958 invoked by uid 66); 5 Jul 2005 06:31:14 -0000 Received: from seneca by colin2.muc.de with UUCP; Tue Jul 5 06:31:14 2005 -0000 Received: from nathan.muc.de (nathan [192.168.20.2]) by seneca.muc.de (Postfix) with ESMTP id 6D73F50BAEC for ; Tue, 5 Jul 2005 08:13:03 +0200 (CEST) Received: by nathan.muc.de (Postfix, from userid 2425) id 60B4584C45; Tue, 5 Jul 2005 08:13:03 +0200 (CEST) From: Harald Milz To: vdr@linuxtv.org Summary: Keywords: User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (Linux/2.6.8-24.14-default (x86_64)) Message-Id: <20050705061303.60B4584C45@nathan.muc.de> Date: Tue, 5 Jul 2005 08:13:03 +0200 (CEST) Subject: [vdr] CUTR patch for vdr-1.3.27 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 06:31:16 -0000 Status: O X-Status: X-Keywords: X-UID: 3422 Hi, I recently upgraded my main vdr to 1.3.27 and applied my CUTR patch... feel free to use and comment :-) diff -ur vdr-1.3.27/svdrp.c vdr-1.3.27-CUTR/svdrp.c --- vdr-1.3.27/svdrp.c 2005-05-26 11:59:09.000000000 +0200 +++ vdr-1.3.27-CUTR/svdrp.c 2005-07-03 10:25:58.304310180 +0200 @@ -36,6 +36,7 @@ #include "timers.h" #include "tools.h" #include "videodir.h" +#include "cutter.h" // --- cSocket --------------------------------------------------------------- @@ -184,6 +185,10 @@ " it returns the current channel number and name.", "CLRE\n" " Clear the entire EPG list.", + "CUTR \n" + " Cut the numbered recording. Before a recording can be\n" + " cut, an LSTR command must have been executed in order to retrieve\n" + " the recording numbers." "DELC \n" " Delete channel.", "DELR \n" @@ -466,6 +471,31 @@ Reply(550, "Unable to find channel \"%d\"", cDevice::CurrentChannel()); } +void cSVDRP::CmdCUTR(const char *Option) +{ + if (*Option) { + if (isnumber(Option)) { + cRecording *recording = Recordings.Get(strtol(Option, NULL, 10) - 1); + if (recording) { + if (cCutter::Start(recording->FileName())) { + Reply(250, "Cutting recording \"%s\"", recording->FileName()); + ::Recordings.Load(); // must make sure the global recordings list is updated + } + else + Reply(554, "Error while cutting recording!"); + } + else + Reply(550, "Recording \"%s\" not found%s", recording->FileName(), Recordings.Count() ? "" : " (use LSTR before cutting)"); + } + else + Reply(501, "Error in recording number \"%s\"", Option); + } + else + Reply(501, "Missing recording number"); +} + + + void cSVDRP::CmdCLRE(const char *Option) { cSchedules::ClearAll(); @@ -1122,6 +1152,7 @@ s = skipspace(s); if (CMD("CHAN")) CmdCHAN(s); else if (CMD("CLRE")) CmdCLRE(s); + else if (CMD("CUTR")) CmdCUTR(s); else if (CMD("DELC")) CmdDELC(s); else if (CMD("DELR")) CmdDELR(s); else if (CMD("DELT")) CmdDELT(s); diff -ur vdr-1.3.27/svdrp.h vdr-1.3.27-CUTR/svdrp.h --- vdr-1.3.27/svdrp.h 2004-01-17 14:30:52.000000000 +0100 +++ vdr-1.3.27-CUTR/svdrp.h 2005-07-03 10:25:58.305310034 +0200 @@ -54,6 +54,7 @@ void Reply(int Code, const char *fmt, ...); void CmdCHAN(const char *Option); void CmdCLRE(const char *Option); + void CmdCUTR(const char *Option); void CmdDELC(const char *Option); void CmdDELR(const char *Option); void CmdDELT(const char *Option);