comparison host/test-c.c @ 393:632c662e95e7 vh

Small test program & some changes to support it
author Chris Cannam
date Wed, 20 May 2015 17:46:17 +0100
parents
children
comparison
equal deleted inserted replaced
392:f4e07ae2725a 393:632c662e95e7
1
2 #include <vamp-hostsdk/host-c.h>
3
4 #include <stdio.h>
5
6 int main(int argc, char **argv)
7 {
8 int i;
9 int libcount = vhGetLibraryCount();
10
11 printf("Vamp plugin libraries found:\n");
12 for (i = 0; i < libcount; ++i) {
13 printf("%d: %s\n", i, vhGetLibraryName(i));
14 }
15
16 printf("Going to try loading qm-vamp-plugins...\n");
17 int libindex = vhGetLibraryIndex("qm-vamp-plugins");
18 vhLibrary lib = vhLoadLibrary(libindex);
19 if (!lib) {
20 printf("Failure!\n");
21 return 1;
22 }
23
24 int plugincount = vhGetPluginCount(lib);
25 printf("Success: it contains %d plugins; they are:\n", plugincount);
26
27 for (i = 0; i < plugincount; ++i) {
28 const VampPluginDescriptor *descriptor = vhGetPluginDescriptor(lib, i);
29 if (!descriptor) {
30 printf("<unknown! failed to load>\n");
31 } else {
32 printf("%s\n", descriptor->identifier);
33 }
34 }
35
36 vhUnloadLibrary(lib);
37
38 return 0;
39 }
40