diff -Nu --strip-trailing-cr -x '*.o' vdr-test-vanilla/config.c vdr-test/config.c --- vdr-test-vanilla/config.c 2003-08-28 20:02:00.000000000 +0200 +++ vdr-test/config.c 2003-08-28 18:09:22.000000000 +0200 @@ -259,6 +259,9 @@ TimeTransponder = 0; MarginStart = 2; MarginStop = 10; + ShowDate = 1; + ShowTime = 1; + ShowLenght = 0; EPGScanTimeout = 5; EPGBugfixLevel = 2; SVDRPTimeout = 300; @@ -409,6 +412,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, "ShowDate")) ShowDate = atoi(Value); + else if (!strcasecmp(Name, "ShowTime")) ShowTime = atoi(Value); + else if (!strcasecmp(Name, "ShowLenght")) ShowLenght = 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); @@ -459,6 +465,9 @@ Store("TimeTransponder", TimeTransponder); Store("MarginStart", MarginStart); Store("MarginStop", MarginStop); + Store("ShowDate", ShowDate); + Store("ShowTime", ShowTime); + Store("ShowLenght", ShowLenght); Store("EPGScanTimeout", EPGScanTimeout); Store("EPGBugfixLevel", EPGBugfixLevel); Store("SVDRPTimeout", SVDRPTimeout); diff -Nu --strip-trailing-cr -x '*.o' vdr-test-vanilla/config.h vdr-test/config.h --- vdr-test-vanilla/config.h 2003-08-28 20:02:00.000000000 +0200 +++ vdr-test/config.h 2003-08-28 18:06:49.000000000 +0200 @@ -212,6 +212,7 @@ int SetSystemTime; int TimeTransponder; int MarginStart, MarginStop; + int ShowDate, ShowTime, ShowLenght; int EPGScanTimeout; int EPGBugfixLevel; int SVDRPTimeout; diff -Nu --strip-trailing-cr -x '*.o' vdr-test-vanilla/i18n.c vdr-test/i18n.c --- vdr-test-vanilla/i18n.c 2003-08-28 20:02:00.000000000 +0200 +++ vdr-test/i18n.c 2003-08-28 19:04:01.000000000 +0200 @@ -2544,6 +2544,57 @@ "Feldolgozott File-k felosztása", "Separar arxius", }, + { "Setup.Recording$Show Date", + "Aufnahmedatum anzeigen", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "Setup.Recording$Show Time", + "AufnahmeZeit anzeigen", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, + { "Setup.Recording$Show Lenght", + "Länge der Aufnahme anzeigen", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + }, { "Setup.Replay$Multi speed mode", "MultiSpeed Modus", "Rezim z vec hitrostmi", Common subdirectories: vdr-test-vanilla/include and vdr-test/include Common subdirectories: vdr-test-vanilla/libdtv and vdr-test/libdtv diff -Nu --strip-trailing-cr -x '*.o' vdr-test-vanilla/menu.c vdr-test/menu.c --- vdr-test-vanilla/menu.c 2003-08-28 20:02:00.000000000 +0200 +++ vdr-test/menu.c 2003-08-29 12:57:24.000000000 +0200 @@ -1678,7 +1678,10 @@ fileName = strdup(Recording->FileName()); name = NULL; totalEntries = newEntries = 0; - SetText(Recording->Title('\t', true, Level)); + SetText(Recording->Title('\t', true, Level)); + //char title[10]=""; + //sprintf(title, "%s",Recording->FileName()); + //SetText("sdsd"); if (*Text() == '\t') name = strdup(Text() + 2); // 'Text() + 2' to skip the two '\t' } @@ -2208,6 +2211,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 Date"), &data.ShowDate)); + Add(new cMenuEditBoolItem( tr("Setup.Recording$Show Time"), &data.ShowTime)); + Add(new cMenuEditBoolItem( tr("Setup.Recording$Show Lenght"), &data.ShowLenght)); } // --- cMenuSetupReplay ------------------------------------------------------ diff -Nu --strip-trailing-cr -x '*.o' vdr-test-vanilla/recording.c vdr-test/recording.c --- vdr-test-vanilla/recording.c 2003-08-28 20:02:00.000000000 +0200 +++ vdr-test/recording.c 2003-08-29 13:28:09.000000000 +0200 @@ -1,4 +1,4 @@ -/* + /* * recording.c: Recording file handling * * See the main source file 'vdr.c' for copyright information and @@ -20,6 +20,8 @@ #include "remux.h" //XXX+ I_FRAME #include "tools.h" #include "videodir.h" +#include + #define RECEXT ".rec" #define DELEXT ".del" @@ -391,10 +393,10 @@ struct stat buf; if (fstat(f, &buf) == 0) { int size = buf.st_size; - summary = MALLOC(char, size + 1); // +1 for terminating 0 + summary = MALLOC(char, size + 1); // +1 for terminating 0 if (summary) { int rbytes = safe_read(f, summary, size); - if (rbytes >= 0) { + if (rbytes >= 0) { summary[rbytes] = 0; if (rbytes != size) esyslog("%s: expected %d bytes but read %d", SummaryFileName, size, rbytes); @@ -489,6 +491,12 @@ const char *cRecording::Title(char Delimiter, bool NewIndicator, int Level) { + struct tIndex { int offset; uchar type; uchar number; short reserved; }; + char *fileName; + int last; + tIndex *index; + char total[20]=""; + char New = NewIndicator && IsNew() ? '*' : ' '; free(titleBuffer); titleBuffer = NULL; @@ -500,14 +508,60 @@ 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, + + 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) { + /* + // new reading of every index file ->very slow!!! Not used ! + cIndexFile *oIndex = new cIndexFile(filename, false); + sprintf(total,"%s",IndexToHMSF(oIndex->Last())); + char hour[1]=""; char min[2]=""; + sprintf(hour,"%c",total[0]); + sprintf(min,"%c%c", total[2],total[3]); + sprintf(total,"%d´",(atoi(hour)*60)+atoi(min)); + */ + + 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(total,"%s",IndexToHMSF(last,true)); + sprintf(hour,"%c",total[0]); + sprintf(min,"%c%c", total[2],total[3]); + sprintf(total,"%3d´",(atoi(hour)*60)+atoi(min)); + } + } + } + } + char RecDate[5]=""; + char RecTime[5]=""; + char DummyDelimiter = ' '; + sprintf(RecDate,"%02d.%02d", t->tm_mday, t->tm_mon + 1); + sprintf(RecTime,"%02d:%02d", t->tm_hour, t->tm_min); + asprintf(&titleBuffer, "%s%c%s%c%c%s%c%s", + (Setup.ShowDate==1?RecDate:""), + (Setup.ShowDate==1?Delimiter:DummyDelimiter), + (Setup.ShowTime==1?RecTime:""), New, - Delimiter, + (Setup.ShowTime==1?Delimiter:DummyDelimiter), + (Setup.ShowLenght==1?total:""), + (Setup.ShowLenght==1?Delimiter:DummyDelimiter), s); // let's not display a trailing '~': stripspace(titleBuffer); @@ -767,7 +821,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 100 // frames diff -Nu --strip-trailing-cr -x '*.o' vdr-test-vanilla/recording.h vdr-test/recording.h --- vdr-test-vanilla/recording.h 2003-08-28 20:02:00.000000000 +0200 +++ vdr-test/recording.h 2003-08-28 17:37:53.000000000 +0200 @@ -15,6 +15,8 @@ #include "timers.h" #include "tools.h" +#define INDEXFILESUFFIX "/index.vdr" + void RemoveDeletedRecordings(void); void AssertFreeDiskSpace(int Priority = 0); Binary files vdr-test-vanilla/vdr and vdr-test/vdr differ