PageRenderTime 25ms CodeModel.GetById 18ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/native/external/espeak/src/fifo.h

http://eyes-free.googlecode.com/
C++ Header | 58 lines | 12 code | 10 blank | 36 comment | 0 complexity | b4c8b8145d0ec239764efa171cbd23ec MD5 | raw file
 1#ifndef FIFO_H
 2#define FIFO_H
 3
 4// Helps to add espeak commands in a first-in first-out queue 
 5// and run them asynchronously.
 6
 7#include "espeak_command.h"
 8#include "speak_lib.h"
 9
10// Initialize the fifo component.
11// First function to be called.
12void fifo_init();
13
14// Add an espeak command.
15//
16// Note: this function fails if too many commands are already buffered.
17// In such a case, the calling function could wait and then add again its command. 
18//
19// Return: EE_OK: operation achieved 
20//         EE_BUFFER_FULL: the command can not be buffered; 
21//           you may try after a while to call the function again.
22//         EE_INTERNAL_ERROR.
23espeak_ERROR fifo_add_command (t_espeak_command* c);
24
25// Add two espeak commands in a single transaction.
26//
27// Note: this function fails if too many commands are already buffered.
28// In such a case, the calling function could wait and then add again these commands. 
29//
30// Return: EE_OK: operation achieved 
31//         EE_BUFFER_FULL: at least one command can not be buffered; 
32//           you may try after a while to call the function again.
33//         EE_INTERNAL_ERROR.
34espeak_ERROR fifo_add_commands (t_espeak_command* c1, t_espeak_command* c2);
35
36// The current running command must be stopped and the awaiting commands are cleared.
37// Return: EE_OK: operation achieved 
38//         EE_INTERNAL_ERROR.
39espeak_ERROR fifo_stop ();
40
41// Is there a running command?
42// Returns 1 if yes; 0 otherwise.
43int fifo_is_busy ();
44
45// Terminate the fifo component.
46// Last function to be called.
47void fifo_terminate();
48
49// Indicates if the running command is still enabled.
50//
51// Note: this function is mainly called by the SynthCallback (speak_lib.cpp)
52// It indicates if the actual wave sample can still be played. It is helpful for 
53// stopping speech as soon as a cancel command is applied. 
54//
55// Returns 1 if yes, or 0 otherwise.
56int fifo_is_command_enabled();
57
58#endif