run
author Markus Bröker <mbroeker@largo.dyndns.tv>
Sun, 14 Dec 2008 12:50:33 +0100
changeset 2 6ee2a130dc07
parent 0 06dd3b8d90ad
child 4 be4de85337e5
permissions -rwxr-xr-x
Common Makefile Style committer: Markus Bröker <mbroeker@largo.homelinux.org>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     1
#!/bin/bash
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     2
# $Header: /work/c/VirtualReader/run-20070320,v 1.3 2007/03/20 20:00:00 bordi $
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     3
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     4
VALGRIND="$(which valgrind)"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     5
STRACE="$(which strace)"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     6
GDB="$(which gdb)"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     7
DDD="$(which ddd)"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     8
SPLINT="$(which splint)"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
     9
BUILD="make -C src"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    10
PROG="bin/vreader"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    11
FILE="test.txt"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    12
OPTIONS="-i ${FILE} -v voice/De_Carla_22kHz -p data -format WAV -o test.wav"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    13
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    14
$BUILD
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    15
if [ $? == 0 ]
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    16
    then
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    17
    echo 
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    18
    echo "   VirtualReader - Version 0.1"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    19
    echo
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    20
    echo "       Navigation Keys:"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    21
    echo " ##############################"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    22
    echo " # i: next word               #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    23
    echo " # j: previous sentence       #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    24
    echo " # k: previous word           #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    25
    echo " # l: next sentence           #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    26
    echo " # p: print position          #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    27
    echo " # q: quit                    #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    28
    echo " # r: reset to first position #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    29
    echo " # s: print current sentence  #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    30
    echo " # v: switch verbosity on/off #"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    31
    echo " ##############################"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    32
    echo "    Press ENTER to Start"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    33
    read
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    34
    case $1 in 
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    35
	valgrind)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    36
	    $VALGRIND $PROG $OPTIONS
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    37
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    38
	strace)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    39
	    $STRACE $PROG $OPTIONS
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    40
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    41
	gdb)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    42
	    echo "break 67">gdb.exec
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    43
	    echo "r $OPTIONS" >> gdb.exec	   
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    44
	    DEBUG=1 $GDB -x gdb.exec $PROG
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    45
	    rm -f gdb.exec 
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    46
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    47
	ddd)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    48
	    echo "break 67">gdb.exec
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    49
	    echo "r $OPTIONS" >> gdb.exec	   
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    50
	    $DDD -x gdb.exec $PROG
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    51
	    rm -f gdb.exec 
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    52
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    53
	splint)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    54
	    $SPLINT -Iinclude -DMBROLA -warnposix src/main.c
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    55
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    56
	help)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    57
	    echo "Usage: run [commands]"
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    58
	    echo "valid commands are: strace, gdb, \
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    59
ddd, valgrind and help"	    
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    60
	    exit 0		
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    61
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    62
	*)
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    63
	    $PROG $OPTIONS
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    64
	    ;;
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    65
    esac    
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    66
fi
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    67
06dd3b8d90ad Virtual Reader
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff changeset
    68
rm -f audio/*.wav;