File: listplugins.c

package info (click to toggle)
ladspa-sdk 1.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 308 kB
  • ctags: 253
  • sloc: ansic: 2,371; cpp: 289; makefile: 123
file content (58 lines) | stat: -rw-r--r-- 1,420 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* listplugins.c

   Free software by Richard W.E. Furse. Do with as you will. No
   warranty. */

/*****************************************************************************/

#include <dlfcn.h>
#include <math.h>
#include <stdio.h>
#include <string.h>

/*****************************************************************************/

#include "ladspa.h"
#include "utils.h"

/*****************************************************************************/

static void 
describePluginLibrary(const char * pcFullFilename, 
		      void * pvPluginHandle,
		      LADSPA_Descriptor_Function fDescriptorFunction) {

  const LADSPA_Descriptor * psDescriptor;
  long lIndex;

  printf("%s:\n", pcFullFilename);
  for (lIndex = 0;
       (psDescriptor = fDescriptorFunction(lIndex)) != NULL;
       lIndex++) 
    printf("\t%s (%lu/%s)\n", 
	   psDescriptor->Name,
	   psDescriptor->UniqueID,
	   psDescriptor->Label);

  dlclose(pvPluginHandle);
}

/*****************************************************************************/

/* Returns 0 if all goes well, otherwise returns 1. */
static int
listPlugins() {
  LADSPAPluginSearch(describePluginLibrary);
  return(0);
}

/*****************************************************************************/

int 
main(const int iArgc, const char ** ppcArgv) {
  return listPlugins();
}

/*****************************************************************************/

/* EOF */