From patchwork Mon Mar 27 06:47:18 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 12238 Received: from server08.mainz-net.com ([213.131.235.212]) by www.linuxtv.org with esmtp (Exim 4.50) id 1FNlVb-0006eg-3M for vdr@linuxtv.org; Mon, 27 Mar 2006 08:47:23 +0200 Received: from [192.168.0.103] (unknown [80.120.117.30]) by server08.mainz-net.com (server08.mainz-net.com) with ESMTP id 768045C5C7 for ; Mon, 27 Mar 2006 08:47:23 +0200 (CEST) Message-ID: <44278A76.1020707@visual-page.de> Date: Mon, 27 Mar 2006 08:47:18 +0200 From: Christian Gmeiner User-Agent: Mail/News 1.5 (X11/20060209) MIME-Version: 1.0 To: Klaus Schmidinger's VDR Subject: [vdr] [PATCH] Add statusinformation for cutter thread via cStatus v2 (resend) X-Enigmail-Version: 0.93.1.0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2006 06:47:23 -0000 Status: O X-Status: X-Keywords: X-UID: 8586 I don't know why this patch get it into vdr-1.3.45, but i hope it will be in the next version. Thanks, Christian diff -ur vdr-1.3.44/cutter.c vdr-1.3.44_pached/cutter.c --- vdr-1.3.44/cutter.c 2006-02-12 11:07:23.000000000 +0100 +++ vdr-1.3.44_pached/cutter.c 2006-03-17 19:21:21.000000000 +0100 @@ -12,6 +12,7 @@ #include "remux.h" #include "thread.h" #include "videodir.h" +#include "status.h" // --- cCuttingThread -------------------------------------------------------- @@ -189,6 +190,7 @@ error = false; ended = false; cRecording Recording(FileName); + filename = FileName; const char *evn = Recording.PrefixFileName('%'); if (evn && RemoveVideoFile(evn) && MakeDirs(evn, true)) { // XXX this can be removed once RenameVideoFile() follows symlinks (see videodir.c) @@ -207,6 +209,7 @@ Recording.WriteInfo(); Recordings.AddByName(editedVersionName); cuttingThread = new cCuttingThread(FileName, editedVersionName); + cStatus::MsgCutterRunning(true, filename); return true; } } @@ -227,6 +230,7 @@ RemoveVideoFile(editedVersionName); //XXX what if this file is currently being replayed? Recordings.DelByName(editedVersionName); } + cStatus::MsgCutterRunning(false, filename); } bool cCutter::Active(void) diff -ur vdr-1.3.44/cutter.h vdr-1.3.44_pached/cutter.h --- vdr-1.3.44/cutter.h 2002-06-22 12:03:15.000000000 +0200 +++ vdr-1.3.44_pached/cutter.h 2006-03-17 19:21:58.000000000 +0100 @@ -18,6 +18,7 @@ static cCuttingThread *cuttingThread; static bool error; static bool ended; + static const char* filename; public: static bool Start(const char *FileName); static void Stop(void); diff -ur vdr-1.3.44/status.c vdr-1.3.44_pached/status.c --- vdr-1.3.44/status.c 2005-12-31 16:10:10.000000000 +0100 +++ vdr-1.3.44_pached/status.c 2006-03-17 19:20:18.000000000 +0100 @@ -112,3 +112,9 @@ for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) sm->OsdProgramme(PresentTime, PresentTitle, PresentSubtitle, FollowingTime, FollowingTitle, FollowingSubtitle); } + +void cStatus::MsgCutterRunning(bool Running, const char *FileName) +{ + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) + sm->CutterRunning(Running, FileName); +} diff -ur vdr-1.3.44/status.h vdr-1.3.44_pached/status.h --- vdr-1.3.44/status.h 2005-12-31 16:15:25.000000000 +0100 +++ vdr-1.3.44_pached/status.h 2006-03-18 14:27:09.000000000 +0100 @@ -67,6 +67,8 @@ // The OSD displays the single line Text with the current channel information. virtual void OsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle) {} // The OSD displays the given programme information. + virtual void CutterRunning(bool Running, const char *FileName) {} + // Inform if cutting process is running and what file it is processing. public: cStatus(void); virtual ~cStatus(); @@ -86,6 +88,7 @@ static void MsgOsdTextItem(const char *Text, bool Scroll = false); static void MsgOsdChannel(const char *Text); static void MsgOsdProgramme(time_t PresentTime, const char *PresentTitle, const char *PresentSubtitle, time_t FollowingTime, const char *FollowingTitle, const char *FollowingSubtitle); + static void MsgCutterRunning(bool Running, const char *FileName); }; #endif //__STATUS_H