vdr/vdr/debian R90.custom vdr-recordingaction README.Debian changelog vdr.default vdr.install

Tobias Grimm pkg-vdr-dvb-changes@lists.alioth.debian.org
Sun, 23 May 2004 17:16:03 +0000


Update of /cvsroot/pkg-vdr-dvb/vdr/vdr/debian
In directory haydn:/tmp/cvs-serv8815/debian

Modified Files:
	README.Debian changelog vdr.default vdr.install 
Added Files:
	R90.custom vdr-recordingaction 
Log Message:
added recording-hooks

Index: README.Debian
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/README.Debian,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- README.Debian	23 May 2004 16:46:02 -0000	1.4
+++ README.Debian	23 May 2004 17:16:01 -0000	1.5
@@ -41,8 +41,8 @@
  -- Tobias Grimm <tg@e-tobi.net>,  Sun, 23 May 2004 18:00:00 +0100
 
 
-Command- and Recording-Command-Hooks
---------------------------------------
+Command-Hooks
+-------------
 
 VDR has the ability, to start external commands using the OSD menu. There are
 two types of external commands - normal commands and recording commands. Normal
@@ -61,13 +61,50 @@
 
 If the author of a package wants the user to be able to customize the commands
 added to vdr, the command file should be installed to /etc/vdr/command-hooks/
-and only symlinked to /usr/share/vdr/command-hooks.
+and only symlinked to /usr/share/vdr/command-hooks/.
 
 For a description of the command file syntax, refer to commands.conf and
 reccmds.conf in the vdr documention.
 
 Commands added by the user, should go to commands.custom.conf and
-reccmds.custom.conf in /etc/vdr/command-hooks. These files contain also some
+reccmds.custom.conf in /etc/vdr/command-hooks/. These files contain also some
 examples.
 
  -- Tobias Grimm <tg@e-tobi.net>,  Sun, 23 May 2004 18:00:00 +0100
+
+
+Recording-Hooks
+---------------
+
+VDR can execute an external command before a recording starts, after a
+recording ends and after a recording has been edited.
+In order to allow other packages to specify their own recording actions,
+all files in /usr/share/vdr/recording-hooks are executed one after another.
+If a file is not an executable or a link to an executable, it is executed as
+a shell script.
+
+Recording hooks are called in their alphabetical order and should follow this
+naming scheme: 
+
+R<XX>.<identifier>
+
+Where <XX> is a two digit number, that mainly specifies the execution order 
+and <identifier> is a unique descriptor.
+
+Two parameters are passed to each recording hook:
+
+Parameter 1 can have the values "before", "after" and "edited", depending
+on whether the recording hook is called before the recording starts,
+after the recording ends or after the recording has been edited.
+
+Parameter 2 is the directory of the recording. Be aware, that this directory 
+doesn't exist before the recording starts.
+
+If the author of a package wants the user to be able to customize a recording
+hook, it should be installed to /etc/vdr/recording-hooks/ and only symlinked
+to /usr/share/vdr/recording-hooks/.
+
+Custom user commands associated with the vdr package, can be added by the user
+to /etc/vdr/recording-hooks/R90.custom.
+
+ -- Tobias Grimm <tg@e-tobi.net>,  Sun, 23 May 2004 19:00:00 +0100

Index: vdr.install
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/vdr.install,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- vdr.install	8 May 2004 20:12:42 -0000	1.1
+++ vdr.install	23 May 2004 17:16:01 -0000	1.2
@@ -19,3 +19,6 @@
 keymacros.conf  etc/vdr/
 sources.conf    etc/vdr/
 svdrphosts.conf etc/vdr/
+
+debian/vdr-recordingaction /usr/bin/
+debian/R90.custom          /etc/vdr/recording-hooks/

Index: changelog
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/changelog,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- changelog	23 May 2004 16:46:02 -0000	1.20
+++ changelog	23 May 2004 17:16:01 -0000	1.21
@@ -32,8 +32,10 @@
 
   * Tobias Grimm <vdr@e-tobi.net>
     - added automatic loading of plugins in init script from c't vdr
