}
ANN m_bool plug_ini(const struct Gwion_ *, const Vector);
-ANN m_bool driver_ini(const struct Gwion_ *);
+ANN gwdriver_t driver_ini(const struct Gwion_ *, struct SoundInfo_ *);
ANN m_bool plug_run(const struct Gwion_ *, const Map);
ANN void free_plug(const Gwion);
ANN void * get_module(const struct Gwion_ *, const m_str);
ANN void gw_seed(uint32_t s[2], const uint64_t);
ANN bool handle(VM_Shred shred, const m_str effect);
#define xfun_handle(shred, effect) {\
-/* shred->mem -= ((Instr)vector_at(&shred->code->instr, shred->pc-1))->m_val2; */\
+ shred->mem -= ((Instr)vector_at(&shred->code->instr, shred->pc-1))->m_val2; \
handle(shred, effect); \
}
-Subproject commit 05ab62e2ce4b00c4e1f380fd4e27adf4946b0bc0
+Subproject commit 3410ba0416ba3d2c18305f5a0518541c8aa90626
ANN m_bool gwion_audio(const Gwion gwion) {
Driver *const di = gwion->vm->bbq;
- if (di->si->arg) CHECK_BB(driver_ini(gwion));
+ if (di->si->arg) CHECK_OB((di->func = driver_ini(gwion, di->si)));
di->func(di->driver);
CHECK_BB(di->driver->ini(gwion->vm, di));
driver_alloc(di);
#ifdef GWION_EMBED
gwion_embed(&gwion);
#endif
- arg_compile(&gwion, &arg);
+ if(ini > 0) arg_compile(&gwion, &arg);
arg_release(&arg);
#ifdef GWION_CONFIG_ARGS
free(config_argv);
return GW_OK;
}
-ANN m_bool driver_ini(const struct Gwion_ *gwion) {
+ANN gwdriver_t driver_ini(const struct Gwion_ *gwion, struct SoundInfo_ *si) {
const Map map = &gwion->data->plugs->map;
- m_str dname = gwion->vm->bbq->si->arg;
+ m_str dname = si->arg;
m_str opt = strchr(dname, '=');
const char c = opt ? *opt : '\0';
if (opt) *opt = '\0';
if (!strcmp(name, dname)) {
const Plug plug = (Plug)VVAL(map, i);
const gwdriver_t drv = plug->driver;
- if (!drv) break;
- gwion->vm->bbq->func = drv;
if (opt) *opt = c;
- return GW_OK;
+ return drv;
}
}
+ if (opt) *opt = c;
gw_err("can't find driver '%s'\n", dname);
- return GW_ERROR;
+ return NULL;
}
ANN void *get_module(const struct Gwion_ *gwion, const m_str name) {