Navit SVN

/work/compile/navit/src/navit/support/espeak/event.h

00001 #ifndef EVENT_H
00002 #define EVENT_H
00003 
00004 /* 
00005 Manage events (sentence, word, mark, end,...), is responsible of calling the external 
00006 callback as soon as the relevant audio sample is played.
00007 
00008 
00009 The audio stream is composed of samples from synthetised messages or audio icons.
00010 Each event is associated to a sample. 
00011 
00012 Scenario:
00013 
00014 - event_declare is called for each expected event.
00015 
00016 - A timeout is started for the first pending event.
00017 
00018 - When the timeout happens, the synth_callback is called.
00019 
00020 Note: 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.
00021 
00022 */
00023 
00024 #include "speak_lib.h"
00025 
00026 // Initialize the event component.
00027 // First function to be called.
00028 // the callback will be called when the event actually occurs.
00029 // The callback is detailled in speak_lib.h .
00030 void event_init(void);
00031 void event_set_callback(t_espeak_callback* cb);
00032 
00033 // Clear any pending event.
00034 //
00035 // Return: EE_OK: operation achieved 
00036 //         EE_INTERNAL_ERROR.
00037 espeak_ERROR event_clear_all ();
00038 
00039 // Declare a future event
00040 //
00041 // Return: EE_OK: operation achieved 
00042 //         EE_BUFFER_FULL: the event can not be buffered; 
00043 //           you may try after a while to call the function again.
00044 //         EE_INTERNAL_ERROR.
00045 espeak_ERROR event_declare (espeak_EVENT* event);
00046 
00047 // Terminate the event component.
00048 // Last function to be called.
00049 void event_terminate();
00050 
00051 #endif