summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXANTRONIX Development2022-03-10 15:28:58 -0500
committerXANTRONIX Development2022-03-10 15:28:58 -0500
commit316ab6ba76addc02a229c1a852182be55df29307 (patch)
treea74b5acac75724002cf477ec02b941a1161fc141 /src
parent5ca4b3bcc5e934191a23283612ca711e90f217ed (diff)
downloadxas-316ab6ba76addc02a229c1a852182be55df29307.tar.gz
xas-316ab6ba76addc02a229c1a852182be55df29307.tar.bz2
xas-316ab6ba76addc02a229c1a852182be55df29307.zip
Implement sequence stop event
Diffstat (limited to 'src')
-rw-r--r--src/seq.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/seq.c b/src/seq.c
index 26e4abe..054b61c 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -457,6 +457,33 @@ error_malloc_ev:
return -1;
}
+int xas_seq_add_stop(xas_seq *seq,
+ struct timeval timestamp) {
+ xas_seq_event *ev;
+
+ if ((ev = malloc(sizeof(*ev))) == NULL) {
+ goto error_malloc_ev;
+ }
+
+ ev->type = XAS_SEQ_EVENT_STOP;
+ ev->objtype = XAS_SEQ_OBJECT_ANY;
+ ev->object = NULL;
+ ev->timestamp = timestamp;
+ ev->flags = 0;
+
+ if (event_add(seq, ev) < 0) {
+ goto error_event_add;
+ }
+
+ return 0;
+
+error_event_add:
+ free(ev);
+
+error_malloc_ev:
+ return -1;
+}
+
static int event_trigger(xas_spatial_scene *scene, xas_seq_event *ev) {
switch (ev->type) {
case XAS_SEQ_EVENT_OFF:
@@ -532,6 +559,9 @@ static int event_trigger(xas_spatial_scene *scene, xas_seq_event *ev) {
xas_vox_generate(ev->object->ctx);
break;
+
+ case XAS_SEQ_EVENT_STOP:
+ break;
}
return 0;