3 function show_consumers( )
5 awk -F '\t' '{ printf( "%d. %s\n", ++ i, $1 ); }' < consumers.ini
8 function get_consumer( )
11 [ "$option" != "" ] && [ $option -gt 0 ] && sed 's/\t\+/\t/g' < consumers.ini | cut -f 2 | head -n $option | tail -n -1
16 sed 's/\t\+/\t/g' < demo.ini |
17 awk -F '\t' '{ printf( "%2d. %-30.30s", ++ i, $2 ); if ( i % 2 == 0 ) printf( "\n" ); } END { if ( i % 2 == 1 ) printf( "\n" ); }'
20 function check_dependencies( )
25 deps=`sed 's/\t\+/\t/g' < demo.ini | cut -f 3 | head -n $option | tail -n -1`
32 ls $dep > /dev/null 2>&1
34 [ $val != 0 ] && echo Failed to find $dep >&2 && echo $val
46 cut -f 1 demo.ini | head -n $option | tail -n -1
65 [ "$option" == "0" ] && break
67 export MLT_CONSUMER=`get_consumer $option`
69 while [ "$option" != "0" -a "$MLT_CONSUMER" != "" ]
81 [ "$option" == "" ] && break
83 demo=`get_demo $option`
84 usable=`check_dependencies $option`
86 if [ "$usable" = "0" -a "$demo" != "" ]
88 if [ "$MLT_CONSUMER" == "westley:" ]
89 then export WESTLEY_CONSUMER="westley:$demo.westley"
90 bash $demo -consumer $WESTLEY_CONSUMER
91 inigo +$demo.txt out=100 $demo.westley $demo.westley -filter watermark:watermark1.png composite.fill=1 composite.geometry=85%,5%:10%x10%
92 elif [ "$MLT_CONSUMER" == "westley" ]
93 then bash $demo -consumer $MLT_CONSUMER | less
94 else bash $demo -consumer $MLT_CONSUMER
96 elif [ "$usable" != "" ]
99 echo Unable to locate suitable files for the demo - please provide them.