#!/bin/bash
#script for using a graphical dialog to jack_capture. Written by Svend-Erik Kjær Madsen

OPTIONS=$@

if [ ! `which Xdialog` ] ; then 
    echo "Xdialog needed";
    exit;
fi

while true
do
  Xdialog --stdout --yesno "PRESS YES TO START REC"  10 40
  case "$?" in
    0) jack_capture $OPTIONS | Xdialog --stdout --msgbox " RECORDING IN PROGRESS\n PRESS OK TO STOP REC " 10 40
       echo "Recording stopped"
    ;;
    1) Xdialog --msgbox "Ok no recording started" 10 40
    ;;
  esac
done
