[1.25.15] Callback in AUDIO_OUTPUT_PLAYBACK mode gives a zero-terminated list of events.

espeak_SetSynthCallback() can be called either before or after espeak_Initialize().


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@31 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-06-01 18:00:19 +00:00
parent 85cb0ec378
commit 97b217c26a
13 changed files with 34 additions and 17 deletions
+11 -4
View File
@@ -74,13 +74,16 @@ static void* polling_thread(void*);
//>
//<event_init
void event_init(t_espeak_callback* SynthCallback)
void event_set_callback(t_espeak_callback* SynthCallback)
{
my_callback = SynthCallback;
}
void event_init(void)
{
ENTER("event_init");
my_callback = SynthCallback;
SHOW("event_init > my_callback=0x%x\n", my_callback);
my_event_is_running=0;
// security
@@ -193,6 +196,10 @@ ENTER("event_notify");
static unsigned int a_old_uid = 0;
espeak_EVENT events[2];
memcpy(&events[0],event,sizeof(espeak_EVENT)); // the event parameter in the callback function should be an array of eventd
events[1].type = espeakEVENT_LIST_TERMINATED; // ... terminated by an event type=0
if (event && my_callback)
{
event_display(event);