Created
May 29, 2019 16:49
-
-
Save jpcima/a791d33debefe59ba88bfb09ce95c9ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dssi.h> | |
#include <dlfcn.h> | |
#include <stdio.h> | |
int main() | |
{ | |
void *dlh = dlopen("/usr/lib/dssi/amsynth_dssi.so", RTLD_LAZY); | |
if (!dlh) | |
return 1; | |
DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) | |
dlsym(dlh, "dssi_descriptor"); | |
if (!fn) | |
return 1; | |
const DSSI_Descriptor *desc = fn(0); | |
if (!desc) | |
return 1; | |
const LADSPA_Descriptor *ldesc = desc->LADSPA_Plugin; | |
if (!ldesc) | |
return 1; | |
size_t count = ldesc->PortCount; | |
for (size_t i = 0; i < count; ++i) { | |
printf("* Port %zu/%zu\n", 1 + i, count); | |
printf(" - Name %s\n", ldesc->PortNames[i]); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment