d470eb0d034315c075604db96880ad72dd921bb6
[platform/upstream/gst-plugins-good.git] / ext / ladspa / utils.h
1 /* utils.h
2
3    Free software by Richard W.E. Furse. Do with as you will. No
4    warranty. */
5
6 #ifndef LADSPA_SDK_LOAD_PLUGIN_LIB
7 #define LADSPA_SDK_LOAD_PLUGIN_LIB
8
9 /*****************************************************************************/
10
11 #include <ladspa.h>
12
13 /*****************************************************************************/
14
15 /* Functions in load.c: */
16
17 /* This function call takes a plugin library filename, searches for
18    the library along the LADSPA_PATH, loads it with dlopen() and
19    returns a plugin handle for use with findPluginDescriptor() or
20    unloadLADSPAPluginLibrary(). Errors are handled by writing a
21    message to stderr and calling exit(1). It is alright (although
22    inefficient) to call this more than once for the same file. */
23 void * loadLADSPAPluginLibrary(const char * pcPluginFilename);
24
25 /* This function unloads a LADSPA plugin library. */
26 void unloadLADSPAPluginLibrary(void * pvLADSPAPluginLibrary);
27
28 /* This function locates a LADSPA plugin within a plugin library
29    loaded with loadLADSPAPluginLibrary(). Errors are handled by
30    writing a message to stderr and calling exit(1). Note that the
31    plugin library filename is only included to help provide
32    informative error messages. */
33 const LADSPA_Descriptor *
34 findLADSPAPluginDescriptor(void * pvLADSPAPluginLibrary,
35                            const char * pcPluginLibraryFilename,
36                            const char * pcPluginLabel);
37
38 /*****************************************************************************/
39
40 /* Functions in search.c: */
41
42 /* Callback function for use with LADSPAPluginSearch(). The callback
43    function passes the filename (full path), a plugin handle (dlopen()
44    style) and a LADSPA_DescriptorFunction (from which
45    LADSPA_Descriptors can be acquired). */
46 typedef void LADSPAPluginSearchCallbackFunction
47 (const char * pcFullFilename, 
48  void * pvPluginHandle,
49  LADSPA_Descriptor_Function fDescriptorFunction);
50
51 /* Search through the $(LADSPA_PATH) (or a default path) for any
52    LADSPA plugin libraries. Each plugin library is tested using
53    dlopen() and dlsym(,"ladspa_descriptor"). After loading each
54    library, the callback function is called to process it. This
55    function leaves items passed to the callback function open. */
56 void LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction);
57
58 /*****************************************************************************/
59
60 #endif
61
62 /* EOF */