29 |
#include "PluginVst.h" |
#include "PluginVst.h" |
30 |
|
|
31 |
#ifndef CHANNELS |
#ifndef CHANNELS |
32 |
#define CHANNELS 2 |
#define CHANNELS 32 |
33 |
#endif |
#endif |
34 |
|
|
35 |
namespace { |
namespace { |
97 |
ProcessHandle = INVALID_HANDLE_VALUE; |
ProcessHandle = INVALID_HANDLE_VALUE; |
98 |
} |
} |
99 |
|
|
100 |
// assume Fantasia is in the same directory as the |
// assume Fantasia is in the same directory or one directory above |
101 |
// liblinuxsampler dll |
// the liblinuxsampler dll |
102 |
String lspath = LinuxSampler::Sampler::GetInstallDir(); |
String lspath = LinuxSampler::Sampler::GetInstallDir(); |
103 |
if (!lspath.empty()) { |
if (!lspath.empty()) { |
104 |
lspath += "\\"; |
lspath += "\\"; |
105 |
WIN32_FIND_DATA fd; |
WIN32_FIND_DATA fd; |
106 |
HANDLE hFind = FindFirstFile((lspath + "Fantasia*.jar").c_str(), &fd); |
HANDLE hFind = FindFirstFile((lspath + "Fantasia*.jar").c_str(), &fd); |
107 |
|
if (hFind == INVALID_HANDLE_VALUE) { |
108 |
|
lspath += "..\\"; |
109 |
|
hFind = FindFirstFile((lspath + "Fantasia*.jar").c_str(), &fd); |
110 |
|
} |
111 |
if (hFind != INVALID_HANDLE_VALUE) { |
if (hFind != INVALID_HANDLE_VALUE) { |
112 |
String fantasia(fd.cFileName); |
String fantasia(fd.cFileName); |
113 |
FindClose(hFind); |
FindClose(hFind); |
119 |
si.cb = sizeof(si); |
si.cb = sizeof(si); |
120 |
ZeroMemory(&pi, sizeof(pi)); |
ZeroMemory(&pi, sizeof(pi)); |
121 |
|
|
122 |
Command = _tcsdup(TEXT((String("javaw -jar \"") + lspath + fantasia + "\" &").c_str())); |
Command = _tcsdup(TEXT((String("javaw -jar \"") + lspath + fantasia + "\"").c_str())); |
123 |
CreateProcess(NULL, Command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); |
CreateProcess(NULL, Command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); |
124 |
ProcessHandle = pi.hProcess; |
ProcessHandle = pi.hProcess; |
125 |
CloseHandle(pi.hThread); |
CloseHandle(pi.hThread); |