Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: saving recording info



Am Dienstag, 6. Juli 2004 22:05 schrieb Jouni Karvo:
> hello,
>
> would it be possible for the VDR to add a file containing the timer
> information (including channel etc from where the recording was made)
> to the *.rec directory?
>

Appended a patch for that. With that patch vdr writes a file "recinfo.vdr" in 
the recording directory. Inside this file are two lines:
first line is the complete timer-info
second line is the complete channel info.

The patch is based on vdr-1.3.7


> Something like: timer.info
> channel: XXXXX
> attribure: value
>
> In addition to the curiosity factor, this would make some
> post-processing easier.
>
> yours,
> 		Jouni

theNoad

diff -Nru vdr-1.3.7.org/menu.c vdr-1.3.7.rcc/menu.c
--- vdr-1.3.7.org/menu.c	2004-06-12 22:45:12.000000000 +0200
+++ vdr-1.3.7.rcc/menu.c	2004-07-07 00:00:54.000000000 +0200
@@ -2763,6 +2763,7 @@
      recorder = new cRecorder(fileName, ch->Ca(), timer->Priority(), ch->Vpid(), ch->Apid1(), ch->Apid2(), ch->Dpid1(), ch->Dpid2());
      if (device->AttachReceiver(recorder)) {
         Recording.WriteSummary();
+        Recording.WriteRecInfo(timer);
         cStatus::MsgRecording(device, Recording.Name());
         if (!Timer && !cReplayControl::LastReplayed()) // an instant recording, maybe from cRecordControls::PauseLiveVideo()
            cReplayControl::SetRecording(fileName, Recording.Name());
diff -Nru vdr-1.3.7.org/recording.c vdr-1.3.7.rcc/recording.c
--- vdr-1.3.7.org/recording.c	2004-06-12 22:45:29.000000000 +0200
+++ vdr-1.3.7.rcc/recording.c	2004-07-07 00:01:00.000000000 +0200
@@ -45,6 +45,7 @@
 
 #define RESUMEFILESUFFIX  "/resume%s%s.vdr"
 #define SUMMARYFILESUFFIX "/summary.vdr"
+#define RECINFOFILESUFFIX "/recinfo.vdr"
 #define MARKSFILESUFFIX   "/marks.vdr"
 
 #define FINDCMD      "cd '%s' && find '%s' -follow -type d -name '%s' 2> /dev/null"
@@ -585,6 +586,26 @@
   return true;
 }
 
+bool cRecording::WriteRecInfo(cTimer *timer)
+{
+  char *RecinfoFileName = NULL;
+  asprintf(&RecinfoFileName, "%s%s", fileName, RECINFOFILESUFFIX);
+  FILE *f = fopen(RecinfoFileName, "w");
+  if (f) {
+     if (!timer->Save(f))
+        LOG_ERROR_STR(RecinfoFileName);
+     cChannel ch = *timer->Channel();
+     ch.SetName(timer->Channel()->Name());
+     if (fprintf(f, ch.ToText()) > 0)
+        LOG_ERROR_STR(RecinfoFileName);
+     fclose(f);
+     }
+  else
+     LOG_ERROR_STR(RecinfoFileName);
+  free(RecinfoFileName);
+  return true;
+}
+
 bool cRecording::Delete(void)
 {
   bool result = true;
diff -Nru vdr-1.3.7.org/recording.h vdr-1.3.7.rcc/recording.h
--- vdr-1.3.7.org/recording.h	2004-06-12 22:45:29.000000000 +0200
+++ vdr-1.3.7.rcc/recording.h	2004-07-07 00:00:57.000000000 +0200
@@ -60,6 +60,7 @@
   bool IsNew(void) const { return GetResume() <= 0; }
   bool IsEdited(void) const;
   bool WriteSummary(void);
+  bool WriteRecInfo(cTimer *timer);
   bool Delete(void);
        // Changes the file name so that it will no longer be visible in the "Recordings" menu
        // Returns false in case of error

Home | Main Index | Thread Index