493cb2e5722e7424bfda435a023b991776efb219
[ardour.git] / libs / fst / fst.h
1 #ifndef __fst_fst_h__
2 #define __fst_fst_h__
3
4 #include <setjmp.h>
5 #include <signal.h>
6 #include <pthread.h>
7
8 /**
9  * Display FST error message.
10  *
11  * @param fmt printf-style formatting specification
12  */
13 extern void fst_error (const char *fmt, ...);
14
15 /**
16  * Set the @ref fst_error_callback for error message display.
17  *
18  * The FST library provides two built-in callbacks for this purpose:
19  * default_fst_error_callback().
20  *
21  * The default will print the message (plus a newline) to stderr.
22  *
23  */
24 void fst_set_error_function (void (*func)(const char *));
25
26 #include <vst/AEffect.h>
27
28 typedef struct _FST FST;
29 typedef struct _FSTHandle FSTHandle;
30 typedef struct _FSTInfo FSTInfo;
31
32 struct _FSTInfo 
33 {
34     char *name;
35     int UniqueID;
36     char *Category;
37     
38     int numInputs;
39     int numOutputs;
40     int numParams;
41
42     int wantMidi;
43     int wantEvents;
44     int hasEditor;
45     int canProcessReplacing; // what do we need this for ?
46
47     // i think we should save the parameter Info Stuff soon.
48     // struct VstParameterInfo *infos;
49     char **ParamNames;
50     char **ParamLabels;
51 };
52
53 struct _FSTHandle
54 {
55     void*    dll;
56     char*    name;
57     char*    nameptr; /* ptr returned from strdup() etc. */
58     AEffect* (*main_entry)(audioMasterCallback);
59
60     int plugincnt;
61 };
62
63 struct _FST 
64 {
65     AEffect*    plugin;
66     void*       window; /* win32 HWND */
67     int         xid; /* X11 XWindow */
68     FSTHandle*  handle;
69     int         width;
70     int         height;
71     int         destroy;
72
73     struct _FST* next;
74
75     pthread_mutex_t lock;
76     pthread_cond_t  window_status_change;
77     int             been_activated;
78 };
79
80 #ifdef __cplusplus
81 extern "C" {
82 #endif
83
84 extern int  fst_init ();
85 extern void fst_finish ();
86
87 extern FSTHandle* fst_load (const char*);
88 extern int        fst_unload (FSTHandle*);
89
90 extern FST*       fst_instantiate (FSTHandle*, audioMasterCallback amc, void* userptr);
91 extern void       fst_close (FST*);
92
93 extern void fst_event_loop_remove_plugin (FST* fst);
94 extern void fst_event_loop_add_plugin (FST* fst);
95
96 extern int  fst_run_editor (FST*);
97 extern void  fst_destroy_editor (FST*);
98 extern int  fst_get_XID (FST*);
99
100 extern void fst_signal_handler (int sig, siginfo_t* info, void* context);
101
102 extern FSTInfo *fst_get_info( char *dllpathname );
103 extern void fst_free_info( FSTInfo *info );
104
105 #ifdef __cplusplus
106 }
107 #endif
108
109 #endif /* __fst_fst_h__ */