From 64bbb2f651ae4c445739f840c2327d45abf7b7f5 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Tue, 19 Sep 2023 10:35:22 +0200 Subject: [PATCH] Updated The VDR Plugin System (markdown) --- The-VDR-Plugin-System.md | 90 ++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/The-VDR-Plugin-System.md b/The-VDR-Plugin-System.md index 43e9019..361a3b0 100644 --- a/The-VDR-Plugin-System.md +++ b/The-VDR-Plugin-System.md @@ -78,9 +78,9 @@ structures and allows it to hook itself into specific areas to perform special a -

Part I - The External Interface

+

Part I - The External Interface

-

Quick start

+

Quick start

Can't wait, can't wait!

@@ -102,7 +102,7 @@ So, for a quick demonstration of the plugin system, there is a sample plugin cal If you enjoyed this brief glimpse into VDR plugin handling, read through the rest of this document and eventually write your own VDR plugin. -


The name of the plugin

+

The name of the plugin

Give me some I.D.!

@@ -126,7 +126,7 @@ const char *Name(void); The actual name is derived from the plugin's library file name, as defined in the next chapter. -


The plugin directory structure

+

The plugin directory structure

Where is everybody?

@@ -156,7 +156,7 @@ for how to generate an example Makefile. 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
API version number
this plugin was
compiled for
@@ -210,7 +210,7 @@ additional libraries foo and bar, the names would be libhello-bar.so.0.0.1

-


Initializing a new plugin directory

+

Initializing a new plugin directory

A room with a view

@@ -229,7 +229,7 @@ have other plans. Add further files and maybe subdirectories to your plugin source directory as necessary. Don't forget to adapt the Makefile appropriately. -


The actual implementation

+

The actual implementation

Use the source, Luke!

@@ -296,7 +296,7 @@ and implements a file named i18n.h. To make sure it won't clash with VD i18n.h it uses the macro _I18N__H (one underline at the beginning and two replacing the dot). -


Construction and Destruction

+

Construction and Destruction

What goes up, must come down...

@@ -325,7 +325,7 @@ Any threads the plugin may have created shall be stopped in the Of course, if your plugin doesn't define any member variables that need to be initialized (and deleted), you don't need to implement either of these functions. -


Version number

+

Version number

Which incarnation is this?

@@ -371,7 +371,7 @@ while those with odd release numbers (like 1.1.x, 1.3.x a version number are not limited to single digits, so a version number of 1.2.15 would be acceptable. -


Description

+

Description

What is it that you do?

@@ -395,7 +395,7 @@ virtual const char *Description(void) Note the tr() around the DESCRIPTION, which allows the description to be internationalized. -


Command line arguments

+

Command line arguments

Taking orders

@@ -449,7 +449,7 @@ correctly, or false in case of an error. The first plugin that returns false from a call to its ProcessArgs() function will cause VDR to exit. -


Command line help

+

Command line help

Tell me about it...

@@ -478,7 +478,7 @@ same formatting as shown here it will line up nicely. Note that all lines should be terminated with a newline character, and should be shorter than 80 characters. -


Getting started

+

Getting started

Let's get ready to rumble!

@@ -516,7 +516,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

+

Shutting down

Stop it, right there!

@@ -533,7 +533,7 @@ 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

+

Logging

Traces in the sand...

@@ -579,7 +579,7 @@ purpose of the plugin to display something on stdout, like for instance the Please make any log messages in ENGLISH! Logs are usually sent to the developers of a program, and they may not be able to read them if they are in an exotic language. -


Main menu entry

+

Main menu entry

Today's special is...

@@ -607,7 +607,7 @@ The menu entries of all plugins will be inserted into VDR's main menu right after the Recordings item, in the same sequence as they were given in the call to VDR. -


User interaction

+

User interaction

It's showtime!

@@ -640,7 +640,7 @@ interaction is possible. If a specific action takes longer than a few seconds, the plugin should launch a separate thread to do this. -


Housekeeping

+

Housekeeping

Chores, chores...

@@ -665,7 +665,7 @@ 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

+

Main thread hook

Pushing in...

@@ -686,7 +686,7 @@ second. as soon as possible! If you spend too much time in this function, the user interface performance will become sluggish! -


Activity

+

Activity

Now is not a good time!

@@ -722,7 +722,7 @@ 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. -


Wakeup

+

Wakeup

Wake me up before you go-go

@@ -755,7 +755,7 @@ return a string when Active() is called at that time, otherwise VDR may again instantly. If WakeupTime() returns a time that is not in the future, the time will be ignored. -


Setup parameters

+

Setup parameters

Remember me...

@@ -828,7 +828,7 @@ needs setup parameters that are not directly user adjustable. It can use SetupStore() and SetupParse() without presenting these parameters to the user. -


The Setup menu

+

The Setup menu

Have it your way!

@@ -886,7 +886,7 @@ You can first assign the temporary values to the global variables and then do th your setup parameters and use that one to copy all parameters with one single statement (like VDR does with its cSetup class). -


Additional files

+

Additional files

I want my own stuff!

@@ -952,7 +952,7 @@ called even from outside any member function of the derived plugin class, by wri const char *MyConfigDir = cPlugin::ConfigDirectory(); -


Internationalization

+

Internationalization

Welcome to Babylon!

@@ -998,7 +998,7 @@ 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

+

Custom services

What can I do for you?

@@ -1066,7 +1066,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

+

SVDRP commands

Infinite Diversity in Infinite Combinations

@@ -1161,7 +1161,7 @@ will be set for all but the last one. Therefore the plugin needs to take care of proper locking if it accesses any global data. -


Locking

+

Locking

U can't touch this

@@ -1211,7 +1211,7 @@ See tools.h, class cListBase for more documentation and information on to use locking with timeouts, and thread.h, classes cStateLock and cStateKey on how to easily react to changes in such lists. -


Loading plugins into VDR

+

Loading plugins into VDR

Saddling up!

@@ -1251,7 +1251,7 @@ in the default or given directory that match the VDR plugin naming convention, and display their help and/or version information in addition to its own output. -


Building the distribution package

+

Building the distribution package

Let's get this show on the road!

@@ -1277,9 +1277,9 @@ vdr-hello-0.0.1.tgz in your source directory, where hello will be replaced with your actual plugin's name, and 0.0.1 will be your plugin's current version number. -


Part II - The Internal Interface

+

Part II - The Internal Interface

-

Status monitor

+

Status monitor

A piece of the action

@@ -1352,7 +1352,7 @@ See the file status.h for detailed information on which status monitor member functions are available in cStatus. You only need to implement the functions you actually want to use. -


Players

+

Players

Play it again, Sam!

@@ -1533,7 +1533,7 @@ enjoy additional players, since they will be able to control them with actions that they already know. If you absolutely want to do things differently, just go ahead - it's your show... -


Receivers

+

Receivers

Tapping into the stream...

@@ -1599,7 +1599,7 @@ Mode).

