diff options
author | Felipe Sateler <fsateler@debian.org> | 2019-04-13 13:54:00 -0400 |
---|---|---|
committer | Felipe Sateler <fsateler@debian.org> | 2019-04-13 13:54:00 -0400 |
commit | 7f00614eb2add32d97bbb0ab47ac5b6322238e87 (patch) | |
tree | de98d4a4ec82eba3d0e1998473cb15a61e44eb2b | |
parent | b7c12c1360bffb758667af95e6ddcf6f2a9758fa (diff) | |
parent | 34b181465b17c6460e055f89d9ad1b47d4517a1b (diff) |
Update upstream source from tag 'upstream/1.15'
Update to upstream version '1.15'
with Debian dir 3b217fcd63314f946cb36492e0b85e7328ada240
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | doc/background.html | 50 | ||||
-rw-r--r-- | doc/changes.html | 147 | ||||
-rw-r--r-- | doc/download.html | 75 | ||||
-rw-r--r-- | doc/example_plugins.html | 51 | ||||
-rw-r--r-- | doc/index.html | 49 | ||||
-rw-r--r-- | doc/installation.html | 72 | ||||
-rw-r--r-- | doc/license.html | 47 | ||||
-rw-r--r-- | doc/overview.html | 49 | ||||
-rw-r--r-- | doc/shared_plugins.html | 47 | ||||
-rw-r--r-- | doc/unique_ids.html | 53 | ||||
-rw-r--r-- | src/Makefile (renamed from src/makefile) | 49 | ||||
-rw-r--r-- | src/gcc_exports.map | 7 | ||||
-rw-r--r-- | src/load.c | 61 | ||||
-rw-r--r-- | src/plugins/amp.c | 26 | ||||
-rw-r--r-- | src/plugins/delay.c | 24 | ||||
-rw-r--r-- | src/plugins/filter.c | 30 | ||||
-rw-r--r-- | src/plugins/noise.c | 26 | ||||
-rw-r--r-- | src/plugins/sine.cpp | 52 | ||||
-rw-r--r-- | src/search.c | 8 | ||||
-rw-r--r-- | src/utils.h | 33 |
21 files changed, 755 insertions, 202 deletions
diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b408e6c..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.pc diff --git a/doc/background.html b/doc/background.html index ba9af8d..5f923d4 100644 --- a/doc/background.html +++ b/doc/background.html @@ -1,8 +1,20 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Background</H1> <P>The Linux Audio Developer's Simple Plugin API (LADSPA) originates -in frustration on the part of <A -HREF="mailto:richard@muse.demon.co.uk">Richard Furse</A> with the lack +in frustration on the part of Richard Furse with the lack of consensus on a standard audio plugin API for Linux. The API is intended to describe a very light-weight plugin form that can be handled by many types of host. To achieve this simplicity various @@ -20,3 +32,37 @@ additional contributions have been made by the members of the Linux Audio Developer's mailing list after whom the plugin is named. Thanks in particular to Alexander Konig.</P> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/changes.html b/doc/changes.html index ecf0a85..b6d8e89 100644 --- a/doc/changes.html +++ b/doc/changes.html @@ -1,120 +1,205 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Changes</H1> <P>[Version numbers relate to the SDK, not the <CODE>ladspa.h</CODE> -header file itself.]</P> + header file itself.]</P> <H2>Version 1.01 - 2 Apr 2000</H2> <UL> -<LI>Initial Release with header file, limited documentation, three -plugins and two hosts.</LI> + <LI>Initial Release with header file, limited documentation, three + plugins and two hosts.</LI> </UL> <H2>Version 1.02 - 4 May 2000</H2> <UL> -<LI>Introduction of version numbering for SDK.</LI> + <LI>Introduction of version numbering for SDK.</LI> -<LI>Plugins added, bringing basic example set to ten. Further -development of basic plugins for serious use shifted away to the CMT -project.</LI> + <LI>Plugins added, bringing basic example set to ten. Further + development of basic plugins for serious use shifted away to the CMT + project.</LI> -<LI>Bug fix to applyplugin when handling channel count changes.</LI> + <LI>Bug fix to applyplugin when handling channel count changes.</LI> -<LI>Introduce support for the <CODE>LADSPA_PATH</CODE> environment -variable to both example hosts.</LI> + <LI>Introduce support for the <CODE>LADSPA_PATH</CODE> environment + variable to both example hosts.</LI> </UL> <H2>Version 1.03 - 4 May 2000</H2> <UL> -<LI>Documentation Converted to HTML.</LI> + <LI>Documentation Converted to HTML.</LI> </UL> <H2>Version 1.04 - 11 May 2000</H2> <UL> -<LI>Use <CODE>_init()</CODE> and <CODE>_fini()</CODE> in example -plugins.</LI> + <LI>Use <CODE>_init()</CODE> and <CODE>_fini()</CODE> in example + plugins.</LI> </UL> <H2>Version 1.05 - 14 May 2000</H2> <UL> -<LI>Updated to correspond to http://www.ladspa.org/.</LI> + <LI>Updated to correspond to http://www.ladspa.org/.</LI> </UL> <H2>Version 1.06 - 18 May 2000</H2> <UL> -<LI>Add listplugins program.</LI> + <LI>Add listplugins program.</LI> </UL> <H2>Version 1.07 - 24 Sep 2000</H2> <UL> -<LI>Discourage reliance on LD_LIBRARY_PATH by stopping analyseplugin -and applyplugin from searching it when looking for LADSPA -plugins.</LI> + <LI>Discourage reliance on LD_LIBRARY_PATH by stopping analyseplugin + and applyplugin from searching it when looking for LADSPA + plugins.</LI> </UL> <H2>Version 1.08 - 30 Sep 2000</H2> <UL> -<LI>Use constructor/destructor rather than _fini() and _init() in -C++. Use C++ for linkage.</LI> + <LI>Use constructor/destructor rather than _fini() and _init() in + C++. Use C++ for linkage.</LI> </UL> <H2>Version 1.09 - 4 Nov 2000</H2> <UL> -<LI>Add optional plugin label parameter to analyseplugin.</LI> + <LI>Add optional plugin label parameter to analyseplugin.</LI> </UL> <H2>Version 1.10 - 8 May 2001</H2> <UL> -<LI>Introduction of LGPL license.</LI> + <LI>Introduction of LGPL license.</LI> -<LI>Removal of superfluous semicolon on line 492 of header file.</LI> + <LI>Removal of superfluous semicolon on line 492 of header file.</LI> </UL> <H2>Version 1.11 - 21 Jul 2001</H2> <UL> -<LI>Remove memory leak in search code.</LI> + <LI>Remove memory leak in search code.</LI> </UL> <H2>Version 1.12 - 7 Aug 2002</H2> <UL> -<LI>Update for LADSPA v1.1 (default values and 1.0f=0dB).</LI> + <LI>Update for LADSPA v1.1 (default values and 1.0f=0dB).</LI> </UL> <H2>Version 1.13 - 6 Nov 2007</H2> <UL> -<LI>Fix compile error in sine.cpp (GCC4).</LI> + <LI>Fix compile error in sine.cpp (GCC4).</LI> + + <LI>Fix typo in text output by analyseplugin.</LI> + + <LI>Extra usage text in analyseplugin and applyplugin.</LI> + + <LI>Replace strdup() with localStrdup() in sine.cpp to avoid + malloc/new mismatch.</LI> + + <LI>Remove "local" part from install directories.</LI> + +</UL> + +<H2>Version 1.14 - 3 Jan 2019</H2> +<UL> + + <LI>Rename Makefile.</LI> + + <LI>Modernise C++ #include style.</LI> + + <LI>Make some globals static.</LI> + + <LI>Use mkdir -p rather than mkdirhier during build.</LI> + + <LI>Use GCC export map to ensure only the ladspa_descriptor() + exported.</LI> + + <LI>Put libraries at the end of link instructions.</LI> + + <LI>Package with version number in archive and directory names.</LI> + + <LI>Tweaks to documentation processing.</LI> + + <LI>Fix bug in LADSPA plugin search which did not handle shared + libraries that are not plugins correctly.</LI> + + <LI>Introduce a default LADSPA plugin search path.</LI> + +</UL> + +<H2>Version 1.15 - 6 Jan 2019</H2> +<UL> + + <LI>Perform macro string expansion in C code rather than in Makefile + for better portability.</LI> -<LI>Fix typo in text output by analyseplugin.</LI> + <LI>Modernise init()/fini() style in GNU C plugin builds (not C++), + tweak link line to correspond.</LI> + +</UL> -<LI>Extra usage text in analyseplugin and applyplugin.</LI> +<HR/> -<LI>Replace strdup() with localStrdup() in sine.cpp to avoid -malloc/new mismatch.</LI> +<H1>LADSPA SDK Index</H1> -<LI>Remove "local" part from install directories.</LI> +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> </UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/download.html b/doc/download.html index fdeb431..0824f39 100644 --- a/doc/download.html +++ b/doc/download.html @@ -1,20 +1,71 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Download</H1> <P>Please select the file you wish to download:</P> <TABLE BORDER=1> -<TR> -<TH>File</TH> -<TH>Description</TH> -</TR> + <TR> + <TH>File</TH> + <TH>Description</TH> + </TR> + + <TR> + <TD> + <A HREF="http://www.ladspa.org/download/ladspa_sdk_1.15.tgz"> + ladspa_sdk_1.15.tgz</A> + </TD> + <TD> + The LADSPA SDK, including the <CODE>ladspa.h</CODE> API header + file, ten example LADSPA plugins and three example programs + (applyplugin, analyseplugin and listplugins). + </TD> + </TR> + +</TABLE> -<TR> -<TD><A HREF="http://www.ladspa.org/download/ladspa_sdk.tgz"> -ladspa_sdk.tgz</A></TD> -<TD>The LADSPA SDK, including the <CODE>ladspa.h</CODE> API header -file, ten example LADSPA plugins and three example programs -(applyplugin, analyseplugin and listplugins).</TD> -</TR> +<HR/> -</TABLE> +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/example_plugins.html b/doc/example_plugins.html index a42250d..26fa549 100644 --- a/doc/example_plugins.html +++ b/doc/example_plugins.html @@ -1,3 +1,16 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Example Plugins</H1> <P>Ten example plugins are provided. These provide a rudimentary basis @@ -8,8 +21,8 @@ rather crude and failures during <CODE>malloc()</CODE> will produce unpleasant behaviour.</P> <P>Note that these plugins are examples. More polished versions of -them all are included within the <A -HREF="http://www.ladspa.org/cmt">CMT plugin +them all are included within +the <A HREF="http://www.ladspa.org/cmt/overview.html">CMT plugin set</A>.</P> <P>The following plugins are provided:</P> @@ -88,3 +101,37 @@ control.</TD> </TR> </TABLE> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/index.html b/doc/index.html index fb7f61b..7fb01f4 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,25 +1,44 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>LADSPA SDK Index</H1> <UL> -<LI><A HREF="overview.html">Overview</A></LI> -<LI><A HREF="background.html">Background</A></LI> -<LI><A HREF="download.html">Download</A></LI> -<LI><A HREF="installation.html">Installation</A></LI> -<LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> -<LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> -<LI><A HREF="license.html">License (LGPL) for This Release</A></LI> -<LI><A HREF="example_plugins.html">Example Plugins</A></LI> -<LI><A HREF="changes.html">Change History</A></LI> -<LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> </UL> <H2>Other Links</H2> <UL> -<LI>The <A HREF="http://www.ladspa.org/cmt">CMT LADSPA Plugin -Library</A></LI> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> </UL> -<P>The author <AUTHOR>Richard Furse</AUTHOR> can be emailed as -<A HREF="mailto:richard@muse.demon.co.uk">richard@muse.demon.co.uk</A>. -</P> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/installation.html b/doc/installation.html index 1b0b339..061eb80 100644 --- a/doc/installation.html +++ b/doc/installation.html @@ -1,19 +1,67 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Installation</H1> <P>This distribution includes both the ladspa.h API header file and a -number of hosts and example plugins. Go to the <CODE>src/</CODE> -directory and type <CODE>make</CODE> to build and test them.</P> + number of hosts and example plugins. Go to the <CODE>src/</CODE> + directory and type <CODE>make</CODE> to build and test them.</P> <P>The <A HREF="ladspa.h.txt"><CODE>ladspa.h</CODE> API header -file</A> is needed to build hosts and plugins. It may be useful to -install it in <CODE>/usr/local/include/</CODE> or -<CODE>/usr/include/</CODE>. The programs generated in the -<CODE>bin/</CODE> directory may be moved to -<CODE>/usr/local/bin/</CODE> or <CODE>/usr/bin/</CODE> and the plugins -generated in the <CODE>plugins/</CODE> directory may be moved to -<CODE>/usr/local/lib/ladspa/</CODE> or -<CODE>/usr/lib/ladspa/</CODE>.</P> + file</A> is needed to build hosts and plugins. It may be useful to + install it in <CODE>/usr/local/include/</CODE> or + <CODE>/usr/include/</CODE>. The programs generated in the + <CODE>bin/</CODE> directory may be moved to + <CODE>/usr/local/bin/</CODE> or <CODE>/usr/bin/</CODE> and the + plugins generated in the <CODE>plugins/</CODE> directory may be + moved to + <CODE>/usr/local/lib/ladspa/</CODE> or + <CODE>/usr/lib/ladspa/</CODE>.</P> <P>To perform automatic installation, log in as root and run -<CODE>make install</CODE>. This by default will install plugins, hosts -and the header file into the <CODE>/usr/local/</CODE> tree.</P> + <CODE>make install</CODE>. This by default will install plugins, + hosts and the header file into the <CODE>/usr/</CODE> tree.</P> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/license.html b/doc/license.html index 3e740ff..019a343 100644 --- a/doc/license.html +++ b/doc/license.html @@ -1,3 +1,16 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>LADSPA and LADSPA SDK License</H1> <P>The LADSPA Software Development Kit and the LADSPA plugin API @@ -11,3 +24,37 @@ applications can use it without having to use a derived LGPL library that LGPL is already free enough for this, but we aren't sure. Does anyone want to pay for a lawyer? In the meantime, please mail me if this is an issue for you.</P> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/overview.html b/doc/overview.html index e19e21f..ef79ecd 100644 --- a/doc/overview.html +++ b/doc/overview.html @@ -1,4 +1,17 @@ -<H1>LADSPA SDK v1.13 Overview</H1> +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + +<H1>LADSPA SDK v1.15 Overview</H1> <P>There is a large number of synthesis packages in use or development on the Linux platform at this time. The Linux Audio Developer's Simple @@ -32,3 +45,37 @@ further development.</LI> as the basis for further development.</LI> </UL> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/shared_plugins.html b/doc/shared_plugins.html index 721c6a2..f94b21c 100644 --- a/doc/shared_plugins.html +++ b/doc/shared_plugins.html @@ -1,3 +1,16 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Shared Plugins</H1> <P>Plugins may be used by a range of different hosts. However, the @@ -20,3 +33,37 @@ LADSPA_PATH=$LADSPA_PATH:/home/<user>/.ladspa:/usr/local/lib/ladspa:/usr/l <P>To list the plugins that can be found on your <CODE>LADSPA_PATH</CODE>, run the <CODE>listplugins</CODE> program.</P> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/doc/unique_ids.html b/doc/unique_ids.html index c923867..3a32ff0 100644 --- a/doc/unique_ids.html +++ b/doc/unique_ids.html @@ -1,9 +1,22 @@ +<HTML> + <HEAD> + <TITLE>LADSPA SDK Documentation</TITLE> + <META NAME="DESCRIPTION" + CONTENT="LADSPA SDK Documentation"> + </HEAD> + <BODY BGCOLOR=#FFFFFF> + <CENTER><IMG BORDER=0 SRC="/images/top.jpg"></CENTER> + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/ladspa.jpg"></CENTER> + <H1>Unique IDs</H1> <P>Plugin types are identified by unique IDs. At the time of writing -plugin writers may request these from <A -HREF="mailto:ladspa@muse.demon.co.uk">ladspa@muse.demon.co.uk.</A> -This may change, in which case <A HREF="http://www.ladspa.org"> +plugin writers may request these +from <A HREF="mailto:ids@ladspa.org">ids@ladspa.org</A>. This may +change, in which case <A HREF="http://www.ladspa.org"> http://www.ladspa.org</A> is likely to provide information on new sources.</P> @@ -15,3 +28,37 @@ ID 0 will never be allocated.</P> event that this range needs to be extended it will be, possibly with the addition of a second dimension (e.g. developer ID). In the meantime hosts may assume that IDs will not exceed 0x00FFFFFF.</P> + +<HR/> + +<H1>LADSPA SDK Index</H1> + +<UL> + <LI><A HREF="overview.html">Overview</A></LI> + <LI><A HREF="background.html">Background</A></LI> + <LI><A HREF="download.html">Download</A></LI> + <LI><A HREF="installation.html">Installation</A></LI> + <LI><A HREF="shared_plugins.html">How to Share Plugins between Hosts</A></LI> + <LI><A HREF="ladspa.h.txt">LADSPA API Header File</A></LI> + <LI><A HREF="license.html">License (LGPL) for This Release</A></LI> + <LI><A HREF="example_plugins.html">Example Plugins</A></LI> + <LI><A HREF="changes.html">Change History</A></LI> + <LI><A HREF="unique_ids.html">Unique Plugin IDs</A></LI> +</UL> + +<H2>Other Links</H2> + +<UL> + <LI> + The <A HREF="http://www.ladspa.org/cmt/overview.html">CMT LADSPA + Plugin Library</A> + </LI> +</UL> + + + <HR/> + + <CENTER><IMG BORDER=0 SRC="/images/base.jpg"></CENTER> + + </BODY> +</HTML> diff --git a/src/makefile b/src/Makefile index 886237f..c339524 100644 --- a/src/makefile +++ b/src/Makefile @@ -15,7 +15,9 @@ INSTALL_BINARY_DIR = /usr/bin/ INCLUDES = -I. LIBRARIES = -ldl -lm -CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC +CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC \ + -DDEFAULT_LADSPA_PATH=$(INSTALL_PLUGINS_DIR) +BINFLAGS = -fPIE -pie CXXFLAGS = $(CFLAGS) PLUGINS = ../plugins/amp.so \ ../plugins/delay.so \ @@ -33,13 +35,27 @@ CPP = c++ # RULES TO BUILD PLUGINS FROM C OR C++ CODE # -../plugins/%.so: plugins/%.c ladspa.h +../plugins/%.so: plugins/%.c ladspa.h gcc_exports.map $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c - $(LD) -o ../plugins/$*.so plugins/$*.o -shared - -../plugins/%.so: plugins/%.cpp ladspa.h + $(CC) -o ../plugins/$*.so \ + plugins/$*.o \ + -shared \ + $(CFLAGS) \ + -fvisibility=hidden \ + -fvisibility-inlines-hidden \ + -s \ + -Wl,--version-script=gcc_exports.map + +../plugins/%.so: plugins/%.cpp ladspa.h gcc_exports.map $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp - $(CPP) -o ../plugins/$*.so plugins/$*.o -shared + $(CPP) -o ../plugins/$*.so \ + plugins/$*.o \ + -shared \ + $(CXXFLAGS) \ + -fvisibility=hidden \ + -fvisibility-inlines-hidden \ + -s \ + -Wl,--version-script=gcc_exports.map ############################################################################### # @@ -59,9 +75,9 @@ test: /tmp/test.wav ../snd/noise.wav always @echo Test complete. install: targets - -mkdirhier $(INSTALL_PLUGINS_DIR) - -mkdirhier $(INSTALL_INCLUDE_DIR) - -mkdirhier $(INSTALL_BINARY_DIR) + -mkdir -p $(INSTALL_PLUGINS_DIR) + -mkdir -p $(INSTALL_INCLUDE_DIR) + -mkdir -p $(INSTALL_BINARY_DIR) cp ../plugins/* $(INSTALL_PLUGINS_DIR) cp ladspa.h $(INSTALL_INCLUDE_DIR) cp ../bin/* $(INSTALL_BINARY_DIR) @@ -90,19 +106,22 @@ targets: $(PLUGINS) $(PROGRAMS) # ../bin/applyplugin: applyplugin.o load.o default.o - $(CC) $(CFLAGS) $(LIBRARIES) \ + $(CC) $(CFLAGS) $(BINFLAGS) \ -o ../bin/applyplugin \ - applyplugin.o load.o default.o + applyplugin.o load.o default.o \ + $(LIBRARIES) ../bin/analyseplugin: analyseplugin.o load.o default.o - $(CC) $(CFLAGS) $(LIBRARIES) \ + $(CC) $(CFLAGS) $(BINFLAGS) \ -o ../bin/analyseplugin \ - analyseplugin.o load.o default.o + analyseplugin.o load.o default.o \ + $(LIBRARIES) ../bin/listplugins: listplugins.o search.o - $(CC) $(CFLAGS) $(LIBRARIES) \ + $(CC) $(CFLAGS) $(BINFLAGS) \ -o ../bin/listplugins \ - listplugins.o search.o + listplugins.o search.o \ + $(LIBRARIES) ############################################################################### # diff --git a/src/gcc_exports.map b/src/gcc_exports.map new file mode 100644 index 0000000..7333e5a --- /dev/null +++ b/src/gcc_exports.map @@ -0,0 +1,7 @@ +LADSPA_SDK +{ + global: + ladspa_descriptor; + local: + *; +}; @@ -53,37 +53,36 @@ dlopenLADSPA(const char * pcFilename, int iFlag) { LD_LIBRARY_PATH, whereas the LADSPA_PATH is the correct place to search. */ - pcLADSPAPath = getenv("LADSPA_PATH"); - - if (pcLADSPAPath) { - - pcStart = pcLADSPAPath; - while (*pcStart != '\0') { - pcEnd = pcStart; - while (*pcEnd != ':' && *pcEnd != '\0') - pcEnd++; - - pcBuffer = malloc(iFilenameLength + 2 + (pcEnd - pcStart)); - if (pcEnd > pcStart) - strncpy(pcBuffer, pcStart, pcEnd - pcStart); - iNeedSlash = 0; - if (pcEnd > pcStart) - if (*(pcEnd - 1) != '/') { - iNeedSlash = 1; - pcBuffer[pcEnd - pcStart] = '/'; - } - strcpy(pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename); - - pvResult = dlopen(pcBuffer, iFlag); - - free(pcBuffer); - if (pvResult != NULL) - return pvResult; - - pcStart = pcEnd; - if (*pcStart == ':') - pcStart++; - } + pcLADSPAPath = getenv("LADSPA_PATH"); + if (pcLADSPAPath == NULL) + pcLADSPAPath = EXPAND_AND_STRINGIFY(DEFAULT_LADSPA_PATH); + + pcStart = pcLADSPAPath; + while (*pcStart != '\0') { + pcEnd = pcStart; + while (*pcEnd != ':' && *pcEnd != '\0') + pcEnd++; + + pcBuffer = malloc(iFilenameLength + 2 + (pcEnd - pcStart)); + if (pcEnd > pcStart) + strncpy(pcBuffer, pcStart, pcEnd - pcStart); + iNeedSlash = 0; + if (pcEnd > pcStart) + if (*(pcEnd - 1) != '/') { + iNeedSlash = 1; + pcBuffer[pcEnd - pcStart] = '/'; + } + strcpy(pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename); + + pvResult = dlopen(pcBuffer, iFlag); + + free(pcBuffer); + if (pvResult != NULL) + return pvResult; + + pcStart = pcEnd; + if (*pcStart == ':') + pcStart++; } } diff --git a/src/plugins/amp.c b/src/plugins/amp.c index b6d2345..9028b5d 100644 --- a/src/plugins/amp.c +++ b/src/plugins/amp.c @@ -16,6 +16,7 @@ /*****************************************************************************/ #include "ladspa.h" +#include "utils.h" /*****************************************************************************/ @@ -48,7 +49,7 @@ typedef struct { /*****************************************************************************/ /* Construct a new plugin instance. */ -LADSPA_Handle +static LADSPA_Handle instantiateAmplifier(const LADSPA_Descriptor * Descriptor, unsigned long SampleRate) { return malloc(sizeof(Amplifier)); @@ -57,7 +58,7 @@ instantiateAmplifier(const LADSPA_Descriptor * Descriptor, /*****************************************************************************/ /* Connect a port to a data location. */ -void +static void connectPortToAmplifier(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation) { @@ -88,7 +89,7 @@ connectPortToAmplifier(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runMonoAmplifier(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -110,7 +111,7 @@ runMonoAmplifier(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runStereoAmplifier(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -137,8 +138,8 @@ runStereoAmplifier(LADSPA_Handle Instance, /*****************************************************************************/ -/* Throw away a simple delay line. */ -void +/* Throw away an amplifier. */ +static void cleanupAmplifier(LADSPA_Handle Instance) { free(Instance); } @@ -150,10 +151,8 @@ LADSPA_Descriptor * g_psStereoDescriptor = 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; @@ -315,7 +314,7 @@ _init() { /*****************************************************************************/ -void +static void deleteDescriptor(LADSPA_Descriptor * psDescriptor) { unsigned long lIndex; if (psDescriptor) { @@ -334,9 +333,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_psMonoDescriptor); deleteDescriptor(g_psStereoDescriptor); } diff --git a/src/plugins/delay.c b/src/plugins/delay.c index 8b03979..5b473da 100644 --- a/src/plugins/delay.c +++ b/src/plugins/delay.c @@ -18,6 +18,7 @@ /*****************************************************************************/ #include "ladspa.h" +#include "utils.h" /*****************************************************************************/ @@ -77,7 +78,7 @@ typedef struct { /*****************************************************************************/ /* Construct a new plugin instance. */ -LADSPA_Handle +static LADSPA_Handle instantiateSimpleDelayLine(const LADSPA_Descriptor * Descriptor, unsigned long SampleRate) { @@ -113,7 +114,7 @@ instantiateSimpleDelayLine(const LADSPA_Descriptor * Descriptor, /*****************************************************************************/ /* Initialise and activate a plugin instance. */ -void +static void activateSimpleDelayLine(LADSPA_Handle Instance) { SimpleDelayLine * psSimpleDelayLine; @@ -130,7 +131,7 @@ activateSimpleDelayLine(LADSPA_Handle Instance) { /*****************************************************************************/ /* Connect a port to a data location. */ -void +static void connectPortToSimpleDelayLine(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation) { @@ -157,7 +158,7 @@ connectPortToSimpleDelayLine(LADSPA_Handle Instance, /*****************************************************************************/ /* Run a delay line instance for a block of SampleCount samples. */ -void +static void runSimpleDelayLine(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -209,7 +210,7 @@ runSimpleDelayLine(LADSPA_Handle Instance, /*****************************************************************************/ /* Throw away a simple delay line. */ -void +static void cleanupSimpleDelayLine(LADSPA_Handle Instance) { SimpleDelayLine * psSimpleDelayLine; @@ -222,14 +223,12 @@ cleanupSimpleDelayLine(LADSPA_Handle Instance) { /*****************************************************************************/ -LADSPA_Descriptor * g_psDescriptor = NULL; +static LADSPA_Descriptor * g_psDescriptor = 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; @@ -321,9 +320,8 @@ _init() { /*****************************************************************************/ -/* _fini() is called automatically when the library is unloaded. */ -void -_fini() { +/* Called automatically when the library is unloaded. */ +ON_UNLOAD_ROUTINE { long lIndex; if (g_psDescriptor) { free((char *)g_psDescriptor->Label); 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); } diff --git a/src/plugins/noise.c b/src/plugins/noise.c index 0fdd938..4068b5c 100644 --- a/src/plugins/noise.c +++ b/src/plugins/noise.c @@ -16,6 +16,7 @@ /*****************************************************************************/ #include "ladspa.h" +#include "utils.h" /*****************************************************************************/ @@ -48,7 +49,7 @@ typedef struct { /*****************************************************************************/ /* Construct a new plugin instance. */ -LADSPA_Handle +static LADSPA_Handle instantiateNoiseSource(const LADSPA_Descriptor * Descriptor, unsigned long SampleRate) { return malloc(sizeof(NoiseSource)); @@ -57,7 +58,7 @@ instantiateNoiseSource(const LADSPA_Descriptor * Descriptor, /*****************************************************************************/ /* Connect a port to a data location. */ -void +static void connectPortToNoiseSource(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation) { @@ -74,7 +75,7 @@ connectPortToNoiseSource(LADSPA_Handle Instance, /*****************************************************************************/ /* Run a delay line instance for a block of SampleCount samples. */ -void +static void runNoiseSource(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -97,7 +98,7 @@ runNoiseSource(LADSPA_Handle Instance, /* Run a delay line instance for a block of SampleCount samples. *ADD* the output to the output buffer. */ -void +static void runAddingNoiseSource(LADSPA_Handle Instance, unsigned long SampleCount) { @@ -120,7 +121,7 @@ runAddingNoiseSource(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void setNoiseSourceRunAddingGain(LADSPA_Handle Instance, LADSPA_Data Gain) { ((NoiseSource *)Instance)->m_fRunAddingGain = Gain; @@ -129,21 +130,19 @@ setNoiseSourceRunAddingGain(LADSPA_Handle Instance, /*****************************************************************************/ /* Throw away a simple delay line. */ -void +static void cleanupNoiseSource(LADSPA_Handle Instance) { free(Instance); } /*****************************************************************************/ -LADSPA_Descriptor * g_psDescriptor; +static LADSPA_Descriptor * g_psDescriptor; /*****************************************************************************/ -/* _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; @@ -218,9 +217,8 @@ _init() { /*****************************************************************************/ -/* _fini() is called automatically when the library is unloaded. */ -void -_fini() { +/* Called automatically when the library is unloaded. */ +ON_UNLOAD_ROUTINE { long lIndex; if (g_psDescriptor) { free((char *)g_psDescriptor->Label); diff --git a/src/plugins/sine.cpp b/src/plugins/sine.cpp index c3d1a6e..012ad8e 100644 --- a/src/plugins/sine.cpp +++ b/src/plugins/sine.cpp @@ -15,9 +15,9 @@ /*****************************************************************************/ -#include <math.h> -#include <stdlib.h> -#include <string.h> +#include <cmath> +#include <cstdlib> +#include <cstring> /*****************************************************************************/ @@ -37,12 +37,12 @@ #define SINE_TABLE_BITS 14 #define SINE_TABLE_SHIFT (8 * sizeof(unsigned long) - SINE_TABLE_BITS) -LADSPA_Data * g_pfSineTable = NULL; -LADSPA_Data g_fPhaseStepBase = 0; +static LADSPA_Data * g_pfSineTable = NULL; +static LADSPA_Data g_fPhaseStepBase = 0; /*****************************************************************************/ -inline char * +static inline char * localStrdup(const char * input) { char * output = new char[strlen(input) + 1]; strcpy(output, input); @@ -51,7 +51,7 @@ localStrdup(const char * input) { /*****************************************************************************/ -void +static void initialise_sine_table() { if (g_pfSineTable == NULL) { long lTableSize = (1 << SINE_TABLE_BITS); @@ -68,6 +68,22 @@ initialise_sine_table() { /*****************************************************************************/ +static LADSPA_Handle instantiateSineOscillator(const LADSPA_Descriptor *, + unsigned long SampleRate); +static void connectPortToSineOscillator(LADSPA_Handle Instance, + unsigned long Port, + LADSPA_Data * DataLocation); +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); +static void cleanupSineOscillator(void *pvHandle); + class SineOscillator { private: @@ -120,7 +136,7 @@ private: /*****************************************************************************/ -LADSPA_Handle +static LADSPA_Handle instantiateSineOscillator(const LADSPA_Descriptor *, unsigned long SampleRate) { return new SineOscillator(SampleRate); @@ -128,7 +144,7 @@ instantiateSineOscillator(const LADSPA_Descriptor *, /*****************************************************************************/ -void +static void connectPortToSineOscillator(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation) { @@ -147,14 +163,14 @@ connectPortToSineOscillator(LADSPA_Handle Instance, /*****************************************************************************/ -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; @@ -174,7 +190,7 @@ runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; @@ -195,7 +211,7 @@ runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; @@ -212,7 +228,7 @@ runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance, unsigned long SampleCount) { SineOscillator * poSineOscillator = (SineOscillator *)Instance; @@ -230,7 +246,7 @@ runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance, /*****************************************************************************/ -void +static void cleanupSineOscillator(void *pvHandle) { delete (SineOscillator *)pvHandle; } @@ -239,7 +255,7 @@ cleanupSineOscillator(void *pvHandle) { typedef char * char_ptr; -LADSPA_Descriptor * g_psDescriptors[4] = { NULL, NULL, NULL, NULL }; +static LADSPA_Descriptor * g_psDescriptors[4] = { NULL, NULL, NULL, NULL }; /*****************************************************************************/ @@ -403,7 +419,9 @@ public: delete [] g_pfSineTable; } -} g_oShutdownStartupHandler; +}; + +static StartupShutdownHandler g_oShutdownStartupHandler; /*****************************************************************************/ diff --git a/src/search.c b/src/search.c index 0006712..7b2eb05 100644 --- a/src/search.c +++ b/src/search.c @@ -80,7 +80,7 @@ LADSPADirectoryPluginSearch } else { /* It was a library, but not a LADSPA one. Unload it. */ - dlclose(pcFilename); + dlclose(pvPluginHandle); free(pcFilename); } } @@ -101,8 +101,10 @@ LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction) { if (!pcLADSPAPath) { fprintf(stderr, "Warning: You do not have a LADSPA_PATH " - "environment variable set.\n"); - return; + "environment variable set. Defaulting to " + EXPAND_AND_STRINGIFY(DEFAULT_LADSPA_PATH) + ".\n"); + pcLADSPAPath = EXPAND_AND_STRINGIFY(DEFAULT_LADSPA_PATH); } pcStart = pcLADSPAPath; diff --git a/src/utils.h b/src/utils.h index d94c420..050db6c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -65,6 +65,39 @@ int getLADSPADefault(const LADSPA_PortRangeHint * psPortRangeHint, const unsigned long lSampleRate, LADSPA_Data * pfResult); + +/*****************************************************************************/ + +/* During C pre-processing, take a string (passed in from the + Makefile) and put quote marks around it. */ +#define RAW_STRINGIFY(x) #x +#define EXPAND_AND_STRINGIFY(x) RAW_STRINGIFY(x) + +/*****************************************************************************/ + +#ifndef __cplusplus +/* In C, special incantations are needed to trigger initialisation and + cleanup routines when a dynamic plugin library is loaded or + unloaded (e.g. with dlopen() or dlclose()). _init() and _fini() are + classic exported symbols to achieve this, but these days GNU C + likes to do things a different way. Ideally we would check the GNU + version as older ones will probably expect the classic behaviour, + but for now... */ +# if __GNUC__ +/* Modern GNU C incantations: */ +# define ON_LOAD_ROUTINE static void __attribute__ ((constructor)) init() +# define ON_UNLOAD_ROUTINE static void __attribute__ ((destructor)) fini() +# else +/* Classic incantations: */ +# define ON_LOAD_ROUTINE void _init() +# define ON_UNLOAD_ROUTINE void _fini() +# endif +#else +/* In C++, we use the constructor/destructor of a static object to + manage initialisation and cleanup, so we don't need these + routines. */ +#endif + /*****************************************************************************/ #endif |