9 /******************************************************************************************/
10 /*VSTFX - an engine to manage native linux VST plugins - derived from FST for Windows VSTs*/
11 /******************************************************************************************/
13 extern void (*vstfx_error_callback)(const char *msg);
15 void vstfx_set_error_function (void (*func)(const char *));
17 void vstfx_error (const char *fmt, ...);
19 /*We will use the vestige headers*/
21 #define VESTIGE_HEADER
23 #include <ardour/vestige/aeffectx.h>
25 typedef struct _VSTFX VSTFX;
26 typedef struct _VSTFXHandle VSTFXHandle;
27 typedef struct _VSTFXInfo VSTFXInfo;
28 typedef struct _VSTFXKey VSTFXKey;
31 /*Struct to contain the info about a plugin*/
47 int canProcessReplacing;
49 /* i think we should save the parameter Info Stuff soon. */
50 // struct VstParameterInfo *infos;
55 /*The AEffect which contains the info about a plugin instance*/
57 typedef struct AEffect * (*main_entry_t)(audioMasterCallback);
59 /*A handle used to identify a plugin to vstfx*/
65 char* nameptr; /* ptr returned from strdup() etc. */
67 main_entry_t main_entry;
72 /*No key forwarding enabled in vstfx at the moment - maybe
77 /** virtual-key code, or 0 if this _VSTFXKey is a `character' key */
79 /** `character' key, or 0 if this _VSTFXKey is a virtual-key */
85 /*Structure used to describe the instance of VSTFX responsible for
86 a particular plugin instance. These are connected together in a
91 struct AEffect* plugin;
92 int window; /* The plugin's parent X11 XWindow */
93 int plugin_ui_window; /*The ID of the plugin UI window created by the plugin*/
94 int xid; /* X11 XWindow */
96 int want_resize; /*Set to signal the plugin resized its UI*/
97 void* extra_data; /*Pointer to any extra data*/
99 void* event_callback_thisptr;
100 void (*eventProc) (void* event);
111 int program_set_without_editor;
116 unsigned char* wanted_chunk;
117 int wanted_chunk_size;
122 VSTFXKey pending_keys[16];
124 int dispatcher_wantcall;
125 int dispatcher_opcode;
126 int dispatcher_index;
128 void * dispatcher_ptr;
129 float dispatcher_opt;
130 int dispatcher_retval;
133 pthread_mutex_t lock;
134 pthread_cond_t window_status_change;
135 pthread_cond_t plugin_dispatcher_called;
136 pthread_cond_t window_created;
142 extern int vstfx_launch_editor(VSTFX* vstfx);
143 extern int vstfx_init (void* possible_hmodule);
144 extern void vstfx_exit ();
145 extern VSTFXHandle* vstfx_load (const char*);
146 extern int vstfx_unload (VSTFXHandle*);
147 extern VSTFX* vstfx_instantiate (VSTFXHandle*, audioMasterCallback amc, void* userptr);
148 extern void vstfx_close (VSTFX*);
150 extern int vstfx_create_editor (VSTFX* vstfx);
151 extern int vstfx_run_editor (VSTFX*);
152 extern void vstfx_destroy_editor (VSTFX*);
153 extern int vstfx_get_XID (VSTFX*);
154 extern void vstfx_move_window_into_view (VSTFX*);
156 extern VSTFXInfo* vstfx_get_info (char *dllpathname);
157 extern void vstfx_free_info (VSTFXInfo *info);
158 extern void vstfx_event_loop_remove_plugin (VSTFX* fst);
159 extern int vstfx_call_dispatcher(VSTFX *vstfx, int opcode, int index, int val, void *ptr, float opt );
161 /** Load a plugin state from a file.**/
163 extern int vstfx_load_state (VSTFX* vstfx, char * filename);
165 /** Save a plugin state to a file.**/
167 extern int vstfx_save_state (VSTFX* vstfx, char * filename);
170 #endif /* __vstfx_h__ */