From d4070d282976488016320ef0e2a9de3b62b8dd6d Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 9 Dec 2023 18:26:39 -0800 Subject: modules/mixer: implement bottom={a,b} setting This makes the setting actually transpose a_module<->b_module for style={interlace,paintroller,sine}. The default is for a_module to be the logical bottom (bottom=a). --- src/modules/mixer/mixer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/mixer/mixer.c b/src/modules/mixer/mixer.c index ccd17a4..299d630 100644 --- a/src/modules/mixer/mixer.c +++ b/src/modules/mixer/mixer.c @@ -144,6 +144,7 @@ static inline float randf(unsigned *seed) static void mixer_prepare_frame(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan) { mixer_context_t *ctxt = (mixer_context_t *)context; + mixer_setup_t *setup = (mixer_setup_t *)context->setup; til_fb_fragment_t *fragment = *fragment_ptr; size_t i = 0; @@ -176,14 +177,14 @@ static void mixer_prepare_frame(til_module_context_t *context, til_stream_t *str */ if (T > .001f) { - til_module_render(ctxt->inputs[1].module_ctxt, stream, ticks, &fragment); + til_module_render(ctxt->inputs[setup->bottom == MIXER_BOTTOM_A ? 1 : 0].module_ctxt, stream, ticks, &fragment); if (T < .999f) ctxt->snapshots[1] = til_fb_fragment_snapshot(&fragment, 0); } if (T < .999f) - til_module_render(ctxt->inputs[0].module_ctxt, stream, ticks, &fragment); + til_module_render(ctxt->inputs[setup->bottom == MIXER_BOTTOM_A ? 0 : 1].module_ctxt, stream, ticks, &fragment); break; } -- cgit v1.2.1