void del_Module(Module* module) { if (module == NULL) return; del_Environment(module->env); del_Song_table(module->songs); del_Pat_table(module->pats); del_Connections(module->connections); del_Au_table(module->au_table); del_Bit_array(module->au_controls); del_Input_map(module->au_map); del_Track_list(module->track_list); del_Channel_defaults_list(module->ch_defs); for (int i = 0; i < KQT_SONGS_MAX; ++i) del_Order_list(module->order_lists[i]); for (int i = 0; i < KQT_TUNING_TABLES_MAX; ++i) del_Tuning_table(module->tuning_tables[i]); del_Bind(module->bind); Device_deinit(&module->parent); memory_free(module); return; }
void del_Effect(Effect* eff) { if (eff == NULL) return; del_Effect_interface(eff->out_iface); del_Effect_interface(eff->in_iface); del_Connections(eff->connections); del_DSP_table(eff->dsps); Device_deinit(&eff->parent); memory_free(eff); return; }
bool Device_init(Device* device, bool req_impl) { assert(device != NULL); static uint32_t id = 1; device->id = id; ++id; device->existent = false; device->req_impl = req_impl; device->enable_signal_support = false; device->dparams = NULL; device->dimpl = NULL; device->create_state = new_Device_state_plain; device->set_control_var_generic = NULL; device->init_control_vars = NULL; for (int port = 0; port < KQT_DEVICE_PORTS_MAX; ++port) { for (Device_port_type type = DEVICE_PORT_TYPE_RECEIVE; type < DEVICE_PORT_TYPES; ++type) device->existence[type][port] = false; } device->dparams = new_Device_params(); if (device->dparams == NULL) { Device_deinit(device); return false; } return true; }