X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=demo%2Fdemo;h=9cb2fee34776f3a7e8037d443e1999041b1fe0ab;hb=164f1aab30d37c01246409ca741623a993861af0;hp=41a14eaa2da4befb4563aaab9a9859f72491bbcf;hpb=84ccbc14a37779df80e1c2b0293e1930d2c0623c;p=melted diff --git a/demo/demo b/demo/demo index 41a14ea..9cb2fee 100755 --- a/demo/demo +++ b/demo/demo @@ -1,5 +1,16 @@ #!/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 | @@ -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