From 1526ac5a15e275499f22900ba0b4fa8993d0a606 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 11 Oct 2019 22:19:31 +0200 Subject: [PATCH] :art: Test fork_join2 longer --- src/lib/ugen.c | 2 +- tests/import/trig.c | 33 +++++++++++++++++++++++++++++++++ tests/import/trig.gw | 3 +++ tests/tree/fork_join2.gw | 2 +- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 tests/import/trig.c create mode 100644 tests/import/trig.gw diff --git a/src/lib/ugen.c b/src/lib/ugen.c index 60301771..ec1c841f 100644 --- a/src/lib/ugen.c +++ b/src/lib/ugen.c @@ -362,6 +362,6 @@ GWION_IMPORT(ugen) { _CHECK_OP("=>", chuck_ugen, UgenConnect) _CHECK_OP("=<", chuck_ugen, UgenDisconnect) _CHECK_OP(":=>", chuck_ugen, TrigConnect) - _CHECK_OP("}=<", chuck_ugen, TrigDisconnect) + _CHECK_OP(":=<", chuck_ugen, TrigDisconnect) return import_global_ugens(gwi); } diff --git a/tests/import/trig.c b/tests/import/trig.c new file mode 100644 index 00000000..6fb1c931 --- /dev/null +++ b/tests/import/trig.c @@ -0,0 +1,33 @@ +#include +#include +#include "gwion_util.h" +#include "gwion_ast.h" +#include "oo.h" +#include "env.h" +#include "vm.h" +#include "gwion.h" +#include "type.h" +#include "instr.h" +#include "object.h" +#include "value.h" +#include "operator.h" +#include "import.h" +#include "ugen.h" +#include "func.h" +#include "gwi.h" + +static TICK(trig_tick) { + u->out = u->module.gen.trig->in ? u->in : 0; +} + +static CTOR(trig_ctor) { + ugen_ini(shred->info->vm->gwion, UGEN(o), 1, 1); + ugen_gen(shred->info->vm->gwion, UGEN(o), trig_tick, (void*)1, 1); +} + + +GWION_IMPORT(trig) { + const Type t_gain = gwi_mk_type(gwi, "Trig", SZ_INT, "UGen"); + GWI_BB(gwi_class_ini(gwi, t_gain, trig_ctor, NULL)) + return gwi_class_end(gwi); +} diff --git a/tests/import/trig.gw b/tests/import/trig.gw new file mode 100644 index 00000000..104dcf3b --- /dev/null +++ b/tests/import/trig.gw @@ -0,0 +1,3 @@ +Trig trig => dac; +adc :=> trig; +adc :=>>; second => now; } @=> Fork @f; +fork { <<< __func__ >>>; minute => now; } @=> Fork @f; f.join(); -- 2.43.0