Mercurial > hg > vamp-plugin-sdk
comparison host/test-c.c @ 395:96cdf661d538
Merge from branch vh
| author | Chris Cannam |
|---|---|
| date | Tue, 16 Jun 2015 10:12:36 +0100 |
| parents | 632c662e95e7 |
| children |
comparison
equal
deleted
inserted
replaced
| 394:a69901aa85d2 | 395:96cdf661d538 |
|---|---|
| 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 |
