aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/vst/src
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/vst/src')
-rw-r--r--externals/grill/vst/src/editorwin.hpp18
-rw-r--r--externals/grill/vst/src/vsthost.cpp12
-rw-r--r--externals/grill/vst/src/vstmaster.cpp2
3 files changed, 28 insertions, 4 deletions
diff --git a/externals/grill/vst/src/editorwin.hpp b/externals/grill/vst/src/editorwin.hpp
index cbdd807f..558301bc 100644
--- a/externals/grill/vst/src/editorwin.hpp
+++ b/externals/grill/vst/src/editorwin.hpp
@@ -15,7 +15,19 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <map>
#include <windows.h>
-typedef std::map<flext::thrid_t,VSTPlugin *> WndMap;
+class ThrCmp
+{
+public:
+ inline bool operator()(const flext::thrid_t &a,const flext::thrid_t &b) const
+ {
+ if(sizeof(a) == sizeof(size_t))
+ return *(size_t *)&a < *(size_t *)&b;
+ else
+ return memcmp(&a,&b,sizeof(a)) < 0;
+ }
+};
+
+typedef std::map<flext::thrid_t,VSTPlugin *,ThrCmp> WndMap;
static WndMap wndmap;
static flext::ThrMutex mapmutex;
@@ -56,7 +68,7 @@ static LRESULT CALLBACK wndproc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp)
case WM_TIMER: // fall through
case WM_ENTERIDLE:
-// plug->EditorIdle();
+ plug->EditorIdle();
break;
#if 0
case WM_WINDOWPOSCHANGED: {
@@ -136,7 +148,7 @@ static LRESULT CALLBACK wndproc(HWND hwnd,UINT msg,WPARAM wp,LPARAM lp)
default:
#ifdef FLEXT_LOGGING
- flext::post("WND MSG %i, WP=%i, lp=%i",msg,wp,lp);
+// flext::post("WND MSG %i, WP=%i, lp=%i",msg,wp,lp);
#endif
res = DefWindowProc(hwnd,msg,wp,lp);
diff --git a/externals/grill/vst/src/vsthost.cpp b/externals/grill/vst/src/vsthost.cpp
index 9553f38d..3fd1a935 100644
--- a/externals/grill/vst/src/vsthost.cpp
+++ b/externals/grill/vst/src/vsthost.cpp
@@ -122,6 +122,7 @@ void VSTPlugin::worker(thr_params *)
// see if editing has stopped
if(p && p->plug->hwnd == NULL) {
// yes, it is now safe to delete the plug
+ post("DELETE %s",p->plug->dllname.c_str());
delete p->plug;
delete p;
}
@@ -170,6 +171,17 @@ bool VSTPlugin::NewPlugin(const char *plugname)
#if FLEXT_OS == FLEXT_OS_WIN
hdll = LoadLibraryEx(dllname.c_str(),NULL,0 /*DONT_RESOLVE_DLL_REFERENCES*/);
+/*
+ char buf[255],*c;
+ strcpy(buf,dllname.c_str());
+ for(c = buf; *c; ++c)
+ if(*c == '/')
+ *c = '\\';
+ char *sl = strrchr(buf,'\\');
+ if(sl) *sl = 0;
+ SetCurrentDirectory(buf);
+ hdll = LoadLibrary(dllname.c_str());
+*/
if(hdll) pluginmain = (PVSTMAIN)GetProcAddress(hdll,"main");
audiomaster = Master;
diff --git a/externals/grill/vst/src/vstmaster.cpp b/externals/grill/vst/src/vstmaster.cpp
index 03457f82..6730a647 100644
--- a/externals/grill/vst/src/vstmaster.cpp
+++ b/externals/grill/vst/src/vstmaster.cpp
@@ -181,7 +181,7 @@ long VSTPlugin::Master(AEffect *effect, long opcode, long index, long value, voi
case audioMasterGetCurrentProcessLevel: // 23
// return thread state
- return flext::GetThreadId() == flext::GetSysThreadId()?2:1;
+ return flext::IsSystemThread()?2:1;
case audioMasterGetAutomationState: // 24
// return th?(th->feedback?2:1):0;