Magellan Linux

Annotation of /trunk/citrix-plugin-speechmike/speechmike-config.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2094 - (hide annotations) (download)
Fri Mar 22 13:04:31 2013 UTC (11 years, 7 months ago) by niro
File size: 5606 byte(s)
-fixed a typo VDPSPDPM.DLL -> VDPSPMIX.DLL
1 niro 2080 #!/bin/bash
2    
3     die() { echo "ERROR: $@;" exit 1; }
4    
5     check_prereqs()
6     {
7 niro 2090 type -P @@BINDIR@@/nuainitool > /dev/null || die "missing nuainitool"
8 niro 2080
9     if [ -e ${ICAROOT}/config/module.ini ]
10     then
11     MODULEINI="${ICAROOT}/config/module.ini"
12     elif [ -e /usr/lib/ICAClient/config/module.ini ]
13     then
14     MODULEINI="/usr/lib/ICAClient/config/module.ini"
15     else
16     die "module.ini not found from citrix client."
17     fi
18     }
19    
20 niro 2090 value_set()
21     {
22     local value="$1"
23     local i
24     local count="${#DRIVERS[*]}"
25    
26     for ((i=0; i < count; i++))
27     do
28     if [[ ${DRIVERS[${i}]} = ${value} ]]
29     then
30     return 0
31     fi
32     done
33    
34     return 1
35     }
36    
37 niro 2080 install_modules()
38     {
39     local virtualdrivers
40 niro 2090 local expanddrivers
41    
42     # parse and expand philips and nuance drivers to an array
43 niro 2080 virtualdrivers=$(@@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "VirtualDriver")
44 niro 2090 eval DRIVERS=( ${virtualdrivers//,} )
45     for i in SbExt PspMix PSPDPM SpeechMikeAudio SpeechMikeMixer SpeechMike
46     do
47     # only add missing drivers
48     value_set ${i} || expanddrivers+=", ${i}"
49     done
50     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "VirtualDriver=${virtualdrivers}${expanddrivers}"
51 niro 2080
52     # enable extensions
53     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "SbExt=On"
54     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "PspMix=On"
55     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "PSPDPM=On"
56     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "SpeechMike=On"
57     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "SpeechMikeAudio=On"
58     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "SpeechMikeMixer=On"
59    
60     # sbext driver settings
61     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SbExt" "DriverName=SMCAUDIO.DLL"
62    
63     # PspMix driver settings
64     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "PspMix" "DriverName=SMCMIXER.DLL"
65    
66     # SpeechMike driver settings
67     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "DriverName=VDPSPCTR.DLL"
68     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "LIB_DIR=@@SPEECHMIKELIBDIR@@"
69     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "LIB_NAME=libCtxSpMike.so"
70     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "HIDDEV_DIR=@@HIDDEVDIR@@"
71     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "JOYDEV_DIR=@@JOYDEVDIR@@"
72     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "FCBUTTON1=12"
73     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "FCBUTTON2=4"
74     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "FCBUTTON3=14"
75     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMike" "FCBUTTON4=10"
76    
77     # SpeechMikeAudio driver settings
78     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMikeAudio" "DriverName=VDPSPAUD.DLL"
79     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMikeAudio" "LIB_DIR=@@SPEECHMIKELIBDIR@@"
80     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMikeAudio" "LIB_NAME=libCtxSbExtAlsa.so"
81    
82     # SpeechMikeMixer driver settings
83 niro 2094 @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMikeMixer" "DriverName=VDPSPMIX.DLL"
84 niro 2080 @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMikeMixer" "LIB_DIR=@@SPEECHMIKELIBDIR@@"
85     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "SpeechMikeMixer" "LIB_NAME=libCtxMixerAlsa.so"
86    
87     #PSPDPM driver settings
88     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "PSPDPM" "DriverName=VDPSPDPM.DLL"
89 niro 2090 @@BINDIR@@/nuainitool -f ${MODULEINI} -s "PSPDPM" "LIB_DIR=@@SPEECHMIKELIBDIR@@"
90     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "PSPDPM" "LIB_NAME=libCtxHidMan.so"
91     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "PSPDPM" "DPM_DIR=@@DPMTEMPDIR@@"
92     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "PSPDPM" 'DPM_DRIVE=@@DPMDRIVELETTER@@'
93 niro 2080 }
94    
95     remove_modules()
96     {
97     local virtualdrivers
98 niro 2090 local driver
99     local finaldrivers
100 niro 2080 local i
101 niro 2090 local count
102 niro 2080
103 niro 2090 # parse modules and remove from array
104 niro 2080 virtualdrivers=$(@@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "VirtualDriver")
105 niro 2090 eval DRIVERS=( ${virtualdrivers//,} )
106     # delete from array
107     count="${#DRIVERS[*]}"
108     for (( i=0; i < count; i++))
109 niro 2080 do
110 niro 2090 for driver in SbExt PspMix PSPDPM SpeechMikeAudio SpeechMikeMixer SpeechMike
111     do
112     if [[ ${driver} = ${DRIVERS[${i}]} ]]
113     then
114     # reset
115     DRIVERS[${i}]=""
116     # no unneccessary parsing required anymore
117     continue
118     fi
119     done
120 niro 2080 done
121 niro 2090 # rebuild final driver list
122     for i in ${DRIVERS[*]}
123     do
124     if [[ -z ${finaldrivers} ]]
125     then
126     finaldrivers="${i}"
127     else
128     finaldrivers+=", ${i}"
129     fi
130     done
131     @@BINDIR@@/nuainitool -f ${MODULEINI} -s "ICA 3.0" "VirtualDriver=${finaldrivers}"
132 niro 2080
133     # remove modules
134     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "ICA 3.0" "SbExt"
135     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "ICA 3.0" "PspMix"
136     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "ICA 3.0" "PSPDPM"
137     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "ICA 3.0" "SpeechMike"
138     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "ICA 3.0" "SpeechMikeAudio"
139     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "ICA 3.0" "SpeechMikeMixer"
140    
141     # sbext driver settings
142     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "SbExt"
143    
144     # PspMix driver settings
145     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "PspMix"
146    
147     # SpeechMike driver settings
148     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "SpeechMike"
149    
150     # SpeechMikeAudio driver settings
151     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "SpeechMikeAudio"
152    
153     # SpeechMikeMixer driver settings
154     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "SpeechMikeMixer"
155    
156     #PSPDPM driver settings
157     @@BINDIR@@/nuainitool -f ${MODULEINI} -D -s "PSPDPM"
158     }
159    
160     case $1 in
161 niro 2090 install)
162     check_prereqs
163     install_modules
164     ;;
165     remove)
166     check_prereqs
167     remove_modules
168     ;;
169 niro 2080 *)
170     echo "Usage: $(basename $0) [action]"
171 niro 2090 echo
172 niro 2080 echo "Available actions are:"
173     echo " install - installs speechmike modules in modules.ini"
174     echo " remove - removes speechmike modules in modules.ini"
175 niro 2090 echo
176 niro 2080 ;;
177     esac
178    
179     exit 0
180