diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2001-01-18 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2001-01-18 18:00:00 +0100 |
commit | 3fe3c15d5db9c1f3982ffe6dac1ae4ad56d1664d (patch) | |
tree | e1c4e489899c119fdfaad6f6bdf9bde988616df2 /recording.c | |
parent | 9aa2cda494d7af2733362de78234441a25959e86 (diff) | |
download | vdr-patch-lnbsharing-vdr-0.70.tar.gz vdr-patch-lnbsharing-vdr-0.70.tar.bz2 |
Version 0.70vdr-0.70
- VDR now requires driver version 0.8.1 or higher.
- Recordings are now saved in PES mode. Note that you now need to install the
driver *WITHOUT* 'outstream=0'! This is the default when you 'make insmod' in
the DVB/driver directory.
Old recordings (in AV_PES mode) can still be replayed (as long as the driver
still supports replaying AV_PES files). The only limitation with this is that
in fast forward/back mode the picture may be slightly distorted and there may
be sound fragments.
- The EPG data is now dumped into the file /video/epg.data every ten minutes.
Use the Perl script 'epg2html.pl' to convert the raw EPG data into a simple
HTML programme listing.
- Fixed handling of channel switching with the "Blue" button in the "What's on
now/next?" menus.
- Fixed saving the MarginStop setup parameter.
- Fixed missing initialization in cConfig.
- Implemented "On Disk Editing".
- There is no more default 'timers.conf' file.
- Added Italian language texts (thanks to Alberto Carraro).
- Fixed starting a replay session when the program is currently in "transfer
mode".
- Fixed setting/modifying timers via SVDRP with empty summary fields.
- Fixed a problem with recordings that have a single quote character in their
name (this is now mapped to 0x01).
- Changed the value for Diseqc to '0' in the default 'channels.conf'.
- Fixed displaying channels and recording status in the RCU's LED display when
a recording is interrupted due to higher priority.
- Implemented safe writing of config files (first writes into a temporary file
and then renames it).
- In case the video data stream is broken the log message will come only every
5 seconds.
- The current channel is now saved in the 'setup.conf' file when VDR is cancelled,
and will be restored next time it is started (thanks to Deti Fliegl).
- The EIT scanning thread is now locked when switching channels to avoid problems.
- Encrypted channels can now be selected even without knowing the PNR (however, it
is still necessary for the EPG info).
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 112 |
1 files changed, 110 insertions, 2 deletions
diff --git a/recording.c b/recording.c index f45be96..064731d 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.21 2000/11/18 16:22:29 kls Exp $ + * $Id: recording.c 1.24 2001/01/13 12:17:15 kls Exp $ */ #define _GNU_SOURCE @@ -26,6 +26,7 @@ #define NAMEFORMAT "%s/%s/" DATAFORMAT #define SUMMARYFILESUFFIX "/summary.vdr" +#define MARKSFILESUFFIX "/marks.vdr" #define FINDCMD "find %s -follow -type d -name '%s' 2> /dev/null | sort -df" @@ -125,6 +126,7 @@ cRecording::cRecording(const char *FileName) strncpy(name, FileName, p - FileName); name[p - FileName] = 0; strreplace(name, '_', ' '); + strreplace(name, '\x01', '\''); } // read an optional summary file: char *SummaryFileName = NULL; @@ -175,8 +177,10 @@ const char *cRecording::FileName(void) if (!fileName) { struct tm *t = localtime(&start); asprintf(&fileName, NAMEFORMAT, VideoDirectory, name, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, priority, lifetime); - if (fileName) + if (fileName) { strreplace(fileName, ' ', '_'); + strreplace(fileName, '\'', '\x01'); + } } return fileName; } @@ -269,3 +273,107 @@ bool cRecordings::Load(bool Deleted) return result; } +// --- cMark ----------------------------------------------------------------- + +char *cMark::buffer = NULL; + +cMark::cMark(int Position, const char *Comment) +{ + position = Position; + comment = Comment ? strdup(Comment) : NULL; +} + +cMark::~cMark() +{ + delete comment; +} + +const char *cMark::ToText(void) +{ + delete buffer; + asprintf(&buffer, "%s%s%s\n", IndexToHMSF(position, true), comment ? " " : "", comment ? comment : ""); + return buffer; +} + +bool cMark::Parse(const char *s) +{ + delete comment; + comment = NULL; + position = HMSFToIndex(s); + const char *p = strchr(s, ' '); + if (p) { + p = skipspace(p); + if (*p) { + comment = strdup(p); + comment[strlen(comment) - 1] = 0; // strips trailing newline + } + } + return true; +} + +bool cMark::Save(FILE *f) +{ + return fprintf(f, ToText()) > 0; +} + +// --- cMarks ---------------------------------------------------------------- + +bool cMarks::Load(const char *RecordingFileName) +{ + const char *MarksFile = AddDirectory(RecordingFileName, MARKSFILESUFFIX); + if (cConfig<cMark>::Load(MarksFile)) { + Sort(); + return true; + } + return false; +} + +void cMarks::Sort(void) +{ + for (cMark *m1 = First(); m1; m1 = Next(m1)) { + for (cMark *m2 = Next(m1); m2; m2 = Next(m2)) { + if (m2->position < m1->position) { + swap(m1->position, m2->position); + swap(m1->comment, m2->comment); + } + } + } +} + +cMark *cMarks::Add(int Position) +{ + cMark *m = Get(Position); + if (!m) { + cConfig<cMark>::Add(m = new cMark(Position)); + Sort(); + } + return m; +} + +cMark *cMarks::Get(int Position) +{ + for (cMark *mi = First(); mi; mi = Next(mi)) { + if (mi->position == Position) + return mi; + } + return NULL; +} + +cMark *cMarks::GetPrev(int Position) +{ + for (cMark *mi = Last(); mi; mi = Prev(mi)) { + if (mi->position < Position) + return mi; + } + return NULL; +} + +cMark *cMarks::GetNext(int Position) +{ + for (cMark *mi = First(); mi; mi = Next(mi)) { + if (mi->position > Position) + return mi; + } + return NULL; +} + |