Debian Codegraph @

tools/faust2appls/faust2graphviewer

raw symbols SCIP
1 #! /bin/bash -e
2
3 # Usage.
4 print_usage()
5 {
6 echo Usage : args of faust2graphviewer should be a \'.dsp\' file, or a list of \'.dsp\' files .
7 echo Display the graph of tasks
8 }
9
10 # prepare how we are going to open .pdf files
11 if [[ $(uname) == Darwin ]]; then
12 OPEN=open
13 else
14 OPEN=xdg-open
15 fi
16
17 # Main loop of this script :
18 for FILEPATH in $@ ; do
19 if [ -f $FILEPATH ] ; then
20 FILENAME=`basename $FILEPATH` &&
21 case $FILENAME in
22 *.dsp )
23 faust -o /dev/null -vec --task-graph $FILEPATH || exit &&
24 dot -Tpdf $FILEPATH.dot -o ${FILEPATH%.dsp}-graph.pdf &&
25 rm $FILEPATH.dot &&
26 ${OPEN} ${FILEPATH%.dsp}-graph.pdf
27 ;;
28 * )
29 echo error : \'$FILEPATH\' does not have a \'.dsp\' extension.
30 exit 2
31 ;;
32 esac
33 else
34 print_usage
35 exit 1
36 fi
37 done
38 exit 0
39