From ad40eaa28e6e9f0fa594937453b5ae53b88dce75 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 28 Aug 2005 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.31=20-=20Added=20missing=20German=20OSD?= =?UTF-8?q?=20texts=20for=20'Audio=20language'.=20-=20The=20Setup/CICAM=20?= =?UTF-8?q?menu=20now=20only=20contains=20the=20devices=20that=20actually?= =?UTF-8?q?=20have=20a=20CI=20and=20=20=20dynamically=20detects=20the=20nu?= =?UTF-8?q?mber=20of=20slots=20a=20CI=20provides.=20-=20Implemented=20cAud?= =?UTF-8?q?ioRepacker=20for=20better=20handling=20of=20audio=20PES=20packe?= =?UTF-8?q?ts=20(thanks=20to=20=20=20Reinhard=20Nissl).=20-=20Modified=20h?= =?UTF-8?q?andling=20of=20audio=20packets=20for=20radio=20channels=20in=20?= =?UTF-8?q?remux.c=20(thanks=20to=20=20=20Reinhard=20Nissl).=20-=20Updated?= =?UTF-8?q?=20the=20Danish=20OSD=20texts=20(thanks=20to=20Mogens=20Elneff)?= =?UTF-8?q?.=20-=20Fixed=20the=20EPG=20scan,=20so=20that=20it=20doesn't=20?= =?UTF-8?q?use=20the=20primary=20device=20if=20that=20is=20=20=20currently?= =?UTF-8?q?=20in=20Transfer-Mode=20from=20itself=20(thanks=20to=20Marcus?= =?UTF-8?q?=20Hilbrich=20for=20a=20bug=20=20=20report=20that=20lead=20to?= =?UTF-8?q?=20this).=20-=20Removed=20the=20TUNER=5FLOCK=5FTIMEOUT=20in=20c?= =?UTF-8?q?Device::AttachReceiver()=20since=20it=20caused=20more=20=20=20t?= =?UTF-8?q?rouble=20than=20it=20fixed.=20-=20Fixed=20detecting=20short=20c?= =?UTF-8?q?hannel=20names=20for=20"Kabel=20Deutschland",=20who=20uses=20a?= =?UTF-8?q?=20comma=20=20=20as=20delimiter=20(thanks=20to=20Marco=20Schl?= =?UTF-8?q?=C3=BC=C3=9Fler).=20-=20Moved=20cMenuEditTimer=20and=20cMenuEve?= =?UTF-8?q?nt=20to=20menu.h=20so=20that=20plugins=20can=20use=20it=20(sugg?= =?UTF-8?q?ested=20=20=20by=20Thomas=20G=C3=BCnther).=20-=20The=20new=20st?= =?UTF-8?q?atic=20function=20cString::sprintf()=20can=20be=20used=20to=20e?= =?UTF-8?q?asily=20create=20a=20formatted=20=20=20string.=20-=20Plugins=20?= =?UTF-8?q?can=20now=20implement=20their=20own=20SVDRP=20commands=20(based?= =?UTF-8?q?=20on=20a=20patch=20from=20Hardy=20=20=20Flor).=20See=20PLUGINS?= =?UTF-8?q?.html,=20section=20"SVDRP=20commands"=20for=20details.=20The=20?= =?UTF-8?q?SVDRP=20commands=20=20=20of=20a=20plugin=20are=20accessed=20thr?= =?UTF-8?q?ough=20the=20new=20SVDRP=20command=20PLUG.=20=20=20See=20PLUGIN?= =?UTF-8?q?S/src/svdrpdemo=20for=20an=20example=20of=20how=20to=20use=20th?= =?UTF-8?q?is=20feature.=20-=20The=20new=20SVDRP=20command=20PLAY=20can=20?= =?UTF-8?q?be=20used=20to=20start=20replaying=20a=20recording=20(thanks=20?= =?UTF-8?q?to=20=20=20Hardy=20Flor).=20-=20The=20new=20SVDRP=20command=20E?= =?UTF-8?q?DIT=20can=20be=20used=20to=20start=20the=20editing=20process=20?= =?UTF-8?q?of=20a=20recording=20=20=20(based=20on=20the=20CUTR=20patch=20b?= =?UTF-8?q?y=20Harald=20Milz).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PLUGINS.html | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 111 insertions(+), 16 deletions(-) (limited to 'PLUGINS.html') diff --git a/PLUGINS.html b/PLUGINS.html index 29d8351..203d870 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -14,18 +14,18 @@ Copyright © 2005 Klaus Schmidinger
www.cadsoft.de/vdr

-
  -Important modifications introduced in version 1.3.19 are marked like this. -
-
  +
  Important modifications introduced in version 1.3.20 are marked like this.
