diff --git a/doc/adding_plugins.html b/doc/adding_plugins.html index 785bdfd..906560b 100644 --- a/doc/adding_plugins.html +++ b/doc/adding_plugins.html @@ -1,3 +1,16 @@ + + + CMT Documentation + + + + +
+ +
+ +

Adding Plugins to the CMT Library

The CMT @@ -5,10 +18,6 @@

Adding Plugins to the CMT Library

additional sophistication to make plugin writing easier. This document describes how to add a new plugin to the toolkit.

-

At the moment CMT is not under public version control, so please -send changes to Richard -Furse.

-

CMT plugins interpret LADSPA_Handle entities as pointers to objects derived from the CMT_PluginInstance class. Plugin instance structures are defined by subclassing this, so @@ -34,10 +43,8 @@

Adding Plugins to the CMT Library

and addPort() methods.

All plugins need unique IDs. During development, use values between -1 and 1000. When the plugin is ready, please request an ID from ladspa@muse.demon.co.uk. Please -also add a brief description of your module to plugins.html.

+1 and 1000. When the plugin is ready, please request a block of IDs +from ids@ladspa.org.

In practice, CMT plugin writing is probably best learned by example. For a simple case, see the mixer.cpp @@ -52,3 +59,35 @@

Adding Plugins to the CMT Library

CMT plugins are licenced under GPL version 2. Please read and understand this license before submitting plugins to the library.

+ +
+ +

CMT Index

+ + + +

Other Links

+ + + + +
+ +
+ + + diff --git a/doc/bugs.html b/doc/bugs.html index e1c89b4..92ff790 100644 --- a/doc/bugs.html +++ b/doc/bugs.html @@ -1,7 +1,19 @@ + + + CMT Documentation + + + + +
+ +
+ +

CMT Bugs

-

Please report bugs to -richard@muse.demon.co.uk.

+

Please report any bugs to richard at ladspa dot org.

+ +
+ +

CMT Index

+ + + +

Other Links

+ + + + +
+ +
+ + + diff --git a/doc/changes.html b/doc/changes.html index 38bd707..b1376e1 100644 --- a/doc/changes.html +++ b/doc/changes.html @@ -1,149 +1,220 @@ + + + CMT Documentation + + + + +
+ +
+ +

CMT Changes

Version 1.01 - 4 May 2000

Version 1.02 - 11 May 2000

Version 1.03 - 14 May 2000

Version 1.04 - 18 May 2000

Version 1.05 - 18 May 2000

Version 1.06 - 24 Sep 2000

Version 1.07 - 30 Sep 2000

Version 1.08 - 30 Sep 2000

Version 1.09 - 4 Nov 2000

Version 1.10 - 17 Feb 2001

Version 1.11 - 8 May 2001

Version 1.12 - 17 Sept 2001

Version 1.13 - 7 May 2002

Version 1.14 - 7 Aug 2002

+ +

Version 1.15 - 19 Dec 2002

+ -

Version 1.15 - 19 Dec 2002

+

Version 1.16 - 6 Nov 2007

-

Version 1.16 - 6 Nov 2007

+

Version 1.17 - 3 Jan 2019

+ + +
+ +

CMT Index

