diff options
Diffstat (limited to 'src/plugins/filter.c')
-rw-r--r-- | src/plugins/filter.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/plugins/filter.c b/src/plugins/filter.c index 3f50457..b20d506 100644 --- a/src/plugins/filter.c +++ b/src/plugins/filter.c @@ -18,6 +18,7 @@ /*****************************************************************************/ #include "ladspa.h" +#include "utils.h" /*****************************************************************************/ @@ -56,7 +57,7 @@ typedef struct { structure can be used for low- or high-pass filters we can get away with only only writing one of these functions. Normally one would be required for each plugin type. */ -LADSPA_Handle +static LADSPA_Handle instantiateSimpleFilter(const LADSPA_Descriptor * Descriptor, unsigned long SampleRate) { @@ -81,7 +82,7 @@ instantiateSimpleFilter(const LADSPA_Descriptor * Descriptor, /* Initialise and activate a plugin instance. Normally separate functions would have to be written for the different plugin types, however we can get away with a single function in this case. */ -void +static void activateSimpleFilter(LADSPA_Handle Instance) { SimpleFilter * psSimpleFilter; psSimpleFilter = (SimpleFilter *)Instance; @@ -93,7 +94,7 @@ activateSimpleFilter(LADSPA_Handle Instance) { /* Connect a port to a data location. Normally separate functions would have to be written for the different plugin types, however we can get away with a single function in this case. */ -void +static void connectPortToSimpleFilter(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation) { @@ -118,7 +119,7 @@ connectPortToSimpleFilter(LADSPA_Handle Instance, /*****************************************************************************/ /* Run the LPF algorithm for a block of SampleCount samples. */ -void +static void runSimpleLowPassFilter(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -177,7 +178,7 @@ runSimpleLowPassFilter(LADSPA_Handle Instance, /*****************************************************************************/ /* Run the HPF algorithm for a block of SampleCount samples. */ -void +static void runSimpleHighPassFilter(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -238,22 +239,20 @@ runSimpleHighPassFilter(LADSPA_Handle Instance, /* Throw away a filter instance. Normally separate functions would have to be written for the different plugin types, however we can get away with a single function in this case. */ -void +static void cleanupSimpleFilter(LADSPA_Handle Instance) { free(Instance); } /*****************************************************************************/ -LADSPA_Descriptor * g_psLPFDescriptor = NULL; -LADSPA_Descriptor * g_psHPFDescriptor = NULL; +static LADSPA_Descriptor * g_psLPFDescriptor = NULL; +static LADSPA_Descriptor * g_psHPFDescriptor = NULL; /*****************************************************************************/ -/* _init() is called automatically when the plugin library is first - loaded. */ -void -_init() { +/* Called automatically when the plugin library is first loaded. */ +ON_LOAD_ROUTINE { char ** pcPortNames; LADSPA_PortDescriptor * piPortDescriptors; @@ -411,7 +410,7 @@ _init() { /*****************************************************************************/ -void +static void deleteDescriptor(LADSPA_Descriptor * psDescriptor) { unsigned long lIndex; if (psDescriptor) { @@ -430,9 +429,8 @@ deleteDescriptor(LADSPA_Descriptor * psDescriptor) { /*****************************************************************************/ -/* _fini() is called automatically when the library is unloaded. */ -void -_fini() { +/* Called automatically when the library is unloaded. */ +ON_UNLOAD_ROUTINE { deleteDescriptor(g_psLPFDescriptor); deleteDescriptor(g_psHPFDescriptor); } |