diff options
author | VDR user <vdr@yavdr.gitarren.local> | 2010-03-14 13:15:46 +0100 |
---|---|---|
committer | VDR user <vdr@yavdr.gitarren.local> | 2010-03-14 13:15:46 +0100 |
commit | 8c00e6eb8fd0fca7f09e1091d1d07a5e0f7ca9b6 (patch) | |
tree | d48e044719599ded9e2cb722187484838e5377c2 /example | |
download | vdr-plugin-pvrinput-8c00e6eb8fd0fca7f09e1091d1d07a5e0f7ca9b6.tar.gz vdr-plugin-pvrinput-8c00e6eb8fd0fca7f09e1091d1d07a5e0f7ca9b6.tar.bz2 |
init
Diffstat (limited to 'example')
-rw-r--r-- | example/README.channel-conv | 13 | ||||
-rwxr-xr-x | example/channel-conv.sh | 81 | ||||
-rw-r--r-- | example/channels.conf_newsyntax.example | 77 | ||||
-rwxr-xr-x | example/externchannelswitch.sh.example | 21 |
4 files changed, 192 insertions, 0 deletions
diff --git a/example/README.channel-conv b/example/README.channel-conv new file mode 100644 index 0000000..3aed6f8 --- /dev/null +++ b/example/README.channel-conv @@ -0,0 +1,13 @@ +Converting your existing channels.conf to the new pvrinput syntax is very +simple. (The following example assumes that your channels.conf is in /etc/vdr and +that you have copied channel-conv.sh into that directory) + +First you need to stop vdr of course. + +cd /etc/vdr +mv channels.conf channels.conf.old +./channel-conv.sh channels.conf.old channels.conf + +If you have timers on pvrinput channels, you have to adjust +the timers.conf before restarting vdr. The easiest way is to delete all +entries for pvrinput channels and set new timers after restarting vdr.
\ No newline at end of file diff --git a/example/channel-conv.sh b/example/channel-conv.sh new file mode 100755 index 0000000..1d0772f --- /dev/null +++ b/example/channel-conv.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# new syntax needs vdr with iptv patch! +# have phun, --wirbel 20090526 + +if [ -z "$2" ] # expecting two args +then + echo "Usage: `basename $0` channels.conf.old channels.conf" + echo " " + echo "converts existing pvrinput channels.conf to new channels.conf syntax." + echo " * first arg is path to old channels.conf" + echo " * second arg is path to new channels.conf" + echo " " + echo "-- MISSING ARGUMENTS. EXITING NOW. --" + exit -1 +else + OLDFILE=$1 + NEWFILE=$2 +fi + + +NUM=0 +nsid=0 +need_ext_inputs=0 + +while IFS=: read name freq param source srate vpid apid tpid caid sid nid tid rid +do + if [ -z "$name" ]; then + echo ":"$freq"" >> $NEWFILE + continue + fi + + if [[ "$caid" == "A1" ]]; then + + if (( freq < 10000 )); then + # ext input; *impossible* to convert. skip them now and add new(!) entries at the end of conf. + need_ext_inputs=1 + continue + fi + + let "nsid=(500 + freq*16)/1000" + echo -n "$name:$freq:PVRINPUT|" >> $NEWFILE + if (( freq < 87500 )) || (( freq > 108000 )); then + echo -n "TV" >> $NEWFILE + norm="PAL" + vtest=$(echo $param | grep "I0") + if [[ ! -z "$vtest" ]]; then + norm="NTSC" + fi + vtest=$(echo $param | grep "I1") + if [[ ! -z "$vtest" ]]; then + norm="SECAM" + fi + echo -n "|$norm:P:0:301:300:305:0:" >> $NEWFILE + else + echo -n "RADIO:P:0:0:300:0:0:" >> $NEWFILE + fi + echo "$nsid:$nid:$tid:$rid" >> $NEWFILE + + else + # non-pvrinput channel; copy n paste it + echo "$name:$freq:$param:$source:$srate:$vpid:$apid:$tpid:$caid:$sid:$nid:$tid:$rid" >> $NEWFILE + fi + + NUM=$NUM+1 +done < $OLDFILE # I/O redirection. + + +# create ext inputs if needed; no scanning - just a dumb adding all of them. +if (( $need_ext_inputs == 1 )); then + ext_sid=9000 + echo -n ":ext analog inputs" >> $NEWFILE && echo "" >> $NEWFILE + for (( i=0; i<=4; i++ )); do + echo "Composite $i;pvrinput:1:PVRINPUT|COMPOSITE$i:P:0:301:300:0:0:$ext_sid:0:0:0" >> $NEWFILE + let "ext_sid=ext_sid+1" + done + for (( i=0; i<=3; i++ )); do + echo "S-Video $i;pvrinput:1:PVRINPUT|SVIDEO$i:P:0:301:300:0:0:$ext_sid:0:0:0" >> $NEWFILE + let "ext_sid=ext_sid+1" + done +fi + diff --git a/example/channels.conf_newsyntax.example b/example/channels.conf_newsyntax.example new file mode 100644 index 0000000..f87f71c --- /dev/null +++ b/example/channels.conf_newsyntax.example @@ -0,0 +1,77 @@ +SE2:112250:PVRINPUT|TV:P:0:301:300:305:0:1796:0:0:0 +SE3:119250:PVRINPUT|TV:P:0:301:300:305:0:1908:0:0:0 +SE4:126250:PVRINPUT|TV:P:0:301:300:305:0:2020:0:0:0 +SE5:133250:PVRINPUT|TV:P:0:301:300:305:0:2132:0:0:0 +SE6:140250:PVRINPUT|TV:P:0:301:300:305:0:2244:0:0:0 +SE7:147250:PVRINPUT|TV:P:0:301:300:305:0:2356:0:0:0 +SE8:154250:PVRINPUT|TV:P:0:301:300:305:0:2468:0:0:0 +SE9:161250:PVRINPUT|TV:P:0:301:300:305:0:2580:0:0:0 +SE10:168250:PVRINPUT|TV:P:0:301:300:305:0:2692:0:0:0 +k05:175250:PVRINPUT|TV:P:0:301:300:305:0:2804:0:0:0 +k06:182250:PVRINPUT|TV:P:0:301:300:305:0:2916:0:0:0 +k07:189250:PVRINPUT|TV:P:0:301:300:305:0:3028:0:0:0 +k08:196250:PVRINPUT|TV:P:0:301:300:305:0:3140:0:0:0 +k09:203250:PVRINPUT|TV:P:0:301:300:305:0:3252:0:0:0 +k10:210250:PVRINPUT|TV:P:0:301:300:305:0:3364:0:0:0 +k11:217250:PVRINPUT|TV:P:0:301:300:305:0:3476:0:0:0 +k12:224250:PVRINPUT|TV:P:0:301:300:305:0:3588:0:0:0 +SE11:231250:PVRINPUT|TV:P:0:301:300:305:0:3700:0:0:0 +SE12:238250:PVRINPUT|TV:P:0:301:300:305:0:3812:0:0:0 +SE13:245250:PVRINPUT|TV:P:0:301:300:305:0:3924:0:0:0 +SE14:252250:PVRINPUT|TV:P:0:301:300:305:0:4036:0:0:0 +SE15:259250:PVRINPUT|TV:P:0:301:300:305:0:4148:0:0:0 +SE16:266250:PVRINPUT|TV:P:0:301:300:305:0:4260:0:0:0 +SE17:273250:PVRINPUT|TV:P:0:301:300:305:0:4372:0:0:0 +SE18:280250:PVRINPUT|TV:P:0:301:300:305:0:4484:0:0:0 +SE19:287250:PVRINPUT|TV:P:0:301:300:305:0:4596:0:0:0 +SE20:294250:PVRINPUT|TV:P:0:301:300:305:0:4708:0:0:0 +S21:303250:PVRINPUT|TV:P:0:301:300:305:0:4852:0:0:0 +S22:311250:PVRINPUT|TV:P:0:301:300:305:0:4980:0:0:0 +S23:319250:PVRINPUT|TV:P:0:301:300:305:0:5108:0:0:0 +S24:327250:PVRINPUT|TV:P:0:301:300:305:0:5236:0:0:0 +S25:335250:PVRINPUT|TV:P:0:301:300:305:0:5364:0:0:0 +S26:343250:PVRINPUT|TV:P:0:301:300:305:0:5492:0:0:0 +S27:351250:PVRINPUT|TV:P:0:301:300:305:0:5620:0:0:0 +S28:359250:PVRINPUT|TV:P:0:301:300:305:0:5748:0:0:0 +S29:367250:PVRINPUT|TV:P:0:301:300:305:0:5876:0:0:0 +S30:375250:PVRINPUT|TV:P:0:301:300:305:0:6004:0:0:0 +S35:415250:PVRINPUT|TV:P:0:301:300:305:0:6644:0:0:0 +k21:471250:PVRINPUT|TV:P:0:301:300:305:0:7540:0:0:0 +k22:479250:PVRINPUT|TV:P:0:301:300:305:0:7668:0:0:0 +k23:487250:PVRINPUT|TV:P:0:301:300:305:0:7796:0:0:0 +k24:495250:PVRINPUT|TV:P:0:301:300:305:0:7924:0:0:0 +k25:503250:PVRINPUT|TV:P:0:301:300:305:0:8052:0:0:0 +k26:511250:PVRINPUT|TV:P:0:301:300:305:0:8180:0:0:0 +k27:519250:PVRINPUT|TV:P:0:301:300:305:0:8308:0:0:0 +k28:527250:PVRINPUT|TV:P:0:301:300:305:0:8436:0:0:0 +k29:535250:PVRINPUT|TV:P:0:301:300:305:0:8564:0:0:0 +k30:543250:PVRINPUT|TV:P:0:301:300:305:0:8692:0:0:0 +k31:551250:PVRINPUT|TV:P:0:301:300:305:0:8820:0:0:0 +k32:559250:PVRINPUT|TV:P:0:301:300:305:0:8948:0:0:0 +k33:567250:PVRINPUT|TV:P:0:301:300:305:0:9076:0:0:0 +k34:575250:PVRINPUT|TV:P:0:301:300:305:0:9204:0:0:0 +k35:583250:PVRINPUT|TV:P:0:301:300:305:0:9332:0:0:0 +k36:591250:PVRINPUT|TV:P:0:301:300:305:0:9460:0:0:0 +k37:599250:PVRINPUT|TV:P:0:301:300:305:0:9588:0:0:0 +k38:607250:PVRINPUT|TV:P:0:301:300:305:0:9716:0:0:0 +k39:615250:PVRINPUT|TV:P:0:301:300:305:0:9844:0:0:0 +k40:623250:PVRINPUT|TV:P:0:301:300:305:0:9972:0:0:0 +k41:631250:PVRINPUT|TV:P:0:301:300:305:0:10100:0:0:0 +k42:639250:PVRINPUT|TV:P:0:301:300:305:0:10228:0:0:0 +k43:647250:PVRINPUT|TV:P:0:301:300:305:0:10356:0:0:0 +k44:655250:PVRINPUT|TV:P:0:301:300:305:0:10484:0:0:0 +k45:663250:PVRINPUT|TV:P:0:301:300:305:0:10612:0:0:0 +:external inputs +S-Video0 Card0:1:PVRINPUT|SVIDEO0|CARD0:P:0:301:300:305:0:9001:0:0:0 +S-Video0 Card1:1:PVRINPUT|SVIDEO0|CARD1:P:0:301:300:305:0:9002:0:0:0 +S-Video1 Card0:1:PVRINPUT|SVIDEO1|CARD0:P:0:301:300:305:0:9004:0:0:0 +S-Video1 Card1:1:PVRINPUT|SVIDEO1|CARD1:P:0:301:300:305:0:9005:0:0:0 +S-Video1 Card2:1:PVRINPUT|SVIDEO1|CARD2:P:0:301:300:305:0:9006:0:0:0 +Composite0 Card0:1:PVRINPUT|COMPOSITE0|CARD0:P:0:301:300:305:0:9007:0:0:0 +Composite0 Card1:1:PVRINPUT|COMPOSITE0|CARD1:P:0:301:300:305:0:9008:0:0:0 +Composite1 Card0:1:PVRINPUT|COMPOSITE1|CARD0:P:0:301:300:305:0:9009:0:0:0 +Composite1 Card1:1:PVRINPUT|COMPOSITE1|CARD1:P:0:301:300:305:0:9010:0:0:0 +:HD PVR +HD PVR:1:PVRINPUT|COMPONENT:P:0:4113+4097=27:0;4352:0:0:9011:1:0:0 +:radio +FM 107.6 MHz:107600:PVRINPUT|RADIO:P:0:0:300:305:0:1721:0:0:0 diff --git a/example/externchannelswitch.sh.example b/example/externchannelswitch.sh.example new file mode 100755 index 0000000..76a57c7 --- /dev/null +++ b/example/externchannelswitch.sh.example @@ -0,0 +1,21 @@ +#!/bin/bash + + +# set to true to enable debugging output +DEBUG="true" + + +declare SID="$1" +declare VDRCHANNEL="$2" +declare VIDEONUMBER="$3" +declare EXTERNCHANNEL +let "EXTERNCHANNEL = SID % 1000" #last three digits from SID without leading 0 + +#exec dct6200 "$EXTERNCHANNEL" + +if test "$DEBUG" == "true"; then + logger -s "DEBUG pvrinput externchannelswitch: Variable SID has value \"$SID\"" + logger -s "DEBUG pvrinput externchannelswitch: Variable VDRCHANNEL has value \"$VDRCHANNEL\"" + logger -s "DEBUG pvrinput externchannelswitch: Variable VIDEONUMBER has value \"$VIDEONUMBER\"" + logger -s "DEBUG pvrinput externchannelswitch: Variable EXTERNCHANNEL has value \"$EXTERNCHANNEL\"" +fi |