From 99904735e066804358f1d0bd138a84f1e9ecda91 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 18 Mar 2007 06:07:08 +0000 Subject: Merged with trunk R1612. git-svn-id: svn://localhost/ardour2/branches/midi@1614 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/fst/vstwin.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'libs/fst/vstwin.c') 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; } -- cgit v1.2.3