From 47a5b7fb91d032f794961ec45a8cb2552b368db6 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 5 Mar 2013 11:53:58 +0000 Subject: [PATCH] Fix last commit --- source/backend/native/audiofile.c | 3 +++ source/backend/plugin/NativePlugin.cpp | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/source/backend/native/audiofile.c b/source/backend/native/audiofile.c index 99145f1dc..7d45fa1a0 100644 --- a/source/backend/native/audiofile.c +++ b/source/backend/native/audiofile.c @@ -292,6 +292,9 @@ static void audiofile_ui_show(PluginHandle handle, bool show) { AudioFileInstance* const handlePtr = (AudioFileInstance*)handle; + if (! show) + return; + const char* const filename = handlePtr->host->ui_open_file(handlePtr->host->handle, false, "Open Audio File", ""); if (filename != NULL) diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index 6e5860fe8..b2673a900 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -494,25 +494,33 @@ public: if (fDescriptor != nullptr && fHandle != nullptr && fDescriptor->ui_show != nullptr) { + fIsUiVisible = yesNo; + fDescriptor->ui_show(fHandle, yesNo); if (yesNo) { - // Update UI values, FIXME - if (kData->midiprog.current >= 0) + // Update UI values + if (fDescriptor->ui_set_custom_data != nullptr) + { + // TODO + } + + if (fDescriptor->ui_set_midi_program != nullptr && kData->midiprog.current >= 0) { const MidiProgramData& mpData = kData->midiprog.getCurrent(); fDescriptor->ui_set_midi_program(fHandle, mpData.bank, mpData.program); } - for (uint32_t i=0; i < kData->param.count; i++) + if (fDescriptor->ui_set_parameter_value != nullptr) { - fDescriptor->ui_set_parameter_value(fHandle, i, fDescriptor->get_parameter_value(fHandle, i)); + for (uint32_t i=0; i < kData->param.count; i++) + { + fDescriptor->ui_set_parameter_value(fHandle, i, fDescriptor->get_parameter_value(fHandle, i)); + } } } } - - fIsUiVisible = yesNo; } void idleGui()