switch to using jack_set_thread_creator() and dont mess with winaudio thread
[fst.git] / vstinfo.c
blob1346479b867057b68af68149d25d91cef424e65a
1 #include <stdio.h>
2 #include <fst.h>
3 #include <vst/aeffectx.h>
5 long amc (AEffect* effect,
6 long opcode,
7 long index,
8 long value,
9 void* ptr,
10 float opt)
12 switch (opcode) {
13 case audioMasterVersion:
14 return 2;
15 default:
16 return 0;
20 void
21 fst_signal_handler (int sig, siginfo_t* info, void* context)
23 fst_error ("fst signal handler %d, thread = 0x%x", sig, pthread_self ());
24 exit (1);
27 void vst_print (AEffect *plugin)
29 unsigned i;
30 char name[9];
31 char display[25];
32 char label[9];
33 char bigbuf[1024];
34 int vst_version;
36 printf ("inputs: %lu\n", plugin->numInputs);
37 printf ("outputs: %lu\n", plugin->numOutputs);
38 printf ("params: %lu\n", plugin->numParams);
39 printf ("programs: %lu\n", plugin->numPrograms);
40 printf ("can HasEditor ? %ld\n", plugin->flags & effFlagsHasEditor);
41 printf ("can HasClip ? %ld\n", plugin->flags & effFlagsHasClip);
42 printf ("can HasVu ? %ld\n", plugin->flags & effFlagsHasVu);
43 printf ("can CanMono ? %ld\n", plugin->flags & effFlagsCanMono);
44 printf ("can CanReplacing ? %ld\n", plugin->flags & effFlagsCanReplacing);
45 printf ("can ProgramChunks ? %ld\n", plugin->flags & effFlagsProgramChunks);
47 plugin->dispatcher (plugin, effGetVendorString, 0, 0, bigbuf, 0);
48 printf ("Vendor: %s\n", bigbuf);
49 plugin->dispatcher (plugin, effGetProductString, 0, 0, bigbuf, 0);
50 printf ("Product: %s\n", bigbuf);
51 printf ("Version: %d\n", plugin->dispatcher (plugin, effGetVendorVersion, 0, 0, NULL, 0.0f));
53 vst_version = plugin->dispatcher (plugin, effGetVstVersion, 0, 0, NULL, 0.0f);
55 if (vst_version >= 2) {
56 printf ("Needs keypresses? %d\n",
57 plugin->dispatcher (plugin, effKeysRequired, 0, 0, NULL, 0.0f));
60 for (i = 0; i < plugin->numParams; i++) {
62 /* the Steinberg(tm) way... */
64 if (i == 0) {
65 printf ("Control input/output(s):\n");
68 memset (name, 0, 9);
69 memset (display, 0, 25);
70 memset (label, 0, 9);
72 plugin->dispatcher (plugin,
73 effGetParamName,
74 i, 0, name, 0);
76 plugin->dispatcher (plugin,
77 effGetParamDisplay,
78 i, 0, display, 0);
79 plugin->dispatcher (plugin,
80 effGetParamLabel,
81 i, 0, label, 0);
82 printf (" #%d \"%s\" (%s %s)\n",
83 i + 1, name, display, label);
87 main (int argc, char *argv[])
89 FSTHandle* handle;
90 FST* fst;
92 if (fst_init (fst_signal_handler)) {
93 return;
96 if ((handle = fst_load (argv[1])) == NULL) {
97 return -1;
100 if ((fst = fst_instantiate (handle, amc, 0)) == NULL) {
101 return -1;
104 vst_print (fst->plugin);
106 exit (0);