#include "gi_dispa.h"
#include "gi_blorb.h"
#include "resource.h"
+#include "event.h"
extern GPrivate *glk_data_key;
}
} else {
clean_up_after_playing_sound(s);
+ /* Sound ended normally, send a notification if requested */
+ if(s->notify)
+ event_throw(s->glk, evtype_SoundNotify, NULL, s->resource, s->notify);
}
break;
default:
glk_data->schannel_list = g_list_prepend(glk_data->schannel_list, s);
s->schannel_list = glk_data->schannel_list;
+ /* Add a pointer to the ChimaraGlk widget, for convenience */
+ s->glk = glk_data->self;
+
/* Create a GStreamer pipeline for the sound channel */
gchar *pipeline_name = g_strdup_printf("pipeline-%p", s);
s->pipeline = gst_pipeline_new(pipeline_name);
}
chan->repeats = repeats;
+ chan->resource = snd;
+ chan->notify = notify;
g_object_set(chan->source, "stream", stream, NULL);
g_object_unref(stream); /* Now owned by GStreamer element */