]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix UGen->trig connection
authorJérémie Astor <fennecdjay@gmail.com>
Mon, 7 Dec 2020 22:45:01 +0000 (23:45 +0100)
committerJérémie Astor <fennecdjay@gmail.com>
Mon, 7 Dec 2020 22:45:01 +0000 (23:45 +0100)
src/lib/ugen.c

index c68344039bc33b57026431def4e7e3004a1ec8ff..b34d1b39eade455ae7add3b0e8a8696d13c12391 100644 (file)
@@ -189,78 +189,78 @@ if(!UGEN(rhs)->module.gen.trig) {       \
   release_connect(shred);               \
   Except(shred, "NonTriggerException"); \
 }
-#define describe_connect_instr(name, func, opt) \
-static INSTR(name##func) {                      \
-  M_Object lhs, rhs;                            \
-  connect_init(shred, &lhs, &rhs);              \
-  opt                                           \
-  _do_(func, UGEN(lhs), UGEN(rhs));             \
-  release_connect(shred);                       \
-}
-describe_connect_instr(Ugen, Connect,)
-describe_connect_instr(Ugen, Disconnect,)
-describe_connect_instr(Trig, Connect,    TRIG_EX)
-describe_connect_instr(Trig, Disconnect, TRIG_EX)
-
-#define describe_connectaa_instr(name, func, opt) \
-static INSTR(name##func) {                        \
-  M_Object lhs, rhs;                              \
-  connect_init(shred, &lhs, &rhs);                \
-  const m_uint lsz = m_vector_size(ARRAY(lhs));   \
-  const m_uint rsz = m_vector_size(ARRAY(rhs));   \
-  const m_uint min = lsz < rsz ? lsz : rsz;       \
-  for(m_uint i = 0; i < min; ++i) {               \
-    M_Object ulhs, urhs;                          \
-    m_vector_get(ARRAY(lhs), i, &ulhs);           \
-    m_vector_get(ARRAY(rhs), i, &urhs);           \
-    opt                                           \
-    if(ulhs && urhs)                              \
-    _do_(func, UGEN(ulhs), UGEN(urhs));           \
-  }                                               \
-  release_connect(shred);                         \
-}
-describe_connectaa_instr(UgenAA, Connect,)
-describe_connectaa_instr(UgenAA, Disconnect,)
-describe_connectaa_instr(TrigAA, Connect, TRIG_EX)
-describe_connectaa_instr(TrigAA, Disconnect, TRIG_EX)
-
-#define describe_connectua_instr(name, func, opt) \
-static INSTR(name##func) {                        \
-  M_Object lhs, rhs;                              \
-  connect_init(shred, &lhs, &rhs);                \
-  const m_uint rsz = m_vector_size(ARRAY(rhs));   \
-  for(m_uint i = 0; i < rsz; ++i) {               \
-    M_Object urhs;                                \
-    m_vector_get(ARRAY(rhs), i, &urhs);           \
-    opt                                           \
-    if(urhs)                                      \
-    _do_(func, UGEN(lhs), UGEN(urhs));            \
-  }                                               \
-  release_connect(shred);                         \
-}
-describe_connectua_instr(UgenUA, Connect,)
-describe_connectua_instr(UgenUA, Disconnect,)
-describe_connectua_instr(TrigUA, Connect, TRIG_EX)
-describe_connectua_instr(TrigUA, Disconnect, TRIG_EX)
-
-#define describe_connectau_instr(name, func, opt) \
-static INSTR(name##func) {                        \
-  M_Object lhs, rhs;                              \
-  connect_init(shred, &lhs, &rhs);                \
-  const m_uint lsz = m_vector_size(ARRAY(lhs));   \
-  for(m_uint i = 0; i < lsz; ++i) {               \
-    M_Object ulhs;                                \
-    m_vector_get(ARRAY(lhs), i, &ulhs);           \
-    opt                                           \
-    if(ulhs)                                      \
-    _do_(func, UGEN(ulhs), UGEN(rhs));            \
-  }                                               \
-  release_connect(shred);                         \
-}
-describe_connectau_instr(UgenAU, Connect,)
-describe_connectau_instr(UgenAU, Disconnect,)
-describe_connectau_instr(TrigAU, Connect, TRIG_EX)
-describe_connectau_instr(TrigAU, Disconnect, TRIG_EX)
+#define describe_connect_instr(name, func, tgt, opt) \
+static INSTR(name##func) {                           \
+  M_Object lhs, rhs;                                 \
+  connect_init(shred, &lhs, &rhs);                   \
+  opt                                                \
+  _do_(func, UGEN(lhs), tgt);                        \
+  release_connect(shred);                            \
+}
+describe_connect_instr(Ugen, Connect,    UGEN(rhs),)
+describe_connect_instr(Ugen, Disconnect, UGEN(rhs),)
+describe_connect_instr(Trig, Connect,    UGEN(rhs)->module.gen.trig, TRIG_EX)
+describe_connect_instr(Trig, Disconnect, UGEN(rhs)->module.gen.trig, TRIG_EX)
+
+#define describe_connectaa_instr(name, func, tgt, opt) \
+static INSTR(name##func) {                             \
+  M_Object lhs, rhs;                                   \
+  connect_init(shred, &lhs, &rhs);                     \
+  const m_uint lsz = m_vector_size(ARRAY(lhs));        \
+  const m_uint rsz = m_vector_size(ARRAY(rhs));        \
+  const m_uint min = lsz < rsz ? lsz : rsz;            \
+  for(m_uint i = 0; i < min; ++i) {                    \
+    M_Object ulhs, urhs;                               \
+    m_vector_get(ARRAY(lhs), i, &ulhs);                \
+    m_vector_get(ARRAY(rhs), i, &urhs);                \
+    opt                                                \
+    if(ulhs && urhs)                                   \
+    _do_(func, UGEN(ulhs), tgt);                       \
+  }                                                    \
+  release_connect(shred);                              \
+}
+describe_connectaa_instr(UgenAA, Connect, UGEN(urhs),)
+describe_connectaa_instr(UgenAA, Disconnect,UGEN(urhs),)
+describe_connectaa_instr(TrigAA, Connect, UGEN(urhs)->module.gen.trig, TRIG_EX)
+describe_connectaa_instr(TrigAA, Disconnect, UGEN(urhs)->module.gen.trig, TRIG_EX)
+
+#define describe_connectua_instr(name, func, tgt, opt) \
+static INSTR(name##func) {                             \
+  M_Object lhs, rhs;                                   \
+  connect_init(shred, &lhs, &rhs);                     \
+  const m_uint rsz = m_vector_size(ARRAY(rhs));        \
+  for(m_uint i = 0; i < rsz; ++i) {                    \
+    M_Object urhs;                                     \
+    m_vector_get(ARRAY(rhs), i, &urhs);                \
+    opt                                                \
+    if(urhs)                                           \
+    _do_(func, UGEN(lhs), tgt);                        \
+  }                                                    \
+  release_connect(shred);                              \
+}
+describe_connectua_instr(UgenUA, Connect, UGEN(urhs),)
+describe_connectua_instr(UgenUA, Disconnect, UGEN(urhs),)
+describe_connectua_instr(TrigUA, Connect, UGEN(urhs)->module.gen.trig, TRIG_EX)
+describe_connectua_instr(TrigUA, Disconnect, UGEN(urhs)->module.gen.trig, TRIG_EX)
+
+#define describe_connectau_instr(name, func, tgt, opt) \
+static INSTR(name##func) {                             \
+  M_Object lhs, rhs;                                   \
+  connect_init(shred, &lhs, &rhs);                     \
+  const m_uint lsz = m_vector_size(ARRAY(lhs));        \
+  for(m_uint i = 0; i < lsz; ++i) {                    \
+    M_Object ulhs;                                     \
+    m_vector_get(ARRAY(lhs), i, &ulhs);                \
+    opt                                                \
+    if(ulhs)                                           \
+    _do_(func, UGEN(ulhs), tgt);                       \
+  }                                                    \
+  release_connect(shred);                              \
+}
+describe_connectau_instr(UgenAU, Connect, UGEN(rhs),)
+describe_connectau_instr(UgenAU, Disconnect, UGEN(rhs),)
+describe_connectau_instr(TrigAU, Connect, UGEN(rhs)->module.gen.trig, TRIG_EX)
+describe_connectau_instr(TrigAU, Disconnect, UGEN(rhs)->module.gen.trig, TRIG_EX)
 
 static CTOR(ugen_ctor) {
   UGEN(o) = new_UGen(shred->info->mp);