From 68cc907e6a8180092f185be1e611d5a8b6057056 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 15 Jun 2023 19:11:35 -0700 Subject: modules/rkt: end the stream on scene 99999 This conditionally will end the stream on scene 99999 if connect=off (playback mode) When connect=on it'll just make it show an "EXIT SCENE" diagnostic instead of the "NO SCENE" message. Now you just stick 99999 in the rkt:scene track to end the show. It's assumed 99999 scenes will never be needed... --- src/modules/rkt/rkt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c index 2cc031d..3316db5 100644 --- a/src/modules/rkt/rkt.c +++ b/src/modules/rkt/rkt.c @@ -297,10 +297,16 @@ static void rkt_render_fragment(til_module_context_t *context, til_stream_t *str unsigned scene; scene = (unsigned)sync_get_val(ctxt->scene_track, ctxt->rocket_row); - if (scene < ((rkt_setup_t *)context->setup)->n_scenes) + if (scene < ((rkt_setup_t *)context->setup)->n_scenes) { til_module_render(ctxt->scenes[scene].module_ctxt, stream, ticks, fragment_ptr); - else { - txt_t *msg = txt_newf("%s: NO SCENE @ %u", context->setup->path, scene); + } else if (scene == 99999 && !((rkt_setup_t *)context->setup)->connect) { + /* 99999 is treated as an "end of sequence" scene, but only honored when connect=off (player mode) */ + til_stream_end(stream); + } else { + txt_t *msg = txt_newf("%s: %s @ %u", + context->setup->path, + scene == 99999 ? "EXIT SCENE" : "NO SCENE", + scene); /* TODO: creating/destroying this every frame is dumb, but * as this is a diagnostic it's not so important. -- cgit v1.2.3