+ + -
  • Replace strdup() with localStrdup() to avoid malloc/new -mismatch.
  • +

    Other Links

    + + + +
    + +
    + + + diff --git a/doc/index.html b/doc/index.html index abab9a5..6c02ee6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,26 +1,42 @@ + + + CMT Documentation + + + + +
    + +
    + +

    CMT Index

    Other Links

    -

    Richard Furse can be emailed as richard@muse.demon.co.uk. -

    +
    + +
    + + diff --git a/doc/installation.html b/doc/installation.html index e66e29a..54d6517 100644 --- a/doc/installation.html +++ b/doc/installation.html @@ -1,19 +1,64 @@ + + + CMT Documentation + + + + +
    + +
    + +

    CMT Installation

    To build the plugin library, enter the src/ directory -and run make. The makefile expects to find the -ladspa.h header file in your include path or -/usr/local/include/. If you do not have this file it can -be downloaded as part of the LADSPA SDK from -http://www.ladspa.org/download/.

    + and run make. The makefile expects to find the + ladspa.h header file in your include path or + /usr/local/include/. If you do not have this file it + can be downloaded as part of the LADSPA SDK + from + http://www.ladspa.org/download/index.html.

    Running make will generate the CMT LADSPA plugin -library (cmt.so) in the plugins/ -directory. This can be moved to an appropriate location depending on -the application you are using. Running make install from -the src/ directory as root will install to -/usr/local/lib/ladspa/ which is on the search path -recommended for hosts looking for plugin libraries. Some applications -may not search this directory automatically.

    + library (cmt.so) in the plugins/ + directory. This can be moved to an appropriate location depending on + the application you are using. Running make install + from the src/ directory as root will install to + /usr/lib/ladspa/ which is on the search path + recommended for hosts looking for plugin libraries. Some + applications may not search this directory automatically.

    + + +
    + +

    CMT Index

    + + + +

    Other Links

    + + + + +
    + +
    + + diff --git a/doc/license.html b/doc/license.html index a7e00db..d89061c 100644 --- a/doc/license.html +++ b/doc/license.html @@ -1,3 +1,16 @@ + + + CMT Documentation + + + + +
    + +
    + +

    CMT License

    The CMT toolkit is licensed under GPL version @@ -14,3 +27,35 @@

    CMT License

    things to be. See the LADPSA license for further details.

    + +
    + +

    CMT Index

    + + + +

    Other Links

    + + + + +
    + +
    + + + diff --git a/doc/overview.html b/doc/overview.html index e34b7a9..120a30a 100644 --- a/doc/overview.html +++ b/doc/overview.html @@ -1,4 +1,17 @@ -

    Computer Music Toolkit (CMT) v1.16 Overview

    + + + CMT Documentation + + + + +
    + +
    + + +

    Computer Music Toolkit (CMT) v1.17 Overview

    The Computer Music Toolkit (CMT) is a collection of LADSPA plugins for use with software @@ -6,9 +19,38 @@

    Computer Music Toolkit (CMT) v1.16 Overview

    HREF="license.html">license before use.

    The CMT was initially designed and developed by Richard W.E. Furse -(who was also the principal designer of the LADSPA standard) and -further plugins have been provided by by Jezar, David Bartold and -Nathaniel Virgo. If you are a programmer or can write documentation -and would like to help out, please feel free to contact Richard.

    +and further plugins have been provided by Jezar, David Bartold and +Nathaniel Virgo.

    + + +
    + +

    CMT Index

    + + + +

    Other Links

    + + + + +
    + +
    + + diff --git a/doc/plugins.html b/doc/plugins.html old mode 100755 new mode 100644 index 9eddd04..1c6efc5 --- a/doc/plugins.html +++ b/doc/plugins.html @@ -1,3 +1,16 @@ + + + CMT Documentation + + + + +
    + +
    + +

    CMT Library Plugins

    The following plugins are provided in the CMT library:

    @@ -475,3 +488,35 @@

    CMT Library Plugins

    "Ambisonics" is a registered trademark of Nimbus Communications International.

    + +
    + +

    CMT Index

    + + + +

    Other Links

    + + + + +
    + +
    + + + diff --git a/doc/tasks.html b/doc/tasks.html deleted file mode 100644 index 72a9ff6..0000000 --- a/doc/tasks.html +++ /dev/null @@ -1,36 +0,0 @@ -

    CMT Library Task List

    - -

    Basic Plugins Needed

    - - - -

    Other Plugins Planned

    - - - -

    Other Tasks

    - - - diff --git a/src/am.cpp b/src/am.cpp index 2e07ae5..0af2b2d 100644 --- a/src/am.cpp +++ b/src/am.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -34,6 +34,9 @@ #define AM_INPUT2 1 #define AM_OUTPUT 2 +static void runAmplitudeModulator(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin multiplies two signals together to produce a third. */ class AmplitudeModulator : public CMT_PluginInstance { public: @@ -44,15 +47,15 @@ class AmplitudeModulator : public CMT_PluginInstance { } friend void runAmplitudeModulator(LADSPA_Handle Instance, - unsigned long SAmplitudeModulatorpleCount); + unsigned long SampleCount); }; /*****************************************************************************/ -void +static void runAmplitudeModulator(LADSPA_Handle Instance, - unsigned long SAmplitudeModulatorpleCount) { + unsigned long SampleCount) { AmplitudeModulator * poAmplitudeModulator = (AmplitudeModulator *)Instance; @@ -61,7 +64,7 @@ runAmplitudeModulator(LADSPA_Handle Instance, LADSPA_Data * pfOutput = poAmplitudeModulator->m_ppfPorts[AM_OUTPUT]; for (unsigned long lSAmplitudeModulatorpleIndex = 0; - lSAmplitudeModulatorpleIndex < SAmplitudeModulatorpleCount; + lSAmplitudeModulatorpleIndex < SampleCount; lSAmplitudeModulatorpleIndex++) *(pfOutput++) = *(pfInput1++) * *(pfInput2++); } diff --git a/src/ambisonic.cpp b/src/ambisonic.cpp index 60e4280..171a449 100644 --- a/src/ambisonic.cpp +++ b/src/ambisonic.cpp @@ -31,9 +31,9 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include +#include /*****************************************************************************/ @@ -58,6 +58,11 @@ /*****************************************************************************/ +static void runBFormatEncoder(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runFMHFormatEncoder(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin encodes a signal to B-Format depending on where it is located in a virtual space. */ class BFormatEncoder : public CMT_PluginInstance { @@ -98,6 +103,9 @@ class FMHFormatEncoder : public CMT_PluginInstance { #define F2B_OUT_Y 11 #define F2B_OUT_Z 12 +static void runFMHToB(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin coverts FMH-Format to B-Format. This is a trivial operation that can also be achieved simply by discarding RSTUV channels. */ @@ -120,6 +128,9 @@ class FMHToB : public CMT_PluginInstance { #define DECST_OUT_L 4 #define DECST_OUT_R 5 +static void runBFormatToStereo(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin decodes B-Format to produce a stereo speaker feed. */ class BFormatToStereo : public CMT_PluginInstance { public: @@ -142,6 +153,9 @@ class BFormatToStereo : public CMT_PluginInstance { #define DECQ_OUT_BL 6 #define DECQ_OUT_BR 7 +static void runBFormatToQuad(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin decodes B-Format to produce a quad (square) speaker feed. */ class BFormatToQuad : public CMT_PluginInstance { public: @@ -168,6 +182,9 @@ class BFormatToQuad : public CMT_PluginInstance { #define DECC_OUT_TBL 10 #define DECC_OUT_TBR 11 +static void runBFormatToCube(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin decodes B-Format to produce a speaker feed for eight speakers arranged at the corners of a cube. */ class BFormatToCube : public CMT_PluginInstance { @@ -200,6 +217,9 @@ class BFormatToCube : public CMT_PluginInstance { #define DECO_OUT_BLL 15 #define DECO_OUT_FLL 16 +static void runFMHFormatToOct(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin decodes FMH-Format to produce a speaker feed for eight speakers arranged at the corners of an octagon. */ class FMHFormatToOct : public CMT_PluginInstance { @@ -224,6 +244,9 @@ class FMHFormatToOct : public CMT_PluginInstance { #define BFROT_OUT_Y 7 #define BFROT_OUT_Z 8 +static void runBFormatRotation(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin rotates an B-Format soundfield around the Z-axis. */ class BFormatRotation : public CMT_PluginInstance { public: @@ -259,6 +282,9 @@ class BFormatRotation : public CMT_PluginInstance { #define FMHROT_OUT_U 17 #define FMHROT_OUT_V 18 +static void runFMHFormatRotation(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin rotates an FMH-Format soundfield around the Z-axis. */ class FMHFormatRotation : public CMT_PluginInstance { public: @@ -272,7 +298,7 @@ class FMHFormatRotation : public CMT_PluginInstance { /*****************************************************************************/ -void +static void runBFormatEncoder(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -314,7 +340,7 @@ runBFormatEncoder(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runFMHFormatEncoder(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -379,7 +405,7 @@ runFMHFormatEncoder(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runFMHToB(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -403,7 +429,7 @@ runFMHToB(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runBFormatToStereo(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -428,7 +454,7 @@ runBFormatToStereo(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runBFormatToQuad(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -460,7 +486,7 @@ runBFormatToQuad(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runBFormatToCube(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -504,7 +530,7 @@ runBFormatToCube(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runFMHFormatToOct(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -549,7 +575,7 @@ runFMHFormatToOct(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runBFormatRotation(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -587,7 +613,7 @@ runBFormatRotation(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runFMHFormatRotation(LADSPA_Handle Instance, unsigned long SampleCount) { diff --git a/src/amp.cpp b/src/amp.cpp index 1d806f1..2f81f22 100644 --- a/src/amp.cpp +++ b/src/amp.cpp @@ -21,7 +21,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -33,6 +33,9 @@ #define AMP_INPUT1 1 #define AMP_OUTPUT1 2 +static void runMonoAmplifier(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin applies a gain to a mono signal. */ class MonoAmplifier : public CMT_PluginInstance { public: @@ -53,6 +56,9 @@ class MonoAmplifier : public CMT_PluginInstance { #define AMP_INPUT2 3 #define AMP_OUTPUT2 4 +static void runStereoAmplifier(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin applies a gain to a stereo signal. */ class StereoAmplifier : public CMT_PluginInstance { public: @@ -63,12 +69,13 @@ class StereoAmplifier : public CMT_PluginInstance { } friend void runStereoAmplifier(LADSPA_Handle Instance, - unsigned long SampleCount); + unsigned long SampleCount); + }; /*****************************************************************************/ -void +static void runMonoAmplifier(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -86,7 +93,7 @@ runMonoAmplifier(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runStereoAmplifier(LADSPA_Handle Instance, unsigned long SampleCount) { diff --git a/src/analogue.cpp b/src/analogue.cpp index c97ea39..da49066 100644 --- a/src/analogue.cpp +++ b/src/analogue.cpp @@ -24,9 +24,8 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include #include "cmt.h" #define PORT_OUT 0 @@ -262,6 +261,8 @@ class Analogue : public CMT_PluginInstance LADSPA_Data filt_lfo_mod; LADSPA_Data **ports; + a = b = c = 0; + ports = analogue->m_ppfPorts; gate = (*ports[PORT_GATE] > 0.0); if (gate == 1 && analogue->trigger == 0) diff --git a/src/canyondelay.cpp b/src/canyondelay.cpp index 55377f9..4af7316 100644 --- a/src/canyondelay.cpp +++ b/src/canyondelay.cpp @@ -24,9 +24,8 @@ /*****************************************************************************/ - -#include -#include +#include +#include #include "cmt.h" #define PORT_IN_LEFT 0 diff --git a/src/cmt.cpp b/src/cmt.cpp index d735c44..9c3d235 100644 --- a/src/cmt.cpp +++ b/src/cmt.cpp @@ -21,7 +21,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -29,7 +29,7 @@ /*****************************************************************************/ -inline char * +static inline char * localStrdup(const char * input) { char * output = new char[strlen(input) + 1]; strcpy(output, input); diff --git a/src/delay.cpp b/src/delay.cpp index 1990941..a64f39a 100644 --- a/src/delay.cpp +++ b/src/delay.cpp @@ -27,9 +27,9 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include +#include /*****************************************************************************/ @@ -55,6 +55,12 @@ /* Present only on feedback delays: */ #define DL_FEEDBACK 4 +static void activateDelayLine(LADSPA_Handle Instance); +static void runSimpleDelayLine(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runFeedbackDelayLine(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This class is used to implement delay line plugins. Different maximum delay times are supported as are both echo and feedback delays. */ @@ -103,7 +109,7 @@ class DelayLine : public CMT_PluginInstance { /*****************************************************************************/ /* Initialise and activate a plugin instance. */ -void +static void activateDelayLine(LADSPA_Handle Instance) { DelayLine * poDelayLine = (DelayLine *)Instance; @@ -121,7 +127,7 @@ activateDelayLine(LADSPA_Handle Instance) { /*****************************************************************************/ /* Run a delay line instance for a block of SampleCount samples. */ -void +static void runSimpleDelayLine(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -171,7 +177,7 @@ runSimpleDelayLine(LADSPA_Handle Instance, /*****************************************************************************/ /** Run a feedback delay line instance for a block of SampleCount samples. */ -void +static void runFeedbackDelayLine(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -228,7 +234,8 @@ runFeedbackDelayLine(LADSPA_Handle Instance, /*****************************************************************************/ -template LADSPA_Handle +template +static LADSPA_Handle CMT_Delay_Instantiate(const LADSPA_Descriptor * Descriptor, unsigned long SampleRate) { return new DelayLine(SampleRate, diff --git a/src/disintegrator.cpp b/src/disintegrator.cpp index 39edefc..867fe37 100644 --- a/src/disintegrator.cpp +++ b/src/disintegrator.cpp @@ -23,7 +23,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -41,7 +41,10 @@ namespace disintegrator { port_output = 3, n_ports = 4 }; - + + static void set_run_adding_gain(LADSPA_Handle instance, + LADSPA_Data new_gain); + /** This plugin multiplies random half-waveforms by port_multiplier, with probability port_probability */ class Plugin : public CMT_PluginInstance { @@ -64,8 +67,8 @@ namespace disintegrator { }; template - void run(LADSPA_Handle instance, - unsigned long sample_count) { + static void run(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -89,7 +92,7 @@ namespace disintegrator { } } - void set_run_adding_gain(LADSPA_Handle instance, + static void set_run_adding_gain(LADSPA_Handle instance, LADSPA_Data new_gain) { ((Plugin *) instance)->run_adding_gain = new_gain; } diff --git a/src/dynamic.cpp b/src/dynamic.cpp index 6314cdf..1903889 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -34,9 +34,9 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include +#include /*****************************************************************************/ @@ -71,6 +71,16 @@ class DynamicProcessor { #define CE_INPUT 4 #define CE_OUTPUT 5 +static void activateCompressorExpander(void * pvHandle); +static void runCompressor_Peak(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runCompressor_RMS(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runExpander_Peak(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runExpander_RMS(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This class is used to implement simple compressor and expander plugins. Attack and decay times are applied at the level detection stage rather than at gain processing. No delay is applied to the @@ -105,6 +115,12 @@ class CompressorExpander #define LN_INPUT 3 #define LN_OUTPUT 4 +static void activateLimiter(void * pvHandle); +static void runLimiter_Peak(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runLimiter_RMS(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This class is used to implement simple limiter plugins. Attack and decay times are applied at the level detection stage rather than at gain processing. No delay is applied to the main signal. Both @@ -129,7 +145,7 @@ class Limiter /*****************************************************************************/ -void +static void activateCompressorExpander(void * pvHandle) { CompressorExpander * poProcessor = (CompressorExpander *)pvHandle; poProcessor->m_fEnvelopeState = 0; @@ -137,7 +153,7 @@ activateCompressorExpander(void * pvHandle) { /*****************************************************************************/ -void +static void activateLimiter(void * pvHandle) { Limiter * poProcessor = (Limiter *)pvHandle; poProcessor->m_fEnvelopeState = 0; @@ -145,7 +161,7 @@ activateLimiter(void * pvHandle) { /*****************************************************************************/ -void +static void runCompressor_Peak(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -193,7 +209,7 @@ runCompressor_Peak(LADSPA_Handle Instance, fGain = 1; else { fGain = pow(rfEnvelopeState * fOneOverThreshold, fRatioMinusOne); - if (isnan(fGain)) + if (std::isnan(fGain)) fGain = 0; } @@ -204,7 +220,7 @@ runCompressor_Peak(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runCompressor_RMS(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -254,7 +270,7 @@ runCompressor_RMS(LADSPA_Handle Instance, fGain = 1; else { fGain = pow(fEnvelopeAmplitude * fOneOverThreshold, fRatioMinusOne); - if (isnan(fGain)) + if (std::isnan(fGain)) fGain = 0; } @@ -265,7 +281,7 @@ runCompressor_RMS(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runExpander_Peak(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -313,7 +329,7 @@ runExpander_Peak(LADSPA_Handle Instance, fGain = 1; else { fGain = pow(rfEnvelopeState * fOneOverThreshold, fOneMinusRatio); - if (isnan(fGain)) + if (std::isnan(fGain)) fGain = 0; } @@ -324,7 +340,7 @@ runExpander_Peak(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runExpander_RMS(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -374,7 +390,7 @@ runExpander_RMS(LADSPA_Handle Instance, fGain = 1; else { fGain = pow(fEnvelopeAmplitude * fOneOverThreshold, fOneMinusRatio); - if (isnan(fGain)) + if (std::isnan(fGain)) fGain = 0; } @@ -385,7 +401,7 @@ runExpander_RMS(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runLimiter_Peak(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -429,7 +445,7 @@ runLimiter_Peak(LADSPA_Handle Instance, fGain = 1; else { fGain = fThreshold / rfEnvelopeState; - if (isnan(fGain)) + if (std::isnan(fGain)) fGain = 0; } @@ -440,7 +456,7 @@ runLimiter_Peak(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runLimiter_RMS(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -486,7 +502,7 @@ runLimiter_RMS(LADSPA_Handle Instance, fGain = 1; else { fGain = fThreshold / fEnvelopeAmplitude; - if (isnan(fGain)) + if (std::isnan(fGain)) fGain = 0; } diff --git a/src/filter.cpp b/src/filter.cpp index a9006fb..2af8ed2 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -34,6 +34,12 @@ #define SF_INPUT 1 #define SF_OUTPUT 2 +static void activateOnePollFilter(LADSPA_Handle Instance); +static void runOnePollLowPassFilter(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runOnePollHighPassFilter(LADSPA_Handle Instance, + unsigned long SampleCount); + /** Instance data for the OnePoll filter (one-poll, low or high pass). We can get away with using this structure for both low- and high-pass filters because the data stored is the same. Note that @@ -71,7 +77,7 @@ class OnePollFilter : public CMT_PluginInstance { /*****************************************************************************/ -void +static void activateOnePollFilter(LADSPA_Handle Instance) { ((OnePollFilter *)Instance)->m_fLastOutput = 0; } @@ -79,7 +85,7 @@ activateOnePollFilter(LADSPA_Handle Instance) { /*****************************************************************************/ /** Run the LPF algorithm for a block of SampleCount samples. */ -void +static void runOnePollLowPassFilter(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -127,7 +133,7 @@ runOnePollLowPassFilter(LADSPA_Handle Instance, /*****************************************************************************/ /** Run the HPF algorithm for a block of SampleCount samples. */ -void +static void runOnePollHighPassFilter(LADSPA_Handle Instance, unsigned long SampleCount) { diff --git a/src/freeverb/Components/denormals.h b/src/freeverb/Components/denormals.h index f871412..1a18a3d 100755 --- a/src/freeverb/Components/denormals.h +++ b/src/freeverb/Components/denormals.h @@ -2,13 +2,16 @@ // // Written by Jezar at Dreampoint, June 2000 // http://www.dreampoint.co.uk -// Based on IS_DENORMAL macro by Jon Watte +// Originally based on IS_DENORMAL macro by Jon Watte, updated to use C99 isnormal(). // This code is public domain #ifndef _denormals_ #define _denormals_ -#define undenormalise(sample) if(((*(unsigned int*)&sample)&0x7f800000)==0) sample=0.0f +//#define undenormalise(sample) if(((*(unsigned int*)&sample)&0x7f800000)==0) sample=0.0f + +#include +#define undenormalise(sample) if(!std::isnormal(sample)) sample=0.0f #endif//_denormals_ diff --git a/src/gcc_exports.map b/src/gcc_exports.map new file mode 100644 index 0000000..a99cc8a --- /dev/null +++ b/src/gcc_exports.map @@ -0,0 +1,7 @@ +CMT +{ + global: + ladspa_descriptor; + local: + *; +}; diff --git a/src/grain.cpp b/src/grain.cpp index 3ec2543..95dca26 100644 --- a/src/grain.cpp +++ b/src/grain.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -132,6 +132,10 @@ class Grain { #define GRN_GRAIN_LENGTH 4 #define GRN_GRAIN_ATTACK 5 +static void activateGrainScatter(LADSPA_Handle Instance); +static void runGrainScatter(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin cuts an audio stream up and uses it to generate a granular texture. */ class GrainScatter : public CMT_PluginInstance { @@ -178,7 +182,7 @@ class GrainScatter : public CMT_PluginInstance { /*****************************************************************************/ /** Initialise and activate a plugin instance. */ -void +static void activateGrainScatter(LADSPA_Handle Instance) { GrainScatter * poGrainScatter = (GrainScatter *)Instance; @@ -195,7 +199,7 @@ activateGrainScatter(LADSPA_Handle Instance) { /*****************************************************************************/ -void +static void runGrainScatter(LADSPA_Handle Instance, unsigned long SampleCount) { diff --git a/src/hardgate.cpp b/src/hardgate.cpp index a2f04b1..359c762 100644 --- a/src/hardgate.cpp +++ b/src/hardgate.cpp @@ -23,7 +23,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -39,7 +39,10 @@ namespace hardgate { port_output = 2, n_ports = 3 }; - + + static void run(LADSPA_Handle instance, + unsigned long sample_count); + /** This plugin sets its input signal to 0 if it falls below a threshold. */ class Plugin : public CMT_PluginInstance { public: @@ -54,8 +57,8 @@ namespace hardgate { }; - void run(LADSPA_Handle instance, - unsigned long sample_count) { + static void run(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; diff --git a/src/init.cpp b/src/init.cpp index 76a7b26..9cfe029 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -21,9 +21,9 @@ /*****************************************************************************/ +#include +#include #include -#include -#include /*****************************************************************************/ @@ -36,7 +36,7 @@ void finalise_modules(); /*****************************************************************************/ -int +static int pluginNameComparator(const void * pvDescriptor1, const void * pvDescriptor2) { const CMT_Descriptor * psDescriptor1 @@ -55,9 +55,9 @@ pluginNameComparator(const void * pvDescriptor1, const void * pvDescriptor2) { /*****************************************************************************/ -CMT_Descriptor ** g_ppsRegisteredDescriptors = NULL; -unsigned long g_lPluginCapacity = 0; -unsigned long g_lPluginCount = 0; +static CMT_Descriptor ** g_ppsRegisteredDescriptors = NULL; +static unsigned long g_lPluginCapacity = 0; +static unsigned long g_lPluginCount = 0; /*****************************************************************************/ @@ -108,7 +108,9 @@ class StartupShutdownHandler { finalise_modules(); } -} g_oStartupShutdownHandler; +}; + +static StartupShutdownHandler g_oStartupShutdownHandler; /*****************************************************************************/ diff --git a/src/lofi.cpp b/src/lofi.cpp index dd7f4bd..8c61f21 100644 --- a/src/lofi.cpp +++ b/src/lofi.cpp @@ -24,9 +24,8 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include #include "cmt.h" #define PORT_IN_LEFT 0 diff --git a/src/logistic.cpp b/src/logistic.cpp index b2dfcb7..ca65ef3 100644 --- a/src/logistic.cpp +++ b/src/logistic.cpp @@ -26,7 +26,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -46,7 +46,11 @@ namespace logistic { n_ports = 3 }; - /** This plugin uses the logistic map to generate periodic or + static void activate(LADSPA_Handle instance); + static void run(LADSPA_Handle instance, + unsigned long sample_count); + + /** This plugin uses the logistic map to generate periodic or chaotic control signals. */ class Plugin : public CMT_PluginInstance { private: @@ -70,15 +74,15 @@ namespace logistic { unsigned long sample_count); }; - void activate(LADSPA_Handle instance) { + static void activate(LADSPA_Handle instance) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; p.x = 0.3; // arbitrary non-zero value. } - void run(LADSPA_Handle instance, - unsigned long sample_count) { + static void run(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; diff --git a/src/makefile b/src/makefile index 8a0f795..159dd46 100644 --- a/src/makefile +++ b/src/makefile @@ -11,7 +11,7 @@ INSTALL_PLUGINS_DIR = /usr/lib/ladspa/ # GENERAL # -CFLAGS = $(INCLUDES) -Wall -O3 -fPIC +CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC CXXFLAGS = $(CFLAGS) PLUGIN_LIB = ../plugins/cmt.so @@ -65,13 +65,17 @@ plugin: $(PLUGIN_LIB) targets: $(PLUGIN_LIB) -$(PLUGIN_LIB): $(PLUGIN_OBJECTS) +$(PLUGIN_LIB): $(PLUGIN_OBJECTS) gcc_exports.map $(CXX) -shared \ + $(CFLAGS) \ + -fvisibility=hidden \ + -fvisibility-inlines-hidden \ + -s \ + -Wl,--version-script=gcc_exports.map \ -o $(PLUGIN_LIB) \ $(PLUGIN_OBJECTS) install: $(PLUGIN_LIB) - -strip $(PLUGIN_LIB) cp $(PLUGIN_LIB) $(INSTALL_PLUGINS_DIR) test: /tmp/test.wav ../../ladspa_sdk/snd/noise.wav always diff --git a/src/mixer.cpp b/src/mixer.cpp index 32d3ec4..4f5ad24 100644 --- a/src/mixer.cpp +++ b/src/mixer.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -36,6 +36,9 @@ #define MIXER_INPUT2 1 #define MIXER_OUTPUT 2 +static void runSimpleMixer(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin adds two signals together to produce a third. */ class SimpleMixer : public CMT_PluginInstance { public: @@ -52,7 +55,7 @@ class SimpleMixer : public CMT_PluginInstance { /*****************************************************************************/ -void +static void runSimpleMixer(LADSPA_Handle Instance, unsigned long SampleCount) { diff --git a/src/noise.cpp b/src/noise.cpp index bf6c5a8..e1fb279 100644 --- a/src/noise.cpp +++ b/src/noise.cpp @@ -21,7 +21,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -34,6 +34,13 @@ #define NOISE_AMPLITUDE 0 #define NOISE_OUTPUT 1 +static void runWhiteNoise(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runWhiteNoiseAdding(LADSPA_Handle Instance, + unsigned long SampleCount); +static void setWhiteNoiseRunAddingGain(LADSPA_Handle Instance, + LADSPA_Data Gain); + /** Plugin that provides white noise output. This is provided by calling rand() repeatedly. */ class WhiteNoise : public CMT_PluginInstance { @@ -59,7 +66,7 @@ class WhiteNoise : public CMT_PluginInstance { /*****************************************************************************/ -void +static void runWhiteNoise(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -76,7 +83,7 @@ runWhiteNoise(LADSPA_Handle Instance, *(pfOutput++) = rand() * fScalar - fAmplitude; } -void +static void runWhiteNoiseAdding(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -96,7 +103,7 @@ runWhiteNoiseAdding(LADSPA_Handle Instance, } -void +static void setWhiteNoiseRunAddingGain(LADSPA_Handle Instance, LADSPA_Data Gain) { } diff --git a/src/null.cpp b/src/null.cpp index afae4f4..e0a8df0 100644 --- a/src/null.cpp +++ b/src/null.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -34,6 +34,13 @@ #define NULL_PORT 0 +static void runNull_Nop(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runNull_OutputAudio(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runNull_OutputControl(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin can be used to take care of unwanted connections in a host's plugin network by generating zero data and audio or accepting (but ignoring) data and audio. */ @@ -59,6 +66,11 @@ class NullPlugin : public CMT_PluginInstance { #define IDENTITY_INPUT 0 #define IDENTITY_OUTPUT 1 +static void runIdentity_Audio(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runIdentity_Control(LADSPA_Handle Instance, + unsigned long SampleCount); + /* This plugin passes its input to its output. There are audio and control varieties. */ class IdentityPlugin : public CMT_PluginInstance { @@ -78,7 +90,7 @@ class IdentityPlugin : public CMT_PluginInstance { /*****************************************************************************/ -void +static void runNull_Nop(LADSPA_Handle Instance, unsigned long SampleCount) { /* Nothing to do. */ @@ -86,7 +98,7 @@ runNull_Nop(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runNull_OutputAudio(LADSPA_Handle Instance, unsigned long SampleCount) { NullPlugin * poPlugin = (NullPlugin *)Instance; @@ -97,7 +109,7 @@ runNull_OutputAudio(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runNull_OutputControl(LADSPA_Handle Instance, unsigned long) { NullPlugin * poPlugin = (NullPlugin *)Instance; @@ -106,7 +118,7 @@ runNull_OutputControl(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runIdentity_Audio(LADSPA_Handle Instance, unsigned long SampleCount) { IdentityPlugin * poPlugin = (IdentityPlugin *)Instance; @@ -119,7 +131,7 @@ runIdentity_Audio(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runIdentity_Control(LADSPA_Handle Instance, unsigned long) { IdentityPlugin * poPlugin = (IdentityPlugin *)Instance; diff --git a/src/organ.cpp b/src/organ.cpp index f05d6b0..deb6f7d 100644 --- a/src/organ.cpp +++ b/src/organ.cpp @@ -24,8 +24,8 @@ /*****************************************************************************/ -#include -#include +#include +#include #include "cmt.h" #define PORT_OUT 0 diff --git a/src/peak.cpp b/src/peak.cpp index d17fc2c..8fc7642 100644 --- a/src/peak.cpp +++ b/src/peak.cpp @@ -21,9 +21,9 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include +#include /*****************************************************************************/ @@ -37,6 +37,16 @@ #define ET_FILTER 2 +static void activateTracker(void * pvHandle); +static void runEnvelopeTracker_Peak(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runEnvelopeTracker_RMS(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runEnvelopeTracker_MaxPeak(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runEnvelopeTracker_MaxRMS(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This class is used to provide plugins that perform envelope tracking. Peak and RMS are supported and smoothed or smoothed maximum approaches are available. */ @@ -66,6 +76,10 @@ class Tracker : public CMT_PluginInstance { }; +static void activatePeakMonitor(void * pvHandle); +static void runPeakMonitor(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This class provides a simple peak monitor that records the highest signal peak present ever. It can be useful to identify clipping cases. */ @@ -89,21 +103,21 @@ class PeakMonitor : public CMT_PluginInstance { /*****************************************************************************/ -void +static void activateTracker(void * pvHandle) { ((Tracker *)pvHandle)->m_fState = 0; } /*****************************************************************************/ -void +static void activatePeakMonitor(void * pvHandle) { ((PeakMonitor *)pvHandle)->m_fState = 0; } /*****************************************************************************/ -void +static void runEnvelopeTracker_Peak(LADSPA_Handle Instance, unsigned long SampleCount) { Tracker * poProcessor = (Tracker *)Instance; @@ -123,7 +137,7 @@ runEnvelopeTracker_Peak(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runEnvelopeTracker_RMS(LADSPA_Handle Instance, unsigned long SampleCount) { Tracker * poProcessor = (Tracker *)Instance; @@ -143,7 +157,7 @@ runEnvelopeTracker_RMS(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runEnvelopeTracker_MaxPeak(LADSPA_Handle Instance, unsigned long SampleCount) { Tracker * poProcessor = (Tracker *)Instance; @@ -169,7 +183,7 @@ runEnvelopeTracker_MaxPeak(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runEnvelopeTracker_MaxRMS(LADSPA_Handle Instance, unsigned long SampleCount) { Tracker * poProcessor = (Tracker *)Instance; @@ -195,7 +209,7 @@ runEnvelopeTracker_MaxRMS(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runPeakMonitor(LADSPA_Handle Instance, unsigned long SampleCount) { PeakMonitor * poProcessor = (PeakMonitor *)Instance; diff --git a/src/phasemod.cpp b/src/phasemod.cpp index cd8a96e..0f91840 100644 --- a/src/phasemod.cpp +++ b/src/phasemod.cpp @@ -24,9 +24,8 @@ /*****************************************************************************/ -#include -#include -#include +#include +#include #include "cmt.h" #define PORT_OUT 0 diff --git a/src/pink.cpp b/src/pink.cpp index bf3e1bb..1c85084 100644 --- a/src/pink.cpp +++ b/src/pink.cpp @@ -25,7 +25,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -44,6 +44,10 @@ namespace pink { n_ports = 2 }; + static void activate(LADSPA_Handle instance); + static void run_interpolated_audio(LADSPA_Handle instance, + unsigned long sample_count); + /** This plugin generates a signal which approximates the effect of low-pass filtered pink noise, which makes for an interesting randomly changing control parameter. It should probably use sinc interpolation, but in fact @@ -82,7 +86,7 @@ namespace pink { }; - void activate(LADSPA_Handle instance) { + static void activate(LADSPA_Handle instance) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -94,9 +98,9 @@ namespace pink { p.multiplier = 1; } - inline float thirdInterp(const float &x, - const float &L1,const float &L0, - const float &H0,const float &H1) { + static inline float thirdInterp(const float &x, + const float &L1,const float &L0, + const float &H0,const float &H1) { return L0 + .5f* @@ -107,8 +111,8 @@ namespace pink { x*((H0 - L0)*6 + (L1 - H1)*2 ))))); } - void run_interpolated_audio(LADSPA_Handle instance, - unsigned long sample_count) { + static void run_interpolated_audio(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -148,8 +152,9 @@ namespace pink { } } - void run_interpolated_control(LADSPA_Handle instance, - unsigned long sample_count) { + /* Not in use; see below. + static void run_interpolated_control(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -174,6 +179,7 @@ namespace pink { } *(out)=value; } + */ void initialise() { CMT_Descriptor * d = new CMT_Descriptor diff --git a/src/pink_full.cpp b/src/pink_full.cpp index 1c4de16..b3e1f88 100644 --- a/src/pink_full.cpp +++ b/src/pink_full.cpp @@ -26,7 +26,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -45,7 +45,11 @@ namespace pink_full { n_ports = 1 }; - /** This plugin generates a signal which approximates pink noise, using the + static void activate(LADSPA_Handle instance); + static void run(LADSPA_Handle instance, + unsigned long sample_count); + + /** This plugin generates a signal which approximates pink noise, using the Voss-McCartney algorithm described at www.firstpr.com.au/dsp/pink-noise/ */ class Plugin : public CMT_PluginInstance { private: @@ -68,15 +72,15 @@ namespace pink_full { unsigned long sample_count); }; - void activate(LADSPA_Handle instance) { + static void activate(LADSPA_Handle instance) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; p.noise_source.reset(); } - void run(LADSPA_Handle instance, - unsigned long sample_count) { + static void run(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; diff --git a/src/pink_sh.cpp b/src/pink_sh.cpp index 13f2a69..6f13790 100644 --- a/src/pink_sh.cpp +++ b/src/pink_sh.cpp @@ -26,7 +26,7 @@ /*****************************************************************************/ -#include +#include /*****************************************************************************/ @@ -45,6 +45,10 @@ namespace pink_sh { n_ports = 2 }; + static void activate(LADSPA_Handle instance); + static void run(LADSPA_Handle instance, + unsigned long sample_count); + /** This plugin generates a signal which approximates stepped (sample-and-hold like) pink noise, using the Voss-McCartney algorithm described at www.firstpr.com.au/dsp/pink-noise/ */ @@ -70,7 +74,7 @@ namespace pink_sh { unsigned long sample_count); }; - void activate(LADSPA_Handle instance) { + static void activate(LADSPA_Handle instance) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -78,8 +82,8 @@ namespace pink_sh { p.counter = 0; } - void run(LADSPA_Handle instance, - unsigned long sample_count) { + static void run(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; diff --git a/src/pinknoise.h b/src/pinknoise.h index c6b350f..d0df847 100644 --- a/src/pinknoise.h +++ b/src/pinknoise.h @@ -27,7 +27,7 @@ #ifndef _PINKNOISE_H #define _PINKNOISE_H -#include +#include typedef unsigned int CounterType; typedef float DataValue; diff --git a/src/sine.cpp b/src/sine.cpp index 7b27ff4..331e184 100644 --- a/src/sine.cpp +++ b/src/sine.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -36,12 +36,12 @@ /*****************************************************************************/ -LADSPA_Data * g_pfSineTable = NULL; -LADSPA_Data g_fPhaseStepBase = 0; +static LADSPA_Data * g_pfSineTable = NULL; +static LADSPA_Data g_fPhaseStepBase = 0; /*****************************************************************************/ -void +static void initialise_sine_wavetable() { if (g_pfSineTable == NULL) { long lTableSize = (1 << SINE_TABLE_BITS); @@ -62,6 +62,16 @@ initialise_sine_wavetable() { #define OSC_AMPLITUDE 1 #define OSC_OUTPUT 2 +static void activateSineOscillator(void * pvHandle); +static void runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance, + unsigned long SampleCount); +static void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance, + unsigned long SampleCount); + /* This class provides sine wavetable oscillator plugins. Band-limiting to avoid aliasing is trivial because of the waveform in use. Four versions of the oscillator are provided, @@ -114,14 +124,14 @@ class SineOscillator : public CMT_PluginInstance{ /*****************************************************************************/ -void +static void activateSineOscillator(void * pvHandle) { ((SineOscillator *)pvHandle)->m_lPhase = 0; } /*****************************************************************************/ -void +static void runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; @@ -143,7 +153,7 @@ runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; @@ -165,7 +175,7 @@ runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; @@ -184,7 +194,7 @@ runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; diff --git a/src/sledgehammer.cpp b/src/sledgehammer.cpp index 60eb79f..06eaa03 100644 --- a/src/sledgehammer.cpp +++ b/src/sledgehammer.cpp @@ -26,8 +26,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -48,6 +48,13 @@ namespace sledgehammer { n_ports = 6 }; + static void activate(LADSPA_Handle instance); + template + static void run(LADSPA_Handle instance, + unsigned long sample_count); + static void set_run_adding_gain(LADSPA_Handle instance, + LADSPA_Data new_gain); + /** This plugin imposes the dynamics of one sound onto another. It can be seen as a brutal compressor with a sidechain, or as a kind of one-band vocoder. */ @@ -70,7 +77,7 @@ namespace sledgehammer { LADSPA_Data new_gain); }; - void activate(LADSPA_Handle instance) { + static void activate(LADSPA_Handle instance) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -79,8 +86,8 @@ namespace sledgehammer { } template - void run(LADSPA_Handle instance, - unsigned long sample_count) { + static void run(LADSPA_Handle instance, + unsigned long sample_count) { Plugin *pp = (Plugin *) instance; Plugin &p = *pp; @@ -113,8 +120,8 @@ namespace sledgehammer { } } - void set_run_adding_gain(LADSPA_Handle instance, - LADSPA_Data new_gain) { + static void set_run_adding_gain(LADSPA_Handle instance, + LADSPA_Data new_gain) { ((Plugin *) instance)->run_adding_gain = new_gain; } diff --git a/src/syndrum.cpp b/src/syndrum.cpp index f8e1577..4120854 100644 --- a/src/syndrum.cpp +++ b/src/syndrum.cpp @@ -24,8 +24,8 @@ /*****************************************************************************/ -#include -#include +#include +#include #include "cmt.h" #define PORT_OUT 0 diff --git a/src/utils.h b/src/utils.h index 1205675..468a9c1 100644 --- a/src/utils.h +++ b/src/utils.h @@ -24,8 +24,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ diff --git a/src/vcf303.cpp b/src/vcf303.cpp index 4bf8364..7607e9d 100644 --- a/src/vcf303.cpp +++ b/src/vcf303.cpp @@ -25,9 +25,8 @@ /*****************************************************************************/ - -#include -#include +#include +#include #include "cmt.h" #define PORT_IN 0 diff --git a/src/wshape_sine.cpp b/src/wshape_sine.cpp index 07eab07..dc4ad33 100644 --- a/src/wshape_sine.cpp +++ b/src/wshape_sine.cpp @@ -21,8 +21,8 @@ /*****************************************************************************/ -#include -#include +#include +#include /*****************************************************************************/ @@ -34,6 +34,9 @@ #define WSS_INPUT 1 #define WSS_OUTPUT 2 +static void runSineWaveshaper(LADSPA_Handle Instance, + unsigned long SampleCount); + /** This plugin applies a gain to a mono signal. */ class SineWaveshaper : public CMT_PluginInstance { public: @@ -44,13 +47,13 @@ class SineWaveshaper : public CMT_PluginInstance { } friend void runSineWaveshaper(LADSPA_Handle Instance, - unsigned long SampleCount); + unsigned long SampleCount); }; /*****************************************************************************/ -void +static void runSineWaveshaper(LADSPA_Handle Instance, unsigned long SampleCount) {