From 2dd68f55fb6fcce3060c862881998cad65aa1f0e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 28 Jun 2014 23:18:26 +0100 Subject: [PATCH] Fix possible minor issues when loading xmz or xiz files directly --- source/modules/native-plugins/zynaddsubfx-synth.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/modules/native-plugins/zynaddsubfx-synth.cpp b/source/modules/native-plugins/zynaddsubfx-synth.cpp index 172780c7a..3a391cf61 100644 --- a/source/modules/native-plugins/zynaddsubfx-synth.cpp +++ b/source/modules/native-plugins/zynaddsubfx-synth.cpp @@ -605,10 +605,22 @@ protected: CARLA_SAFE_ASSERT_RETURN(key != nullptr,); CARLA_SAFE_ASSERT_RETURN(value != nullptr,); + pthread_mutex_lock(&fMaster->mutex); + if (std::strcmp(key, "CarlaAlternateFile1") == 0) // xmz + { + fMaster->defaults(); fMaster->loadXML(value); + } else if (std::strcmp(key, "CarlaAlternateFile2") == 0) // xiz + { + fMaster->part[0]->defaultsinstrument(); fMaster->part[0]->loadXMLinstrument(value); + } + + pthread_mutex_unlock(&fMaster->mutex); + + fMaster->applyparameters(); } // -------------------------------------------------------------------