diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/Makefile.am | 3 | ||||
-rw-r--r-- | src/plugins/Makefile.in | 562 | ||||
-rw-r--r-- | src/plugins/ladspa/Makefile.am | 18 | ||||
-rw-r--r-- | src/plugins/ladspa/Makefile.in | 535 | ||||
-rw-r--r-- | src/plugins/ladspa/ladspa.h | 497 | ||||
-rw-r--r-- | src/plugins/ladspa/remix_ladspa.c | 1045 | ||||
-rw-r--r-- | src/plugins/noise/Makefile.am | 17 | ||||
-rw-r--r-- | src/plugins/noise/Makefile.in | 533 | ||||
-rw-r--r-- | src/plugins/noise/remix_noise.c | 142 |
9 files changed, 3352 insertions, 0 deletions
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am new file mode 100644 index 0000000..56e8c00 --- /dev/null +++ b/src/plugins/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = ladspa noise diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in new file mode 100644 index 0000000..2ab90e3 --- /dev/null +++ b/src/plugins/Makefile.in @@ -0,0 +1,562 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/plugins +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_MONITOR = @BUILD_MONITOR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_DOXYGEN = @HAVE_DOXYGEN@ +HAVE_VALGRIND = @HAVE_VALGRIND@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_PLUGIN_DIR = @PACKAGE_PLUGIN_DIR@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHARED_VERSION_INFO = @SHARED_VERSION_INFO@ +SHELL = @SHELL@ +SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +VALGRIND_ENVIRONMENT = @VALGRIND_ENVIRONMENT@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = ladspa noise +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/plugins/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/plugins/ladspa/Makefile.am b/src/plugins/ladspa/Makefile.am new file mode 100644 index 0000000..9e79121 --- /dev/null +++ b/src/plugins/ladspa/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = -I$(top_srcdir)/include -I$(CTXDATADIR) + +libdir = $(PACKAGE_PLUGIN_DIR) + +CTXDATADIR = $(top_srcdir)/src/ctxdata +CTXDATA_LIBS = $(top_builddir)/src/ctxdata/libctxdata.la + +REMIXDIR = ../../libremix +REMIX_LIBS = $(REMIXDIR)/libremix.la + +lib_LTLIBRARIES = \ + libremix_ladspa.la + +libremix_ladspa_la_SOURCES = remix_ladspa.c ladspa.h +libremix_ladspa_la_LDFLAGS = -module -version-info 1:0:0 +libremix_ladspa_la_LIBADD = $(REMIX_LIBS) $(CTXDATA_LIBS) diff --git a/src/plugins/ladspa/Makefile.in b/src/plugins/ladspa/Makefile.in new file mode 100644 index 0000000..1b17e88 --- /dev/null +++ b/src/plugins/ladspa/Makefile.in @@ -0,0 +1,535 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/plugins/ladspa +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libremix_ladspa_la_DEPENDENCIES = $(REMIX_LIBS) $(CTXDATA_LIBS) +am_libremix_ladspa_la_OBJECTS = remix_ladspa.lo +libremix_ladspa_la_OBJECTS = $(am_libremix_ladspa_la_OBJECTS) +libremix_ladspa_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libremix_ladspa_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libremix_ladspa_la_SOURCES) +DIST_SOURCES = $(libremix_ladspa_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_MONITOR = @BUILD_MONITOR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_DOXYGEN = @HAVE_DOXYGEN@ +HAVE_VALGRIND = @HAVE_VALGRIND@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_PLUGIN_DIR = @PACKAGE_PLUGIN_DIR@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHARED_VERSION_INFO = @SHARED_VERSION_INFO@ +SHELL = @SHELL@ +SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +VALGRIND_ENVIRONMENT = @VALGRIND_ENVIRONMENT@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(PACKAGE_PLUGIN_DIR) +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir)/include -I$(CTXDATADIR) +CTXDATADIR = $(top_srcdir)/src/ctxdata +CTXDATA_LIBS = $(top_builddir)/src/ctxdata/libctxdata.la +REMIXDIR = ../../libremix +REMIX_LIBS = $(REMIXDIR)/libremix.la +lib_LTLIBRARIES = \ + libremix_ladspa.la + +libremix_ladspa_la_SOURCES = remix_ladspa.c ladspa.h +libremix_ladspa_la_LDFLAGS = -module -version-info 1:0:0 +libremix_ladspa_la_LIBADD = $(REMIX_LIBS) $(CTXDATA_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/ladspa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/plugins/ladspa/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libremix_ladspa.la: $(libremix_ladspa_la_OBJECTS) $(libremix_ladspa_la_DEPENDENCIES) + $(libremix_ladspa_la_LINK) -rpath $(libdir) $(libremix_ladspa_la_OBJECTS) $(libremix_ladspa_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remix_ladspa.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/plugins/ladspa/ladspa.h b/src/plugins/ladspa/ladspa.h new file mode 100644 index 0000000..5ed8d08 --- /dev/null +++ b/src/plugins/ladspa/ladspa.h @@ -0,0 +1,497 @@ +/* ladspa.h + + Version 1. Copyright 2000 Richard W.E. Furse, Paul Barton-Davis, + Stefan Westerfeld. */ + +#ifndef LADSPA_INCLUDED +#define LADSPA_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/*****************************************************************************/ + +/* Overview: + + There is a large number of synthesis packages in use or development + on the Linux platform at this time. This API (`The Linux Audio + Developer's Simple Plugin API') attempts to give programmers the + ability to write simple `plugin' audio processors in C/C++ and link + them dynamically (`plug') into a range of these packages (`hosts'). + It should be possible for any host and any plugin to communicate + completely through this interface. The LADSPA plugin API is free to + use. + + This API is deliberately short and simple. To achieve compatibility + with a range of promising Linux sound synthesis packages it + attempts to find the `greatest common divisor' in their logical + behaviour. Having said this, certain limiting decisions are + implicit, notably the use of a fixed type (LADSPA_Data) for all + data transfer and absence of a parameterised `initialisation' + phase. See below for the LADSPA_Data typedef. + + Plugins are expected to distinguish between control and audio + data. Plugins have `ports' that are inputs or outputs for audio or + control data and each plugin is `run' for a `block' corresponding + to a short time interval measured in samples. Audio data is + communicated using arrays of LADSPA_Data, allowing a block of audio + to be processed by the plugin in a single pass. Control data is + communicated using single LADSPA_Data values. Control data has a + single value at the start of a call to the `run()' or `run_adding()' + function, and may be considered to remain this value for its + duration. The plugin may assume that all its input and output ports + have been connected to the relevant data location (see the + `connect_port()' function below) before it is asked to run. + + Plugins will reside in shared object files suitable for dynamic + linking by dlopen() and family. The file will provide a number of + `plugin types' that can be used to instantiate actual plugins + (sometimes known as `plugin instances') that can be connected + together to perform tasks. + + This API contains very limited error-handling. */ + +/*****************************************************************************/ + +/* Fundamental data type passed in and out of plugin. This data type + is used to communicate audio samples and control values. It is + assumed that the plugin will work sensibly given any numeric input + value although it may have a preferred range (see hints below). */ + +typedef float LADSPA_Data; + +/*****************************************************************************/ + +/* Special Plugin Properties: + + Optional features of the plugin type are encapsulated in the + LADSPA_Properties type. This is assembled by ORing individual + properties together. */ + +typedef int LADSPA_Properties; + +/* Property LADSPA_PROPERTY_REALTIME indicates that the plugin has a + real-time dependency (e.g. listens to a MIDI device) and so its + output must not be cached or subject to significant latency. */ +#define LADSPA_PROPERTY_REALTIME 0x1 + +/* Property LADSPA_PROPERTY_INPLACE_BROKEN indicates that the plugin + may cease to work correctly if the host elects to use the same data + location for both input and output (see connect_port()). This + should be avoided as enabling this flag makes it impossible for + hosts to use the plugin to process audio `in-place.' */ +#define LADSPA_PROPERTY_INPLACE_BROKEN 0x2 + +/* Property LADSPA_PROPERTY_HARD_RT_CAPABLE indicates that the plugin + is capable of running not only in a conventional host but also in a + `hard real-time' environment. To qualify for this the plugin must + satisfy all of the following: + + (1) The plugin must not use malloc(), free() or other heap memory + management within its run() or run_adding() functions. All new + memory used in run() must be managed via the stack. These + restrictions only apply to the run() function. + + (2) The plugin will not attempt to make use of any library + functions with the exceptions of functions in the ANSI standard C + and C maths libraries, which the host is expected to provide. + + (3) The plugin will not access files, devices, pipes, sockets, IPC + or any other mechanism that might result in process or thread + blocking. + + (4) The plugin will take an amount of time to execute a run() or + run_adding() call approximately of form (A+B*SampleCount) where A + and B depend on the machine and host in use. This amount of time + may not depend on input signals or plugin state. The host is left + the responsibility to perform timings to estimate upper bounds for + A and B. */ +#define LADSPA_PROPERTY_HARD_RT_CAPABLE 0x4 + +#define LADSPA_IS_REALTIME(x) ((x) & LADSPA_PROPERTY_REALTIME) +#define LADSPA_IS_INPLACE_BROKEN(x) ((x) & LADSPA_PROPERTY_INPLACE_BROKEN) +#define LADSPA_IS_HARD_RT_CAPABLE(x) ((x) & LADSPA_PROPERTY_HARD_RT_CAPABLE) + +/*****************************************************************************/ + +/* Plugin Ports: + + Plugins have `ports' that are inputs or outputs for audio or + data. Ports can communicate arrays of LADSPA_Data (for audio + inputs/outputs) or single LADSPA_Data values (for control + input/outputs). This information is encapsulated in the + LADSPA_PortDescriptor type which is assembled by ORing individual + properties together. + + Note that a port must be an input or an output port but not both + and that a port must be a control or audio port but not both. */ + +typedef int LADSPA_PortDescriptor; + +/* Property LADSPA_PORT_INPUT indicates that the port is an input. */ +#define LADSPA_PORT_INPUT 0x1 + +/* Property LADSPA_PORT_OUTPUT indicates that the port is an output. */ +#define LADSPA_PORT_OUTPUT 0x2 + +/* Property LADSPA_PORT_CONTROL indicates that the port is a control + port. */ +#define LADSPA_PORT_CONTROL 0x4 + +/* Property LADSPA_PORT_AUDIO indicates that the port is a audio + port. */ +#define LADSPA_PORT_AUDIO 0x8 + +#define LADSPA_IS_PORT_INPUT(x) ((x) & LADSPA_PORT_INPUT) +#define LADSPA_IS_PORT_OUTPUT(x) ((x) & LADSPA_PORT_OUTPUT) +#define LADSPA_IS_PORT_CONTROL(x) ((x) & LADSPA_PORT_CONTROL) +#define LADSPA_IS_PORT_AUDIO(x) ((x) & LADSPA_PORT_AUDIO) + +/*****************************************************************************/ + +/* Plugin Port Range Hints: + + The host may wish to provide a representation of data entering or + leaving a plugin (e.g. to generate a GUI automatically). To make + this more meaningful, the plugin should provide `hints' to the host + describing the usual values taken by the data. + + Note that these are only hints. The host may ignore them and the + plugin must not assume that data supplied to it is meaningful. If + the plugin receives invalid input data it is expected to continue + to run without failure and, where possible, produce a sensible + output (e.g. a high-pass filter given a negative cutoff frequency + might switch to an all-pass mode). + + Hints are meaningful for all input and output ports but hints for + input control ports are expected to be particularly useful. + + More hint information is encapsulated in the + LADSPA_PortRangeHintDescriptor type which is assembled by ORing + individual hint types together. Hints may require further + LowerBound and UpperBound information. + + All the hint information for a particular port is aggregated in the + LADSPA_PortRangeHint structure. */ + +typedef int LADSPA_PortRangeHintDescriptor; + +/* Hint LADSPA_HINT_BOUNDED_BELOW indicates that the LowerBound field + of the LADSPA_PortRangeHint should be considered meaningful. The + value in this field should be considered the (inclusive) lower + bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also + specified then the value of LowerBound should be multiplied by the + sample rate. */ +#define LADSPA_HINT_BOUNDED_BELOW 0x1 + +/* Hint LADSPA_HINT_BOUNDED_ABOVE indicates that the UpperBound field + of the LADSPA_PortRangeHint should be considered meaningful. The + value in this field should be considered the (inclusive) upper + bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also + specified then the value of UpperBound should be multiplied by the + sample rate. */ +#define LADSPA_HINT_BOUNDED_ABOVE 0x2 + +/* Hint LADSPA_HINT_TOGGLED indicates that the data item should be + considered a Boolean toggle. Data less than or equal to zero should + be considered `off' or `false,' and data above zero should be + considered `on' or `true.' LADSPA_HINT_TOGGLED may not be used in + conjunction with any other hint. */ +#define LADSPA_HINT_TOGGLED 0x4 + +/* Hint LADSPA_HINT_SAMPLE_RATE indicates that any bounds specified + should be interpreted as multiples of the sample rate. For + instance, a frequency range from 0Hz to the Nyquist frequency (half + the sample rate) could be requested by this hint in conjunction + with LowerBound = 0 and UpperBound = 0.5. Hosts that support bounds + at all must support this hint to retain meaning. */ +#define LADSPA_HINT_SAMPLE_RATE 0x8 + +/* Hint LADSPA_HINT_LOGARITHMIC indicates that it is likely that the + user will find it more intuitive to view values using a logarithmic + scale. This is particularly useful for frequencies and gains. */ +#define LADSPA_HINT_LOGARITHMIC 0x10 + +/* Hint LADSPA_HINT_INTEGER indicates that a user interface would + probably wish to provide a stepped control taking only integer + values. Any bounds set should be slightly wider than the actual + integer range required to avoid floating point rounding errors. For + instance, the integer set {0,1,2,3} might be described as [-0.1, + 3.1]. */ +#define LADSPA_HINT_INTEGER 0x20 + +#define LADSPA_IS_HINT_BOUNDED_BELOW(x) ((x) & LADSPA_HINT_BOUNDED_BELOW) +#define LADSPA_IS_HINT_BOUNDED_ABOVE(x) ((x) & LADSPA_HINT_BOUNDED_ABOVE) +#define LADSPA_IS_HINT_TOGGLED(x) ((x) & LADSPA_HINT_TOGGLED) +#define LADSPA_IS_HINT_SAMPLE_RATE(x) ((x) & LADSPA_HINT_SAMPLE_RATE) +#define LADSPA_IS_HINT_LOGARITHMIC(x) ((x) & LADSPA_HINT_LOGARITHMIC) +#define LADSPA_IS_HINT_INTEGER(x) ((x) & LADSPA_HINT_INTEGER) + +typedef struct _LADSPA_PortRangeHint { + + /* Hints about the port. */ + LADSPA_PortRangeHintDescriptor HintDescriptor; + + /* Meaningful when hint LADSPA_HINT_BOUNDED_BELOW is active. When + LADSPA_HINT_SAMPLE_RATE is also active then this value should be + multiplied by the relevant sample rate. */ + LADSPA_Data LowerBound; + + /* Meaningful when hint LADSPA_HINT_BOUNDED_ABOVE is active. When + LADSPA_HINT_SAMPLE_RATE is also active then this value should be + multiplied by the relevant sample rate. */ + LADSPA_Data UpperBound; + +} LADSPA_PortRangeHint; + +/*****************************************************************************/ + +/* Plugin Handles: + + This plugin handle indicates a particular instance of the plugin + concerned. It is valid to compare this to NULL (0 for C++) but + otherwise the host should not attempt to interpret it. The plugin + may use it to reference internal instance data. */ + +typedef void * LADSPA_Handle; + +/*****************************************************************************/ + +/* Descriptor for a Type of Plugin: + + This structure is used to describe a plugin type. It provides a + number of functions to examine the type, instantiate it, link it to + buffers and workspaces and to run it. */ + +typedef struct _LADSPA_Descriptor { + + /* This numeric identifier indicates the plugin type + uniquely. Plugin programmers may reserve ranges of IDs from a + central body to avoid clashes. Hosts may assume that IDs are + below 0x1000000. */ + unsigned long UniqueID; + + /* This identifier can be used as a unique, case-sensitive + identifier for the plugin type within the plugin file. Plugin + types should be identified by file and label rather than by index + or plugin name, which may be changed in new plugin + versions. Labels must not contain white-space characters. */ + const char * Label; + + /* This indicates a number of properties of the plugin. */ + LADSPA_Properties Properties; + + /* This member points to the null-terminated name of the plugin + (e.g. "Sine Oscillator"). */ + const char * Name; + + /* This member points to the null-terminated string indicating the + maker of the plugin. This can be an empty string but not NULL. */ + const char * Maker; + + /* This member points to the null-terminated string indicating any + copyright applying to the plugin. If no Copyright applies the + string "None" should be used. */ + const char * Copyright; + + /* This indicates the number of ports (input AND output) present on + the plugin. */ + unsigned long PortCount; + + /* This member indicates an array of port descriptors. Valid indices + vary from 0 to PortCount-1. */ + const LADSPA_PortDescriptor * PortDescriptors; + + /* This member indicates an array of null-terminated strings + describing ports (e.g. "Frequency (Hz)"). Valid indices vary from + 0 to PortCount-1. */ + const char * const * PortNames; + + /* This member indicates an array of range hints for each port (see + above). Valid indices vary from 0 to PortCount-1. */ + const LADSPA_PortRangeHint * PortRangeHints; + + /* This may be used by the plugin developer to pass any custom + implementation data into an instantiate call. It must not be used + or interpreted by the host. It is expected that most plugin + writers will not use this facility as LADSPA_Handle should be + used to hold instance data. */ + void * ImplementationData; + + /* This member is a function pointer that instantiates a plugin. A + handle is returned indicating the new plugin instance. The + instantiation function accepts a sample rate as a parameter. The + plugin descriptor from which this instantiate function was found + must also be passed. This function must return NULL if + instantiation fails. + + Note that instance initialisation should generally occur in + activate() rather than here. */ + LADSPA_Handle (*instantiate)(const struct _LADSPA_Descriptor * Descriptor, + unsigned long SampleRate); + + /* This member is a function pointer that connects a port on an + instantiated plugin to a memory location at which a block of data + for the port will be read/written. The data location is expected + to be an array of LADSPA_Data for audio ports or a single + LADSPA_Data value for control ports. Memory issues will be + managed by the host. The plugin must read/write the data at these + locations every time run() or run_adding() is called and the data + present at the time of this connection call should not be + considered meaningful. + + connect_port() may be called more than once for a plugin instance + to allow the host to change the buffers that the plugin is + reading or writing. These calls may be made before or after + activate() or deactivate() calls. + + connect_port() must be called at least once for each port before + run() or run_adding() is called. When working with blocks of + LADSPA_Data the plugin should pay careful attention to the block + size passed to the run function as the block allocated may only + just be large enough to contain the block of samples. + + Plugin writers should be aware that the host may elect to use the + same buffer for more than one port and even use the same buffer + for both input and output (see LADSPA_PROPERTY_INPLACE_BROKEN). + However, overlapped buffers or use of a single buffer for both + audio and control data may result in unexpected behaviour. */ + void (*connect_port)(LADSPA_Handle Instance, + unsigned long Port, + LADSPA_Data * DataLocation); + + /* This member is a function pointer that initialises a plugin + instance and activates it for use. This is separated from + instantiate() to aid real-time support and so that hosts can + reinitialise a plugin instance by calling deactivate() and then + activate(). In this case the plugin instance must reset all state + information dependent on the history of the plugin instance + except for any data locations provided by connect_port() and any + gain set by set_run_adding_gain(). If there is nothing for + activate() to do then the plugin writer may provide a NULL rather + than an empty function. + + When present, hosts must call this function once before run() (or + run_adding()) is called for the first time. This call should be + made as close to the run() call as possible and indicates to + real-time plugins that they are now live. Plugins should not rely + on a prompt call to run() after activate(). activate() may not be + called again unless deactivate() is called first. Note that + connect_port() may be called before or after a call to + activate(). */ + void (*activate)(LADSPA_Handle Instance); + + /* This method is a function pointer that runs an instance of a + plugin for a block. Two parameters are required: the first is a + handle to the particular instance to be run and the second + indicates the block size (in samples) for which the plugin + instance may run. + + Note that if an activate() function exists then it must be called + before run() or run_adding(). If deactivate() is called for a + plugin instance then the plugin instance may not be reused until + activate() has been called again. + + If the plugin has the property LADSPA_PROPERTY_HARD_RT_CAPABLE + then there are various things that the plugin should not do + within the run() or run_adding() functions (see above). */ + void (*run)(LADSPA_Handle Instance, + unsigned long SampleCount); + + /* This method is a function pointer that runs an instance of a + plugin for a block. This has identical behaviour to run() except + in the way data is output from the plugin. When run() is used, + values are written directly to the memory areas associated with + the output ports. However when run_adding() is called, values + must be added to the values already present in the memory + areas. Furthermore, output values written must be scaled by the + current gain set by set_run_adding_gain() (see below) before + addition. + + run_adding() is optional. When it is not provided by a plugin, + this function pointer must be set to NULL. When it is provided, + the function set_run_adding_gain() must be provided also. */ + void (*run_adding)(LADSPA_Handle Instance, + unsigned long SampleCount); + + /* This method is a function pointer that sets the output gain for + use when run_adding() is called (see above). If this function is + never called the gain is assumed to default to 1. Gain + information should be retained when activate() or deactivate() + are called. + + This function should be provided by the plugin if and only if the + run_adding() function is provided. When it is absent this + function pointer must be set to NULL. */ + void (*set_run_adding_gain)(LADSPA_Handle Instance, + LADSPA_Data Gain); + + /* This is the counterpart to activate() (see above). If there is + nothing for deactivate() to do then the plugin writer may provide + a NULL rather than an empty function. + + Hosts must deactivate all activated units after they have been + run() (or run_adding()) for the last time. This call should be + made as close to the last run() call as possible and indicates to + real-time plugins that they are no longer live. Plugins should + not rely on prompt deactivation. Note that connect_port() may be + called before or after a call to deactivate(). + + Deactivation is not similar to pausing as the plugin instance + will be reinitialised when activate() is called to reuse it. */ + void (*deactivate)(LADSPA_Handle Instance); + + /* Once an instance of a plugin has been finished with it can be + deleted using the following function. The instance handle passed + ceases to be valid after this call. + + If activate() was called for a plugin instance then a + corresponding call to deactivate() must be made before cleanup() + is called. */ + void (*cleanup)(LADSPA_Handle Instance); + +} LADSPA_Descriptor; + +/**********************************************************************/ + +/* Accessing a Plugin: */ + +/* The exact mechanism by which plugins are loaded is host-dependent, + however all most hosts will need to know is the name of shared + object file containing the plugin types. To allow multiple hosts to + share plugin types, hosts may wish to check for environment + variable LADSPA_PATH. If present, this should contain a + colon-separated path indicating directories that should be searched + (in order) when loading plugin types. + + A plugin programmer must include a function called + "ladspa_descriptor" with the following function prototype within + the shared object file. This function will have C-style linkage (if + you are using C++ this is taken care of by the `extern "C"' clause + at the top of the file). + + A host will find the plugin shared object file by one means or + another, find the ladspa_descriptor() function, call it, and + proceed from there. + + Plugin types are accessed by index (not ID) using values from 0 + upwards. Out of range indexes must result in this function + returning NULL, so the plugin count can be determined by checking + for the least index that results in NULL being returned. */ + +const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index); + +/* Datatype corresponding to the ladspa_descriptor() function. */ +typedef const LADSPA_Descriptor * +(*LADSPA_Descriptor_Function)(unsigned long Index); + +/**********************************************************************/ + +#ifdef __cplusplus +}; +#endif + +#endif /* LADSPA_INCLUDED */ + +/* EOF */ diff --git a/src/plugins/ladspa/remix_ladspa.c b/src/plugins/ladspa/remix_ladspa.c new file mode 100644 index 0000000..cdb6984 --- /dev/null +++ b/src/plugins/ladspa/remix_ladspa.c @@ -0,0 +1,1045 @@ +/* + * LADSPA wrapper plugin for libremix + * + * Copyright (C) 2000 Conrad Parker + * Copyright (C) 2001 Commonwealth Scientific and Industrial Research + * Organisation (CSIRO), Australia. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + * This file assumes that both LADSPA and libremix are built with + * an audio datatype of 'float'. + */ + +#include "config.h" + +#include <stdlib.h> +#include <stdio.h> +#include <sys/types.h> +#include <dirent.h> +#include <string.h> +#include <math.h> /* for ceil() */ + +#include <dlfcn.h> +#include <sys/stat.h> + +#define __REMIX_PLUGIN__ +#include <remix/remix.h> + +#include "ladspa.h" + +#define PATH_LEN 1024 + +/* Compile in support for inplace processing? */ +#define _PROCESS_INPLACE + +#ifdef _PROCESS_INPLACE +#define LADSPA_WRAPPER_IS_INPLACE_BROKEN(x) LADSPA_IS_INPLACE_BROKEN(x) +#else +#define LADSPA_WRAPPER_IS_INPLACE_BROKEN(x) (1L) +#endif + +#define LADSPA_IS_CONTROL_INPUT(x) (LADSPA_IS_PORT_INPUT(x) && LADSPA_IS_PORT_CONTROL(x)) +#define LADSPA_IS_AUDIO_INPUT(x) (LADSPA_IS_PORT_INPUT(x) && LADSPA_IS_PORT_AUDIO(x)) +#define LADSPA_IS_CONTROL_OUTPUT(x) (LADSPA_IS_PORT_OUTPUT(x) && LADSPA_IS_PORT_CONTROL(x)) +#define LADSPA_IS_AUDIO_OUTPUT(x) (LADSPA_IS_PORT_OUTPUT(x) && LADSPA_IS_PORT_AUDIO(x)) + +#define LADSPA_frames_to_bytes(f) (f * sizeof(LADSPA_Data)) + +static char * default_ladspa_path = "/usr/lib/ladspa:/usr/local/lib/ladspa:/opt/ladspa/lib"; + +#ifndef WIN32 +# define remix_stat_regular(mode) (S_ISREG((mode)) || S_ISLNK((mode))) +#else +# define remix_stat_regular(mode) ((mode) & S_IFREG) +#endif + +/* Dummy control output, used to connect all LADSPA control outputs to */ +static LADSPA_Data dummy_control_output; + +static CDList * modules_list = CD_EMPTY_LIST; +static int ladspa_wrapper_initialised = FALSE; + + +typedef struct _RemixLADSPA RemixLADSPA; + +struct _RemixLADSPA { + unsigned long samplerate; /* samplerate initialised at */ + LADSPA_Descriptor * d; + LADSPA_Handle * handle; + LADSPA_Data * control_inputs; +}; + +static RemixBase * remix_ladspa_optimise (RemixEnv * env, RemixBase * base); + +/* + * is_usable (d) + * + * Determine if a LADSPA_Descriptor * d is usable by this remix ladspa + * wrapper plugin. Currently this means that there is not more than 1 + * audio input or more than 1 audio output. + */ +static int +is_usable(const LADSPA_Descriptor * d) +{ + LADSPA_PortDescriptor pd; + int i; + int + nr_ai=0, /* audio inputs */ + nr_ao=0; /* audio outputs */ + + for (i=0; i < d->PortCount; i++) { + pd = d->PortDescriptors[i]; + if (LADSPA_IS_AUDIO_INPUT(pd)) + nr_ai++; + if (LADSPA_IS_AUDIO_OUTPUT(pd)) + nr_ao++; + } + + /* Sanity checks */ + if (! d->run) return FALSE; /* plugin does nothing! */ + if (! d->instantiate) return FALSE; /* plugin cannot be instantiated */ + if (! d->connect_port) return FALSE; /* plugin cannot be wired up */ + + if (nr_ao == 1 && nr_ai == 1) return TRUE; + if (nr_ao == 0 && nr_ai == 1) return TRUE; + if (nr_ao == 1 && nr_ai == 0) return TRUE; + + return FALSE; +} + +static RemixParameterType +convert_type (const LADSPA_PortRangeHintDescriptor prhd) +{ + if (LADSPA_IS_HINT_TOGGLED(prhd)) + return REMIX_TYPE_BOOL; + else if (LADSPA_IS_HINT_INTEGER(prhd)) + return REMIX_TYPE_INT; + else + return REMIX_TYPE_FLOAT; +} + +static RemixFlags +get_valid_mask (const LADSPA_PortRangeHintDescriptor prhd) +{ + RemixFlags ret = 0; + + if (LADSPA_IS_HINT_BOUNDED_BELOW(prhd)) + ret &= REMIX_RANGE_LOWER_BOUND_VALID; + if (LADSPA_IS_HINT_BOUNDED_ABOVE(prhd)) + ret &= REMIX_RANGE_UPPER_BOUND_VALID; + + return ret; +} + +static RemixParameterRange * +convert_constraint (const LADSPA_PortRangeHint * prh) +{ + RemixParameterRange * pr; + LADSPA_PortRangeHintDescriptor prhd = prh->HintDescriptor; + + if (LADSPA_IS_HINT_TOGGLED(prhd)) + return NULL; + + pr = malloc (sizeof (*pr)); + + pr->valid_mask = get_valid_mask (prhd); + + if (LADSPA_IS_HINT_INTEGER(prhd)) { + if (LADSPA_IS_HINT_BOUNDED_BELOW(prhd)) + pr->lower.s_int = (int)prh->LowerBound; + if (LADSPA_IS_HINT_BOUNDED_ABOVE(prhd)) + pr->upper.s_int = (int)prh->UpperBound; + } else { + if (LADSPA_IS_HINT_BOUNDED_BELOW(prhd)) + pr->lower.s_float = (float)prh->LowerBound; + if (LADSPA_IS_HINT_BOUNDED_ABOVE(prhd)) + pr->upper.s_float = (float)prh->UpperBound; + } + + return pr; +} + +static RemixBase * +remix_ladspa_replace_handle (RemixEnv * env, RemixBase * base) +{ + RemixPlugin * plugin = remix_base_get_plugin (env, base); + RemixLADSPA * al = (RemixLADSPA *) remix_base_get_instance_data (env, base); + LADSPA_Descriptor * d; + + if (al == NULL) { + remix_set_error (env, REMIX_ERROR_NOENTITY); + return RemixNone; + } + + if (al->d != NULL) + if (al->d->deactivate) al->d->deactivate (al->handle); + + al->samplerate = (unsigned long) remix_get_samplerate (env); + + al->d = d = (LADSPA_Descriptor *) plugin->plugin_data; + + if (d != NULL) { + al->handle = d->instantiate (d, al->samplerate); + if (d->activate) d->activate (al->handle); + } + + return base; +} + +static RemixBase * +remix_ladspa_init (RemixEnv * env, RemixBase * base, CDSet * parameters) +{ + RemixLADSPA * al = malloc (sizeof (*al)); + + remix_base_set_instance_data (env, base, al); + al->d = NULL; /* let this get set in replace_handle() */ + + remix_ladspa_replace_handle (env, base); + remix_ladspa_optimise (env, base); + return base; +} + +static RemixBase * +remix_ladspa_clone (RemixEnv * env, RemixBase * base) +{ + /* XXX: Most of this should really be handled in remix_base.c */ + RemixPlugin * plugin = remix_base_get_plugin (env, base); + RemixBase * new_base = remix_base_new (env); + remix_base_set_plugin (env, new_base, plugin); + remix_ladspa_init (env, new_base, CD_EMPTY_SET); + return new_base; +} + +static int +remix_ladspa_destroy (RemixEnv * env, RemixBase * base) +{ + RemixLADSPA * al = (RemixLADSPA *) remix_base_get_instance_data (env, base); + + if (al->d) { + if (al->d->deactivate) al->d->deactivate (al->handle); + } + + free (al->control_inputs); + free (al); + free (base); + + return 0; +} + +static int +remix_ladspa_ready (RemixEnv * env, RemixBase * base) +{ + unsigned long samplerate = (unsigned long)remix_get_samplerate (env); + RemixLADSPA * al = (RemixLADSPA *) remix_base_get_instance_data (env, base); + return (samplerate == al->samplerate); +} + +static RemixBase * +remix_ladspa_prepare (RemixEnv * env, RemixBase * base) +{ + remix_ladspa_replace_handle (env, base); + return base; + +} + +/* + * remix_ladspa_1_0: + * A RemixChunkChunkFunc for a mono LADSPA sound consumer. + */ +static RemixCount +remix_ladspa_1_0 (RemixEnv * env, RemixChunk * chunk, RemixCount offset, + RemixCount count, int channelname, void * data) +{ + RemixLADSPA * al = (RemixLADSPA *) data; + LADSPA_Descriptor * d; + LADSPA_PortDescriptor pd; + unsigned long port_i; + + d = al->d; + + /* Connect audio input */ + for (port_i = 0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_AUDIO_INPUT(pd)) { + d->connect_port (al->handle, port_i, &chunk->data[offset]); + } + } + + d->run (al->handle, count); + + return count; +} + +/* + * remix_ladspa_0_1: + * A RemixChunkChunkFunc for a mono LADSPA sound generator. + */ +static RemixCount +remix_ladspa_0_1 (RemixEnv * env, RemixChunk * chunk, RemixCount offset, + RemixCount count, int channelname, void * data) +{ + RemixLADSPA * al = (RemixLADSPA *) data; + LADSPA_Descriptor * d; + LADSPA_PortDescriptor pd; + unsigned long port_i; + + d = al->d; + + /* Connect audio output */ + for (port_i = 0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_AUDIO_OUTPUT(pd)) { + d->connect_port (al->handle, port_i, &chunk->data[offset]); + } + } + + d->run (al->handle, count); + + return count; +} + +/* + * remix_ladspa_1_1: + * A RemixChunkChunkFunc for filtering with a mono LADSPA plugin. + */ +static RemixCount +remix_ladspa_1_1 (RemixEnv * env, RemixChunk * src, RemixCount src_offset, + RemixChunk * dest, RemixCount dest_offset, + RemixCount count, int channelname, void * data) +{ + RemixLADSPA * al = (RemixLADSPA *) data; + LADSPA_Descriptor * d; + LADSPA_PortDescriptor pd; + unsigned long port_i; + + d = al->d; + + if (al == NULL) { + remix_set_error (env, REMIX_ERROR_INVALID); + return -1; + } + + for (port_i = 0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_AUDIO_INPUT(pd)) { + d->connect_port (al->handle, port_i, &src->data[src_offset]); + } + if (LADSPA_IS_AUDIO_OUTPUT(pd)) { + d->connect_port (al->handle, port_i, &dest->data[dest_offset]); + } + } + + d->run (al->handle, count); + + return count; +} + + +#if 0 +static void +ladspa_wrapper_apply_region (RemixEnv * env, gpointer pcmdata, sw_format * format, + gint nr_frames, + sw_param_set pset, void * custom_data) +{ + lm_custom * lm = (lm_custom *)custom_data; + const LADSPA_Descriptor * d = lm->d; + sw_param_spec * param_specs = lm->param_specs; + + LADSPA_Handle * handle; + LADSPA_Data ** input_buffers, ** output_buffers; + LADSPA_Data * mono_input_buffer=NULL; + LADSPA_Data * p; + LADSPA_Data * control_inputs; + LADSPA_Data dummy_control_output; + LADSPA_PortDescriptor pd; + long length_b; + unsigned long port_i; /* counter for iterating over ports */ + int i, j, n; + + /* The number of times the plugin will be run; ie. if the number of + * channels in the input pcmdata is greater than the number of + * audio ports on the ladspa plugin, the plugin will be run + * multiple times until enough output channels have been calculated. + */ + gint iterations; + + /* Enumerate the numbers of each type of port on the ladspa plugin */ + gint + nr_ci=0, /* control inputs */ + nr_ai=0, /* audio inputs */ + nr_co=0, /* control outputs */ + nr_ao=0; /* audio outputs */ + + /* The number of audio channels to be processed */ + gint nr_channels = format->channels; + + /* The number of input and output buffers to use */ + gint nr_i=0, nr_o=0; + + /* Counters for allocating input and output buffers */ + gint ibi=0, obi=0; + + + /* instantiate the ladspa plugin */ + handle = d->instantiate (d, (long)format->rate); + + /* Cache how many of each type of port this ladspa plugin has */ + for (port_i=0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_CONTROL_INPUT(pd)) + nr_ci++; + if (LADSPA_IS_AUDIO_INPUT(pd)) + nr_ai++; + if (LADSPA_IS_CONTROL_OUTPUT(pd)) + nr_co++; + if (LADSPA_IS_AUDIO_OUTPUT(pd)) + nr_ao++; + } + + /* Basic assumption of this wrapper plugin, which was + * checked above in is_usable(); nb. for future expansion + * much of this routine is written to accomodate this + * assumption being incorrect. + */ + g_assert (nr_ai == nr_ao); + + /* Basic assumption that this plugin has audio output. + * Also important as we are about to divide by nr_ao. + */ + g_assert (nr_ao > 0); + + iterations = (gint) ceil(((double)nr_channels) / ((double)nr_ao)); + + /* Numbers of input and output buffers: ensure + * nr_i >= nr_channels && nr_o >= nr_channels + */ + nr_i = iterations * nr_ai; + nr_o = iterations * nr_ao; + + if ((nr_channels == 1) && (nr_ai == 1) && (nr_ao >= 1)) { + /* + * Processing a mono sample with a mono filter. + * Attempt to do this in place. + */ + + /* Copy PCM data if this ladspa plugin cannot work inplace */ + if (LADSPA_WRAPPER_IS_INPLACE_BROKEN(d->Properties)) { + length_b = frames_to_bytes (format, nr_frames); + mono_input_buffer = g_malloc (length_b); + input_buffers = &mono_input_buffer; + } else { + input_buffers = (LADSPA_Data **)&pcmdata; + } + + output_buffers = (LADSPA_Data **)&pcmdata; + + } else { + length_b = LADSPA_frames_to_bytes (nr_frames); + + /* Allocate zeroed input buffers; these will remain zeroed + * if there aren't enough channels in the input pcmdata + * to use them. + */ + input_buffers = g_malloc (sizeof(LADSPA_Data *) * nr_i); + for (i=0; i < nr_i; i++) { + input_buffers[i] = g_malloc0 (length_b); + } + + output_buffers = g_malloc(sizeof(LADSPA_Data *) * nr_o); + + /* Create separate output buffers if this ladspa plugin cannot + * work inplace */ + if (LADSPA_WRAPPER_IS_INPLACE_BROKEN(d->Properties)) { + for (i=0; i < nr_o; i++) { + output_buffers[i] = g_malloc (length_b); + } + } else { + /* Re-use the input buffers, directly mapping them to + * corresponding output buffers + */ + for (i=0; i < MIN(nr_i, nr_o); i++) { + output_buffers[i] = input_buffers[i]; + } + /* Create some extra output buffers if nr_o > nr_i */ + for (; i < nr_o; i++) { + output_buffers[i] = g_malloc (length_b); + } + } + } + + /* Copy data into input buffers */ + if (nr_channels == 1) { + if (!LADSPA_WRAPPER_IS_INPLACE_BROKEN(d->Properties)) { + length_b = frames_to_bytes (format, nr_frames); + memcpy (input_buffers[0], pcmdata, length_b); + } /* else we're processing in-place, so we haven't needed to set + * up a separate input buffer; input_buffers[0] actually + * points to pcmdata hence we don't do any copying here. + */ + } else { + /* de-interleave multichannel data */ + + p = (LADSPA_Data *)pcmdata; + + for (n=0; n < nr_channels; n++) { + for (i=0; i < nr_frames; i++) { + input_buffers[n][i] = *p++; + } + } + } + + /* connect control ports */ + control_inputs = g_malloc (nr_ci * sizeof(LADSPA_Data)); + j=0; + for (port_i=0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_CONTROL_INPUT(pd)) { + /* do something with pset! */ + switch (param_specs[j].type) { + case SWEEP_TYPE_BOOL: + /* from ladspa.h: + * Data less than or equal to zero should be considered + * `off' or `false,' + * and data above zero should be considered `on' or `true.' + */ + control_inputs[j] = pset[j].b ? 1.0 : 0.0; + break; + case SWEEP_TYPE_INT: + control_inputs[j] = (LADSPA_Data)pset[j].i; + break; + case SWEEP_TYPE_FLOAT: + control_inputs[j] = pset[j].f; + break; + default: + /* This plugin should produce no other types */ + g_assert_not_reached (); + break; + } + d->connect_port (handle, port_i, &control_inputs[j]); + j++; + } + if (LADSPA_IS_CONTROL_OUTPUT(pd)) { + d->connect_port (handle, port_i, &dummy_control_output); + } + } + + /* run the plugin as many times as necessary */ + while (iterations--) { + + /* connect input and output audio buffers to the + * audio ports of the ladspa plugin */ + for (port_i=0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_AUDIO_INPUT(pd)) { + d->connect_port (handle, port_i, input_buffers[ibi++]); + } + if (LADSPA_IS_AUDIO_OUTPUT(pd)) { + d->connect_port (handle, port_i, output_buffers[obi++]); + } + } + + /* activate the ladspa plugin */ + if (d->activate) + d->activate (handle); + + /* run the ladspa plugin */ + d->run (handle, nr_frames); + + /* deactivate the ladspa plugin */ + if (d->deactivate) + d->deactivate (handle); + } + + /* re-interleave data */ + if (nr_channels > 1) { + p = (LADSPA_Data *)pcmdata; + + for (n=0; n < nr_channels; n++) { + for (i=0; i < nr_frames; i++) { + *p++ = output_buffers[n][i]; + } + } + } + + /* let the ladspa plugin clean up after itself */ + if (d->cleanup) + d->cleanup (handle); + + /* free the input and output buffers */ + if (control_inputs) g_free (control_inputs); + + if ((nr_channels == 1) && (nr_ai == 1) && (nr_ao >= 1)) { + if (LADSPA_WRAPPER_IS_INPLACE_BROKEN(d->Properties)) { + g_free (mono_input_buffer); + } + } else { + + /* free the output buffers */ + for (i=0; i < nr_o; i++) { + g_free (output_buffers[i]); + } + g_free (output_buffers); + + /* free the input buffers, if we created some */ + if (LADSPA_WRAPPER_IS_INPLACE_BROKEN(d->Properties)) { + for (i=0; i < nr_i; i++) { + g_free (input_buffers[i]); + } + } else { + /* inplace worked, but if (nr_i > nr_o), then + * we still need to free the last input buffers + */ + for (i=nr_o; i < nr_i; i++) { + g_free (input_buffers[i]); + } + } + g_free (input_buffers); + } +} +#endif + +static RemixBase * +remix_ladspa_connect_control_inputs (RemixEnv * env, RemixBase * base) +{ + RemixLADSPA * al = (RemixLADSPA *) remix_base_get_instance_data (env, base); + LADSPA_Descriptor * d; + LADSPA_PortDescriptor pd; + RemixParameter parameter; + RemixParameterType type; + int j; + unsigned long port_i; + + d = al->d; + + if (d == NULL) { + remix_set_error (env, REMIX_ERROR_NOENTITY); + return RemixNone; + } + + j=0; + for (port_i=0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_CONTROL_INPUT(pd)) { + type = remix_get_parameter_type (env, base, j); + parameter = remix_get_parameter (env, base, j); + switch (type) { + case REMIX_TYPE_BOOL: + /* from ladspa.h: + * Data less than or equal to zero should be considered + * `off' or `false,' + * and data above zero should be considered `on' or `true.' + */ + al->control_inputs[j] = parameter.s_bool ? 1.0 : 0.0; + break; + case REMIX_TYPE_INT: + al->control_inputs[j] = (LADSPA_Data)parameter.s_int; + break; + case REMIX_TYPE_FLOAT: + al->control_inputs[j] = parameter.s_float; + break; + default: + /* This plugin should produce no other types */ + break; + } + d->connect_port (al->handle, port_i, &al->control_inputs[j]); + j++; + } + if (LADSPA_IS_CONTROL_OUTPUT(pd)) { + d->connect_port (al->handle, port_i, &dummy_control_output); + } + } + + return base; +} + +static RemixCount +remix_ladspa_1_0_process (RemixEnv * env, RemixBase * base, RemixCount count, + RemixStream * input, RemixStream * output) +{ + RemixLADSPA * al = remix_base_get_instance_data (env, base); + remix_ladspa_connect_control_inputs (env, base); + return remix_stream_chunkfuncify (env, input, count, remix_ladspa_1_0, al); +} + +static RemixCount +remix_ladspa_0_1_process (RemixEnv * env, RemixBase * base, RemixCount count, + RemixStream * input, RemixStream * output) +{ + RemixLADSPA * al = remix_base_get_instance_data (env, base); + remix_ladspa_connect_control_inputs (env, base); + return remix_stream_chunkfuncify (env, output, count, remix_ladspa_0_1, al); +} + +static RemixCount +remix_ladspa_1_1_process (RemixEnv * env, RemixBase * base, RemixCount count, + RemixStream * input, RemixStream * output) +{ + RemixLADSPA * al = remix_base_get_instance_data (env, base); + remix_ladspa_connect_control_inputs (env, base); + return remix_stream_chunkchunkfuncify (env, input, output, count, + remix_ladspa_1_1, al); +} + +static RemixCount +remix_ladspa_process (RemixEnv * env, RemixBase * base, RemixCount count, + RemixStream * input, RemixStream * output) +{ + RemixPlugin * plugin = remix_base_get_plugin (env, base); + RemixLADSPA * al; + LADSPA_PortDescriptor pd; + unsigned long port_i; /* counter for iterating over ports */ + + /* Enumerate the numbers of each type of port on the ladspa plugin */ + int + nr_ci=0, /* control inputs */ + nr_ai=0, /* audio inputs */ + nr_co=0, /* control outputs */ + nr_ao=0; /* audio outputs */ + + if (plugin == RemixNone) { + remix_set_error (env, REMIX_ERROR_NOENTITY); + return -1; + } + + remix_ladspa_connect_control_inputs (env, base); + + al = remix_base_get_instance_data (env, base); + + /* Cache how many of each type of port this ladspa plugin has */ + for (port_i=0; port_i < al->d->PortCount; port_i++) { + pd = al->d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_CONTROL_INPUT(pd)) + nr_ci++; + if (LADSPA_IS_AUDIO_INPUT(pd)) + nr_ai++; + if (LADSPA_IS_CONTROL_OUTPUT(pd)) + nr_co++; + if (LADSPA_IS_AUDIO_OUTPUT(pd)) + nr_ao++; + } + + if (nr_ai == 1 && nr_ao == 1) { + return remix_stream_chunkchunkfuncify (env, input, output, count, + remix_ladspa_1_1, al); + } else if (nr_ai == 1 && nr_ao == 0) { + return remix_stream_chunkfuncify (env, input, count, remix_ladspa_1_0, al); + } else if (nr_ai == 0 && nr_ao == 1) { + return remix_stream_chunkfuncify (env, output, count, remix_ladspa_0_1, al); + } else { + remix_set_error (env, REMIX_ERROR_INVALID); + return -1; + } +} + +static RemixCount +remix_ladspa_length (RemixEnv * env, RemixBase * base) +{ + return REMIX_COUNT_INFINITE; +} + +static struct _RemixMethods _remix_ladspa_1_0_methods = { + remix_ladspa_clone, + remix_ladspa_destroy, + remix_ladspa_ready, /* ready */ + remix_ladspa_prepare, /* prepare */ + remix_ladspa_1_0_process, + remix_ladspa_length, + NULL, /* seek */ + NULL, /* flush */ +}; + +static struct _RemixMethods _remix_ladspa_0_1_methods = { + remix_ladspa_clone, + remix_ladspa_destroy, + remix_ladspa_ready, /* ready */ + remix_ladspa_prepare, /* prepare */ + remix_ladspa_0_1_process, + remix_ladspa_length, + NULL, /* seek */ + NULL, /* flush */ +}; + +static struct _RemixMethods _remix_ladspa_1_1_methods = { + remix_ladspa_clone, + remix_ladspa_destroy, + remix_ladspa_ready, /* ready */ + remix_ladspa_prepare, /* prepare */ + remix_ladspa_1_1_process, + remix_ladspa_length, + NULL, /* seek */ + NULL, /* flush */ +}; + + +static struct _RemixMethods _remix_ladspa_methods = { + remix_ladspa_clone, + remix_ladspa_destroy, + remix_ladspa_ready, /* ready */ + remix_ladspa_prepare, /* prepare */ + remix_ladspa_process, + remix_ladspa_length, + NULL, /* seek */ + NULL, /* flush */ +}; + +static RemixBase * +remix_ladspa_optimise (RemixEnv * env, RemixBase * base) +{ + RemixLADSPA * al = remix_base_get_instance_data (env, base); + LADSPA_Descriptor * d; + LADSPA_PortDescriptor pd; + unsigned long port_i; /* counter for iterating over ports */ + + /* Enumerate the numbers of each type of port on the ladspa plugin */ + int + nr_ci=0, /* control inputs */ + nr_ai=0, /* audio inputs */ + nr_co=0, /* control outputs */ + nr_ao=0; /* audio outputs */ + + if (al == NULL) { + remix_set_error (env, REMIX_ERROR_NOENTITY); + return RemixNone; + } + + d = al->d; + + if (d == NULL) { + remix_set_error (env, REMIX_ERROR_NOENTITY); + return RemixNone; + } + + /* Cache how many of each type of port this ladspa plugin has */ + for (port_i=0; port_i < d->PortCount; port_i++) { + pd = d->PortDescriptors[(int)port_i]; + if (LADSPA_IS_CONTROL_INPUT(pd)) + nr_ci++; + if (LADSPA_IS_AUDIO_INPUT(pd)) + nr_ai++; + if (LADSPA_IS_CONTROL_OUTPUT(pd)) + nr_co++; + if (LADSPA_IS_AUDIO_OUTPUT(pd)) + nr_ao++; + } + + al->control_inputs = malloc (nr_ci * sizeof (LADSPA_Data)); + + if (nr_ai == 1 && nr_ao == 1) { + remix_base_set_methods (env, base, &_remix_ladspa_1_1_methods); + } else if (nr_ai == 1 && nr_ao == 0) { + remix_base_set_methods (env, base, &_remix_ladspa_1_0_methods); + } else if (nr_ai == 0 && nr_ao == 1) { + remix_base_set_methods (env, base, &_remix_ladspa_0_1_methods); + } else { + remix_base_set_methods (env, base, &_remix_ladspa_methods); + } + + return base; +} + + +/* + * ladspa_wrapper_load_plugins (dir, name, gl) + * + * form RemixPlugins to describe the ladspa plugin functions that + * are in the shared library file "dir/name" + */ +static CDList * +ladspa_wrapper_load_plugins (RemixEnv * env, char * dir, char * name) +{ + char path[PATH_LEN]; + void * module; + LADSPA_Descriptor_Function desc_func; + const LADSPA_Descriptor * d; + LADSPA_PortDescriptor pd; + int i, j, k; + int valid_mask; + RemixPlugin * plugin; + RemixMetaText * mt; + RemixParameterScheme * scheme; + CDList * l, * plugins = CD_EMPTY_LIST; +#define BUF_LEN 256 + static char buf[BUF_LEN]; + struct stat statbuf; + + snprintf (path, PATH_LEN, "%s/%s", dir, name); + + if (stat (path, &statbuf) == -1) return CD_EMPTY_LIST; + if (!remix_stat_regular (statbuf.st_mode)) return CD_EMPTY_LIST; + + module = dlopen (path, RTLD_NOW); + if (!module) return CD_EMPTY_LIST; + + /* Check that this module has not already been loaded (eg. if it is + * a symlink etc.) */ + for (l = modules_list; l; l = l->next) { + if (l->data.s_pointer == module) { + dlclose (module); + return CD_EMPTY_LIST; + } + } + + modules_list = cd_list_append (env, modules_list, CD_POINTER(module)); + + if ((desc_func = dlsym (module, "ladspa_descriptor"))) { + for (i=0; (d = desc_func (i)) != NULL; i++) { + + if (!is_usable(d)) + continue; + + remix_dprintf ("[ladspa_wrapper_load_plugins] adding %s [%lu] by %s\n", + d->Name, d->UniqueID, d->Maker); + + plugin = malloc (sizeof (*plugin)); + + mt = remix_meta_text_new (env); + + snprintf (buf, BUF_LEN, "ladspa::%lu", d->UniqueID); + remix_meta_text_set_identifier (env, mt, strdup (buf)); + + snprintf (buf, BUF_LEN, "Miscellaneous::%s", d->Name); + remix_meta_text_set_category (env, mt, strdup (buf)); + + remix_meta_text_set_copyright (env, mt, (char *)d->Copyright); + remix_meta_text_add_author (env, mt, (char *)d->Maker, NULL); + + plugin->metatext = mt; + + plugin->init_scheme = CD_EMPTY_SET; + plugin->process_scheme = CD_EMPTY_SET; + + k=0; + for (j=0; j < d->PortCount; j++) { + pd = d->PortDescriptors[j]; + if (LADSPA_IS_CONTROL_INPUT(pd)) { + scheme = malloc (sizeof (*scheme)); + + scheme->name = (char *)d->PortNames[j]; + scheme->description = (char *)d->PortNames[j]; + scheme->type = convert_type (d->PortRangeHints[j].HintDescriptor); + valid_mask = get_valid_mask (d->PortRangeHints[j].HintDescriptor); + if (valid_mask == 0) { + scheme->constraint_type = REMIX_CONSTRAINT_TYPE_NONE; + } else { + scheme->constraint_type = REMIX_CONSTRAINT_TYPE_RANGE; + scheme->constraint.range = + convert_constraint (&d->PortRangeHints[j]); + } + plugin->process_scheme = cd_set_insert (env, plugin->process_scheme, + k, CD_POINTER(scheme)); + k++; + } + } + + plugin->init = remix_ladspa_init; + + plugin->plugin_data = (void *)d; + + plugin->destroy = NULL; + + plugins = cd_list_append (env, plugins, CD_POINTER(plugin)); + } + } + + return plugins; + +#undef BUF_LEN +} + +/* + * ladspa_wrapper_load_dir (dir, gl) + * + * scan a directory "dirname" for LADSPA plugins, and attempt to load + * each of them. + */ +static CDList * +ladspa_wrapper_load_dir (RemixEnv * env, char * dirname) +{ + DIR * dir; + struct dirent * dirent; + CDList * plugins = CD_EMPTY_LIST, * l; + + if (!dirname) return plugins; + + dir = opendir (dirname); + if (!dir) { + return plugins; + } + + while ((dirent = readdir (dir)) != NULL) { + l = ladspa_wrapper_load_plugins (env, dirname, dirent->d_name); + plugins = cd_list_join (env, plugins, l); + } + + closedir (dir); + + return plugins; +} + +CDList * +remix_load (RemixEnv * env) +{ + CDList * plugins = CD_EMPTY_LIST, * l; + char * ladspa_path=NULL; + char * next_sep=NULL; + char * saved_lp=NULL; + + /* If this ladspa_wrapper module has already been initialised, don't + * initialise again until cleaned up. + */ + if (ladspa_wrapper_initialised) + return CD_EMPTY_LIST; + + ladspa_path = getenv ("LADSPA_PATH"); + if (!ladspa_path) + ladspa_path = saved_lp = strdup(default_ladspa_path); + + do { + next_sep = strchr (ladspa_path, ':'); + if (next_sep != NULL) *next_sep = '\0'; + + l = ladspa_wrapper_load_dir (env, ladspa_path); + plugins = cd_list_join (env, plugins, l); + + if (next_sep != NULL) ladspa_path = ++next_sep; + + } while ((next_sep != NULL) && (*next_sep != '\0')); + + ladspa_wrapper_initialised = TRUE; + + /* free string if dup'd for ladspa_path */ + if (saved_lp != NULL) free(saved_lp); + + return plugins; +} + +void +remix_unload (RemixEnv * env) +{ + CDList * l; + + if (!ladspa_wrapper_initialised) return; + + for (l = modules_list; l; l = l->next) { + dlclose(l->data.s_pointer); + } + + modules_list = NULL; +} + diff --git a/src/plugins/noise/Makefile.am b/src/plugins/noise/Makefile.am new file mode 100644 index 0000000..7324e61 --- /dev/null +++ b/src/plugins/noise/Makefile.am @@ -0,0 +1,17 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = -I$(top_srcdir)/include -I$(CTXDATADIR) + +libdir = $(PACKAGE_PLUGIN_DIR) + +CTXDATADIR = $(top_srcdir)/src/ctxdata +CTXDATA_LIBS = $(top_builddir)/src/ctxdata/libctxdata.la + +REMIXDIR = ../../libremix +REMIX_LIBS = $(REMIXDIR)/libremix.la + +lib_LTLIBRARIES = libremix_noise.la + +libremix_noise_la_SOURCES = remix_noise.c +libremix_noise_la_LDFLAGS = -module -version-info 1:0:0 +libremix_noise_la_LIBADD = $(REMIX_LIBS) $(CTXDATA_LIBS) diff --git a/src/plugins/noise/Makefile.in b/src/plugins/noise/Makefile.in new file mode 100644 index 0000000..384a39e --- /dev/null +++ b/src/plugins/noise/Makefile.in @@ -0,0 +1,533 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/plugins/noise +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libremix_noise_la_DEPENDENCIES = $(REMIX_LIBS) $(CTXDATA_LIBS) +am_libremix_noise_la_OBJECTS = remix_noise.lo +libremix_noise_la_OBJECTS = $(am_libremix_noise_la_OBJECTS) +libremix_noise_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libremix_noise_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libremix_noise_la_SOURCES) +DIST_SOURCES = $(libremix_noise_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_MONITOR = @BUILD_MONITOR@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_DOXYGEN = @HAVE_DOXYGEN@ +HAVE_VALGRIND = @HAVE_VALGRIND@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_PLUGIN_DIR = @PACKAGE_PLUGIN_DIR@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHARED_VERSION_INFO = @SHARED_VERSION_INFO@ +SHELL = @SHELL@ +SHLIB_VERSION_ARG = @SHLIB_VERSION_ARG@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +VALGRIND_ENVIRONMENT = @VALGRIND_ENVIRONMENT@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(PACKAGE_PLUGIN_DIR) +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir)/include -I$(CTXDATADIR) +CTXDATADIR = $(top_srcdir)/src/ctxdata +CTXDATA_LIBS = $(top_builddir)/src/ctxdata/libctxdata.la +REMIXDIR = ../../libremix +REMIX_LIBS = $(REMIXDIR)/libremix.la +lib_LTLIBRARIES = libremix_noise.la +libremix_noise_la_SOURCES = remix_noise.c +libremix_noise_la_LDFLAGS = -module -version-info 1:0:0 +libremix_noise_la_LIBADD = $(REMIX_LIBS) $(CTXDATA_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/noise/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/plugins/noise/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libremix_noise.la: $(libremix_noise_la_OBJECTS) $(libremix_noise_la_DEPENDENCIES) + $(libremix_noise_la_LINK) -rpath $(libdir) $(libremix_noise_la_OBJECTS) $(libremix_noise_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remix_noise.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/plugins/noise/remix_noise.c b/src/plugins/noise/remix_noise.c new file mode 100644 index 0000000..65337db --- /dev/null +++ b/src/plugins/noise/remix_noise.c @@ -0,0 +1,142 @@ +/* + * libremix -- An audio mixing and sequencing library. + * + * Copyright (C) 2001 Commonwealth Scientific and Industrial Research + * Organisation (CSIRO), Australia. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + * RemixNoise: a noise generator + * + * Conrad Parker <conrad@metadecks.org>, August 2001 + */ + +#include <stdlib.h> + +#define __REMIX_PLUGIN__ +#include <remix/remix.h> + +/* Optimisation dependencies: none */ +static RemixBase * remix_noise_optimise (RemixEnv * env, RemixBase * noise); + +static RemixBase * +remix_noise_init (RemixEnv * env, RemixBase * base, CDSet * parameters) +{ + remix_noise_optimise (env, base); + return base; +} + +static RemixBase * +remix_noise_clone (RemixEnv * env, RemixBase * base) +{ + RemixBase * new_noise = remix_base_new (env); + remix_noise_optimise (env, new_noise); + return new_noise; +} + +static int +remix_noise_destroy (RemixEnv * env, RemixBase * base) +{ + free (base); + return 0; +} + +/* An RemixChunkFunc for creating noise */ +static RemixCount +remix_noise_write_chunk (RemixEnv * env, RemixChunk * chunk, RemixCount offset, + RemixCount count, int channelname, void * data) +{ + RemixPCM * d; + RemixPCM r, rmax = (RemixPCM)RAND_MAX; + RemixCount i; + + remix_dprintf ("[remix_noise_write_chunk] (%p, +%ld) @ %ld\n", data, count, + offset); + + d = &chunk->data[offset]; + for (i = 0; i < count; i++) { + r = (RemixPCM) random (); + r *= 2.0; + r /= rmax; + *d++ = r - 1.0; + } + + return count; +} + +static RemixCount +remix_noise_process (RemixEnv * env, RemixBase * base, RemixCount count, + RemixStream * input, RemixStream * output) +{ + return remix_stream_chunkfuncify (env, output, count, + remix_noise_write_chunk, base); +} + +static RemixCount +remix_noise_length (RemixEnv * env, RemixBase * base) +{ + return REMIX_COUNT_INFINITE; +} + +static struct _RemixMethods _remix_noise_methods = { + remix_noise_clone, + remix_noise_destroy, + NULL, /* ready */ + NULL, /* prepare */ + remix_noise_process, + remix_noise_length, + NULL, /* seek */ + NULL, /* flush */ +}; + +static RemixBase * +remix_noise_optimise (RemixEnv * env, RemixBase * noise) +{ + remix_base_set_methods (env, noise, &_remix_noise_methods); + return noise; +} + +static struct _RemixMetaText noise_metatext = { + "envstd::noise", + "Generators::Noise", + "White noise generator", + "Copyright (C) 2001 CSIRO Australia", + "http://www.metadecks.org/remix/plugins/noise.html", + REMIX_ONE_AUTHOR ("Conrad Parker", "conrad@metadecks.org"), +}; + +static struct _RemixPlugin noise_plugin = { + &noise_metatext, + REMIX_FLAGS_NONE, + CD_EMPTY_SET, /* new scheme */ + remix_noise_init, + CD_EMPTY_SET, /* process scheme */ + NULL, /* suggests */ + NULL, /* plugin data */ + NULL /* destroy */ +}; + +CDList * +remix_load (RemixEnv * env) +{ + CDList * plugins = cd_list_new (env); + + plugins = cd_list_prepend (env, plugins, CD_POINTER(&noise_plugin)); + + return plugins; +} |