X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/1059e1cc0c2ecfa237406949aa26155b6a5b9154..66f23d4fabf89ad09adbd4dfc15ac6b5b2b7da83:/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2appls/faust2sigviewer diff --git a/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2appls/faust2sigviewer b/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2appls/faust2sigviewer new file mode 100755 index 0000000..a167ec4 --- /dev/null +++ b/interpreter/preprocessor/faust-0.9.47mr3/tools/faust2appls/faust2sigviewer @@ -0,0 +1,41 @@ +#!/bin/bash + +# Usage. +print_usage() +{ + echo Usage : args of faust2graphviewer should be a \'.dsp\' file, or a list of \'.dsp\' files. +} + + +# prepare how we are going to open .pdf files +if [[ $(uname) == Darwin ]]; then + OPEN=open +else + OPEN=xdg-open +fi + + + +# Main loop of this script : +for FILEPATH in $@ ; do + if [ -f $FILEPATH ] ; then + FILENAME=`basename $FILEPATH` && + case $FILENAME in + *.dsp ) + faust -o /dev/null -sg $FILEPATH && + dot -Tpdf $FILEPATH-sig.dot -o ${FILEPATH%.dsp}-sig.pdf && + rm $FILEPATH-sig.dot && + ${OPEN} ${FILEPATH%.dsp}-sig.pdf + ;; + * ) + echo error : \'$FILEPATH\' does not have a \'.dsp\' extension. + exit 2 + ;; + esac + else + print_usage + exit 1 + fi +done +exit 0 +