To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / host / test-c.c
History | View | Annotate | Download (901 Bytes)
| 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 |
|