Optimize automation-event process splitting
[ardour.git] / libs / ardour / ardour / vst_types.h
index 936cab6173fb1120da85f67b896044e5ead94bdf..7bce34f05a22c0129d7461165215050314065cc0 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <pthread.h>
 #include "ardour/libardour_visibility.h"
-#include "ardour/vestige/aeffectx.h"
+#include "ardour/vestige/vestige.h"
 
 struct LIBARDOUR_API _VSTKey
 {
@@ -77,24 +77,21 @@ typedef struct _VSTHandle VSTHandle;
 
 struct LIBARDOUR_API _VSTState
 {
-       AEffect* plugin;
+       AEffect*    plugin;
+       VSTHandle*  handle;
+       audioMasterCallback amc;
+
+       void*       gtk_window_parent;
+       int         xid;                     ///< X11 XWindow (wine + lxvst)
 
-       /* Linux */
+       /* LXVST/X11 */
        int         linux_window;            ///< The plugin's parent X11 XWindow
        int         linux_plugin_ui_window;  ///< The ID of the plugin UI window created by the plugin
+       void  (* eventProc) (void * event);  ///< X11 UI _XEventProc
 
        /* Windows */
        void*       windows_window;
 
-       int         xid;               ///< X11 XWindow
-
-       int         want_resize;       ///< Set to signal the plugin resized its UI
-       void*       extra_data;        ///< Pointer to any extra data
-
-       void * event_callback_thisptr;
-       void  (* eventProc) (void * event);
-
-       VSTHandle*  handle;
 
        int width;
        int height;
@@ -107,51 +104,43 @@ struct LIBARDOUR_API _VSTState
        int vst_version;
        int has_editor;
 
-       int         program_set_without_editor;
-
-       int         want_program;
-       int         want_chunk;
-       int         n_pending_keys;
-       unsigned char * wanted_chunk;
-       int         wanted_chunk_size;
-       float *     want_params;
-       float *     set_params;
-
-       VSTKey      pending_keys[16];
-
-       int         dispatcher_wantcall;
-       int         dispatcher_opcode;
-       int         dispatcher_index;
-       int         dispatcher_val;
-       void *      dispatcher_ptr;
-       float       dispatcher_opt;
-       int         dispatcher_retval;
-
-       struct _VSTState * next;
-       pthread_mutex_t    lock;
-       pthread_cond_t     window_status_change;
-       pthread_cond_t     plugin_dispatcher_called;
-       pthread_cond_t     window_created;
-       int                been_activated;
-
-       void init () {
-               pthread_mutex_init (&lock, 0);
-               pthread_cond_init (&window_status_change, 0);
-               pthread_cond_init (&plugin_dispatcher_called, 0);
-               pthread_cond_init (&window_created, 0);
-               want_program = -1;
-               want_chunk = 0;
-               n_pending_keys = 0;
-               has_editor = 0;
-               program_set_without_editor = 0;
-               linux_window = 0;
-               linux_plugin_ui_window = 0;
-               eventProc = 0;
-               extra_data = 0;
-               want_resize = 0;
-       }
+       int     program_set_without_editor;
+       int     want_program;
+       int     want_chunk;
+       int     n_pending_keys;
+       unsigned char* wanted_chunk;
+       int     wanted_chunk_size;
+       float*  want_params;
+       float*  set_params;
+
+       VSTKey  pending_keys[16];
+
+       int     dispatcher_wantcall;
+       int     dispatcher_opcode;
+       int     dispatcher_index;
+       int     dispatcher_val;
+       void*   dispatcher_ptr;
+       float   dispatcher_opt;
+       int     dispatcher_retval;
+
+       struct _VSTState* next;
+       pthread_mutex_t   lock;
+       pthread_mutex_t   state_lock;
+       pthread_cond_t    window_status_change;
+       pthread_cond_t    plugin_dispatcher_called;
+       pthread_cond_t    window_created;
+       int               been_activated;
 };
 
 typedef struct _VSTState VSTState;
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+LIBARDOUR_API extern void vststate_init (VSTState* state);
+LIBARDOUR_API extern void vststate_maybe_set_program (VSTState* state);
+#ifdef __cplusplus
+}
+#endif
+
 #endif