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