Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: dsp_config_manager : enable DSP fix. (Read 1254 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

dsp_config_manager : enable DSP fix.

Got some updated code for dsp_config_manager::core_enable_dsp. Should append DSPs to the end of the current list instead of overwriting the first element as it does currently in the current SDK if a DSP already exists. This was also needed on my end because of latency from other 3rd party components interfering with mine (pitch ones work best at end of chain)
Code: [Select]
void DSPEnable(const dsp_preset & data) {
//altered from enable_dsp to append to DSP array
dsp_chain_config_impl cfg;
static_api_ptr_t<dsp_config_manager>()->get_core_settings(cfg);
bool found = false;
bool changed = false;
t_size n, m = cfg.get_count();
for (n = 0; n < m; n++) {
if (cfg.get_item(n).get_owner() == data.get_owner()) {
found = true;
if (cfg.get_item(n) != data) {
cfg.replace_item(data, n);
changed = true;
}
break;
}
}
//append to DSP queue if not present
]if (!found) { if (n>0)n++; cfg.insert_item(data, n); changed = true; }
if (changed) static_api_ptr_t<dsp_config_manager>()->set_core_settings(cfg);
}

The line in question is:
if (!found) { if (n>0)n++; cfg.insert_item(data, n); changed = true; }