Using '~' in recording filename

This commit is contained in:
Klaus Schmidinger 2001-09-02 10:28:20 +02:00
parent 4aee497101
commit 0d75710545
5 changed files with 30 additions and 7 deletions

View File

@ -67,7 +67,9 @@ Video Disk Recorder File Formats
be automatically deleted by a new recording with higher priority, 99 means
that this recording will never be automatically deleted
- Name of timer (will be used to name the recording); if the name contains
any ':' characters, these have to be replaced with '|'
any ':' characters, these have to be replaced with '|'. If the name shall
contain subdirectories, these have to be delimited by '~' (since the '/'
character may be part of a regular programme name).
- Summary (any newline characters in the summary have to be replaced with '|';
the summary may contain ':' characters)

View File

@ -677,7 +677,7 @@ Video Disk Recorder Revision History
they will be recording. This can be disabled in the "Setup" menu. Note
that the "Mark" button doesn't work if timers are displayed sorted.
2001-09-01: Version 0.9.4
2001-09-02: Version 0.9.4
- Changed version number notation.
- Implemented automatic shutdown (see INSTALL and MANUAL for details).
@ -696,3 +696,8 @@ Video Disk Recorder Revision History
one timer ends at the same time another timer starts.
- New setup parameter OSDMessageTime to define how long an OSD message shall
be displayed.
- The "File" parameter of a timer can now contain the '~' character to store
the recording in a hierarchical directory structure. The '~' character has
been chosen since the file system's directory delimiter '/' may be part of
a regular programme name (showing the directory hierarchy in the "Recordings"
menu will follow later).

6
MANUAL
View File

@ -285,6 +285,12 @@ Video Disk Recorder User's Manual
time, so it is possible to have a "repeating timer" store all its
recordings under the same name; they will be distinguishable by
their date and time).
If the file name contains the special character '~', the recording
will be stored in a hierarchical directory structure. For instance,
a file name of "Sci-Fi~Star Trek~Voyager" will result in a directory
structure "/video/Sci-Fi/Star_Trek/Voyager". The '~' character has
been chosen for this since the file system's directory delimiter '/'
may be part of a regular programme name.
If this field is left blank, the channel name will be used to form
the name of the recording.

5
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.112 2001/09/01 15:18:23 kls Exp $
* $Id: menu.c 1.113 2001/09/02 10:00:40 kls Exp $
*/
#include "menu.h"
@ -19,7 +19,7 @@
#define MENUTIMEOUT 120 // seconds
#define MAXWAIT4EPGINFO 10 // seconds
const char *FileNameChars = " aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-.#^";
const char *FileNameChars = " aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789-.#~^";
// --- cMenuEditItem ---------------------------------------------------------
@ -494,6 +494,7 @@ eOSState cMenuEditStrItem::ProcessKey(eKeys Key)
if (value[pos] == '^')
value[pos] = 0;
pos = -1;
stripspace(value);
break;
}
// run into default

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 1.34 2001/09/01 13:05:56 kls Exp $
* $Id: recording.c 1.35 2001/09/02 10:25:12 kls Exp $
*/
#define _GNU_SOURCE
@ -179,6 +179,7 @@ void cResumeFile::Delete(void)
struct tCharExchange { char a; char b; };
tCharExchange CharExchange[] = {
{ '~', '/' },
{ ' ', '_' },
{ '\'', '\x01' },
{ '/', '\x02' },
@ -190,8 +191,16 @@ tCharExchange CharExchange[] = {
char *ExchangeChars(char *s, bool ToFileSystem)
{
for (struct tCharExchange *ce = CharExchange; ce->a && ce->b; ce++)
strreplace(s, ToFileSystem ? ce->a : ce->b, ToFileSystem ? ce->b : ce->a);
char *p = s;
while (*p) {
for (struct tCharExchange *ce = CharExchange; ce->a && ce->b; ce++) {
if (*p == (ToFileSystem ? ce->a : ce->b)) {
*p = ToFileSystem ? ce->b : ce->a;
break;
}
}
p++;
}
return s;
}