1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Using subtitle for repeating timers; taking summary at recording time

This commit is contained in:
Klaus Schmidinger 2001-09-02 15:21:54 +02:00
parent 0d75710545
commit 22ccf22f6f
9 changed files with 89 additions and 38 deletions

15
HISTORY
View File

@ -701,3 +701,18 @@ Video Disk Recorder Revision History
been chosen since the file system's directory delimiter '/' may be part of been chosen since the file system's directory delimiter '/' may be part of
a regular programme name (showing the directory hierarchy in the "Recordings" a regular programme name (showing the directory hierarchy in the "Recordings"
menu will follow later). menu will follow later).
- Repeating timers now create recordings that contain the 'Subtitle' information
from the EPG data in their file name. Typically (on tv stations that care
about their viewers) this contains the episode title of a series. The
subtitle is appended to the timer's file name, separated by a '~' character,
so that it results in all recordings of this timer being collected in a
common subdirectory. You can disable this with the 'UseSubtitle' parameter
in the "Setup" menu.
- The summary information is now taken from the EPG data at the actual time of
recording (no longer at the time the timer is created in the "Schedule" menu).
If a timer already has summary data, that data will be used. If you have
repeating timers in your 'timers.conf', you may want to make sure they do
NOT contain any summary information (that's the last field in the timer
definitions). Use your favourite text editor to delete that information.
That way every recording will store the actual summary data at the time of
the recording.

14
MANUAL
View File

