From 68347e96bbac8c60b32895c5214487f58990fea3 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 21 Jan 2023 11:02:48 -0800 Subject: til_tap: introduce til_tap_t.owner We need a way to identify owners of taps when cleaning up their containing contexts, especially once they're hanging off streams. --- src/modules/plato/plato.c | 4 ++-- src/modules/stars/stars.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/plato/plato.c b/src/modules/plato/plato.c index c8977bf..259d5b0 100644 --- a/src/modules/plato/plato.c +++ b/src/modules/plato/plato.c @@ -640,8 +640,8 @@ static til_module_context_t * plato_create_context(const til_module_t *module, t ctxt->setup = *((plato_setup_t *)setup); - ctxt->taps.spin_rate = til_tap_init_float(&ctxt->spin_rate, 1, &ctxt->setup.spin_rate, "spin_rate"); - ctxt->taps.orbit_rate = til_tap_init_float(&ctxt->orbit_rate, 1, &ctxt->setup.orbit_rate, "orbit_rate"); + ctxt->taps.spin_rate = til_tap_init_float(ctxt, &ctxt->spin_rate, 1, &ctxt->setup.spin_rate, "spin_rate"); + ctxt->taps.orbit_rate = til_tap_init_float(ctxt, &ctxt->orbit_rate, 1, &ctxt->setup.orbit_rate, "orbit_rate"); return &ctxt->til_module_context; } diff --git a/src/modules/stars/stars.c b/src/modules/stars/stars.c index e2c9a21..d64a3d8 100644 --- a/src/modules/stars/stars.c +++ b/src/modules/stars/stars.c @@ -89,11 +89,11 @@ static til_module_context_t * stars_create_context(const til_module_t *module, t ctxt->vars.offset_x = 0.5; ctxt->vars.offset_angle = 0.01; - ctxt->taps.rot_rate = til_tap_init_float(&ctxt->rot_rate, 1, &ctxt->vars.rot_rate, "rot_rate"); - ctxt->taps.rot_angle = til_tap_init_float(&ctxt->rot_angle, 1, &ctxt->vars.rot_angle, "rot_angle"); - ctxt->taps.offset_x = til_tap_init_float(&ctxt->offset_x, 1, &ctxt->vars.offset_x, "offset_x"); - ctxt->taps.offset_y = til_tap_init_float(&ctxt->offset_y, 1, &ctxt->vars.offset_y, "offset_y"); - ctxt->taps.offset_angle = til_tap_init_float(&ctxt->offset_angle, 1, &ctxt->vars.offset_angle, "offset_angle"); + ctxt->taps.rot_rate = til_tap_init_float(ctxt, &ctxt->rot_rate, 1, &ctxt->vars.rot_rate, "rot_rate"); + ctxt->taps.rot_angle = til_tap_init_float(ctxt, &ctxt->rot_angle, 1, &ctxt->vars.rot_angle, "rot_angle"); + ctxt->taps.offset_x = til_tap_init_float(ctxt, &ctxt->offset_x, 1, &ctxt->vars.offset_x, "offset_x"); + ctxt->taps.offset_y = til_tap_init_float(ctxt, &ctxt->offset_y, 1, &ctxt->vars.offset_y, "offset_y"); + ctxt->taps.offset_angle = til_tap_init_float(ctxt, &ctxt->offset_angle, 1, &ctxt->vars.offset_angle, "offset_angle"); //add a bunch of points for(z=0.01; z<1; z=z+0.01) { -- cgit v1.2.3