X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=demo%2Fdemo;h=8ebe737ad23484159571351559422d6680df9ff1;hb=HEAD;hp=41a14eaa2da4befb4563aaab9a9859f72491bbcf;hpb=84ccbc14a37779df80e1c2b0293e1930d2c0623c;p=mlt diff --git a/demo/demo b/demo/demo index 41a14eaa..8ebe737a 100755 --- a/demo/demo +++ b/demo/demo @@ -1,9 +1,23 @@ #!/bin/bash +export MLT_PROFILE=dv_pal +export LC_NUMERIC=C + +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 +53,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 @@ -87,11 +88,11 @@ eof if [ "$usable" = "0" -a "$demo" != "" ] then - 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 - elif [ "$MLT_CONSUMER" == "westley" ] + if [ "$MLT_CONSUMER" == "xml:" ] + then export XML_CONSUMER="xml:$demo.mlt" + bash $demo -consumer $XML_CONSUMER + melt +$demo.txt out=100 $demo.mlt $demo.mlt -filter watermark:watermark1.png composite.fill=1 composite.geometry=85%/5%:10%x10% + elif [ "$MLT_CONSUMER" == "xml" ] then bash $demo -consumer $MLT_CONSUMER | less else bash $demo -consumer $MLT_CONSUMER fi