From abf22c3546b4c7fa8e323fffa02ed4c760554ed0 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Sat, 4 Jul 2020 14:26:44 +0200 Subject: [PATCH] Use a string rather than a file --- lv2/resources/EmptyInstrument.sfz | 0 lv2/sfizz.c | 11 ++--------- 2 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 lv2/resources/EmptyInstrument.sfz diff --git a/lv2/resources/EmptyInstrument.sfz b/lv2/resources/EmptyInstrument.sfz deleted file mode 100644 index e69de29b..00000000 diff --git a/lv2/sfizz.c b/lv2/sfizz.c index ffe1d3e1..95e84a35 100644 --- a/lv2/sfizz.c +++ b/lv2/sfizz.c @@ -305,13 +305,6 @@ sfizz_lv2_get_default_sfz_path(LV2_Handle instance, char *path, size_t size) snprintf(path, size, "%s/%s", self->bundle_path, "Resources/DefaultInstrument.sfz"); } -static void -sfizz_lv2_get_empty_sfz_path(LV2_Handle instance, char *path, size_t size) -{ - sfizz_plugin_t *self = (sfizz_plugin_t *)instance; - snprintf(path, size, "%s/%s", self->bundle_path, "Resources/EmptyInstrument.sfz"); -} - static void sfizz_lv2_get_default_scala_path(LV2_Handle instance, char *path, size_t size) { @@ -975,8 +968,8 @@ restore(LV2_Handle instance, lv2_log_note(&self->logger, "[sfizz] Restoring the file %s\n", path); // Load an empty file to remove the default sine - sfizz_lv2_get_empty_sfz_path(instance, self->sfz_file_path, MAX_PATH_SIZE); - sfizz_lv2_load_file(instance, self->sfz_file_path); + strcpy(self->sfz_file_path, ""); + sfizz_load_string(self->synth, "empty.sfz", ""); // Try loading the new file sfizz_lv2_load_file(instance, path);