From 17990782709a52da6cd0aad02edd5cd4e4bc91af Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 13 Jul 2023 05:34:09 -0700 Subject: modules/rkt: add 99999 exit scene define rkt_scener needs to know this value so define it in rkt.h and switch over all the existing 99999 instances. --- src/modules/rkt/rkt.c | 9 ++++++--- src/modules/rkt/rkt.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c index a16d24f..02154b0 100644 --- a/src/modules/rkt/rkt.c +++ b/src/modules/rkt/rkt.c @@ -277,13 +277,16 @@ static void rkt_render_fragment(til_module_context_t *context, til_stream_t *str if (scene < ctxt->n_scenes) { til_module_render(ctxt->scenes[scene].module_ctxt, stream, ticks, fragment_ptr); - } else if (scene == 99999 && !((rkt_setup_t *)context->setup)->connect && !ctxt->scener) { + } else if (scene == RKT_EXIT_SCENE_IDX && + !((rkt_setup_t *)context->setup)->connect && + !ctxt->scener) { + /* 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 [%s] [%s]", context->setup->path, - scene == 99999 ? "EXIT SCENE" : "NO SCENE", + scene == RKT_EXIT_SCENE_IDX ? "EXIT SCENE" : "NO SCENE", scene, ((rkt_setup_t *)context->setup)->connect ? (ctxt->connected ? "ONLINE" : "OFFLINE") : "PLAYER", ctxt->scener ? "SCENER" : "NOSCENER"); @@ -302,7 +305,7 @@ static void rkt_render_fragment(til_module_context_t *context, til_stream_t *str } if (scene < ctxt->n_scenes && - scene != 999999 && + scene != RKT_EXIT_SCENE_IDX && ((rkt_setup_t *)context->setup)->connect && !ctxt->connected) { txt_t *msg = txt_newf("OFFLINE"); diff --git a/src/modules/rkt/rkt.h b/src/modules/rkt/rkt.h index ae0fa64..241fa24 100644 --- a/src/modules/rkt/rkt.h +++ b/src/modules/rkt/rkt.h @@ -5,6 +5,8 @@ #include "til_module_context.h" #include "til_settings.h" +#define RKT_EXIT_SCENE_IDX 99999 + typedef struct rkt_scener_t rkt_scener_t; typedef struct rkt_scene_t { -- cgit v1.2.3