Autostart Plug-in

Autostart Plug-in

Description

Allows the automatic start of other plug-ins on change or insertion of removable devices.

The plug-in detects audio CDs or video DVDs. For removable devices like USB sticks the plug-in mounts the device and try to detect a suitable plug-in according the file extension.

Configuration

The plug-in will be configured via the file $VDRCONFIG/conf/plugins/autostart/autostart.conf.

Example for an autostart.conf

An audio CD shall be played with the CD player plug-in, a video DVD shall be displayed with the externalplayer plug-in, an USB stick with MP3 files shall be played with the music plug-in. For an USB stick with pictures the pictures shall be displayed with the image plug-in.

; The global section contains definitions global to all detectors 
[GLOBAL]
; exclude the given devices from media detection, e.g. the root hard drives
filterdev = sda sdb hda hdb
; filterdev = AUTO
[DVD]
type = dvd ; DVD Media tester
keys = @externalplayer OK
[CD]
type = cd ; CD Media tester
keys = @cdplayer ; Start CD-Player plug-in
[MP3]
type = file ; File Media tester
files = mp3 ; Suffix to match
keys = @music YELLOW ; If a file ending with .mp3 is found, start music
plug-in
linkpath = /video/mount/mp3
[IMG]
type = file ; File Media tester
files = jpg gif bmp ; If a file ends with .jpg .gif or .bmp, start image plug-in
keys = @image YELLOW DOWN RED RED
linkpath = /video/mount/image

Global Section.

The global section contains definitions global to all detectors. Currently only the keyword filterdev is available.

filterdev defines an exclude list of devices, which shall not be scanned (for example the root disk). If the keyword AUTO is used, the plug-in tries to detect internal devices according the file /etc/fstab.

Keywords for all Media Tester.

TYPE defines an instance of a Media-Tester. Currently the following Media-Tester are available:

DVD Detect video DVDs via libdvdread.
CD Detect audio CDs via libcdio.
FILE Mounts a removable media and try to detect the file type according the file extension.

KEY Defines the plug-in and the keys required to start the action, when a media is inserted and detected. A @ at the beginning of a name indicates the plug-in to start. For example the row "keys = @externalplayer OK" means, start plug-in externalplayer and send the OK key to the plug-in.

Keywords for the FILE-Media Tester.

FILES File extensions which the media tester shall check.
LINKPATH Generates a symbolic link from the automatic mounted medium to a directory. In the secton [MP3] in the above example a link for an inserted USB-Stick will be created to /video/mount/mp3.

Configuration of the externalplayer Plug-in

In this configuration only one menu entry exist. So it is sufficient to simulate only an OK.

 # Externalplayer plug-in example configuration.
{
Command = "xine -L --stdctl -c /video/etc/xine.conf dvd://";
MenuEntry = "Xine DVD";
OutputMode = extern;
InputMode = slave;
BlockMenu = true; # This makes sense, because an invisible main menu would block all the keys.
vdrKeyUp = specialKeyPageUp; # See below for a full list of "special keys."
vdrKeyDown = specialKeyPageDown;
vdrKeyLeft = specialKeyLeft;
vdrKeyRight = specialKeyRight;
vdrKeyOk = specialKeyReturn;
vdrKeyBack = noKey;
vdrKeyRed = noKey;
vdrKeyGreen = ">";
vdrkeyyellow = "<";
....
}

Music Plug-in

The musicsources.conf should have for the above example the following entry in the first line:

/video/mount/mp3;USB-Stick;0;*.mp3/*.ogg/*.wav/*.MP3/*.OGG/*.WAV/*.m3u/*.M3U/*.pls/*.PLS 

Image Plug-in

A slightly more complex example is the image Plug-in:

/video/images; Bilder;0; *.jpg *.jpeg *.png *.tif* *.bmp
/video/mount/image; USB; 0; *.jpg *.jpeg *.png *.tif* *.bmp

SVDRP Support

The media detection can be started via svdrpsend.pl plug autostart DETECT.


requirements

Parameter

Parameter (short) Parameter (long) Description
-c <directory> --configdir=<directory> Configuration directory

Download