@ -291,6 +291,12 @@ Video Disk Recorder User's Manual
structure "/video/Sci-Fi/Star_Trek/Voyager". The '~' character has structure "/video/Sci-Fi/Star_Trek/Voyager". The '~' character has
been chosen for this since the file system's directory delimiter '/' been chosen for this since the file system's directory delimiter '/'
may be part of a regular programme name. may be part of a regular programme name.
Repeating timers create recordings that contain the 'Subtitle'
information from the EPG data in their file name. Typically (on tv
stations that care about their viewers) this contains the episode
title of a series. The subtitle is appended to the timer's file name,
separated by a '~' character, so that it results in all recordings
of this timer being collected in a common subdirectory.
If this field is left blank, the channel name will be used to form If this field is left blank, the channel name will be used to form
the name of the recording. the name of the recording.
@ -408,6 +414,14 @@ Video Disk Recorder User's Manual
means that this recording will never be deleted means that this recording will never be deleted
automatically. automatically.
UseSubtitle = 1 Repeating timers use the EPG's 'Subtitle' information to
create recording file names in a hierarchical structure
(for instance to gather all episodes of a series in a
common subdirectory). This parameter can be used to
control this.
0 = don't use the 'Subtitle'
1 = use it (and create subdirectories)
VideoFormat = 0 The video format (or aspect ratio) of the tv set in use. VideoFormat = 0 The video format (or aspect ratio) of the tv set in use.
0 = 4:3 0 = 4:3
1 = 16:9 1 = 16:9

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.c 1.63 2001/09/01 15:17:44 kls Exp $ * $Id: config.c 1.64 2001/09/02 15:04:13 kls Exp $
*/ */
#include "config.h" #include "config.h"
@ -365,21 +365,6 @@ cTimer::cTimer(const cEventInfo *EventInfo)
if (!isempty(Title)) if (!isempty(Title))
strn0cpy(file, EventInfo->GetTitle(), sizeof(file)); strn0cpy(file, EventInfo->GetTitle(), sizeof(file));
summary = NULL; summary = NULL;
const char *Subtitle = EventInfo->GetSubtitle();
if (isempty(Subtitle))
Subtitle = "";
const char *Summary = EventInfo->GetExtendedDescription();
if (isempty(Summary))
Summary = "";
if (*Subtitle || *Summary) {
asprintf(&summary, "%s%s%s", Subtitle, (*Subtitle && *Summary) ? "\n\n" : "", Summary);
char *p = summary;
while (*p) {
if (*p == '\n')
*p = '|';
p++;
}
}
} }
cTimer::~cTimer() cTimer::~cTimer()
@ -815,6 +800,7 @@ cSetup::cSetup(void)
PrimaryLimit = 0; PrimaryLimit = 0;
DefaultPriority = 50; DefaultPriority = 50;
DefaultLifetime = 50; DefaultLifetime = 50;
UseSubtitle = 1;
VideoFormat = VIDEO_FORMAT_4_3; VideoFormat = VIDEO_FORMAT_4_3;
ChannelInfoPos = 0; ChannelInfoPos = 0;
OSDwidth = 52; OSDwidth = 52;
@ -851,6 +837,7 @@ bool cSetup::Parse(char *s)
else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = atoi(Value); else if (!strcasecmp(Name, "PrimaryLimit")) PrimaryLimit = atoi(Value);
else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value); else if (!strcasecmp(Name, "DefaultPriority")) DefaultPriority = atoi(Value);
else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value); else if (!strcasecmp(Name, "DefaultLifetime")) DefaultLifetime = atoi(Value);
else if (!strcasecmp(Name, "UseSubtitle")) UseSubtitle = atoi(Value);
else if (!strcasecmp(Name, "VideoFormat")) VideoFormat = atoi(Value); else if (!strcasecmp(Name, "VideoFormat")) VideoFormat = atoi(Value);
else if (!strcasecmp(Name, "ChannelInfoPos")) ChannelInfoPos = atoi(Value); else if (!strcasecmp(Name, "ChannelInfoPos")) ChannelInfoPos = atoi(Value);
else if (!strcasecmp(Name, "OSDwidth")) OSDwidth = atoi(Value); else if (!strcasecmp(Name, "OSDwidth")) OSDwidth = atoi(Value);
@ -922,6 +909,7 @@ bool cSetup::Save(const char *FileName)
fprintf(f, "PrimaryLimit = %d\n", PrimaryLimit); fprintf(f, "PrimaryLimit = %d\n", PrimaryLimit);
fprintf(f, "DefaultPriority = %d\n", DefaultPriority); fprintf(f, "DefaultPriority = %d\n", DefaultPriority);
fprintf(f, "DefaultLifetime = %d\n", DefaultLifetime); fprintf(f, "DefaultLifetime = %d\n", DefaultLifetime);
fprintf(f, "UseSubtitle = %d\n", UseSubtitle);
fprintf(f, "VideoFormat = %d\n", VideoFormat); fprintf(f, "VideoFormat = %d\n", VideoFormat);
fprintf(f, "ChannelInfoPos = %d\n", ChannelInfoPos); fprintf(f, "ChannelInfoPos = %d\n", ChannelInfoPos);
fprintf(f, "OSDwidth = %d\n", OSDwidth); fprintf(f, "OSDwidth = %d\n", OSDwidth);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: config.h 1.70 2001/09/01 15:16:42 kls Exp $ * $Id: config.h 1.71 2001/09/02 15:03:19 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -292,6 +292,7 @@ public:
int SortTimers; int SortTimers;
int PrimaryLimit; int PrimaryLimit;
int DefaultPriority, DefaultLifetime; int DefaultPriority, DefaultLifetime;
int UseSubtitle;
int VideoFormat; int VideoFormat;
int ChannelInfoPos; int ChannelInfoPos;
int OSDwidth, OSDheight; int OSDwidth, OSDheight;

