From 293ed4027ed3c3c8fd6ef1e8bdd79bfe69193957 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 17 Apr 2006 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.47=20-=20Updated=20the=20Finnish=20OSD=20?= =?UTF-8?q?texts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20a=20cra?= =?UTF-8?q?sh=20when=20setting=20the=20time=20transponder=20in=20the=20Set?= =?UTF-8?q?up=20menu,=20caused=20by=20the=20=20=20new=20'noneString'=20in?= =?UTF-8?q?=20cMenuEditChanItem=20(reported=20by=20Thomas=20G=C3=BCnther).?= =?UTF-8?q?=20-=20Added=20NULL=20checks=20to=20some=20strdup()=20calls=20i?= =?UTF-8?q?n=20menuitems.c=20(suggested=20by=20Darren=20=20=20Salt).=20-?= =?UTF-8?q?=20Removed=20the=20unnecessary=20'value'=20member=20from=20cMen?= =?UTF-8?q?uEditItem.=20-=20Fixed=20the=20initial=20setting=20of=20the=20t?= =?UTF-8?q?ime=20transponder=20setup=20parameter=20(reported=20=20=20by=20?= =?UTF-8?q?Thomas=20G=C3=BCnther).=20-=20Fixed=20unnecessary=20Set()=20cal?= =?UTF-8?q?ls=20in=20cMenuEditIntItem::ProcessKey().=20-=20Allowing=20a=20?= =?UTF-8?q?tolerance=20for=20symbol=20rate=20values=20that=20are=20off=20b?= =?UTF-8?q?y=20one=20(thanks=20to=20=20=20Richard=20Lithvall).=20-=20Added?= =?UTF-8?q?=20VBITeletextDescriptorTag,=20TeletextDescriptorTag,=20LocalTi?= =?UTF-8?q?meOffsetDescriptorTag=20=20=20and=20PremiereContentTransmission?= =?UTF-8?q?Descriptor=20to=20'libsi'=20(thanks=20to=20Marco=20Schl=C3=BC?= =?UTF-8?q?=C3=9Fler).=20-=20Using=20geteuid()=20to=20check=20whether=20VD?= =?UTF-8?q?R=20is=20running=20as=20user=20'root'=20(suggested=20by=20=20?= =?UTF-8?q?=20Tobias=20Grimm).=20-=20Added=20a=20missing=20"Key$"=20in=20s?= =?UTF-8?q?kincurses.c=20(reported=20by=20Darren=20Salt).=20-=20Reintroduc?= =?UTF-8?q?ed=20the=20log=20message=20"deleting=20plugin:=20..."=20when=20?= =?UTF-8?q?shutting=20down=20VDR=20(upon=20=20=20request=20by=20Ville=20Sk?= =?UTF-8?q?ytt=C3=A4,=20as=20in=20the=20initial=20patch=20from=20Christoph?= =?UTF-8?q?=20Haubrich).=20-=20Fixed=20the=20vdr.1=20man=20page=20(a=20sin?= =?UTF-8?q?gle=20DVB=20card=20can=20record=20and=20do=20live=20tv).=20-=20?= =?UTF-8?q?The=20preferred=20audio=20language=20is=20now=20automatically?= =?UTF-8?q?=20selected=20when=20starting=20replay.=20-=20Updated=20the=20D?= =?UTF-8?q?anish=20OSD=20texts=20(thanks=20to=20Mogens=20Elneff).=20-=20Th?= =?UTF-8?q?e=20new=20function=20cPlugin::Active()=20can=20be=20used=20by?= =?UTF-8?q?=20a=20plugin=20to=20indicate=20that=20it=20=20=20is=20still=20?= =?UTF-8?q?busy=20and=20the=20system=20should=20not=20shut=20down=20or=20r?= =?UTF-8?q?estart=20(based=20on=20a=20patch=20=20=20from=20Sascha=20Volken?= =?UTF-8?q?andt).=20See=20PLUGINS.html=20for=20details.=20-=20Fixed=20sett?= =?UTF-8?q?ing=20the=20'Delta'=20parameter=20when=20calling=20the=20shutdo?= =?UTF-8?q?wn=20script=20with=20=20=20no=20active=20timer=20(reported=20by?= =?UTF-8?q?=20Helge=20Lenz).=20-=20In=20order=20to=20make=20sure=20that=20?= =?UTF-8?q?plugins=20are=20compiled=20with=20the=20same=20DVB=20driver=20h?= =?UTF-8?q?eader=20=20=20files=20as=20VDR=20itself,=20the=20definition=20o?= =?UTF-8?q?f=20DVBDIR=20has=20been=20removed=20from=20the=20VDR=20=20=20Ma?= =?UTF-8?q?kefile.=20If=20you=20are=20using=20a=20driver=20version=20that?= =?UTF-8?q?=20has=20its=20header=20files=20at=20a=20location=20=20=20other?= =?UTF-8?q?=20than=20/usr/include/linux/dvb,=20you=20can=20define=20DVBDIR?= =?UTF-8?q?=20in=20the=20Make.config=20=20=20file=20(see=20also=20INSTALL)?= =?UTF-8?q?.=20Note=20that=20if=20you=20already=20have=20a=20Make.config?= =?UTF-8?q?=20file=20of=20your=20=20=20own,=20you=20should=20add=20the=20l?= =?UTF-8?q?ines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ifdef DVBDIR INCLUDES += -I$(DVBDIR)/include endif to its end, as in the new Make.config.template. Any reference to DVBDIR should be removed from all plugins' Makefiles, like this: ------------------------------------------------------------ --- PLUGINS/src/hello/Makefile 2005/11/11 13:20:14 1.10 +++ PLUGINS/src/hello/Makefile 2006/04/15 11:58:46 1.11 @@ -20,7 +20,6 @@ ### The directory environment: -DVBDIR = ../../../../DVB VDRDIR = ../../.. LIBDIR = ../../lib TMPDIR = /tmp @@ -40,7 +39,7 @@ ### Includes and Defines (add further entries here): -INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include +INCLUDES += -I$(VDRDIR)/include DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ------------------------------------------------------------ Thanks to Marco Schlüßler for pointing out this problem. - Implemented kNext and kPrev keys (based on a patch from Peter Juszack). See MANUAL for details. - Implemented kChanPrev (from a patch from Darren Salt). - The "Update channels" parameter in the "Setup/DVB" menu has been extended to allow updating only the PIDs (see MANUAL for details). When updating to this version of VDR, please verify that the setting is as you want it to be, because the values have been shifted. - The new APIVERSION (see config.h) now allows existing compiled plugins to be used with newer versions of VDR, as long as there have been no changes to the VDR header files since the last APIVERSION. Existing plugins' Makefiles should have all references to VDRVERSION changed to APIVERSION, like this: ------------------------------------------------------------ --- PLUGINS/src/hello/Makefile 2006/04/15 11:58:46 1.11 +++ PLUGINS/src/hello/Makefile 2006/04/16 09:03:50 1.12 @@ -28,9 +28,9 @@ -include $(VDRDIR)/Make.config -### The version number of VDR (taken from VDR's "config.h"): +### The version number of VDR's plugin API (taken from VDR's "config.h"): -VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g') +APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h) ### The name of the distribution archive: @@ -67,7 +67,7 @@ libvdr-$(PLUGIN).so: $(OBJS) $(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@ - @cp $@ $(LIBDIR)/$@.$(VDRVERSION) + @cp $@ $(LIBDIR)/$@.$(APIVERSION) dist: clean @-rm -rf $(TMPDIR)/$(ARCHIVE) ------------------------------------------------------------ - If a timer is newly created from within the "Schedule" menu, and its event is already running or has its start time within the next two minutes, it now goes directly into the "Edit timer" menu in order to allow the user to make further changes to timer parameters before the actual recording starts (inspired by Christian Wieninger's "epgsearch" plugin). - Added format check to syslog_with_tid(). - Updated the INSTALL file's section about non-VDR files in the video directory (since version 1.3.38 disk access is done in a separate thread, so the watchdog timer won't hit). - Changed the behaviour of the "Use small font" setup option to *always* use the small font if set to '2' - even if it would have been a fixed font (suggested by Ronny Kornexl). - No longer using characters 0x01 and 0x02 for mapping single quote and slash in recording names (thanks to Patrick Fischer for reporting that this was a problem with XML). The single quote is not mapped at all, and the slash is interchanged with the tilde. Existing recordings will be handled like before, so there is no need to actually rename them. - The cRemote::CallPlugin() function now has a boolean return value that tells the caller whether initiating the plugin call was successful (suggested by Reinhard Nissl). If it returns false, another plugin call is currently pending and the caller should try again later. This also means that the SVDRP command PLUG can now return an error code is the call fails. - The new function cPlugin::MainThreadHook() can be used by plugins to perform actions in the context of the main program thread. Use this function with great care and only of you absolutely have to! See also PLUGINS.html. --- PLUGINS.html | 101 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 84 insertions(+), 17 deletions(-) (limited to 'PLUGINS.html') diff --git a/PLUGINS.html b/PLUGINS.html index 9515174..bd18a86 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,16 @@ structures and allows it to hook itself into specific areas to perform special a

  • Main menu entry
  • User interaction
  • Housekeeping +
      +
  • Main thread hook +
  • Activity +
  • Setup parameters
  • The Setup menu
  • Configuration files
  • Internationalization -
     
  • Custom services -
  • -
      +
     
  • SVDRP commands
  • Loading plugins into VDR @@ -164,11 +166,20 @@ loadable library file for that plugin (we'll get to the details later). The lib directory contains the dynamically loadable libraries of all available plugins. Note that the names of these files are created by concatenating

    +
      - +
    libvdr-hello.so.1.1.0
    VDR plugin
    library prefix
    name of
    the plugin
    shared object
    indicator
    VDR version number
    this plugin was
    compiled for
    VDR plugin
    library prefix
    name of
    the plugin
    shared object
    indicator
    API version number
    this plugin was
    compiled for

    +The API version number refers to the plugin API version number of the VDR +version this plugin was compiled with. Compiled plugins can run with newer versions +of VDR as long as their plugin API version number is still the same as that of +the current VDR version. That way minor fixes to VDR, that don't require changes +to the VDR header files, can be made without requiring all plugins to be +recompiled. +

    +

    The plugin library files can be stored in any directory. If the default organization is not used, the path to the plugin directory has be be given to VDR through the -L option. @@ -609,6 +620,65 @@ interaction is possible. If a specific action takes longer than a few seconds, the plugin should launch a separate thread to do this. +
      +

    Main thread hook

    + +
    Pushing in...

    + +Normally a plugin only reacts on user input if directly called through its +main menu entry, or performs some background +activity in a separate thread. However, sometimes a plugin may need to do +something in the context of the main program thread, without being explicitly +called up by the user. In such a case it can implement the function + +

    +virtual void MainThreadHook(void);
    +

    + +in which it can do this. This function is called for every plugin once during +every cycle of VDR's main program loop, which typically happens once every +second. +Be very careful when using this function, and make sure you return from it +as soon as possible! If you spend too much time in this function, the user +interface performance will become sluggish! + +


    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 +934,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 +1002,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 +1329,7 @@ public: cMyControl(void); virtual ~cMyControl(); virtual void Hide(void); -
      +
      virtual cOsdObject *GetInfo(void);
    virtual eOSState ProcessKey(eKeys Key); @@ -1294,7 +1361,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 +1589,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