From 4ba450b7372709507a8602ae5c80b47ef39b6d38 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 15 Apr 2006 11:18:36 +0200 Subject: Implemented cPlugin::Active() --- PLUGINS.html | 68 ++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 16 deletions(-) (limited to 'PLUGINS.html') diff --git a/PLUGINS.html b/PLUGINS.html index 9515174f..8f0e12ef 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.3.30 are marked like this. -
-
  +
  Important modifications introduced in version 1.3.31 are marked like this.
-
  +
  Important modifications introduced in version 1.3.37 are marked like this.
-
  +
  Important modifications introduced in version 1.3.38 are marked like this.
+
  +Important modifications introduced in version 1.3.46 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. @@ -62,14 +62,15 @@ structures and allows it to hook itself into specific areas to perform special a

  • Main menu entry
  • User interaction
  • Housekeeping +
      +
  • Activity +
  • Setup parameters
  • The Setup menu
  • Configuration files
  • Internationalization -
     
  • Custom services -
  • -
      +
     
  • SVDRP commands
  • Loading plugins into VDR @@ -609,6 +610,44 @@ interaction is possible. If a specific action takes longer than a few seconds, the plugin should launch a separate thread to do this. +
      +

    Activity

    + +
    Now is not a good time!

    + +If a plugin is running a background task that should be finished before shutting +down the system, it can implement the function + +

    +virtual cString Active(void);
    +

    + +which shall return an empty string if it is ok to shut down, and a proper message +if not: + +

    +cString cDoSomethingPlugin::Active(void)
    +{
    +  if (busy)
    +     return tr("Doing something");
    +  return NULL;
    +}
    +

    + +The message should be short and should indicate what is currently going on. +It will be presented to the user as a confirmation message, followed by a +hyphen and a "shut down anyway?" prompt, as in +

    +Doing something - shut down anyway? +

    +All plugins will be queried, and the first one that returns a non empty +string will cause the confirmation message to be shown. If the user confirms +the prompt by pressing the "Ok" button, the rest of the plugins will also +be queried, and further prompts may show up. If all prompts have been confirmed, +the shutdown will take place. As soon as one prompt is not confirmed, no +further plugins will be queried and no shutdown will be done. +

    +

    Setup parameters

    Remember me...

    @@ -864,7 +903,6 @@ 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?

    @@ -933,9 +971,7 @@ 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

    @@ -1262,7 +1298,7 @@ public: cMyControl(void); virtual ~cMyControl(); virtual void Hide(void); -
      +
      virtual cOsdObject *GetInfo(void);
    virtual eOSState ProcessKey(eKeys Key); @@ -1294,7 +1330,7 @@ A derived cControl must implement the Hide() function, it has to hide itself from the OSD, in case it uses it. Hide() may be called at any time, and it may be called even if the cControl is not visible at the moment.

    -
      +
      The GetInfo() function is called when the user presses the Info button, and shall return a pointer to a cOsdObject that contains information about the currently played programme. The caller takes ownership of the returned @@ -1522,7 +1558,7 @@ 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). -
      +
     

    Directly accessing the OSD is only allowed from the foreground thread, which restricts this to a cOsdObject returned from the plugin's MainMenuAction() -- cgit v1.2.3