diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-06-15 19:11:35 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-06-15 19:11:35 -0700 |
commit | 68cc907e6a8180092f185be1e611d5a8b6057056 (patch) | |
tree | 871b9b31c01e22ce2807c6c33f8b4235b3ad9cba /src/modules | |
parent | 3da9ffaefe9c5557cd8eb8c61e34471b19ca0c5f (diff) |
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...
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/rkt/rkt.c | 12 |
1 files 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. |