vdr/PLUGINS/src/svdrpdemo/svdrpdemo.c
Klaus Schmidinger 771986b89f Version 1.7.0
- Re-implemented handling of DVB-S2, which first appeared in version 1.5.14, but was
  revoked in version 1.5.15 in favor of making a stable version 1.6.0. VDR now
  requires the "multiproto" DVB driver, e.g. from http://jusst.de/hg/multiproto.
  Note that the channels.conf file now supports additional parameters, so you may
  want to make sure you have a backup of this file in case you need to go back to
  the previous version of VDR!
- Fixed displaying transponder data when it is modified (thanks to Reinhard Nissl).
- Fixed handling the counter in detection of pre 1.3.19 PS data (thanks to Reinhard
  Nissl).
- Improved logging system time changes to avoid problems on slow systems under
  heavy load (suggested by Helmut Auer).
- Now setting the thread name, so that it can be seen in 'top -H' (thanks to Rolf
  Ahrenberg).
- Fixed initializing the timer's flags in the cTimer copy constructor (thanks to
  Andreas Mair).
- Fixed setting the OSD level in the 'osddemo' example (thanks to Wolfgang Rohdewald).
- Increased the time between checking the CAM status to 500ms to avoid problems
  with some CAMs (reported by Arthur Konovalov).
2008-04-13 18:00:00 +02:00

60 lines
1.8 KiB
C

/*
* svdrpdemo.c: A plugin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
* $Id: svdrpdemo.c 2.0 2007/08/15 13:19:57 kls Exp $
*/
#include <vdr/plugin.h>
static const char *VERSION = "0.0.3";
static const char *DESCRIPTION = "How to add SVDRP support to a plugin";
class cPluginSvdrpdemo : public cPlugin {
private:
// Add any member variables or functions you may need here.
public:
virtual const char *Version(void) { return VERSION; }
virtual const char *Description(void) { return DESCRIPTION; }
virtual const char **SVDRPHelpPages(void);
virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode);
};
const char **cPluginSvdrpdemo::SVDRPHelpPages(void)
{
static const char *HelpPages[] = {
"DATE\n"
" Print the current date.",
"TIME [ raw ]\n"
" Print the current time.\n"
" If the optional keyword 'raw' is given, the result will be the\n"
" raw time_t data.",
NULL
};
return HelpPages;
}
cString cPluginSvdrpdemo::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
{
if (strcasecmp(Command, "DATE") == 0) {
// we use the default reply code here
return DateString(time(NULL));
}
else if (strcasecmp(Command, "TIME") == 0) {
ReplyCode = 901;
if (*Option) {
if (strcasecmp(Option, "RAW") == 0)
return cString::sprintf("%ld\nThis is the number of seconds since the epoch\nand a demo of a multi-line reply", time(NULL));
else {
ReplyCode = 504;
return cString::sprintf("Unknown option: \"%s\"", Option);
}
}
return TimeString(time(NULL));
}
return NULL;
}
VDRPLUGINCREATOR(cPluginSvdrpdemo); // Don't touch this!