diff options
author | David Robillard <d@drobilla.net> | 2007-03-18 06:07:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-03-18 06:07:08 +0000 |
commit | 99904735e066804358f1d0bd138a84f1e9ecda91 (patch) | |
tree | 71a924cf1660b5b00231275bd481bbd27094dd9b /libs/fst/vstwin.c | |
parent | eb270e70a12c410cdd98585ad25bb6d8e384a4f5 (diff) |
Merged with trunk R1612.
git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/fst/vstwin.c')
-rw-r--r-- | libs/fst/vstwin.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c index 8911ff4a01..55061c2b72 100644 --- a/libs/fst/vstwin.c +++ b/libs/fst/vstwin.c @@ -326,9 +326,17 @@ DWORD WINAPI gui_event_loop (LPVOID param) fst_error ("cannot set timer on dummy window"); } - while (GetMessageA (&msg, NULL, 0,0)) { + while (1) { + + GetMessageA (&msg, NULL, 0,0); + + if (msg.message == WM_SYSTEMERROR) { + /* sent when this thread is supposed to exist */ + break; + } - if( msg.message == WM_KEYDOWN ) debreak(); + if (msg.message == WM_KEYDOWN) debreak(); + TranslateMessage( &msg ); DispatchMessageA (&msg); @@ -336,7 +344,6 @@ DWORD WINAPI gui_event_loop (LPVOID param) and run idle callbacks */ - if( msg.message == WM_TIMER ) { pthread_mutex_lock (&plugin_mutex); again: @@ -411,6 +418,12 @@ fst_init () return 0; } +void +fst_finish () +{ + PostThreadMessageA (gui_thread_id, WM_SYSTEMERROR, 0, 0); +} + int fst_run_editor (FST* fst) { @@ -501,7 +514,9 @@ fst_load (const char *path) return NULL; } - if ((fhandle->main_entry = GetProcAddress (fhandle->dll, "main")) == NULL) { + typedef AEffect* (*entryFunctionType)(audioMasterCallback); + + if ((fhandle->main_entry = (entryFunctionType) GetProcAddress (fhandle->dll, "main")) == NULL) { fst_unload (fhandle); return NULL; } |