summaryrefslogtreecommitdiff
path: root/PLUGINS/src/svdrpdemo/svdrpdemo.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-08-28 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-08-28 18:00:00 +0200
commitad40eaa28e6e9f0fa594937453b5ae53b88dce75 (patch)
tree6bd222711a6a20d4977d572dcab2bb526c27d743 /PLUGINS/src/svdrpdemo/svdrpdemo.c
parentdab203efe9e24f1dade33ee1da6a39b26f8501f0 (diff)
downloadvdr-patch-lnbsharing-ad40eaa28e6e9f0fa594937453b5ae53b88dce75.tar.gz
vdr-patch-lnbsharing-ad40eaa28e6e9f0fa594937453b5ae53b88dce75.tar.bz2
Version 1.3.31vdr-1.3.31
- Added missing German OSD texts for 'Audio language'. - The Setup/CICAM menu now only contains the devices that actually have a CI and dynamically detects the number of slots a CI provides. - Implemented cAudioRepacker for better handling of audio PES packets (thanks to Reinhard Nissl). - Modified handling of audio packets for radio channels in remux.c (thanks to Reinhard Nissl). - Updated the Danish OSD texts (thanks to Mogens Elneff). - Fixed the EPG scan, so that it doesn't use the primary device if that is currently in Transfer-Mode from itself (thanks to Marcus Hilbrich for a bug report that lead to this). - Removed the TUNER_LOCK_TIMEOUT in cDevice::AttachReceiver() since it caused more trouble than it fixed. - Fixed detecting short channel names for "Kabel Deutschland", who uses a comma as delimiter (thanks to Marco Schlüßler). - Moved cMenuEditTimer and cMenuEvent to menu.h so that plugins can use it (suggested by Thomas Günther). - The new static function cString::sprintf() can be used to easily create a formatted string. - Plugins can now implement their own SVDRP commands (based on a patch from Hardy Flor). See PLUGINS.html, section "SVDRP commands" for details. The SVDRP commands of a plugin are accessed through the new SVDRP command PLUG. See PLUGINS/src/svdrpdemo for an example of how to use this feature. - The new SVDRP command PLAY can be used to start replaying a recording (thanks to Hardy Flor). - The new SVDRP command EDIT can be used to start the editing process of a recording (based on the CUTR patch by Harald Milz).
Diffstat (limited to 'PLUGINS/src/svdrpdemo/svdrpdemo.c')
-rw-r--r--PLUGINS/src/svdrpdemo/svdrpdemo.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/PLUGINS/src/svdrpdemo/svdrpdemo.c b/PLUGINS/src/svdrpdemo/svdrpdemo.c
new file mode 100644
index 0000000..b6ee9a7
--- /dev/null
+++ b/PLUGINS/src/svdrpdemo/svdrpdemo.c
@@ -0,0 +1,60 @@
+/*
+ * 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 1.1 2005/08/27 16:28:58 kls Exp $
+ */
+
+#include <vdr/plugin.h>
+
+static const char *VERSION = "0.0.1";
+static const char *DESCRIPTION = "How to add SVDRP support to a plugin";
+static const char *MAINMENUENTRY = NULL;
+
+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!