From a1299e382917639b7ff446d02202a640fd3f94a6 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 20 Mar 2009 11:41:24 +0100 Subject: [PATCH] ZynAddSubFX: add preset directory to bankRootDirList This commit fixes non-usable instrument bank browser in ZynAddSubFX, especially in win32 version. Adding the ZynAddSubFX preset directory (inside LMMS' preset directory) to config.cfg.bankRootDirList allows easy instrument browsing using ZynAddSubFX' instrument bank browser (closes #2627950). --- plugins/zynaddsubfx/remote_zynaddsubfx.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/zynaddsubfx/remote_zynaddsubfx.cpp b/plugins/zynaddsubfx/remote_zynaddsubfx.cpp index 35a13b474..9d8973be3 100644 --- a/plugins/zynaddsubfx/remote_zynaddsubfx.cpp +++ b/plugins/zynaddsubfx/remote_zynaddsubfx.cpp @@ -34,6 +34,8 @@ #include "remote_zynaddsubfx.h" +std::string __presets_dir; + #define main unused_main #ifdef LMMS_BUILD_LINUX #define ATOM(x) (x) @@ -44,8 +46,6 @@ #include -std::string __presets_dir; - static pthread_t __gui_thread_handle; static pthread_mutex_t __gui_mutex; static std::queue __gui_messages; @@ -104,6 +104,20 @@ public: case IdZasfPresetDirectory: __presets_dir = _m.getString(); + for( int i = 0; i < MAX_BANK_ROOT_DIRS; ++i ) + { + if( config.cfg.bankRootDirList[i] == NULL ) + { + config.cfg.bankRootDirList[i] = new char[MAX_STRING_SIZE]; + strcpy(config.cfg.bankRootDirList[i], __presets_dir.c_str() ); + break; + } + else if( strcmp( config.cfg.bankRootDirList[i], + __presets_dir.c_str() ) == 0 ) + { + break; + } + } break; default: