switch to using jack_set_thread_creator() and dont mess with winaudio thread
[fst.git] / fst.h
blob82a6871ba90e66d4abf0a45c08bdcbeb92cab8d4
1 #ifndef __fst_fst_h__
2 #define __fst_fst_h__
4 #include <setjmp.h>
5 #include <signal.h>
6 #include <pthread.h>
8 #include <windows.h>
9 /**
10 * Display FST error message.
12 * Set via fst_set_error_function(), otherwise a FST-provided
13 * default will print @a msg (plus a newline) to stderr.
15 * @param msg error message text (no newline at end).
17 extern void (*fst_error_callback)(const char *msg);
19 /**
20 * Set the @ref fst_error_callback for error message display.
22 * The FST library provides two built-in callbacks for this purpose:
23 * default_fst_error_callback() and silent_fst_error_callback().
25 void fst_set_error_function (void (*func)(const char *));
27 #include <vestige/aeffectx.h>
29 typedef struct _FST FST;
30 typedef struct _FSTHandle FSTHandle;
31 typedef struct _FSTInfo FSTInfo;
33 struct _FSTInfo
35 char *name;
36 int UniqueID;
37 char *Category;
39 int numInputs;
40 int numOutputs;
41 int numParams;
43 int wantMidi;
44 int wantEvents;
45 int hasEditor;
46 int canProcessReplacing; // what do we need this for ?
48 // i think we should save the parameter Info Stuff soon.
49 // struct VstParameterInfo *infos;
50 char **ParamNames;
51 char **ParamLabels;
54 typedef struct AEffect * (*main_entry_t)(audioMasterCallback);
56 struct _FSTHandle
58 void* dll;
59 char* name;
60 char* nameptr; /* ptr returned from strdup() etc. */
61 //struct AEffect* (*main_entry)(audioMasterCallback);
62 main_entry_t main_entry;
64 int plugincnt;
67 struct _FST
69 struct AEffect* plugin;
70 void* window; /* win32 HWND */
71 int xid; /* X11 XWindow */
72 FSTHandle* handle;
73 int width;
74 int height;
75 int wantIdle;
76 int destroy;
78 int want_program;
79 float *want_params;
80 float *set_params;
82 int dispatcher_wantcall;
83 int dispatcher_opcode;
84 int dispatcher_index;
85 int dispatcher_val;
86 void * dispatcher_ptr;
87 float dispatcher_opt;
88 int dispatcher_retval;
90 struct _FST* next;
91 pthread_mutex_t lock;
92 pthread_cond_t window_status_change;
93 pthread_cond_t plugin_dispatcher_called;
94 int been_activated;
97 #ifdef __cplusplus
98 extern "C" {
99 #endif
101 extern int fst_init (HMODULE hInst);
103 extern FSTHandle* fst_load (const char*);
104 extern int fst_unload (FSTHandle*);
106 extern FST* fst_instantiate (FSTHandle*, audioMasterCallback amc, void* userptr);
107 extern void fst_close (FST*);
109 extern int fst_run_editor (FST*);
110 extern void fst_destroy_editor (FST*);
111 extern int fst_get_XID (FST*);
113 extern FSTInfo *fst_get_info (char *dllpathname);
114 extern void fst_free_info (FSTInfo *info);
115 extern void fst_event_loop_remove_plugin (FST* fst);
116 extern int fst_call_dispatcher(FST *fst, int opcode, int index, int val, void *ptr, float opt );
119 * Load a plugin state from a file.
121 extern int fst_load_state (FST * fst, char * filename);
124 * Save a plugin state to a file.
126 extern int fst_save_state (FST * fst, char * filename);
128 #ifdef __cplusplus
130 #endif
132 #endif /* __fst_fst_h__ */