+      (see README.Debian)
     - added dynamic generation of reccmds.conf and commands.conf from c't vdr
-    - added description of plugin and command loading to README.Debian
+      (see README.Debian)
+    - added recording hooks as used in c't vdr (see README.Debian)
 
  -- Thomas Schmidt <thomas.schmidt@in.stud.tu-ilmenau.de>  Sat, 24 Apr 2004 12:04:41 +0200
 

Index: vdr.default
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/vdr/debian/vdr.default,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- vdr.default	9 May 2004 16:24:19 -0000	1.6
+++ vdr.default	23 May 2004 17:16:01 -0000	1.7
@@ -27,6 +27,9 @@
 # Command-Hooks Directory
 CMDHOOKSDIR="/usr/share/vdr/command-hooks"
 
+# Commmand executed on start, stop and editing of a recording
+REC_CMD=/usr/bin/vdr-recordingaction
+
 # Options that will be passed to vdr's commandline
 # for example: OPTIONS="-w 15 --port=0"
-OPTIONS="-w 30"
+OPTIONS="-r $REC_CMD -w 30"

--- NEW FILE: vdr-recordingaction ---
#!/bin/sh
#
# VDR Recording Action Script  - Tobias Grimm <tg@e-tobi.net>
# ---------------------------
#
# This script gets executed by VDR before a recording starts, after a
# recording ends and after a recording has been edited.
# In order to allow other addons to hook into this process, this script will
# search for any executables in /usr/share/vdr/recording-hooks. These
# hooks are called in their alphabetical order and should follow this
# naming scheme: 
#
# R<XX>.<identifier>
#
# Where <XX> is a two digit number, that mainly specifies the execution order 
# and <identifier> is a unique descriptor.
#
# Two parameters are passed to each recording hook:
#
# Parameter 1 can have the values "before", "after" and "edited", depending
# on whether the recording hook is called before the recording starts,
# after the recording ends or after the recording has been edited.
#
# Parameter 2 is the directory of the recording. Be aware, that this directory 
# doesn't exist before the recording starts.
#

REC_HOOKS_DIR=/usr/share/vdr/recording-hooks

recordinghooks=`find $REC_HOOKS_DIR -maxdepth 1 -perm +111 -xtype f | sort`

for recordinghook in $recordinghooks; do
    case $1 in
	before|after)
	    action="$1 recording $2" 
	    ;;
	edited)
	    action "after editing recording $2" 
	    ;;
    esac
    if [ -x $recordinghook ]; then
	logger -t recordingaction "executing $recordinghook $action"
	$recordinghook $*
    else
	logger -t recordingaction "executing $recordinghook $action as shell script"
	/bin/sh $recordinghook $*
    fi
    [ $? -ne 0 ] && logger -t recordingaction "error when executing $recordinghook"
done 

--- NEW FILE: R90.custom ---
#
# Custom VDR Recording Action Hook
# ----------------------------------
#
# This is a custom Recording Action Hook. It gets called by vdr
# before a recording starts, after a recording ended and after a
# recording has been edited. It is maintained as a config file in the vdr
# package. All other recording hooks get executed before this one! 
#
# If you want to create your own recording hook that may get executed
# before any other hook, create it in /usr/share/vdr/recording-hooks or
# link to this location. All hooks are called in their alphabetical
# order and should follow this naming scheme: 
#
# R<XX>.<identifier>
#
# Where <XX> is a two digit number, that mainly specifies the execution order 
# and <identifier> is a unique descriptor.
#
# Two parameters are passed:
#
# Parameter 1 can have the values "before", "after" and "edited", depending
# on whether the recording hook is called before the recording starts,
# after the recording ends or after the recording has been edited.
#
# Parameter 2 is the directory of the recording. Be aware, that this directory 
# doesn't exist before the recording starts.
#

case $1 in
    before)
	# do here what ever you would like to do right BEFORE
	# the recording $2 STARTS
	;;
    after)
	# do here what ever you would like to do right AFTER
	# the recording $2 ENDED
        ;;
    edited)
	# do here what ever you would like to do right AFTER
	# the recording $2 has been EDITED
        ;;
esac