Skip to content
Snippets Groups Projects
Commit 06081bba authored by ale's avatar ale
Browse files

Implement synchronous restore

parent e2da2f9b
Branches
No related tags found
No related merge requests found
......@@ -218,8 +218,8 @@ static void handle_event(struct sampler_plugin *plugin, LV2_Atom_Event *ev) {
// Sample change, send it to the worker.
lv2_log_trace(&plugin->logger, "Scheduling sample change\n");
plugin->schedule->schedule_work(plugin->schedule->handle,
lv2_atom_total_size(&ev->body),
&ev->body);
lv2_atom_total_size(&ev->body),
&ev->body);
/* } else if (key == uris->param_gain) { */
/* // Gain change */
/* if (value->type == uris->atom_Float) { */
......@@ -324,8 +324,18 @@ static LV2_State_Status restore(LV2_Handle instance,
path = paths->absolute_path(paths->handle, (const char *)value);
if (!plugin->activated || !schedule) {
struct drumkit *new_kit;
lv2_log_trace(&plugin->logger, "Synchronous restore\n");
// Do sync restore.
new_kit = drumkit_new(path, plugin->samplerate);
if (!new_kit) {
lv2_log_error(&plugin->logger, "Error loading the drumkit %s\n", path);
return LV2_WORKER_ERR_UNKNOWN;
}
sampler_set_drumkit(plugin->sampler, new_kit);
} else {
LV2_Atom_Forge forge;
LV2_Atom *buf = (LV2_Atom *)calloc(1, strlen(path) + 128);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment