diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/config.c vdr-test/config.c --- /root/vdr-1.2.6/config.c 2003-10-17 16:11:27.000000000 +0200 +++ vdr-test/config.c 2003-12-07 15:18:47.000000000 +0100 @@ -259,6 +259,9 @@ TimeTransponder = 0; MarginStart = 2; MarginStop = 10; + ShowRecDate = 1; + ShowRecTime = 1; + ShowRecLength = 0; EPGScanTimeout = 5; EPGBugfixLevel = 2; SVDRPTimeout = 300; @@ -410,6 +413,9 @@ else if (!strcasecmp(Name, "SetSystemTime")) SetSystemTime = atoi(Value); else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value); else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value); + else if (!strcasecmp(Name, "ShowRecDate")) ShowRecDate = atoi(Value); + else if (!strcasecmp(Name, "ShowRecTime")) ShowRecTime = atoi(Value); + else if (!strcasecmp(Name, "ShowRecLength")) ShowRecLength = atoi(Value); else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value); else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value); else if (!strcasecmp(Name, "EPGBugfixLevel")) EPGBugfixLevel = atoi(Value); @@ -461,6 +467,9 @@ Store("TimeTransponder", TimeTransponder); Store("MarginStart", MarginStart); Store("MarginStop", MarginStop); + Store("ShowRecDate", ShowRecDate); + Store("ShowRecTime", ShowRecTime); + Store("ShowRecLength", ShowRecLength); Store("EPGScanTimeout", EPGScanTimeout); Store("EPGBugfixLevel", EPGBugfixLevel); Store("SVDRPTimeout", SVDRPTimeout); diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/config.h vdr-test/config.h --- /root/vdr-1.2.6/config.h 2003-11-14 14:29:13.000000000 +0100 +++ vdr-test/config.h 2003-12-07 15:19:12.000000000 +0100 @@ -216,6 +216,7 @@ int SetSystemTime; int TimeTransponder; int MarginStart, MarginStop; + int ShowRecDate, ShowRecTime, ShowRecLength; int EPGScanTimeout; int EPGBugfixLevel; int SVDRPTimeout; diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/i18n.c vdr-test/i18n.c --- /root/vdr-1.2.6/i18n.c 2003-09-11 15:51:56.000000000 +0200 +++ vdr-test/i18n.c 2003-12-07 15:18:47.000000000 +0100 @@ -2561,6 +2561,57 @@ "Feldolgozott File-k felosztása", "Separar arxius", }, + { "Setup.Recording$Show Recording Date", + "Aufnahmedatum anzeigen", + "", + "", + "", + "", + "", + "", + "Näytä tallenteen päiväys", + "", + "", + "", + "", + "", + "", + "", + }, + { "Setup.Recording$Show Recording Time", + "AufnahmeZeit anzeigen", + "", + "", + "", + "", + "", + "", + "Näytä tallenteen ajankohta", + "", + "", + "", + "", + "", + "", + "", + }, + { "Setup.Recording$Show Recording Length", + "Länge der Aufnahme anzeigen", + "", + "", + "", + "", + "", + "", + "Näytä tallenteen kesto", + "", + "", + "", + "", + "", + "", + "", + }, { "Setup.Replay$Multi speed mode", "MultiSpeed Modus", "Rezim z vec hitrostmi", diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/menu.c vdr-test/menu.c --- /root/vdr-1.2.6/menu.c 2003-10-03 16:36:20.000000000 +0200 +++ vdr-test/menu.c 2003-12-07 15:18:46.000000000 +0100 @@ -2227,6 +2230,9 @@ Add(new cMenuEditBoolItem(tr("Setup.Recording$Record Dolby Digital"), &data.RecordDolbyDigital)); Add(new cMenuEditIntItem( tr("Setup.Recording$Max. video file size (MB)"), &data.MaxVideoFileSize, MINVIDEOFILESIZE, MAXVIDEOFILESIZE)); Add(new cMenuEditBoolItem(tr("Setup.Recording$Split edited files"), &data.SplitEditedFiles)); + Add(new cMenuEditBoolItem( tr("Setup.Recording$Show Recoding Date"), &data.ShowRecDate)); + Add(new cMenuEditBoolItem( tr("Setup.Recording$Show Recording Time"), &data.ShowRecTime)); + Add(new cMenuEditBoolItem( tr("Setup.Recording$Show Recording Length"), &data.ShowRecLength)); } // --- cMenuSetupReplay ------------------------------------------------------ diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/recording.c vdr-test/recording.c --- /root/vdr-1.2.6/recording.c 2003-11-08 16:25:35.000000000 +0100 +++ vdr-test/recording.c 2003-12-07 15:04:10.000000000 +0100 @@ -20,6 +20,8 @@ #include "remux.h" //XXX+ I_FRAME #include "tools.h" #include "videodir.h" +#include + #define RECEXT ".rec" #define DELEXT ".del" @@ -488,8 +490,16 @@ return fileName; } -const char *cRecording::Title(char Delimiter, bool NewIndicator, int Level) +const char *cRecording::Title(char Delimiter, bool NewIndicator, int Level, bool Original) { + struct tIndex { int offset; uchar type; uchar number; short reserved; }; + char *fileName; + int last; + tIndex *index; + char RecLength[20]=""; + char RecDate[5]=""; + char RecTime[5]=""; + char RecDelimiter[1] = ""; char New = NewIndicator && IsNew() ? '*' : ' '; free(titleBuffer); titleBuffer = NULL; @@ -501,15 +511,62 @@ s++; else s = name; - asprintf(&titleBuffer, "%02d.%02d%c%02d:%02d%c%c%s", - t->tm_mday, - t->tm_mon + 1, - Delimiter, - t->tm_hour, - t->tm_min, - New, - Delimiter, - s); + if (Setup.ShowRecLength) { + fileName = NULL; + last = -1; + index = NULL; + char filename[199]=""; + sprintf(filename, "%s", FileName()); + if (filename) { + fileName = MALLOC(char, strlen(filename) + strlen(INDEXFILESUFFIX) + 1); + if (fileName) { + strcpy(fileName, filename); + char *pFileExt = fileName + strlen(fileName); + strcpy(pFileExt, INDEXFILESUFFIX); + int delta = 0; + if (access(fileName, R_OK) == 0) { + struct stat buf; + if (stat(fileName, &buf) == 0) { + delta = buf.st_size % sizeof(tIndex); + if (delta) { + delta = sizeof(tIndex) - delta; + esyslog("ERROR: invalid file size (%ld) in '%s'", buf.st_size, fileName); + } + last = (buf.st_size + delta) / sizeof(tIndex) - 1; + char hour[1]=""; char min[2]=""; + sprintf(RecLength,"%s",IndexToHMSF(last,true)); + sprintf(hour,"%c",RecLength[0]); + sprintf(min,"%c%c", RecLength[2],RecLength[3]); + sprintf(RecLength,"%3dŽ",(atoi(hour)*60)+atoi(min)); + } + } + } + } + } + sprintf(RecDate,"%02d.%02d", t->tm_mday, t->tm_mon + 1); + sprintf(RecTime,"%02d:%02d", t->tm_hour, t->tm_min); + sprintf(RecDelimiter,"%c", Delimiter); + if (Original) { + asprintf(&titleBuffer, "%02d.%02d%c%02d:%02d%c%c%s", + t->tm_mday, + t->tm_mon + 1, + Delimiter, + t->tm_hour, + t->tm_min, + New, + Delimiter, + s); + } else { + asprintf(&titleBuffer, "%s%s%s%c%s%s%s%s", + (Setup.ShowRecDate? RecDate : ""), + (Setup.ShowRecDate ? Setup.ShowRecTime ? RecDelimiter : "" : ""), + (Setup.ShowRecTime ? RecTime : ""), + New, + (Setup.ShowRecTime ? RecDelimiter : Setup.ShowRecDate ? RecDelimiter : ""), + (Setup.ShowRecLength ? RecLength : ""), + (Setup.ShowRecLength ? RecDelimiter : ""), + s); + } // let's not display a trailing '~': stripspace(titleBuffer); s = &titleBuffer[strlen(titleBuffer) - 1]; @@ -773,7 +830,8 @@ //XXX+ somewhere else??? // --- cIndexFile ------------------------------------------------------------ -#define INDEXFILESUFFIX "/index.vdr" +// Now defined in recording.h, used here and in cRecording::Title +// #define INDEXFILESUFFIX "/index.vdr" // The number of frames to stay off the end in case of time shift: #define INDEXSAFETYLIMIT 150 // frames diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/recording.h vdr-test/recording.h --- /root/vdr-1.2.6/recording.h 2003-10-17 16:27:36.000000000 +0200 +++ vdr-test/recording.h 2003-12-07 15:04:10.000000000 +0100 @@ -16,6 +16,8 @@ #include "timers.h" #include "tools.h" +#define INDEXFILESUFFIX "/index.vdr" + void RemoveDeletedRecordings(void); void AssertFreeDiskSpace(int Priority = 0); ///< The special Priority value -1 means that we shall get rid of any @@ -53,7 +55,7 @@ virtual bool operator< (const cListObject &ListObject); const char *Name(void) { return name; } const char *FileName(void); - const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1); + const char *Title(char Delimiter = ' ', bool NewIndicator = false, int Level = -1, bool Original = false); const char *Summary(void) { return summary; } const char *PrefixFileName(char Prefix); int HierarchyLevels(void); diff -Nu --strip-trailing-cr -x '*.o dependencies' /root/vdr-1.2.6/svdrp.c vdr-test/svdrp.c --- /root/vdr-1.2.6/svdrp.c 2003-08-31 13:24:47.000000000 +0200 +++ vdr-test/svdrp.c 2003-12-07 15:05:20.000000000 +0100 @@ -748,7 +748,7 @@ else if (recordings) { cRecording *recording = Recordings.First(); while (recording) { - Reply(recording == Recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true)); + Reply(recording == Recordings.Last() ? 250 : -250, "%d %s", recording->Index() + 1, recording->Title(' ', true, -1, true)); recording = Recordings.Next(recording); } }