From 5e3374539c08d87abfc55f4878e544e0d4ac3ef6 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 13 Jan 2008 14:48:15 +0100 Subject: Added a section about "Logging" to PLUGINS.html --- PLUGINS.html | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'PLUGINS.html') diff --git a/PLUGINS.html b/PLUGINS.html index e34ab0ec..5644b684 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -14,18 +14,18 @@ Copyright © 2006 Klaus Schmidinger
www.cadsoft.de/vdr

-
  -Important modifications introduced in version 1.5.3 are marked like this. -
-
  +
  Important modifications introduced in version 1.5.7 are marked like this.
-
  +
  Important modifications introduced in version 1.5.8 are marked like this.
-
  +
  Important modifications introduced in version 1.5.10 are marked like this.
+
  +Important modifications introduced in version 1.5.13 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. @@ -59,6 +59,9 @@ structures and allows it to hook itself into specific areas to perform special a

  • Command line help
  • Getting started
  • Shutting down +
      +
  • Logging +
  • Main menu entry
  • User interaction
  • Housekeeping @@ -540,6 +543,26 @@ The Stop() function will only be called if a previous call to the returned true. The Stop() functions are called in the reverse order as the Start() functions were called. +
      +

    Logging

    + +If the plugin should print log messages, you can use dsyslog(), isyslog() or esyslog().
    +
      +
    • dsyslog() prints the log message only if the log level of vdr is set to 3. +
    • isyslog() prints the log message only if the log level of vdr is set to 2 or above. +
    • esyslog() prints the log message only if the log level of vdr is set to 1 or above. +
    +The output of this log is the syslog of the system vdr is running on. +The logmessage can be formatted like printf(), as in + +

    +esyslog("pluginname: error #%d has occurred", ErrorNumber);
    +

    + +Note that the log messages will be given as provided, the plugin's name will not +automatically be added, so make shure your log messages are obvious enough. +

    +

    Main menu entry

    Today's special is...

    @@ -906,7 +929,7 @@ const char *MyConfigDir = cPlugin::ConfigDirectory();

    Welcome to Babylon!

    -
      +
      If a plugin displays texts to the user, it should prepare for internationalization of these texts. All that is necessary for this is to mark every text that is presented to the user as translatable, as in @@ -917,7 +940,7 @@ const char *s = tr("Hello world!"); The text given here must be the English version, and the returned pointer is either a translated version (if available) or the original string. -
      +
      Texts are searched for in the domain registered for this plugin. If a plugin wants to make use of texts defined by the core VDR code, it can use the special trVDR() macro to mark these texts without having them @@ -940,7 +963,6 @@ for (int i = 0; i < 3; i++)

    -
      The system VDR is running on may use a character encoding where a single character (or symbol) consists of more than one byte (UTF-8, as opposed to, for instance, ISO8859-1, where every character is represented by a single byte in memory). @@ -951,7 +973,6 @@ character set. The names of these functions and macros are all of the form U and are defined in VDR/tools.h. Most of the time a plugin doesn't need to care about this, but when it comes to handling individual characters these functions may come in handy. -


    Custom services

    @@ -1328,7 +1349,7 @@ A player that has special requirements about audio tracks should announce its available audio tracks by calling

    -
      +
      bool DeviceSetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language = NULL, const char *Description = NULL)

    @@ -1456,13 +1477,13 @@ public: }; cMyReceiver::cMyReceiver(int Pid) -
      +
      :cReceiver(tChannelID(), -1, Pid)
    { } -
     
    +
     
     cMyReceiver::~cMyReceiver()
     {
       cReceiver::Detach();
    @@ -1614,7 +1635,6 @@ with the full required resolution. Only if this fails shall it use alternate
     areas. Drawing areas are always rectangular and may not overlap (but do not need
     to be adjacent).
     

    -
      Special consideration may have to be given to color usage if the OSD provides 8bpp (256 colors). In that case, fonts may be drawn using anti-aliasing, which requires several blended color values between the foreground and background @@ -1628,7 +1648,6 @@ osd->SetAntiAliasGranularity(); which allows the system to evenly distribute the palette entries to the various color combinations (see VDR/osd.h for details). -

    Directly accessing the OSD is only allowed from the foreground thread, which restricts this to a cOsdObject returned from the plugin's MainMenuAction() @@ -1832,7 +1851,7 @@ virtual bool HasDecoder(void) const; virtual bool CanReplay(void) const; virtual bool SetPlayMode(ePlayMode PlayMode); virtual int64_t GetSTC(void); -
      +
      virtual bool HasIBPTrickSpeed(void);
    virtual void TrickSpeed(int Speed); @@ -1862,7 +1881,7 @@ the functions

     virtual int OpenFilter(u_short Pid, u_char Tid, u_char Mask);
    -
      +
      virtual void CloseFilter(int Handle);

    -- cgit v1.2.3