]> Nishi Git Mirror - gwion.git/commitdiff
:art: Test fork_join2 longer
authorfennecdjay <astor.jeremie@wanadoo.fr>
Fri, 11 Oct 2019 20:19:31 +0000 (22:19 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Fri, 11 Oct 2019 20:19:31 +0000 (22:19 +0200)
src/lib/ugen.c
tests/import/trig.c [new file with mode: 0644]
tests/import/trig.gw [new file with mode: 0644]
tests/tree/fork_join2.gw

index 603017713adc288d3f3e600bd4b41873fc3e6382..ec1c841fb72cb0770100c59d25f99cfc10fc9721 100644 (file)
@@ -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 (file)
index 0000000..6fb1c93
--- /dev/null
@@ -0,0 +1,33 @@
+#include <stdlib.h>
+#include <math.h>
+#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 (file)
index 0000000..104dcf3
--- /dev/null
@@ -0,0 +1,3 @@
+Trig trig => dac;
+adc :=> trig;
+adc :=<trig;
index 0d20535496c37386c8ef4aec19251a05860e0f61..e6654c8a62d9a8ad16cb10046927445f8efc9e89 100644 (file)
@@ -1,2 +1,2 @@
-fork { <<< __func__ >>>; second => now; } @=> Fork @f;
+fork { <<< __func__ >>>; minute => now; } @=> Fork @f;
 f.join();