29 #include <linux/sched.h>
36 #define DRV_VERSION "2.20"
37 #define SYNTH_CLEAR 0x03
38 #define PROCSPEECH 0x0b
41 static inline int synth_full(
void)
48 static void read_buff_add(
u_char c);
49 static unsigned char get_index(
void);
52 static int is_flushing;
57 static struct var_t vars[] = {
59 {
CAPS_STOP, .u.s = {
"[:dv ap 100 ] " } },
60 {
RATE, .u.n = {
"[:ra %d] ", 180, 75, 650, 0, 0,
NULL } },
61 {
PITCH, .u.n = {
"[:dv ap %d] ", 122, 50, 350, 0, 0,
NULL } },
62 {
VOL, .u.n = {
"[:dv g5 %d] ", 86, 60, 86, 0, 0,
NULL } },
63 {
PUNCT, .u.n = {
"[:pu %c] ", 0, 0, 2, 0, 0,
"nsa" } },
64 {
VOICE, .u.n = {
"[:n%c] ", 0, 0, 9, 0, 0,
"phfdburwkv" } },
102 static struct attribute *synth_attrs[] = {
103 &caps_start_attribute.
attr,
104 &caps_stop_attribute.
attr,
105 &pitch_attribute.
attr,
106 &punct_attribute.
attr,
107 &rate_attribute.
attr,
108 &voice_attribute.
attr,
110 &delay_time_attribute.
attr,
111 &direct_attribute.
attr,
112 &full_time_attribute.
attr,
113 &jiffy_delta_attribute.
attr,
114 &trigger_time_attribute.
attr,
118 static int ap_defaults[] = {122, 89, 155, 110, 208, 240, 200, 106, 306};
119 static int g5_defaults[] = {86, 81, 86, 84, 81, 80, 83, 83, 73};
124 .long_name =
"Dectalk Express",
125 .init =
"[:error sp :name paul :rate 180 :tsr off] ",
135 .default_pitch = ap_defaults,
136 .default_vol = g5_defaults,
140 .catch_up = do_catch_up,
141 .flush = synth_flush,
143 .synth_adjust =
NULL,
147 .command =
"[:in re %d ] ",
153 .attrs = synth_attrs,
158 static int is_indnum(
u_char *ch)
160 if ((*ch >=
'0') && (*ch <=
'9')) {
186 spin_unlock_irqrestore(&flush_lock, flags);
187 }
else if (c == 0x13) {
189 }
else if (c == 0x11) {
191 }
else if (is_indnum(&c)) {
196 }
else if ((c > 31) && (c < 127)) {
205 int synth_full_val = 0;
209 unsigned long jiff_max;
212 struct var_t *jiffy_delta;
213 struct var_t *delay_time;
220 jiffy_delta_val = jiffy_delta->
u.
n.value;
222 jiff_max =
jiffies + jiffy_delta_val;
227 while (is_flushing && timeout) {
229 spin_unlock_irqrestore(&flush_lock, flags);
235 spin_unlock_irqrestore(&flush_lock, flags);
250 delay_time_val = delay_time->
u.
n.value;
251 synth_full_val = synth_full();
267 else if (ch <=
SPACE) {
268 if (!in_escape &&
strchr(
",.!?;:", last))
270 if (jiffies >= jiff_max) {
274 jiffy_delta_val = jiffy_delta->
u.
n.value;
275 delay_time_val = delay_time->
u.
n.value;
279 jiff_max =
jiffies + jiffy_delta_val;
288 static void synth_flush(
struct spk_synth *synth)
305 static int __init dectlk_init(
void)
310 static void __exit dectlk_exit(
void)