X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=demo%2Fdemo;h=98777ca7946622a0a4bd0e3824a8d9da964085c2;hb=1f2e5621296c35af5d2e2e0756087d2e214e7430;hp=41a14eaa2da4befb4563aaab9a9859f72491bbcf;hpb=84ccbc14a37779df80e1c2b0293e1930d2c0623c;p=melted diff --git a/demo/demo b/demo/demo index 41a14ea..98777ca 100755 --- a/demo/demo +++ b/demo/demo @@ -1,9 +1,20 @@ #!/bin/bash +function show_consumers( ) +{ + awk -F '\t' '{ printf( "%d. %s\n", ++ i, $1 ); }' < consumers.ini +} + +function get_consumer( ) +{ + option=$1 + [ "$option" != "" ] && [ $option -gt 0 ] && sed 's/\t\+/\t/g' < consumers.ini | cut -f 2 | head -n $option | tail -n -1 +} + function show_menu( ) { sed 's/\t\+/\t/g' < demo.ini | - awk -F '\t' '{ printf( "%2d. %-30.30s", ++ i, $2 ); if ( i % 2 == 0 ) printf( "\n" ); }' + awk -F '\t' '{ printf( "%2d. %-30.30s", ++ i, $2 ); if ( i % 2 == 0 ) printf( "\n" ); } END { if ( i % 2 == 1 ) printf( "\n" ); }' } function check_dependencies( ) @@ -39,34 +50,21 @@ function get_demo( ) while [ 1 ] do -cat << "eof" -Select Consumer - -1. Play with Inigo half size -2. Play with Inigo full size -3. Serialise with Westley to terminal -4. Play with Westley - -0. Exit + echo Select Consumer + echo -eof + show_consumers + echo + echo 0. Exit + echo echo -n "Option: " read option echo - export MLT_CONSUMER= + [ "$option" == "0" ] && break - case "$option" in - "0" ) exit 0 ;; - "1" ) export MLT_CONSUMER="sdl:360x288 buffer=1" ;; - "2" ) export MLT_CONSUMER="sdl" ;; - "3" ) export MLT_CONSUMER="westley" ;; - "4" ) export MLT_CONSUMER="westley:" ;; - "5" ) export MLT_CONSUMER="mcdv:NTSC target=/dev/dv1394 rescale=nearest" ;; - "6" ) export MLT_CONSUMER="bluefish:NTSC" ;; - "7" ) export MLT_CONSUMER="sdl rescale=none" ;; - esac + export MLT_CONSUMER=`get_consumer $option` while [ "$option" != "0" -a "$MLT_CONSUMER" != "" ] do @@ -90,7 +88,7 @@ eof if [ "$MLT_CONSUMER" == "westley:" ] then export WESTLEY_CONSUMER="westley:$demo.westley" bash $demo -consumer $WESTLEY_CONSUMER - inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=true + inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=1 composite.geometry=85%,5%:10%x10% elif [ "$MLT_CONSUMER" == "westley" ] then bash $demo -consumer $MLT_CONSUMER | less else bash $demo -consumer $MLT_CONSUMER