Add statusinformation for cutter thread via cStatus

Message ID 441A82CC.1080107@visual-page.de
State New
Headers

Commit Message

Christian Gmeiner March 17, 2006, 9:35 a.m. UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ChangeLog:
	+ adds function to cStatus.[c/h] to support cutter
	+ adds fucntion calls to cStatus in cCuttingThread

Such a patch is useful to all status plugins.

Greets,
Christian

- --
Christian Gmeiner - student of computer science

http://dxr3plugin.sf.net
http://itb04.ath.cx
http://javamill.ath.cx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEGoLMDwe2AbwGBA8RApJ6AJwNdfSR0/CvHrrKTq2BaWjYt8KVHwCdFMEa
6QZfrTbAKafeCq/gGnmitTM=
=Wn5v
-----END PGP SIGNATURE-----
Nur in vdr-1.3.44_pached/: status.h~.
  

Comments

Matthias Becker March 17, 2006, 9:51 a.m. UTC | #1
Hi Christian,

uh, very nice patch. I think it would be better to not only now that SOME
recording is beeing cutted but to know WHICH recording exactly is beeing
cutted.
What do you think?

Regards,
Matthias

P.S.: It would be much better if you would attach the patch as a file to you
posting. A patch directly in the mail body always makes "problems".
  
Klaus Schmidinger March 17, 2006, 9:57 a.m. UTC | #2
Christian Gmeiner wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> ChangeLog:
> 	+ adds function to cStatus.[c/h] to support cutter
> 	+ adds fucntion calls to cStatus in cCuttingThread
> 
> Such a patch is useful to all status plugins.

Couldn't you just call cCutter::Active() if you're interested
in that information?

Klaus
  
Christian Gmeiner March 17, 2006, 11:11 a.m. UTC | #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Klaus Schmidinger wrote:
> Christian Gmeiner wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> ChangeLog:
>>     + adds function to cStatus.[c/h] to support cutter
>>     + adds fucntion calls to cStatus in cCuttingThread
>>
>> Such a patch is useful to all status plugins.
> 
> Couldn't you just call cCutter::Active() if you're interested
> in that information?

I thought that a plugin couldn't call such core functions? A plugin
could get status informations, like if is vdr recording with cStatus
interface. Have a look at:
PLUGINS.html#Status monitor


Or i am wrong?

Thanks,
Christian

> 
> Klaus
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


- --
Christian Gmeiner - student of computer science

http://dxr3plugin.sf.net
http://itb04.ath.cx
http://javamill.ath.cx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEGplUDwe2AbwGBA8RApPaAJ9DuS//9EX1PEBK5hSLHOdc9QrwIgCggxBp
MWsvLgBMcZaGPtSjxK5BK2g=
=vMCG
-----END PGP SIGNATURE-----
  
Christian Gmeiner March 17, 2006, 11:12 a.m. UTC | #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthias Becker wrote:
> Hi Christian,
> 
> uh, very nice patch. I think it would be better to not only now that SOME
> recording is beeing cutted but to know WHICH recording exactly is beeing
> cutted.
> What do you think?

Thats a good idea, i will change the patch.
> 
> Regards,
> Matthias
> 
> P.S.: It would be much better if you would attach the patch as a file to you
> posting. A patch directly in the mail body always makes "problems".

Okay.. will try to make it better the next time.

Greets,
Christian

> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


- --
Christian Gmeiner - student of computer science

http://dxr3plugin.sf.net
http://itb04.ath.cx
http://javamill.ath.cx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEGpmzDwe2AbwGBA8RAktmAJ9d4jbNMLewzi8FSLGA5UFUgTxbhwCdF7Ik
aZo7tdOiv9hsrmBaiSZmF7c=
=Cn8k
-----END PGP SIGNATURE-----
  

Patch

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 10:17:31.000000000 +0100
@@ -12,6 +12,7 @@ 
 #include "remux.h"
 #include "thread.h"
 #include "videodir.h"
+#include "status.h"
 
 // --- cCuttingThread --------------------------------------------------------
 
@@ -207,6 +208,7 @@ 
         Recording.WriteInfo();
         Recordings.AddByName(editedVersionName);
         cuttingThread = new cCuttingThread(FileName, editedVersionName);
+        cStatus::MsgCutterRunning(true);
         return true;
         }
      }
@@ -227,6 +229,7 @@ 
      RemoveVideoFile(editedVersionName); //XXX what if this file is currently being replayed?
      Recordings.DelByName(editedVersionName);
      }
+  cStatus::MsgCutterRunning(false);
 }
 
 bool cCutter::Active(void)
Nur in vdr-1.3.44_pached/: cutter.c~.
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 10:12:04.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)
+{
+  for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm))
+      sm->CutterRunning(running);
+}
Nur in vdr-1.3.44_pached/: status.c~.
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-17 10:02:17.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) {}
+               // Inform if cutting process is running.
 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);
   };
 
 #endif //__STATUS_H