1 /*
2  * brass - Braille and speech server
3  *
4  * Copyright (C) 2001 by Roger Butenuth, All rights reserved.
5  *
6  * This is free software, placed under the terms of the
7  * GNU General Public License, as published by the Free Software
8  * Foundation.  Please see the file COPYING for details.
9  *
10  * $Id: synthesizer.h,v 1.1.1.1 2002/03/03 19:49:48 mgorse Exp $
11  */
12 #ifndef SYNTHESIZER_H
13 #define SYNTHESIZER_H
14 
15 #include "lookup.h"
16 
17 #define LANGUAGES            3
18 
19 /*
20  * Language numbers. Do not change the ordering, some programs rely on
21  * this ordering because they index some statically initialized arrays
22  * with this language numbers.
23  */
24 #define LANG_BRITISH_ENGLISH 0
25 #define LANG_GERMAN          1
26 #define LANG_DUMMY           2
27 
28 
29 typedef struct {
30     int  lang;			/* index (see defines above) */
31     char *name;			/* descriptive name */
32 } lang_descr_t;
33 
34 extern lang_descr_t languages[LANGUAGES];
35 
36 typedef enum {
37     S_SPEED,			/* 1000 = normal */
38     S_PITCH,			/* 1000 = normal */
39     S_VOLUME,			/* 1000 = normal */
40     S_MAX
41 } synth_par_t;
42 
43 
44 typedef struct synth_state *synth_state_p;
45 
46 typedef struct synth_struct {
47     synth_state_p state;
48     lang_descr_t  *lang;
49     char          *name;
50     void          *lib_handle;
51     int (*close)(struct synth_struct *s);
52     int (*synth)(struct synth_struct *s, unsigned char *buffer);
53     int (*flush)(struct synth_struct *s);
54     int (*clear)(struct synth_struct *s);
55     int (*index_set)(struct synth_struct *s);
56     int (*index_wait)(struct synth_struct *s, int id, int timeout);
57     int (*get_param)(struct synth_struct *s, synth_par_t par, int *value);
58     int (*set_param)(struct synth_struct *s, synth_par_t par, int value);
59 } synth_t;
60 
61 synth_t *open_synthesizer(void *context, lookup_string_t lookup);
62 int     close_synthesizer(synth_t *synth);
63 
64 /* open function in one of the libraries */
65 synth_t *synth_open(void *context, lookup_string_t lookup);
66 
67 #endif /* SYNTHESIZER_H */
68