- /* handle window creation requests, destroy requests,
- and run idle callbacks
- */
-
-
- if( msg.message == WM_TIMER ) {
- pthread_mutex_lock (&plugin_mutex);
-again:
- for (fst = fst_first; fst; fst = fst->next) {
-
- if (fst->destroy) {
- if (fst->window) {
- fst->plugin->dispatcher( fst->plugin, effEditClose, 0, 0, NULL, 0.0 );
- CloseWindow (fst->window);
- fst->window = NULL;
- fst->destroy = FALSE;
- }
- fst_event_loop_remove_plugin (fst);
- fst->been_activated = FALSE;
- pthread_mutex_lock (&fst->lock);
- pthread_cond_signal (&fst->window_status_change);
- pthread_mutex_unlock (&fst->lock);
- goto again;
- }
-
- if (fst->window == NULL) {
- pthread_mutex_lock (&fst->lock);
- if (fst_create_editor (fst)) {
- fst_error ("cannot create editor for plugin %s", fst->handle->name);
- fst_event_loop_remove_plugin (fst);
- pthread_cond_signal (&fst->window_status_change);
- pthread_mutex_unlock (&fst->lock);
- goto again;
- }
- /* condition/unlock handled when we receive WM_ACTIVATE */
- }
+static VSTState*
+fst_new (void)
+{
+ VSTState* fst = (VSTState*) calloc (1, sizeof (VSTState));
+ pthread_mutex_init (&fst->lock, NULL);
+ pthread_cond_init (&fst->window_status_change, NULL); // unused ?? -> TODO check gtk2ardour
+ pthread_cond_init (&fst->plugin_dispatcher_called, NULL); // unused ??
+ fst->want_program = -1;
+ fst->want_chunk = 0;
+ fst->n_pending_keys = 0;
+ fst->has_editor = 0;
+#ifdef PLATFORM_WINDOWS
+ fst->voffset = 50;
+ fst->hoffset = 0;
+#else /* linux + wine */
+ fst->voffset = 24;
+ fst->hoffset = 6;
+#endif
+ fst->program_set_without_editor = 0;
+ return fst;
+}