103 |
dmsg(1,("Loading instrument editor plugins...")); |
dmsg(1,("Loading instrument editor plugins...")); |
104 |
#if defined(WIN32) |
#if defined(WIN32) |
105 |
String dir = Sampler::GetInstallDir(); |
String dir = Sampler::GetInstallDir(); |
106 |
|
|
107 |
|
// Put the LS installation directory first in DLL search |
108 |
|
// path, so the plugin finds for example the bundled GTK |
109 |
|
// libraries before any other installed versions |
110 |
|
if (!dir.empty()) { |
111 |
|
// The SetDllDirectory function is only available on |
112 |
|
// XP and higher, so we call it dynamically |
113 |
|
HMODULE k32 = GetModuleHandleA("kernel32.dll"); |
114 |
|
if (k32) { |
115 |
|
BOOL WINAPI (*setDllDirectory)(LPCSTR) = |
116 |
|
(BOOL WINAPI (*)(LPCSTR))GetProcAddress(k32, "SetDllDirectoryA"); |
117 |
|
if (setDllDirectory) { |
118 |
|
setDllDirectory(dir.c_str()); |
119 |
|
} |
120 |
|
} |
121 |
|
} |
122 |
|
|
123 |
if (dir.empty() || !LoadPlugins(dir + "\\plugins")) { |
if (dir.empty() || !LoadPlugins(dir + "\\plugins")) { |
124 |
if (!LoadPlugins(CONFIG_PLUGIN_DIR)) { |
if (!LoadPlugins(CONFIG_PLUGIN_DIR)) { |
125 |
std::cerr << "Could not open instrument editor plugins " |
std::cerr << "Could not open instrument editor plugins " |