The cReceiver must be detached from its device before it is deleted. -


Filters

+

Filters

A Fistful of Data

@@ -1643,7 +1643,7 @@ and will automatically detach itself from the cDevice.

See VDR/eit.c or VDR/pat.c to learn how to process filter data. -


The On Screen Display

+

The On Screen Display

Window to the world

@@ -1734,7 +1734,7 @@ int cSkins::QueueMessage(eMessageType Type, const char *s, int Seconds = 0, int to queue that message for display. See VDR/skins.h for details. -


Skins

+

Skins

The emperor's new clothes

@@ -1791,7 +1791,7 @@ skinxyz where xyz is the actual name of the skin. -


Themes

+

Themes

Eye of the beholder...

@@ -1839,7 +1839,7 @@ By default this will use the colors that have been defined in the respective THEME_CLR() line, but may be overwritten through user supplied theme files (see man vdr(5) for information about the format of a theme file). -


Devices

+

Devices

Expanding the possibilities

@@ -2090,7 +2090,7 @@ new cMyDeviceHook; and shall not delete this object. It will be automatically deleted when the program ends. -


Positioners

+

Positioners

Now you see me - now you don't!

@@ -2129,7 +2129,7 @@ Note that the object has to be created on the heap (using new), and you shall not delete it at any point (it will be deleted automatically when the program ends). -


Audio

+

Audio

"The stereo effect may only be experienced if stereo equipment is used!"

@@ -2172,7 +2172,7 @@ will need to copy it for later processing in your thread. The Mute() and Clear() functions will be called whenever the audio shall be muted, or any buffered data shall be cleared, respectively. -


Remote Control

+

Remote Control

The joy of zapping!

@@ -2298,7 +2298,7 @@ if a key is held pressed down for a while, your derived class should use the glo parameters Setup.RcRepeatDelay and Setup.RcRepeatDelta to allow users to configure the behavior of this function. -


Conditional Access

+

Conditional Access

Members only!

@@ -2333,7 +2333,7 @@ virtual bool Assign(cDevice *Device, bool Query = false); See the description of this function in ci.h for details. -


Electronic Program Guide

+

Electronic Program Guide

The grass is always greener on the other side...

@@ -2363,7 +2363,7 @@ to signal VDR that no other EPG handlers shall be queried after this one.

See VDR/epg.h for details. -


The video directory

+

The video directory

Bits and pieces...