Debian Codegraph @

external/espeak/fifo.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2007, Gilles Casse <[email protected]>
3 * Copyright (C) 2015-2016 Reece H. Dunn
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see: <http://www.gnu.org/licenses/>.
17 */
18
19 // Helps to add espeak commands in a first-in first-out queue
20 // and run them asynchronously.
21
22 #ifndef ESPEAK_NG_FIFO_H
23 #define ESPEAK_NG_FIFO_H
24
25 #include "espeak_ng.h"
26 #include "espeak_command.h"
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32
33 // Initialize the fifo component.
34 // First function to be called.
35 void fifo_init(void);
36
37 // Add an espeak command.
38 //
39 // Note: this function fails if too many commands are already buffered.
40 // In such a case, the calling function could wait and then add again its command.
41 espeak_ng_STATUS fifo_add_command(t_espeak_command *c);
42
43 // Add two espeak commands in a single transaction.
44 //
45 // Note: this function fails if too many commands are already buffered.
46 // In such a case, the calling function could wait and then add again these commands.
47 espeak_ng_STATUS fifo_add_commands(t_espeak_command *c1, t_espeak_command *c2);
48
49 // The current running command must be stopped and the awaiting commands are cleared.
50 espeak_ng_STATUS fifo_stop(void);
51
52 // Is there a running command?
53 // Returns 1 if yes; 0 otherwise.
54 int fifo_is_busy(void);
55
56 // Terminate the fifo component.
57 // Last function to be called.
58 void fifo_terminate(void);
59
60 // Indicates if the running command is still enabled.
61 //
62 // Note: this function is mainly called by the SynthCallback (speak_lib.cpp)
63 // It indicates if the actual wave sample can still be played. It is helpful for
64 // stopping speech as soon as a cancel command is applied.
65 //
66 // Returns 1 if yes, or 0 otherwise.
67 int fifo_is_command_enabled(void);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif