PageRenderTime 53ms CodeModel.GetById 45ms app.highlight 2ms RepoModel.GetById 4ms app.codeStats 0ms

/native/external/espeak/src/event.h

http://eyes-free.googlecode.com/
C++ Header | 51 lines | 9 code | 7 blank | 35 comment | 0 complexity | 71cbd5e0ed58fc0c5b5704a679d68984 MD5 | raw file
 1#ifndef EVENT_H
 2#define EVENT_H
 3
 4/* 
 5Manage events (sentence, word, mark, end,...), is responsible of calling the external 
 6callback as soon as the relevant audio sample is played.
 7
 8
 9The audio stream is composed of samples from synthetised messages or audio icons.
10Each event is associated to a sample. 
11
12Scenario:
13
14- event_declare is called for each expected event.
15
16- A timeout is started for the first pending event.
17
18- When the timeout happens, the synth_callback is called.
19
20Note: the timeout is checked against the real progress of the audio stream, which depends on pauses or underruns. If the real progress is lower than the expected one, a new timeout starts.
21
22*/
23
24#include "speak_lib.h"
25
26// Initialize the event component.
27// First function to be called.
28// the callback will be called when the event actually occurs.
29// The callback is detailled in speak_lib.h .
30void event_init(void);
31void event_set_callback(t_espeak_callback* cb);
32
33// Clear any pending event.
34//
35// Return: EE_OK: operation achieved 
36//         EE_INTERNAL_ERROR.
37espeak_ERROR event_clear_all ();
38
39// Declare a future event
40//
41// Return: EE_OK: operation achieved 
42//         EE_BUFFER_FULL: the event can not be buffered; 
43//           you may try after a while to call the function again.
44//         EE_INTERNAL_ERROR.
45espeak_ERROR event_declare (espeak_EVENT* event);
46
47// Terminate the event component.
48// Last function to be called.
49void event_terminate();
50
51#endif