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

New SVDRP command CLRE

This commit is contained in:
Klaus Schmidinger 2002-08-25 10:49:02 +02:00
parent e63b279d96
commit 2d487365a1
6 changed files with 25 additions and 4 deletions

View File

@ -54,6 +54,7 @@ Matthias Schniedermeyer <ms@citd.de>
for his "schnitt" tools for his "schnitt" tools
for his "master-timer" tool for his "master-timer" tool
for helping to debug the "move to last position in list" bug for helping to debug the "move to last position in list" bug
for suggesting the SVDRP command CLRE
Miha Setina <mihasetina@softhome.net> Miha Setina <mihasetina@softhome.net>
for translating OSD texts to the Slovenian language for translating OSD texts to the Slovenian language

View File

@ -1425,3 +1425,5 @@ Video Disk Recorder Revision History
OSD capabilities (thanks to Andreas Schultz). OSD capabilities (thanks to Andreas Schultz).
- Added cPalette::AllColors() for plugins that need to get the color entries of - Added cPalette::AllColors() for plugins that need to get the color entries of
a cPalette (see osdbase.h). a cPalette (see osdbase.h).
- The new SVDRP command CLRE can be used to clear the entire EPG data (suggested
by Matthias Schniedermeyer).

9
eit.c
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: eit.c 1.48 2002/08/11 11:11:12 kls Exp $ * $Id: eit.c 1.49 2002/08/25 10:43:36 kls Exp $
***************************************************************************/ ***************************************************************************/
#include "eit.h" #include "eit.h"
@ -1035,6 +1035,13 @@ bool cSIProcessor::Read(FILE *f)
return result; return result;
} }
void cSIProcessor::Clear(void)
{
cMutexLock MutexLock(&schedulesMutex);
delete schedules;
schedules = new cSchedules;
}
void cSIProcessor::SetEpgDataFileName(const char *FileName) void cSIProcessor::SetEpgDataFileName(const char *FileName)
{ {
epgDataFileName = NULL; epgDataFileName = NULL;

3
eit.h
View File

@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* $Id: eit.h 1.17 2002/08/04 11:30:24 kls Exp $ * $Id: eit.h 1.18 2002/08/25 10:38:34 kls Exp $
***************************************************************************/ ***************************************************************************/
#ifndef __EIT_H #ifndef __EIT_H
@ -156,6 +156,7 @@ public:
// time the returned cSchedules is accessed. Once the cSchedules is no // time the returned cSchedules is accessed. Once the cSchedules is no
// longer used, the cMutexLock must be destroyed. // longer used, the cMutexLock must be destroyed.
static bool Read(FILE *f = NULL); static bool Read(FILE *f = NULL);
static void Clear(void);
void SetStatus(bool On); void SetStatus(bool On);
void SetCurrentTransponder(int CurrentTransponder); void SetCurrentTransponder(int CurrentTransponder);
static bool SetCurrentServiceID(unsigned short servid); static bool SetCurrentServiceID(unsigned short servid);

11
svdrp.c
View File

@ -10,7 +10,7 @@
* and interact with the Video Disk Recorder - or write a full featured * and interact with the Video Disk Recorder - or write a full featured
* graphical interface that sits on top of an SVDRP connection. * graphical interface that sits on top of an SVDRP connection.
* *
* $Id: svdrp.c 1.39 2002/08/11 12:01:28 kls Exp $ * $Id: svdrp.c 1.40 2002/08/25 10:40:46 kls Exp $
*/ */
#include "svdrp.h" #include "svdrp.h"
@ -174,6 +174,8 @@ const char *HelpPages[] = {
" Switch channel up, down or to the given channel number or name.\n" " Switch channel up, down or to the given channel number or name.\n"
" Without option (or after successfully switching to the channel)\n" " Without option (or after successfully switching to the channel)\n"
" it returns the current channel number and name.", " it returns the current channel number and name.",
"CLRE\n"
" Clear the entire EPG list.",
"DELC <number>\n" "DELC <number>\n"
" Delete channel.", " Delete channel.",
"DELR <number>\n" "DELR <number>\n"
@ -438,6 +440,12 @@ void cSVDRP::CmdCHAN(const char *Option)
Reply(550, "Unable to find channel \"%d\"", cDevice::CurrentChannel()); Reply(550, "Unable to find channel \"%d\"", cDevice::CurrentChannel());
} }
void cSVDRP::CmdCLRE(const char *Option)
{
cSIProcessor::Clear();
Reply(250, "EPG data cleared");
}
void cSVDRP::CmdDELC(const char *Option) void cSVDRP::CmdDELC(const char *Option)
{ {
//TODO combine this with menu action (timers must be updated) //TODO combine this with menu action (timers must be updated)
@ -967,6 +975,7 @@ void cSVDRP::Execute(char *Cmd)
*s++ = 0; *s++ = 0;
s = skipspace(s); s = skipspace(s);
if (CMD("CHAN")) CmdCHAN(s); if (CMD("CHAN")) CmdCHAN(s);
else if (CMD("CLRE")) CmdCLRE(s);
else if (CMD("DELC")) CmdDELC(s); else if (CMD("DELC")) CmdDELC(s);
else if (CMD("DELR")) CmdDELR(s); else if (CMD("DELR")) CmdDELR(s);
else if (CMD("DELT")) CmdDELT(s); else if (CMD("DELT")) CmdDELT(s);

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: svdrp.h 1.15 2002/03/08 16:40:23 kls Exp $ * $Id: svdrp.h 1.16 2002/08/25 10:35:25 kls Exp $
*/ */
#ifndef __SVDRP_H #ifndef __SVDRP_H
@ -53,6 +53,7 @@ private:
bool Send(const char *s, int length = -1); bool Send(const char *s, int length = -1);
void Reply(int Code, const char *fmt, ...); void Reply(int Code, const char *fmt, ...);
void CmdCHAN(const char *Option); void CmdCHAN(const char *Option);
void CmdCLRE(const char *Option);
void CmdDELC(const char *Option); void CmdDELC(const char *Option);
void CmdDELR(const char *Option); void CmdDELR(const char *Option);
void CmdDELT(const char *Option); void CmdDELT(const char *Option);