11
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: i18n.c 1.38 2001/09/01 15:20:45 kls Exp $ * $Id: i18n.c 1.39 2001/09/02 15:17:33 kls Exp $
* *
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net> * Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
* Italian translations provided by Alberto Carraro <bertocar@tin.it> * Italian translations provided by Alberto Carraro <bertocar@tin.it>
@ -857,6 +857,15 @@ const tPhrase Phrases[] = {
"Durée de vie par défaut", "Durée de vie par défaut",
"Normal levetid (Timer)", "Normal levetid (Timer)",
}, },
{ "UseSubtitle",
"Subtitle verwenden",
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
},
{ "VideoFormat", { "VideoFormat",
"Video Format", "Video Format",
"", // TODO "", // TODO

13
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 1.113 2001/09/02 10:00:40 kls Exp $ * $Id: menu.c 1.114 2001/09/02 15:04:41 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -1727,6 +1727,7 @@ void cMenuSetup::Set(void)
Add(new cMenuEditIntItem( tr("PrimaryLimit"), &data.PrimaryLimit, 0, MAXPRIORITY)); Add(new cMenuEditIntItem( tr("PrimaryLimit"), &data.PrimaryLimit, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("DefaultPriority"), &data.DefaultPriority, 0, MAXPRIORITY)); Add(new cMenuEditIntItem( tr("DefaultPriority"), &data.DefaultPriority, 0, MAXPRIORITY));
Add(new cMenuEditIntItem( tr("DefaultLifetime"), &data.DefaultLifetime, 0, MAXLIFETIME)); Add(new cMenuEditIntItem( tr("DefaultLifetime"), &data.DefaultLifetime, 0, MAXLIFETIME));
Add(new cMenuEditBoolItem(tr("UseSubtitle"), &data.UseSubtitle));
Add(new cMenuEditBoolItem(tr("VideoFormat"), &data.VideoFormat, "4:3", "16:9")); Add(new cMenuEditBoolItem(tr("VideoFormat"), &data.VideoFormat, "4:3", "16:9"));
Add(new cMenuEditBoolItem(tr("ChannelInfoPos"), &data.ChannelInfoPos, tr("bottom"), tr("top"))); Add(new cMenuEditBoolItem(tr("ChannelInfoPos"), &data.ChannelInfoPos, tr("bottom"), tr("top")));
Add(new cMenuEditIntItem( tr("OSDwidth"), &data.OSDwidth, MINOSDWIDTH, MAXOSDWIDTH)); Add(new cMenuEditIntItem( tr("OSDwidth"), &data.OSDwidth, MINOSDWIDTH, MAXOSDWIDTH));
@ -2100,12 +2101,14 @@ cRecordControl::cRecordControl(cDvbApi *DvbApi, cTimer *Timer)
timer->SetPending(true); timer->SetPending(true);
timer->SetRecording(true); timer->SetRecording(true);
if (Channels.SwitchTo(timer->channel, dvbApi)) { if (Channels.SwitchTo(timer->channel, dvbApi)) {
const char *Subtitle = NULL;
const char *Summary = NULL;
if (GetEventInfo()) { if (GetEventInfo()) {
//XXX this is in preparation for storing recordings in subdirectories and giving them the name of the Subtitle dsyslog(LOG_INFO, "Title: '%s' Subtitle: '%s'", eventInfo->GetTitle(), eventInfo->GetSubtitle());
dsyslog(LOG_INFO, "Title: '%s' Subtitle: '%s'", eventInfo->GetTitle(), eventInfo->GetSubtitle());//XXX Subtitle = eventInfo->GetSubtitle();
//XXX modify timer's name and summary, mark it as modified (revert later when stopping) Summary = eventInfo->GetExtendedDescription();
} }
cRecording Recording(timer); cRecording Recording(timer, Subtitle, Summary);
if (dvbApi->StartRecord(Recording.FileName(), Channels.GetByNumber(timer->channel)->ca, timer->priority)) if (dvbApi->StartRecord(Recording.FileName(), Channels.GetByNumber(timer->channel)->ca, timer->priority))
Recording.WriteSummary(); Recording.WriteSummary();
Interface->DisplayRecording(dvbApi->CardIndex(), true); Interface->DisplayRecording(dvbApi->CardIndex(), true);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.c 1.35 2001/09/02 10:25:12 kls Exp $ * $Id: recording.c 1.36 2001/09/02 15:09:28 kls Exp $
*/ */
#define _GNU_SOURCE #define _GNU_SOURCE
@ -204,19 +204,32 @@ char *ExchangeChars(char *s, bool ToFileSystem)
return s; return s;
} }
cRecording::cRecording(cTimer *Timer) cRecording::cRecording(cTimer *Timer, const char *Subtitle, const char *Summary)
{ {
titleBuffer = NULL; titleBuffer = NULL;
fileName = NULL; fileName = NULL;
name = strdup(Timer->file); if (Timer->IsSingleEvent() || !Setup.UseSubtitle)
name = strdup(Timer->file);
else {
if (isempty(Subtitle))
Subtitle = " ";
asprintf(&name, "%s~%s", Timer->file, Subtitle);
}
// substitute characters that would cause problems in file names: // substitute characters that would cause problems in file names:
strreplace(name, '\n', ' '); strreplace(name, '\n', ' ');
summary = Timer->summary ? strdup(Timer->summary) : NULL;
if (summary)
strreplace(summary, '|', '\n');
start = Timer->StartTime(); start = Timer->StartTime();
priority = Timer->priority; priority = Timer->priority;
lifetime = Timer->lifetime; lifetime = Timer->lifetime;
// handle summary:
summary = !isempty(Timer->summary) ? strdup(Timer->summary) : NULL;
if (!summary) {
if (isempty(Subtitle))
Subtitle = "";
if (isempty(Summary))
Summary = "";
if (*Subtitle || *Summary)
asprintf(&summary, "%s%s%s", Subtitle, (*Subtitle && *Summary) ? "\n\n" : "", Summary);
}
} }
cRecording::cRecording(const char *FileName) cRecording::cRecording(const char *FileName)

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: recording.h 1.15 2001/09/01 12:58:02 kls Exp $ * $Id: recording.h 1.16 2001/09/02 11:35:56 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -39,7 +39,7 @@ public:
time_t start; time_t start;
int priority; int priority;
int lifetime; int lifetime;
cRecording(cTimer *Timer); cRecording(cTimer *Timer, const char *Subtitle, const char *Summary);
cRecording(const char *FileName); cRecording(const char *FileName);
~cRecording(); ~cRecording();
const char *FileName(void); const char *FileName(void);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: videodir.c 1.5 2001/05/01 09:48:57 kls Exp $ * $Id: videodir.c 1.6 2001/09/02 14:55:15 kls Exp $
*/ */
#include "videodir.h" #include "videodir.h"
@ -188,13 +188,21 @@ const char *PrefixVideoFileName(const char *FileName, char Prefix)
if (!PrefixedName || strlen(PrefixedName) <= strlen(FileName)) if (!PrefixedName || strlen(PrefixedName) <= strlen(FileName))
PrefixedName = (char *)realloc(PrefixedName, strlen(FileName) + 2); PrefixedName = (char *)realloc(PrefixedName, strlen(FileName) + 2);
if (PrefixedName) { if (PrefixedName) {
strcpy(PrefixedName, VideoDirectory); const char *p = FileName + strlen(FileName); // p points at the terminating 0
char *p = PrefixedName + strlen(PrefixedName); int n = 2;
*p++ = '/'; while (p-- > FileName && n > 0) {
*p++ = Prefix; if (*p == '/') {
strcpy(p, FileName + strlen(VideoDirectory) + 1); if (--n == 0) {
int l = p - FileName + 1;
strncpy(PrefixedName, FileName, l);
PrefixedName[l] = Prefix;
strcpy(PrefixedName + l + 1, p + 1);
return PrefixedName;
}
}
}
} }
return PrefixedName; return NULL;
} }
void RemoveEmptyVideoDirectories(void) void RemoveEmptyVideoDirectories(void)