#! /bin/bash -e

VIEWER_LAUNCH=${FAUST2FIREFOX_VIEWER_LAUNCH}
if [[ -z "${VIEWER_LAUNCH}" ]]; then
    if [[ $(uname) == Darwin ]]; then
        VIEWER_LAUNCH=open
    else
        VIEWER_LAUNCH=xdg-open
    fi
fi

faust2svg $@ || exit
${VIEWER_LAUNCH} ${1%.dsp}-svg/process.svg&
shift
for f in $@; do
    sleep 1
    ${VIEWER_LAUNCH} ${f%.dsp}-svg/process.svg&
done