-
  +
  Important modifications introduced in version 1.3.21 are marked like this.
-
  +
  Important modifications introduced in version 1.3.30 are marked like this.
+
  +Important modifications introduced in version 1.3.31 are marked like this. +

VDR provides an easy to use plugin interface that allows additional functionality to be added to the program by implementing a dynamically loadable library file. @@ -58,7 +58,7 @@ structures and allows it to hook itself into specific areas to perform special a

  • Command line arguments
  • Command line help
  • Getting started -
      +
     
  • Shutting down
  • Main menu entry @@ -68,9 +68,12 @@ structures and allows it to hook itself into specific areas to perform special a
  • The Setup menu
  • Configuration files
  • Internationalization -
      +
     
  • Custom services
  • +
      +
  • SVDRP commands +
  • Loading plugins into VDR
  • Building the distribution package @@ -84,7 +87,7 @@ structures and allows it to hook itself into specific areas to perform special a
  • Skins
  • Themes
  • Devices -
      +
     
  • Audio
  • Remote Control @@ -311,7 +314,7 @@ since VDR, for instance, has to create the plugin objects in order to get their command line help - and after that immediately destroys them again.

    The destructor has to clean up any data created by the plugin. -
      +
      Any threads the plugin may have created shall be stopped in the Stop() function.
    @@ -509,7 +512,7 @@ VDR to exit. If the plugin doesn't implement any background functionality or internationalized texts, it doesn't need to implement either of these functions. -
      +
     

    Shutting down

    Stop it, right there!

    @@ -869,7 +872,7 @@ Texts are first searched for in the Phrases registered for this plugin (i and then in the global VDR texts. So a plugin can make use of texts defined by the core VDR code. -
      +
     

    Custom services

    What can I do for you?

    @@ -934,12 +937,106 @@ will send the request to all plugins until one plugin handles it. The function returns a pointer to the plugin that handled the request, or NULL if no plugin handled it.

    -To send a messages to all plugins, a plugin can call the function +To send a message to all plugins, a plugin can call the function cPluginManager::CallAllServices(). This function returns true if any plugin handled the request, or false if no plugin handled the request.

    +
      +

    SVDRP commands

    + +
    Infinite Diversity in Infinite Combinations

    + +A plugin can implement its own SVDRP commands through the two functions + +

    +virtual const char **SVDRPHelpPages(void);
    +virtual cString SVDRPCommand(const char *Cmd, const char *Option, int &ReplyCode);
    +

    + +The SVDRPHelpPages() function must return a pointer to a list of help +strings for all of the plugin's SVDRP commands, like this + +

    +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;
    +}
    +

    + +Note that the first line of each entry contains the actual command and its +parameters, while the following lines explain what the command does and what +the parameters (if any) mean. All lines of the explanation shall be indented +by exactly 4 blanks (no tabs), and none of them shall be longer than 79 characters +(to avoid messy output on 80 character wide terminals). The last entry in the +list must be NULL. +

    +The command names HELP and MAIN are reserverd and cannot +be used by a plugin. +

    +The actual processing of SVDRP commands for a plugin is done in its +SVDRPCommand() function. +Here's an example of such a function, which implements the commands advertised in +the above help texts: + +

    +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\n"
    +                                   "and 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;
    +}
    +

    + +The command is given to this function in the Command parameter, and any optional parameters +are given in the Option string. Command always points to an actual, non-empty string, while +Option may point to an empty string (it is never NULL, though). +

    +If a plugin doesn't implement the given command, it shall return NULL, and VDR will +automatically issue a proper error message. If it encounters an unknown or invalid +option, it shall set the ReplyCode to one of the codes defined in VDR/svdrp.c +and return a proper error message. +

    +The default ReplyCode is 900, and if the plugin doesn't care about reply +codes, it doesn't have to set it to anything else (unless there is an error, of +course). The codes in the range 901..999 are reserved for plugins that want +to use special reply codes. Any plugin can use any of these values and doesn't +have to coordinate this with any other plugin, since the caller knows which +plugin was called, and will therefore process the values according to the +particular plugin's definitions. +

    +The returned string may consist of several lines, separated by the newline character +('\n'). Each of these lines will be preceeded with the ReplyCode +when presenting them to the caller, and the continuation character ('-') +will be set for all but the last one. + +

    +

    Loading plugins into VDR

    Saddling up!

    @@ -1276,9 +1373,7 @@ public: }; cMyReceiver::cMyReceiver(int Pid) -
      :cReceiver(0, -1, Pid) -
    { } @@ -1735,7 +1830,7 @@ private: virtual void Action(void); public: cMyAudio(void); -
      +
      virtual void Play(const uchar *Data, int Length, uchar Id);
    virtual void Mute(bool On); -- cgit v1.2.3