ecasound-2.9.3/0000755000076400007640000000000013606336217010346 500000000000000ecasound-2.9.3/BUGS0000644000076400007640000000531212260764407010753 00000000000000----------------------------------------------------------------------- *** Ecasound - Known Bugs/Features *** ----------------------------------------------------------------------- Reporting bugs ----------------------------------------------------------------------- Please send your bug reports to the ecasound-list mailing list (see README or http://nosignal.fi/ecasound/mlists.php for list contact information). If the bug (or feature request) cannot be solved immediately (or getting a response takes longer than you care to wait for), feel free to add the item to the sourceforge.net tracker (see below). It is also a good idea to send a note to the list that you have added a new item as the sourceforge.net tracker is not monitored by all developers. To get the best results, see for example Simon Tatham's excellent article on 'How to Report Bugs Effectively' (if you are in a hurry, skip to the summary at the end of the article :)): http://www.chiark.greenend.org.uk/~sgtatham/bugs.html Ecasound bug tracker at sourceforge.net ----------------------------------------------------------------------- Ecasound has used the sourceforge.net bug tracker since Jan/2006: https://sourceforge.net/tracker/?group_id=4605&atid=104605 This tracker is used to monitor longstanding bugs and feature/improvement items. It replaces the old Ecasound Development Item practise (items marked with 'edi-x' tags) that was used between 2002-08. Known Bugs and Features (not in other issue trackers) ----------------------------------------------------------------------- In addition to the below items, some known missing features have been listed in the 'TODO' file (in same directory as this file). - commas in filenames given as arguments to '-i' and '-o' options need to be either escaped with backslashes (-i foo\\,bar.wav) or quoted with doublequotes (-i "foo,bar.wav") - certain combinations of glibc and linux-2.6 kernels cause the 'cs-edit' EIAM command to fail (ecasound exits back to shell after the command); as a workaround, set the LD_ASSUME_KERNEL=2.2.5 environment variable before running ecasound; see http://people.redhat.com/drepper/assumekernel.html for background information on LD_ASSUME_KERNEL - ecasound cannot parse ogg and flac headers so correct audio format parameters must be set manually with ecasound's '-f' option - pitch shifter (-ei) doesn't work with all real-time audio object types (for instance JACK) - ecasound crashes if /dev/midi points to an invalid rawmidi device - MIDI-ops like '-km' cannot be used in presets - controller sources and big buffersizes - distortion results for example if sine-oscillators are used with big buffersize (-b:X) settings ecasound-2.9.3/configure.ac0000644000076400007640000011753513606335572012573 00000000000000dnl --- dnl configure.ac for ecasound dnl dnl Many of the tests and macros in this file have been borrowed from dnl other GPL-licensed packages (Alsaplayer, ALSA, SIP, PyQt, dnl kpackage, etc, etc). dnl dnl refs: dnl - http://www.gnu.org/software/autoconf/manual/ dnl - http://www.gnu.org/software/automake/manual/ dnl - http://www.gnu.org/software/libtool/manual/ dnl --- dnl ------------------------------------------------------------------ dnl --- dnl Initialize autoconf and automake dnl --- AC_INIT([ecasound], [2.9.3]) AC_PREREQ(2.50) AC_CONFIG_SRCDIR([libecasound/audiofx.h]) AM_INIT_AUTOMAKE([1.6.1]) dnl FIXME: replace with AC_CONFIG_HEADERS when upgrading to a newer automake AM_CONFIG_HEADER([config.h]) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "1. Section: Basic setup" echo "------------------------------------------------------------------" dnl --- dnl Set library interface version numbers dnl dnl defines: LIBECASOUND_VERSION, LIBECASOUNDC_VERSION, LIBKVUTILS_VERSION dnl --- LIBECASOUND_VERSION=24 LIBECASOUND_VERSION_AGE=0 LIBECASOUNDC_VERSION=2 LIBECASOUNDC_VERSION_AGE=1 LIBKVUTILS_VERSION=10 LIBKVUTILS_VERSION_AGE=0 AC_SUBST(LIBECASOUND_VERSION) AC_SUBST(LIBECASOUND_VERSION_AGE) AC_SUBST(LIBECASOUNDC_VERSION) AC_SUBST(LIBECASOUNDC_VERSION_AGE) AC_SUBST(LIBKVUTILS_VERSION) AC_SUBST(LIBKVUTILS_VERSION_AGE) AC_DEFINE_UNQUOTED([LIBECASOUND_VERSION], ${LIBECASOUND_VERSION}, [libecasound interface version]) AC_DEFINE_UNQUOTED([LIBECASOUND_VERSION_AGE], ${LIBECASOUND_VERSION_AGE}, [libecasound interface age]) AC_DEFINE_UNQUOTED([LIBECASOUNDC_VERSION], ${LIBECASOUNDC_VERSION}, [libecasoundc interface version]) AC_DEFINE_UNQUOTED([LIBKVUTILS_VERSION], ${LIBKVUTILS_VERSION}, [libkvutils interface version]) AC_DEFINE_UNQUOTED([LIBKVUTILS_VERSION_AGE], ${LIBKVUTILS_VERSION_AGE}, [libkvutils interface age]) dnl ------------------------------------------------------------------ dnl -- dnl Initialize default flags dnl -- AC_PROG_CC AC_PROG_CXX AC_PROG_CPP AC_LANG_CPLUSPLUS AC_CANONICAL_HOST dnl --- dnl Set compiler flags dnl dnl AM_xxx flags are global flags that are always utilized dnl for compiling and linking. dnl dnl It is possible to add custom options by adding them dnl to the CPPFLAGS/CFLAGS/CXXFLAGS/LDFLAGS shell variables dnl when invoking the configure script. It is not possible dnl to override AM_xxx flags. dnl dnl modifies: AM_CXXFLAGS, AM_CFLAGS dnl --- EXTRACPPFLAGS="-D_REENTRANT -D_XOPEN_SOURCE=600" EXTRAGCCFLAGS="-ffast-math -fstrict-aliasing" EXTRACXXFLAGS="-std=c++98" if test x${GXX} = xyes; then AM_CXXFLAGS="$AM_CXXFLAGS $EXTRAGCCFLAGS" AM_CFLAGS="$AM_CFLAGS $EXTRAGCCFLAGS" fi AM_CPPFLAGS="$AM_CPPFLAGS $EXTRACPPFLAGS" AM_CXXFLAGS="$AM_CXXFLAGS $EXTRACXXFLAGS" AC_SUBST(AM_CFLAGS) AC_SUBST(AM_CXXFLAGS) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_LDFLAGS) dnl ------------------------------------------------------------------ dnl --- dnl Sets up default values dnl --- dnl Selected the Python ECI implementation. eca_platform_python_impl="python" dnl All components required by ecasound curses are found eca_platform_curses_support="yes" dnl --- dnl Sets up some operating system specific options dnl dnl modifies: AM_CXXFLAGS, AM_CFLAGS, AM_CPPFLAGS, AM_LIBS dnl --- case "$host" in *-*-openbsd*) AM_CFLAGS="$AM_CFLAGS -pthread" AM_CXXFLAGS="$AM_CXXFLAGS -pthread" echo "Setting OpenBSD compilation options for POSIX threads" ;; *-*-freebsd*) AM_CFLAGS="$AM_CFLAGS -pthread" AM_CPPFLAGS="$AM_CPPFLAGS -D_THREAD_SAFE -D_P1003_1B_VISIBLE" AM_CXXFLAGS="$AM_CXXFLAGS -pthread" echo "Setting FreeBSD compilation options for POSIX threads" ;; *-*-solaris*) AM_CPPFLAGS="$AM_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS" LIBS="$LIBS -lposix4 -lpthread" echo "Setting Solaris compilation options for POSIX threads" if test x$CXX = xCC; then LIBS="$LIBS -mt" AM_CXXFLAGS="$AM_CXXFLAGS -instances=static" echo "Sun Workshop C++ compiler detected. Enabling static template instantation." fi ;; *-*-linux-gnu) ;; alpha*-*-linux-*) AM_CFLAGS="$AM_CFLAGS -mieee" AM_CXXFLAGS="$AM_CXXFLAGS -mieee" echo "Enabling fully IEEE compliant floating-point code generation on Alpha." ;; *darwin*) if test "$GCC" = yes; then AM_CPPFLAGS="$AM_CPPFLAGS -D_P1003_1B_VISIBLE" fi ;; *) echo "Using generic settings for POSIX thread support." ;; esac dnl ------------------------------------------------------------------ dnl --- dnl Check pthread and rt support dnl --- dnl switch to C while testing for pthread support AC_LANG_C AC_SEARCH_LIBS(pthread_create, pthread c_r,, AC_MSG_ERROR([** POSIX.4 threads not installed or broken **])) AC_SEARCH_LIBS(clock_gettime, rt) dnl switch back to C++ AC_LANG_CPLUSPLUS echo "------------------------------------------------------------------" echo "2. Section: Options for the configure script" echo "------------------------------------------------------------------" dnl ------------------------------------------------------------------ dnl --- dnl Check whether to enable debugging dnl dnl defines: ECA_AM_DEBUG_MODE dnl modifies: AM_CXXFLAGS, AM_CFLAGS dnl --- AC_MSG_CHECKING(whether to enable debugging) AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) include_debug=yes ;; n | no) AC_MSG_RESULT(no) include_debug=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-debug: $enableval]) ;; esac ] ) AM_CONDITIONAL(ECA_AM_DEBUG_MODE, test x$include_debug = xyes) if test x$include_debug = xyes; then EXTRADEBUGFLAGS="-Wall -O" AC_DEFINE([ECA_DEBUG_MODE], 1, [debugging mode build]) else EXTRADEBUGFLAGS="-DNDEBUG" fi AM_CXXFLAGS="$AM_CXXFLAGS $EXTRADEBUGFLAGS" AM_CFLAGS="$AM_CFLAGS $EXTRADEBUGFLAGS" dnl ------------------------------------------------------------------ dnl --- dnl Check for experimental mode dnl dnl defines: ECA_FEELING_EXPERIMENTAL, ECA_AM_FEELING_EXPERIMENTAL dnl --- AC_ARG_ENABLE(experimental, [ --enable-experimental Enable experimental code (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) experimental=yes ;; n | no) AC_MSG_RESULT(no) experimental=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-experimental: $enableval]) ;; esac ]) if test x$experimental = xyes; then AC_DEFINE([ECA_FEELING_EXPERIMENTAL], 1, [enable experimental features]) fi AM_CONDITIONAL(ECA_AM_FEELING_EXPERIMENTAL, test x$experimental = xyes) dnl ------------------------------------------------------------------ dnl --- dnl Sets the ecasound prefix variable dnl dnl defines: ECA_PREFIX, ECA_S_PREFIX dnl --- dnl Define ecaprefix, prefer user-specified prefix if given if test "x${prefix}" = "xNONE"; then ecaprefix=${ac_default_prefix} else ecaprefix=${prefix} fi ECA_S_PREFIX=${ecaprefix} AC_SUBST(ECA_S_PREFIX) AC_DEFINE_UNQUOTED([ECA_PREFIX], "${ecaprefix}", [Ecasound configure script prefix]) dnl ------------------------------------------------------------------ dnl --- dnl Check whether to enable design-by-contract assertations dnl dnl modifies: AM_CXXFLAGS, AM_CFLAGS dnl --- AC_MSG_CHECKING(whether to check design-by-contract assertions) enable_dbc_d=yes AC_ARG_ENABLE(dbc, [ --disable-dbc Don't check design-by-contract assertions (default = check)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) enable_dbc_d=yes ;; n | no) AC_MSG_RESULT(no) enable_dbc_d=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-dbc: $enableval]) ;; esac ],[ AC_MSG_RESULT(yes) ] ) if test x$enable_dbc_d = xyes; then AM_CXXFLAGS="$AM_CXXFLAGS -DENABLE_DBC" AM_CFLAGS="$AM_CFLAGS -DENABLE_DBC" fi dnl ------------------------------------------------------------------ dnl --- dnl Check whether to disable effects dnl dnl defines: ECA_AM_DISABLE_EFFECTS, ECA_DISABLE_EFFECTS dnl --- AC_MSG_CHECKING(whether to enable effects) AC_ARG_ENABLE(effects, [ --disable-effects Disable effects (default = no)], [ echo "Enableval: ${enableval}." case "$enableval" in y | yes) AC_MSG_RESULT(yes) enable_effects_d=yes ;; n | no) AC_MSG_RESULT(no) enable_effects_d=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-effects: $enableval]) ;; esac ],[ AC_MSG_RESULT(yes) enable_effects_d=yes ] ) AM_CONDITIONAL(ECA_AM_DISABLE_EFFECTS, test x$enable_effects_d = xno) if test x$enable_effects_d = xno; then AC_DEFINE([ECA_DISABLE_EFFECTS], 1, [disable all effects]) fi dnl ------------------------------------------------------------------ dnl --- dnl Check for extra compile flags dnl dnl modifies: ECA_S_EXTRA_CPPFLAGS, ECA_S_EXTRA_LIBS dnl --- AC_ARG_WITH(extra-cppflags, [ --with-extra-cppflags=FLAGS pass extra flags to cpp ], [ ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${withval}" ]) AC_ARG_WITH(extra-libs, [ --with-extra-libs=FLAGS pass extra flags to linker ], [ ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${withval}" ]) dnl ------------------------------------------------------------------ dnl --- dnl Check for LFS (--with-largefile, --disable-largefile dnl dnl NOTE: AC_CHECK_LARGEFILE is defined in acinlude.m4 and dnl use AC_SYS_LARGEFILE to perform the check. dnl dnl Refs: dnl http://www.gnu.org/software/hello/manual/autoconf/System-Services.html dnl http://ac-archive.sourceforge.net/largefile/future.html dnl dnl defines: enable_largefile dnl --- AC_CHECK_LARGEFILE dnl ------------------------------------------------------------------ dnl ------------------------------------------------------------------ dnl --- dnl Check for OSS driver support dnl dnl defines: ECA_COMPILE_OSS, ECA_AM_COMPILE_OSS dnl --- AC_CHECK_HEADER(sys/soundcard.h,oss_support=yes,oss_support=no) AC_ARG_ENABLE(oss, [ --disable-oss Disable OSS (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) oss_support=yes ;; n | no) AC_MSG_RESULT(no) oss_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-oss: $enableval]) ;; esac ]) AM_CONDITIONAL(ECA_AM_COMPILE_OSS, test x$oss_support = xyes) if test x$oss_support = xyes; then AC_DEFINE([ECA_COMPILE_OSS], 1, [enable OSS audio input/output]) fi dnl --- dnl Disabling OSS trigger functions dnl dnl defines: ECA_DISABLE_OSS_TRIGGER dnl --- AC_ARG_ENABLE(osstrigger, [ --disable-osstrigger Disable the use of OSS trigger functions (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) osstrigger=yes ;; n | no) AC_MSG_RESULT(no) osstrigger=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-osstrigger: $enableval]) ;; esac ]) if test x$osstrigger = xyes; then AC_DEFINE([ECA_DISABLE_OSS_TRIGGER], 1, [disable use of OSS trigger API]) fi dnl ------------------------------------------------------------------ dnl -- dnl Check for aRts support dnl dnl defines: ECA_AM_COMPILE_ARTS, ECA_COMPILE_ARTS dnl modifies: ECA_S_EXTRA_CPPFLAGS, ECA_S_EXTRA_LIBS dnl -- AC_PATH_PROG(ARTSC_CONFIG,artsc-config,none) if test x$ARTSC_CONFIG = xnone; then arts_support=no else arts_support=yes ECA_ARTSC_CFLAGS="`$ARTSC_CONFIG --cflags`" ECA_ARTSC_LIBS="`$ARTSC_CONFIG --libs`" fi if test x$arts_support = xyes; then old_LIBS=$LIBS LIBS="$LIBS $ECA_ARTSC_LIBS" old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $ECA_ARTSC_CFLAGS" AC_LANG_C AC_TRY_LINK( [ #include ], [ arts_init(); return 0; ], [ /bin/true ], [ arts_support=no ] ) AC_LANG_CPLUSPLUS LIBS=${old_LIBS} CFLAGS=${old_CFLAGS} fi AC_ARG_ENABLE(arts, [ --disable-arts Disable aRts support (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) arts_support=yes ;; n | no) AC_MSG_RESULT(no) arts_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-arts: $enableval]) ;; esac ]) AM_CONDITIONAL(ECA_AM_COMPILE_ARTS, test x$arts_support = xyes) if test x$arts_support = xyes; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_ARTSC_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_ARTSC_LIBS}" AC_DEFINE([ECA_COMPILE_ARTS], 1, [enable aRts support]) fi dnl ------------------------------------------------------------------ dnl -- dnl Check for libsamplerate dnl dnl defines: ECA_AM_COMPILE_SAMPLERATE, ECA_COMPILE_SAMPLERATE dnl modifies: ECA_S_EXTRA_CPPFLAGS, ECA_S_EXTRA_LIBS dnl -- AC_CHECK_HEADER(samplerate.h,samplerate_support=yes,samplerate_support=no) AC_ARG_WITH(libsamplerate, [ --with-libsamplerate=DIR Compile against libsamplerate installed in DIR], [ ECA_SAMPLERATE_LIBS="-L${withval}/lib" ECA_SAMPLERATE_INCLUDES="-I${withval}/include" samplerate_support=yes ]) AC_ARG_ENABLE(libsamplerate, [ --disable-libsamplerate Disable libsamplerate support (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) samplerate_support=yes ;; n | no) AC_MSG_RESULT(no) samplerate_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-samplerate: $enableval]) ;; esac ]) AM_CONDITIONAL(ECA_AM_COMPILE_SAMPLERATE, test x$samplerate_support = xyes) if test x$samplerate_support = xyes; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_SAMPLERATE_INCLUDES}" ECA_SAMPLERATE_LIBS="${ECA_SAMPLERATE_LIBS} -lsamplerate" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_SAMPLERATE_LIBS}" AC_DEFINE([ECA_COMPILE_SAMPLERATE], 1, [enable libsamplerate support]) fi dnl ------------------------------------------------------------------ dnl -- dnl Checks for pyecasound dnl dnl defines: ECA_S_PYTHON_INCLUDES, ECA_S_PYTHON_DLMODULES, dnl ECA_AM_PYECASOUND_CEXT, ECA_AM_PYECASOUND_INSTALL dnl -- dnl default impl depends on target platform pyecasound_support=${eca_platform_python_impl} AC_ARG_ENABLE(pyecasound, [ --enable-pyecasound Enable compilation of pyecasound (default = python)], [ case "$enableval" in y | yes) pyecasound_support=python ;; n | no | none) pyecasound_support=none ;; python) pyecasound_support=python ;; *) pyecasound_support=python ;; esac ]) dnl -- dnl Python interpreter and installation prefix AC_PATH_PROG(PYTHONPATH,python,none) if test x$PYTHONPATH = xnone; then pyecasound_support=none python_install_prefix="" else python_install_prefix=`python -c "import sys; print (sys.prefix)"` fi dnl -- dnl Python modules AC_MSG_CHECKING([for Python libraries]) AC_ARG_WITH(python-modules, [ --with-python-modules=DIR install Python modules in DIR]) if test "X$with_python_modules" = "X" then if test x${python_install_prefix} != x${ecaprefix} -a \ x${ecaprefix} != x/usr -a \ x${ecaprefix} != x/usr/local ; then pyecasound_support=none AC_MSG_RESULT([none]) if test x$PYTHONPATH != xnone; then python_prefix_tmp=`python -c "import sys; print (sys.prefix + '/lib/python' + sys.version[[:3]])"` else python_prefix_tmp="DIR" fi AC_MSG_WARN([ *** *** Python modules won't be installed as the module install prefix does *** not match ecasound's build prefix! To override, set python *** module directory explicitly (for example *** "--with-python-modules=${python_prefix_tmp}"). *** ]) else pymoddirs="/usr/local/lib /usr/lib" dnl -- Double-brackets to espace the real brackets pymoddirsmore=`python -c "import sys; print (sys.prefix + '/lib/python' + sys.version[[:3]])"` pymoddirs="$pymoddirs $pymoddirsmore" AC_MSG_RESULT($pymoddirs) fi else pymoddirs=$with_python_modules AC_MSG_RESULT($pymoddirs) fi dnl --- dnl a hack to support broken debian python installs AC_ARG_ENABLE(python-force-site-packages, [ --enable-python-force-site-packages force install Python modules into site-packages even when it doesn't exist [default=no] ], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) python_force_site_packages=yes ;; n | no) AC_MSG_RESULT(no) python_force_site_packages=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-python-force-site-packages: $enableval]) ;; esac ]) AC_FIND_FILE(lib-dynload,$pymoddirs,ECA_S_PYTHON_MODULES) dnl Use site-packages in preference if it is there. if test -d $ECA_S_PYTHON_MODULES/site-packages -o "X$python_force_site_packages" = "Xyes" then ECA_S_PYTHON_MODULES=$ECA_S_PYTHON_MODULES/site-packages ECA_S_PYTHON_DLMODULES=$ECA_S_PYTHON_MODULES else ECA_S_PYTHON_DLMODULES=$ECA_S_PYTHON_MODULES/lib-dynload fi AC_SUBST(ECA_S_PYTHON_MODULES) AC_SUBST(ECA_S_PYTHON_DLMODULES) dnl if test x$disable_pyecasound = xyes ; then pyecasound_support=no ; fi AM_CONDITIONAL(ECA_AM_PYECASOUND_CEXT, test x$pyecasound_support = xc) AM_CONDITIONAL(ECA_AM_PYECASOUND_INSTALL, test x$pyecasound_support != xnone) dnl ------------------------------------------------------------------ dnl -- dnl Checks for rubyecasound dnl dnl defines: ECA_S_RUBY_SITEDIR, dnl ECA_AM_RUBYECASOUND_INSTALL dnl -- dnl default to enabled if Ruby interpreter available rubyecasound_support=yes AC_ARG_ENABLE(rubyecasound, [ --enable-rubyecasound Enable rubyecasound (default = yes)], [ case "$enableval" in y | yes) rubyecasound_support=yes ;; n | no | none) rubyecasound_support=no ;; *) rubyecasound_support=no ;; esac ]) dnl -- dnl Ruby interpreter and installation prefix AC_PATH_PROG(RUBYPATH,ruby,none) if test x$RUBYPATH = xnone; then rubyecasound_support=no ECA_S_RUBY_SITEDIR="" else ECA_S_RUBY_SITEDIR="`ruby -e 'require "rbconfig"; include RbConfig; print CONFIG[["sitedir"]] + "/" + CONFIG[["MAJOR"]] + "." + CONFIG[["MINOR"]]'`" fi AC_SUBST(ECA_S_RUBY_SITEDIR) AM_CONDITIONAL(ECA_AM_RUBYECASOUND_INSTALL, test x$rubyecasound_support = xyes) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "3. Section: Programs " echo "------------------------------------------------------------------" dnl ------------------------------------------------------------------ AC_CHECK_CXX_NAMESPACE_SUPPORT dnl ------------------------------------------------------------------ dnl -- dnl Autotools and libtool dnl -- AC_LANG_C dnl do not add 'AC_DISABLE_SHARED' as pyecasound needs shared dnl objects at link time (note that all the major libs are static) AC_PROG_LIBTOOL AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "4. Section: Libraries" echo "------------------------------------------------------------------" dnl --- dnl Check system libraries dnl --- dnl switch to C for testing AC_LANG_C dnl see also section 7 - functions AC_SEARCH_LIBS(inet_ntoa, socket nsl,, AC_MSG_ERROR([*** required inet_ntoa() function not found! ***])) AC_SEARCH_LIBS(nanosleep, rt posix4) AC_SEARCH_LIBS(sched_setscheduler, rt posix4) AC_SEARCH_LIBS(socket, socket nsl,, AC_MSG_ERROR([*** required socket() function not found! ***])) AC_SEARCH_LIBS(sin, m,, AC_MSG_ERROR([*** required sin() function not found! ***])) AC_SEARCH_LIBS(dlopen, dl,, AC_MSG_ERROR([*** required dlopen() function not found! ***])) dnl switch back to C++ AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ dnl --- dnl Checks for ncurses/termcap dnl dnl defines: ECA_AM_USE_NCURSES, ECA_AM_USE_TERMCAP, ECA_USE_NCURSES_H, dnl ECA_USE_CURSES_H, ECA_HAVE_NCURSES_CURSES_H dnl --- dnl switch to C for testing AC_LANG_C AC_CHECK_LIB(ncurses, main, termcap_library=ncurses, AC_CHECK_LIB(termcap, main, termcap_library=termcap, termcap_library=none)) AC_ARG_ENABLE(ncurses, [ --disable-ncurses Disable ncurses (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) termcap_library=ncurses ;; n | no) AC_MSG_RESULT(no) termcap_library=none ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-ncurses: $enableval]) ;; esac ]) AM_CONDITIONAL(ECA_AM_USE_NCURSES, test $termcap_library = ncurses) AM_CONDITIONAL(ECA_AM_USE_TERMCAP, test $termcap_library = termcap) if test x$termcap_library = xtermcap; then AC_CHECK_HEADER(curses.h, AC_DEFINE([ECA_USE_CURSES_H], 1, [use ncurses.h for curses interface]), AC_MSG_ERROR([*** curses.h not found! Try with "./configure --disable-ncurses". ***])) fi if test x$termcap_library = xncurses; then AC_CHECK_HEADER(ncurses/ncurses.h, AC_DEFINE([ECA_USE_NCURSES_NCURSES_H], 1, [ncurses headers are installed in ncurses subdir ]), [ AC_CHECK_HEADER(ncurses.h, AC_DEFINE([ECA_USE_NCURSES_H], 1, [use curses.h for curses interface]), AC_MSG_ERROR([*** Neither ncurses.h or ncurses/ncurses.h found! Try with "./configure --disable-ncurses". ***])) ]) fi if test $termcap_library = xnone ; then eca_platform_curses_support=no fi dnl switch back to C++ AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ dnl --- dnl Audiofile library dnl dnl defines: ECA_AM_COMPILE_AUDIOFILE, ECA_COMPILE_AUDIOFILE dnl modifies: ECA_S_EXTRA_LIBS dnl --- AC_CHECK_LIB(audiofile,main,af_support=yes,af_support=no) AC_ARG_ENABLE(audiofile, [ --disable-audiofile Disable libaudiofile (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) af_support=yes ;; n | no) AC_MSG_RESULT(no) af_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-audiofile: $enableval]) ;; esac ] ) AM_CONDITIONAL(ECA_AM_COMPILE_AUDIOFILE, test x$af_support = xyes) if test x$af_support = xyes; then ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -laudiofile" AC_DEFINE([ECA_COMPILE_AUDIOFILE], 1, [enable libaudiofile support]) fi dnl ------------------------------------------------------------------ dnl --- dnl Libsndfile support dnl dnl defines: ECA_AM_COMPILE_SNDFILE, ECA_COMPILE_SNDFILE dnl --- AC_CHECK_LIB(sndfile,main,sndfile_support=yes,sndfile_support=no) AC_ARG_ENABLE(sndfile, [ --disable-sndfile Disable libsndfile (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) sndfile_support=yes ;; n | no) AC_MSG_RESULT(no) sndfile_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-sndfile: $enableval]) ;; esac ] ) if test x$sndfile_support = xyes; then AC_LANG_C AC_TRY_LINK( [ #include ], [ SF_INFO sfinfo; sfinfo.frames = 0; return 0; ], [ /bin/true ], [ sndfile_support=no AC_MSG_WARN([Found an old version of libsndfile. Libsndfile 1.0.0 or newer is required.]) ] ) AC_LANG_CPLUSPLUS fi AM_CONDITIONAL(ECA_AM_COMPILE_SNDFILE, test x$sndfile_support = xyes) if test x$sndfile_support = xyes; then ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -lsndfile" AC_DEFINE([ECA_COMPILE_SNDFILE], 1, [enable libsndfile support]) fi dnl ------------------------------------------------------------------ dnl --- dnl Check for ALSA driver support dnl dnl defines: ECA_AM_COMPILE_ALSA dnl --- AC_ARG_ENABLE(alsa, [ --disable-alsa Disable ALSA (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) alsa_support=yes ;; n | no) AC_MSG_RESULT(no) alsa_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-alsa: $enableval]) ;; esac ]) if test x$alsa_support = x; then AC_CHECK_LIB(asound, snd_pcm_delay, alsa_support=yes, [ alsa_support=no AC_MSG_WARN([ALSA version older than 0.9.0 not supported - update to a newer version or compile with --disable-alsa]) ]) fi AC_LANG_C AC_SEARCH_LIBS(snd_pcm_open, asound) AC_CHECK_FUNCS(snd_pcm_sw_params_set_tstamp_type) AC_LANG_CPLUSPLUS AM_CONDITIONAL(ECA_AM_COMPILE_ALSA, test x$alsa_support = xyes) if test x$alsa_support = xyes; then ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -lasound" AC_DEFINE([ECA_COMPILE_ALSA], 1, [enable ALSA support]) fi dnl ------------------------------------------------------------------ AC_CHECK_JACK ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_S_JACK_INCLUDES}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_S_JACK_LIBS}" dnl ------------------------------------------------------------------ dnl --- dnl Check for already installed libkvutils dnl dnl defines: ECA_AM_KVUTILS_INSTALLED dnl --- AC_CHECK_LIB(kvutils,main,kvutils_installed=yes,kvutils_installed=no) AM_CONDITIONAL(ECA_AM_KVUTILS_INSTALLED, test x$kvutils_installed = xyes) dnl ------------------------------------------------------------------ dnl -- dnl Check whether to use an already installed readline library dnl dnl defines: ECA_AM_SYSTEM_READLINE, ECA_S_READLINE_INCLUDES, dnl ECA_S_READLINE_LIBS dnl -- AC_MSG_CHECKING(whether to build with system readline) AC_ARG_ENABLE(sys_readline, [ --enable-sys-readline Compile with system readline (default=yes)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) enable_sysreadline=yes ;; n | no) AC_MSG_RESULT(no) enable_sysreadline=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-sys-readline: $enableval]) ;; esac ], [ AC_MSG_RESULT(yes) enable_sysreadline=yes ] ) dnl Check for readline.h or readline/readline.h (same with history.h) dnl and for readline and history libraries if test x$enable_sysreadline = xyes; then AC_CHECK_HEADER(readline.h, ECA_S_READLINE_INCLUDES=/usr/include, [AC_CHECK_HEADER(readline/readline.h, ECA_S_READLINE_INCLUDES=/usr/include/readline, [ AC_MSG_WARN([*** readline headers not installed ***]) enable_sysreadline=no ])]) AC_CHECK_HEADER(history.h,, [AC_CHECK_HEADER(readline/history.h,, [ AC_MSG_WARN([*** readline history headers not installed ***]) enable_sysreadline=no ]) ]) if test x${termcap_library} = xnone; then readline_extra_libs=""; else readline_extra_libs="-l${termcap_library}" fi AC_CHECK_LIB(readline, main, ECA_S_READLINE_LIBS="-lreadline", [ AC_MSG_WARN([*** readline support not installed ***]) enable_sysreadline=no ], ${readline_extra_libs}) AC_CHECK_LIB(history, main, ECA_S_READLINE_LIBS="${ECA_S_READLINE_LIBS} -lhistory", [ AC_MSG_WARN([*** readline support not installed ***]) enable_sysreadline=no ], ${readline_extra_libs}) else ECA_S_READLINE_INCLUDES="" ECA_S_READLINE_LIBS="" fi # if no readline library is found, disable platform-curses toggle if test $enable_sysreadline = no ; then eca_platform_curses_support=no fi AM_CONDITIONAL(ECA_AM_SYSTEM_READLINE, test x$enable_sysreadline = xyes) AC_SUBST(ECA_S_READLINE_INCLUDES) AC_SUBST(ECA_S_READLINE_LIBS) dnl ------------------------------------------------------------------ dnl -- dnl Check for liboil (optional) dnl -- PKG_CHECK_MODULES([LIBOIL], [liboil-0.3], HAVE_LIBOIL=yes, HAVE_LIBOIL=no) AC_MSG_CHECKING(whether to use liboil) AC_ARG_ENABLE(liboil, [ --enable-liboil Use liboil if available (default=no)], [ case "$enableval" in y | yes) if test "x${HAVE_LIBOIL}" = xyes ; then AC_MSG_RESULT(yes) enable_liboil=yes else AC_MSG_RESULT(no) AC_MSG_WARN([--enable-liboil given but liboil library not available]) fi ;; n | no) AC_MSG_RESULT(no) enable_liboil=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-liboil: $enableval]) ;; esac ], [ if test "x${HAVE_LIBOIL}" = xyes ; then AC_MSG_RESULT(yes) enable_liboil=yes else AC_MSG_RESULT(no) AC_MSG_WARN([disabling liboil as library devel files are not available]) fi ] ) if test "x${enable_liboil}" = "xyes" ; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBOIL_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBOIL_LIBS}" AC_DEFINE([ECA_USE_LIBOIL], 1, [Use liboil]) fi dnl ------------------------------------------------------------------ dnl -- dnl Check for liblilv (optional) dnl -- AC_MSG_CHECKING(whether to use liblilv for LV2 support) AC_ARG_ENABLE(liblilv, [ --enable-liblilv Use liblilv if available (default=yes)], [ case "$enableval" in y | yes) PKG_CHECK_MODULES([LIBLILV], [lv2 lilv-0], HAVE_LIBLILV=yes, HAVE_LIBLILV=no) if test "x${HAVE_LIBLILV}" = xyes ; then AC_MSG_RESULT(yes) enable_liblilv=yes else AC_MSG_RESULT(no) AC_MSG_WARN([--enable-liblilv given but liblilv library not available]) fi ;; n | no) AC_MSG_RESULT(no) enable_liblilv=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-liblilv: $enableval]) ;; esac ], [ PKG_CHECK_MODULES([LIBLILV], [lv2core lilv-0 > 0.5.0 ], HAVE_LIBLILV=yes, HAVE_LIBLILV=no) enable_liblilv=${HAVE_LIBLILV} AC_MSG_RESULT(${enable_liblilv}) ] ) if test "x${enable_liblilv}" = "xyes" ; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBLILV_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBLILV_LIBS}" AC_DEFINE([ECA_USE_LIBLILV], 1, [Use liblilv for LV2 support]) fi dnl ------------------------------------------------------------------ dnl -- dnl Check for liblo (optional) dnl -- PKG_CHECK_MODULES([LIBLO], [liblo], HAVE_LIBLO=yes, HAVE_LIBLO=no) AC_MSG_CHECKING(whether to use liblo for OSC support) AC_ARG_ENABLE(liblo, [ --enable-liblo Use liblo if available (default=yes)], [ case "$enableval" in y | yes) if test "x${HAVE_LIBLO}" = xyes ; then AC_MSG_RESULT(yes) enable_liblo=yes else AC_MSG_RESULT(no) AC_MSG_WARN([--enable-liblo given but liblo library not available]) fi ;; n | no) AC_MSG_RESULT(no) enable_liblo=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-liblo: $enableval]) ;; esac ], [ enable_liblo=${HAVE_LIBLO} AC_MSG_RESULT(${enable_liblo}) ] ) if test "x${enable_liblo}" = "xyes" ; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBLO_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBLO_LIBS}" AC_DEFINE([ECA_USE_LIBLO], 1, [Use liblo for OSC support]) fi dnl ------------------------------------------------------------------ dnl All non-std external libraries that libecasound depends on AC_SUBST(ECA_S_EXTRA_CPPFLAGS) AC_SUBST(ECA_S_EXTRA_LIBS) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "5. Section: Headers" echo "------------------------------------------------------------------" dnl ------------------------------------------------------------------ dnl --- dnl Checks for system header files. dnl --- AC_HEADER_TIME dnl Note! Header filenames must be on the same line! AC_CHECK_HEADERS(dlfcn.h errno.h fcntl.h regex.h signal.h unistd.h sys/poll.h sys/stat.h sys/socket.h sys/time.h sys/types.h sys/wait.h sys/select.h,, AC_MSG_ERROR([*** not all required header files were found ***])) AC_CHECK_HEADERS(execinfo.h features.h inttypes.h locale.h ladspa.h sched.h stdint.h sys/mman.h termios.h) dnl ------------------------------------------------------------------ dnl --- dnl C++ specific checks dnl --- dnl AC_HEADER_STDC AC_HEADER_STDC dnl --- AC_CHECK_HEADER(stl.h,, dnl --- AC_MSG_WARN([** C++/STL header files not found! ***])) AC_LANG_CPLUSPLUS AC_CHECK_HEADER(map,nostlmap=0,nostlmap=1) if test "x$nostlmap" = "x1" ; then AC_MSG_ERROR([C++ header files not found! Searched for '' (STL).]) fi dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "6. Section: Typedefs and structures" echo "------------------------------------------------------------------" dnl --- dnl Checks for typedefs, structures, and compiler characteristics. dnl --- AC_LANG_C dnl AC_C_CONST AC_C_BIGENDIAN AC_TYPE_SIZE_T AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "7. Section: Functions" echo "------------------------------------------------------------------" dnl --- dnl Checks for functions. dnl --- AC_LANG_C AC_FUNC_MMAP AC_CHECK_FUNCS(execvp gettimeofday pthread_mutexattr_init,, AC_MSG_ERROR([*** not all required library functions were found ***])) AC_CHECK_FUNCS(clock_gettime) AC_CHECK_FUNCS(mlockall) AC_CHECK_FUNCS(munlockall) AC_CHECK_FUNCS(nanosleep) AC_CHECK_FUNCS(pause) AC_CHECK_FUNCS(posix_memalign) AC_CHECK_FUNCS(pthread_self) AC_CHECK_FUNCS(pthread_getschedparam) AC_CHECK_FUNCS(pthread_setschedparam) AC_CHECK_FUNCS(pthread_sigmask) AC_CHECK_FUNCS(pthread_kill) AC_CHECK_FUNCS(sched_get_priority_max) AC_CHECK_FUNCS(sched_getparam) AC_CHECK_FUNCS(sched_getscheduler) AC_CHECK_FUNCS(sched_setscheduler) AC_CHECK_FUNCS(setlocale) AC_CHECK_FUNCS(sigprocmask) AC_CHECK_FUNCS(sigwait) AC_CHECK_FUNCS(usleep) AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ dnl --- dnl Check whether to disable all use of shared libs dnl dnl Note! Must be run after all other autoconf tests as dnl 'ld' doesn't understand -all-static. dnl dnl defines: ECA_STATIC_ONLY, ECA_AM_STATIC_ONLY dnl modifies: AM_CXXFLAGS, AM_CFLAGS, AM_LDFLAGS dnl --- AC_ARG_ENABLE(all-static, [ --enable-all-static Build only static binaries (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) enable_all_static=yes ;; n | no) AC_MSG_RESULT(no) enable_all_static=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-all-static: $enableval]) ;; esac ]) if test x$enable_all_static = xyes; then AC_DEFINE([ECA_ALL_STATIC], 1, [disable all use of shared libs]) AM_CXXFLAGS="$AM_CXXFLAGS -static" AM_CFLAGS="$AM_CFLAGS -static" AM_LDFLAGS="$AM_LDFLAGS -Bstatic -all-static" fi AM_CONDITIONAL(ECA_AM_ALL_STATIC, test x$enable_all_static = xyes) dnl ------------------------------------------------------------------ dnl --- dnl Checks for platform options dnl --- if test $eca_platform_curses_support == yes ; then AC_DEFINE([ECA_PLATFORM_CURSES], 1, [enable ecasound curses console interface]) fi dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "8. Section: Output" echo "------------------------------------------------------------------" dnl --- dnl Create output files dnl --- AC_OUTPUT([ Makefile libecasound/Makefile libecasound/libecasound-config libecasound/plugins/Makefile libecasoundc/Makefile libecasoundc/libecasoundc-config pyecasound/Makefile rubyecasound/Makefile ecasound/Makefile ecatools/Makefile kvutils/Makefile Documentation/Makefile Documentation/users_guide/Makefile Documentation/programmers_guide/Makefile examples/Makefile ]) dnl --- dnl Print summary of the configured options dnl --- echo "-----------------------------------------------------------------" echo "Following packages are now configured:" echo "ecasound: yes (ecasound,libecasound,libecasoundc)" echo "ecatools: yes" if test x$pyecasound_support != xnone ; then if test x$pyecasound_support = xc ; then echo "pyecasound: yes (as Python C extension module)" else echo "pyecasound: yes (as native Python module)" fi else echo "pyecasound: no" fi if test x$rubyecasound_support = xyes ; then echo "rubyecasound: yes" else echo "rubyecasound: no" fi echo "libkvutils: yes" echo "-----------------------------------------------------------------" echo "Compiler options:" echo "CFLAGS: $AM_CFLAGS $CFLAGS" echo "CXXFLAGS: $AM_CXXFLAGS $CXXFLAGS" echo "CPPFLAGS: $AM_CPPFLAGS $CPPFLAGS" echo "LDFLAGS: $AM_LDFLAGS $LDFLAGS" echo "-----------------------------------------------------------------" echo "Following features were selected:" if test x$include_debug = xyes ; then echo "Debugging info: yes" else echo "Debugging info: no" fi if test x$enable_effects_d = xyes ; then echo "Effects enabled: yes" else echo "Effects enabled: no" fi if test x$termcap_library = xtermcap ; then echo "Termcap: termcap" fi if test x$termcap_library = xncurses; then echo "Termcap: ncurses" fi if test x$termcap_library = xnone; then echo "Termcap: none" fi if test x$enable_sysreadline = xyes ; then echo "Use system readline: yes" else echo "Use system readline: no" fi echo "Use curses interface: $eca_platform_curses_support" if test x$af_support = xyes ; then echo "Libaudiofile: yes" else echo "Libaudiofile: no" fi if test x$sndfile_support = xyes ; then echo "Libsndfile: yes" else echo "Libsndfile: no" fi if test x$alsa_support = xyes ; then echo "ALSA support: yes" else echo "ALSA support: no" fi if test x$oss_support = xyes ; then echo "OSS support: yes" else echo "OSS support: no" fi if test x$arts_support = xyes ; then echo "aRts support: yes" else echo "aRts support: no" fi if test x$jack_support = xyes ; then echo "JACK support: yes" else echo "JACK support: no" fi if test x$samplerate_support = xyes ; then echo "Libsamplerate support yes" else echo "Libsamplerate support no" fi if test x$enable_liblilv = xyes ; then echo "LV2 (liblilv) support: yes" else echo "LV2 (liblilv) support: no" fi if test x$enable_liboil = xyes ; then echo "Liboil support: yes" else echo "Liboil support: no" fi if test x$enable_liblo = xyes ; then echo "Liblo (OSC) support: yes" else echo "Liblo (OSC) support: no" fi echo "-----------------------------------------------------------------" echo "Following directories are used:" echo "Directory prefix: "$ECA_S_PREFIX if test x$pyecasound_support = xc ; then echo "Python include dir: "$ECA_S_PYTHON_INCLUDES fi if test x$pyecasound_support != xnone ; then echo "Python module dir: "$ECA_S_PYTHON_MODULES fi if test x$rubyecasound_support != xnone ; then echo "Ruby module dir: "$ECA_S_RUBY_SITEDIR fi if test "x$ECA_S_EXTRA_CPPFLAGS" != "x" ; then echo "Extra headers: "$ECA_S_EXTRA_CPPFLAGS fi if test "x$ECA_S_EXTRA_LIBS" != "x" ; then echo "Extra libs: "$ECA_S_EXTRA_LIBS fi echo "-------------------------------------------------------------------" echo "Type 'make' to compile the package and 'make install' to install." echo "Remember to use GNU Make, often installed as 'gmake'." echo "-------------------------------------------------------------------" dnl ------------------------------------------------------------------ dnl X. Section: End dnl ------------------------------------------------------------------ ecasound-2.9.3/config.sub0000755000076400007640000010645013604135372012254 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ecasound-2.9.3/install-sh0000755000076400007640000003601013604135372012267 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ecasound-2.9.3/COPYING0000644000076400007640000000146210664032032011311 00000000000000======================================================================= *** Ecasound - Licensing/distribution policy *** ======================================================================= Copyright (C) 1997-2006 Kai Vehmanen and others (see ecasound/AUTHORS). Ecasound is freely distributable according to the terms of the GNU General Public License (see the file 'COPYING.GPL'). This program is distributed without any warranty. See the file 'COPYING.GPL' for details. As an exception to the above, the C, C++ and python implementations of the Ecasound Control Interface (ECI) are licensed under the LGPL (see the file 'COPYING.LGPL'). This allows writing ECI applications that are not licensed under GPL. ======================================================================= ecasound-2.9.3/generic_oscillators0000755000076400007640000000145211746757206014260 00000000000000# -------------------------------------------------------------------- # ecasound / generic oscillator presets # -------------------------------------------------------------------- # # - all lines beginning with a '#' are ignored # - '\' can be used to break long lines # - preset format: # "preset_number start_value end_value pos1 value1 pos2 value2 ..." # - requirements: # - all specified positions and values must be between 0.0 and 1.0 # - pos1 < pos2 < ... < posN # - there must be a posN for every valueN # # -------------------------------------------------------------------- # # a triangle wave - start=0.0, end=0.0, pos1=0.5, value1=1.00 0 = 0.0 0.0 0.5 1.00 # linear wave - start=0.0 end=1.0 1 = 0.0 1.0 # random bounces 2 = 0.5 0.5 0.2 0.1 0.3 0.7 0.4 0.1 0.5 0.9 0.6 0.05 0.8 0.9 0.2 ecasound-2.9.3/TODO0000644000076400007640000000171211137704671010757 00000000000000----------------------------------------------------------------------- *** Ecasound - To do list / Plans *** ----------------------------------------------------------------------- Ecasound bug tracker at sourceforge.net ----------------------------------------------------------------------- The Ecasound bug tracker at sourceforge.net is also used to track feature requests: - https://sourceforge.net/tracker/?group_id=4605&atid=104605 This same tracker is used for both longstanding bugs, as well as for keeping tracking of feature/improvement requests. It replaces the old Ecasound Development Item practise (items marked with 'edi-x' tags) that was used during years 2002-08. Active development areas ----------------------------------------------------------------------- Probably the best way to follow active development is to subscribe to the ecasound-list mailing list (see the "Mailing lists" section in README). ecasound-2.9.3/ecasoundrc.in0000644000076400007640000000266012501305527012741 00000000000000# settings decided at build time ecasound-version = @VERSION@ resource-directory = @pkgdatadir@ resource-file-genosc-envelopes = generic_oscillators resource-file-effect-presets = effect_presets ladspa-plugin-directory = @prefix@/lib/ladspa # settings that affect creation of chainsetups (examples) #midi-device = rawmidi,/dev/midi #default-output = autodetect #default-audio-format = s16_le,2,44100,i #default-to-precise-sample-rates = false default-mix-mode = avg #bmode-defaults-nonrt = 1024,false,50,false,100000,true #bmode-defaults-rt = 1024,true,50,true,100000,true #bmode-defaults-rtlowlatency = 256,true,50,true,100000,false # commands for launching external programs #ext-cmd-text-editor = nano #ext-cmd-text-editor-use-getenv = true #ext-cmd-wave-editor = ecawave #ext-cmd-mp3-input = mpg123 --stereo -r %s -q -s -k %o %f #ext-cmd-mp3-output = lame -b %B -s %S --little-endian -S - %f #ext-cmd-ogg-input = ogg123 -d raw -o byteorder:%E --file=- %f #ext-cmd-ogg-output = oggenc -b %B --raw --raw-bits=%b --raw-chan=%c --raw-rate=%s --raw-endianness 0 --output=%f - #ext-cmd-mikmod = mikmod -d stdout -o 16s -q -f %s -p 0 --noloops %f #ext-cmd-timidity = timidity -Or1S -id -s %s -o - %f #ext-cmd-flac-input = flac -d -c %f #ext-cmd-flac-output = flac -o %f -f --force-raw-format --channels=%c --bps=%b --sample-rate=%s --sign=%I --endian=%E - #ext-cmd-aac-input = faad -w -b 1 -f 2 -d %f #ext-cmd-aac-output = faac -P -o %f -R %s -B %b -C %c - ecasound-2.9.3/config.h.in0000644000076400007640000001730413606336213012312 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* disable all use of shared libs */ #undef ECA_ALL_STATIC /* enable ALSA support */ #undef ECA_COMPILE_ALSA /* enable aRts support */ #undef ECA_COMPILE_ARTS /* enable libaudiofile support */ #undef ECA_COMPILE_AUDIOFILE /* enable JACK support */ #undef ECA_COMPILE_JACK /* enable OSS audio input/output */ #undef ECA_COMPILE_OSS /* enable libsamplerate support */ #undef ECA_COMPILE_SAMPLERATE /* enable libsndfile support */ #undef ECA_COMPILE_SNDFILE /* debugging mode build */ #undef ECA_DEBUG_MODE /* disable all effects */ #undef ECA_DISABLE_EFFECTS /* disable use of OSS trigger API */ #undef ECA_DISABLE_OSS_TRIGGER /* enable experimental features */ #undef ECA_FEELING_EXPERIMENTAL /* ecasound specific versioning of JACK interface features */ #undef ECA_JACK_FEATSET /* version of JACK transport API to use */ #undef ECA_JACK_TRANSPORT_API /* enable ecasound curses console interface */ #undef ECA_PLATFORM_CURSES /* Ecasound configure script prefix */ #undef ECA_PREFIX /* use ncurses.h for curses interface */ #undef ECA_USE_CURSES_H /* use C++ std namespace */ #undef ECA_USE_CXX_STD_NAMESPACE /* Use liblilv for LV2 support */ #undef ECA_USE_LIBLILV /* Use liblo for OSC support */ #undef ECA_USE_LIBLO /* Use liboil */ #undef ECA_USE_LIBOIL /* use curses.h for curses interface */ #undef ECA_USE_NCURSES_H /* ncurses headers are installed in ncurses subdir */ #undef ECA_USE_NCURSES_NCURSES_H /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define to 1 if you have the `execvp' function. */ #undef HAVE_EXECVP /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LADSPA_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mlockall' function. */ #undef HAVE_MLOCKALL /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the `munlockall' function. */ #undef HAVE_MUNLOCKALL /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the `pause' function. */ #undef HAVE_PAUSE /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Define to 1 if you have the `pthread_getschedparam' function. */ #undef HAVE_PTHREAD_GETSCHEDPARAM /* Define to 1 if you have the `pthread_kill' function. */ #undef HAVE_PTHREAD_KILL /* Define to 1 if you have the `pthread_mutexattr_init' function. */ #undef HAVE_PTHREAD_MUTEXATTR_INIT /* Define to 1 if you have the `pthread_self' function. */ #undef HAVE_PTHREAD_SELF /* Define to 1 if you have the `pthread_setschedparam' function. */ #undef HAVE_PTHREAD_SETSCHEDPARAM /* Define to 1 if you have the `pthread_sigmask' function. */ #undef HAVE_PTHREAD_SIGMASK /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H /* Define to 1 if you have the `sched_getparam' function. */ #undef HAVE_SCHED_GETPARAM /* Define to 1 if you have the `sched_getscheduler' function. */ #undef HAVE_SCHED_GETSCHEDULER /* Define to 1 if you have the `sched_get_priority_max' function. */ #undef HAVE_SCHED_GET_PRIORITY_MAX /* Define to 1 if you have the header file. */ #undef HAVE_SCHED_H /* Define to 1 if you have the `sched_setscheduler' function. */ #undef HAVE_SCHED_SETSCHEDULER /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK /* Define to 1 if you have the `sigwait' function. */ #undef HAVE_SIGWAIT /* Define to 1 if you have the `snd_pcm_sw_params_set_tstamp_type' function. */ #undef HAVE_SND_PCM_SW_PARAMS_SET_TSTAMP_TYPE /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* libecasoundc interface version */ #undef LIBECASOUNDC_VERSION /* libecasound interface version */ #undef LIBECASOUND_VERSION /* libecasound interface age */ #undef LIBECASOUND_VERSION_AGE /* libkvutils interface version */ #undef LIBKVUTILS_VERSION /* libkvutils interface age */ #undef LIBKVUTILS_VERSION_AGE /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define to `unsigned int' if does not define. */ #undef size_t ecasound-2.9.3/rubyecasound/0000755000076400007640000000000013606336217013051 500000000000000ecasound-2.9.3/rubyecasound/Makefile.am0000644000076400007640000000327511172656140015030 00000000000000# ---------------------------------------------------------------------- # File: ecasound/pyecasound/Makefile.am # Description: Ruby implmentation of the Ecasound Control Interface # License: LGPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- AUTOMAKE_OPTIONS = foreign EXTRA_DIST = README \ ecasound.rb \ stresstest.rb # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- if ECA_AM_RUBYECASOUND_INSTALL rubyecasound_install_list1 = $(srcdir)/ecasound.rb rubyecasound_uninstall_list1 = $(DESTDIR)$(ECA_S_RUBY_SITEDIR)/ecasound.rb endif if ECA_AM_RUBYECASOUND_INSTALL TESTS = stresstest.rb endif # ---------------------------------------------------------------------- # hooks # ---------------------------------------------------------------------- # unit test requires "ecasound.rb" in the build directory stresstest.rb: ecasound.rb-STAMP ecasound.rb-STAMP: $(srcdir)/ecasound.rb if test ! -e ecasound.rb ; then $(LN_S) $(srcdir)/ecasound.rb . ; fi touch ecasound.rb-STAMP if ECA_AM_RUBYECASOUND_INSTALL install-exec-hook: $(rubyecasound_install_list1) $(rubyecasound_install_list2) $(INSTALL) -d $(DESTDIR)$(ECA_S_RUBY_SITEDIR) $(INSTALL) $(rubyecasound_install_list1) $(rubyecasound_install_list2) $(DESTDIR)$(ECA_S_RUBY_SITEDIR)/ else install-exec-hook: endif if ECA_AM_RUBYECASOUND_INSTALL uninstall-local: rm -f $(rubyecasound_uninstall_list1) $(rubyecasound_uninstall_list2) rmdir $(DESTDIR)$(ECA_S_RUBY_SITEDIR) || echo "Skipping non-empty directory" else uninstall-local: endif clean-local: rm -vf ecasound.rb-STAMPecasound-2.9.3/rubyecasound/stresstest.rb0000755000076400007640000000563212260762753015555 00000000000000#!/usr/bin/env ruby # ----------------------------------------------------------------------- # Runs a stress test using the ruby-ecasound ControlInterface # Jan Weil # Adapted from original code for ecacontrol.py/pyecasound: # Copyright (C) 2003 Kai Vehmanen # Licensed under GPL. See the file 'COPYING' for more information. # ----------------------------------------------------------------------- if test(?x, "../ecasound/ecasound_debug") ENV['ECASOUND'] = "../ecasound/ecasound_debug" end if test(?x, "../ecasound/ecasound") ENV['ECASOUND'] = "../ecasound/ecasound" end # workaround to support both ruby >=1.9 (current dir not # in $LOAD_PATH) and older ruby versions require File.expand_path('.', "ecasound") # --- # configuration variables # run for how many seconds runlen = 5 # debug level (0, 1, 2) debuglevel = 2 # if above tests fail, the default ecasound binary # will be used # main program e = Ecasound::ControlInterface.new() result = 0 e.command("cs-add play_chainsetup") e.command("c-add 1st_chain") e.command("ai-add rtnull") e.command("ao-add null") e.command("cop-add -ezx:1,0.0") e.command("ctrl-add -kos:2,-1,1,300,0") e.command("cop-add -efl:300") e.command("cop-add -evp") e.command("cop-select 3") e.command("copp-select 1") e.command("cs-connect") e.command("start") total_cmds = 0 curpos = 0 # not a block var! copp = 0 puts "Test1" while true curpos = e.command("get-position") break if curpos > runlen copp = e.command("copp-get") if debuglevel == 2 #print curpos, e.last_float() #if curpos == None: # curpos = 0.0 $stderr << "#{curpos} #{copp}\r" # sys.stderr.write('%6.2f %6.4f\r' % (curpos,e.last_float())) else $stderr << '.' if debuglevel == 1 end total_cmds += 2 end $stderr << "\nprocessing speed: #{total_cmds / runlen} cmds/second.\n" if debuglevel == 2 $stderr << "\n" if debuglevel > 0 e.command("stop") e.command("cs-disconnect") # Test 2 puts "Test2" e.command("cs-remove") e.command("cs-add play_chainsetup") e.command("c-add 1st_chain") e.command("ai-add rtnull") e.command("ao-add null") e.command("cop-add -ezx:1,0.0") e.command("ctrl-add -kos:2,-1,1,300,0") e.command("cop-add -efl:300") e.command("cop-add -evp") e.command("cop-select 3") e.command("copp-select 1") e.command("cs-connect") e.command("start") total_cmds = 0 curpos = 0 # not a block var! copp = 0 while true curpos = e.command("get-position") break if curpos > runlen e.command("copp-get") # some commands that return a lot # of return data e.command("cop-register") e.command("aio-register") e.command("int-cmd-list") total_cmds = total_cmds + 4 $stderr << '.' if debuglevel > 0 end e.command("stop") e.command("cs-disconnect") $stderr << "\nprocessing speed: #{total_cmds / runlen} cmds/second.\n" if debuglevel == 2 $stderr << "\n" if debuglevel > 0 e.command("quit") exit(result) ecasound-2.9.3/rubyecasound/README0000644000076400007640000000063312260765643013657 00000000000000 ecasound-ruby ------------- This is the first part of an ecasound module for Ruby. It was written with Ruby 1.8.0 but it should also work with Ruby 1.6.8. (Someone to prove this?) documentation ------------- See the Ecasound Control Interface (ECI) Guide and related documents: dist package: ecasound/Documentation/ web.........: http://nosignal.fi/ecasound Have fun, Jan Weil ecasound-2.9.3/rubyecasound/ecasound.rb0000644000076400007640000001205613604166572015126 00000000000000# This is a native implementation of Ecasound's control interface for Ruby. # Copyright (C) 2003 - 2004 Jan Weil # # 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.1 of the License, or (at your option) any later version. # # This program 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # --------------------------------------------------------------------------- =begin = ruby-ecasound Example: require "ecasound" eci = Ecasound::ControlInterface.new(ecasound_args) ecasound-response = eci.command("iam-command-here") ... TODO: Is there a chance that the ecasound process gets zombified? =end require "timeout" require "thread" class File def self::which(prog, path=ENV['PATH']) path.split(File::PATH_SEPARATOR).each do |dir| f = File::join(dir, prog) if File::executable?(f) && ! File::directory?(f) return f end end end end # File class VersionString < String attr_reader :numbers def initialize(str) if str.split(".").length() != 3 raise("Versioning scheme must be major.minor.micro") end super(str) @numbers = [] str.split(".").each {|s| @numbers.push(s.to_i())} end def <=>(other) numbers.each_index do |i| if numbers[i] < other.numbers[i] return -1 elsif numbers[i] > other.numbers[i] return 1 elsif i < 2 next end end return 0 end end # VersionString module Ecasound REQUIRED_VERSION = VersionString.new("2.2.0") TIMEOUT = 15 # seconds before sync is called 'lost' class EcasoundError < RuntimeError; end class EcasoundCommandError < EcasoundError attr_accessor :command, :error def initialize(command, error) @command = command @error = error end end class ControlInterface @@ecasound = ENV['ECASOUND'] || File::which("ecasound") if not File::executable?(@@ecasound.to_s) raise("ecasound executable not found") else @@version = VersionString.new(`#{@@ecasound} --version`.split("\n")[0][/\d\.\d\.\d/]) if @@version < REQUIRED_VERSION raise("ecasound version #{REQUIRED_VERSION} or newer required, found: #{@@version}") end end def initialize(args = nil) @mutex = Mutex.new() @ecapipe = IO.popen("-", "r+") # fork! if @ecapipe.nil? # child $stderr.reopen(open("/dev/null", "w")) exec("#{@@ecasound} #{args.to_s} -c -D -d:256 ") else @ecapipe.sync = true # parent command("int-output-mode-wellformed") end end def cleanup() @ecapipe.close() end def command(cmd) @mutex.synchronize do cmd.strip!() #puts "command: #{cmd}" @ecapipe.write(cmd + "\n") # ugly hack but the process gets stuck otherwise -kvehmanen if cmd == "quit" return nil end response = "" begin # TimeoutError is raised unless response is complete Timeout.timeout(TIMEOUT) do loop do response += read() break if response =~ /256 ([0-9]{1,5}) (\-|i|li|f|s|S|e)\r\n(.*)\r\n\r\n/m end end rescue TimeoutError raise(EcasoundError, "lost synchronisation to ecasound subprocess\nlast command was: '#{cmd}'") end content = $3[0, $1.to_i()] #puts "type: '#{$2}'" #puts "length: #{$1}" #puts "content: #{content}" case $2 when "e" raise(EcasoundCommandError.new(cmd, content)) when "-" return nil when "s" return content when "S" return content.split(",") when "f" return content.to_f() when "i", "li" return content.to_i() else raise(EcasoundError, "parsing of ecasound's output produced an unknown return type") end end end private def read() buffer = "" while select([@ecapipe], nil, nil, 0) buffer += @ecapipe.read(1) || "" end return buffer end end # ControlInterface end # Ecasound:: ecasound-2.9.3/rubyecasound/Makefile.in0000644000076400007640000004004613606336177015047 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/pyecasound/Makefile.am # Description: Ruby implmentation of the Ecasound Control Interface # License: LGPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = rubyecasound DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = README \ ecasound.rb \ stresstest.rb # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- @ECA_AM_RUBYECASOUND_INSTALL_TRUE@rubyecasound_install_list1 = $(srcdir)/ecasound.rb @ECA_AM_RUBYECASOUND_INSTALL_TRUE@rubyecasound_uninstall_list1 = $(DESTDIR)$(ECA_S_RUBY_SITEDIR)/ecasound.rb @ECA_AM_RUBYECASOUND_INSTALL_TRUE@TESTS = stresstest.rb all: all-am .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign rubyecasound/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign rubyecasound/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 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: 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) 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-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-local .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool clean-local distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-exec-hook install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-info-am \ uninstall-local # ---------------------------------------------------------------------- # hooks # ---------------------------------------------------------------------- # unit test requires "ecasound.rb" in the build directory stresstest.rb: ecasound.rb-STAMP ecasound.rb-STAMP: $(srcdir)/ecasound.rb if test ! -e ecasound.rb ; then $(LN_S) $(srcdir)/ecasound.rb . ; fi touch ecasound.rb-STAMP @ECA_AM_RUBYECASOUND_INSTALL_TRUE@install-exec-hook: $(rubyecasound_install_list1) $(rubyecasound_install_list2) @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ $(INSTALL) -d $(DESTDIR)$(ECA_S_RUBY_SITEDIR) @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ $(INSTALL) $(rubyecasound_install_list1) $(rubyecasound_install_list2) $(DESTDIR)$(ECA_S_RUBY_SITEDIR)/ @ECA_AM_RUBYECASOUND_INSTALL_FALSE@install-exec-hook: @ECA_AM_RUBYECASOUND_INSTALL_TRUE@uninstall-local: @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ rm -f $(rubyecasound_uninstall_list1) $(rubyecasound_uninstall_list2) @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ rmdir $(DESTDIR)$(ECA_S_RUBY_SITEDIR) || echo "Skipping non-empty directory" @ECA_AM_RUBYECASOUND_INSTALL_FALSE@uninstall-local: clean-local: rm -vf ecasound.rb-STAMP # 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: ecasound-2.9.3/AUTHORS0000644000076400007640000001770613604674645011361 00000000000000======================================================================= *** Ecasound - AUTHORS file *** ======================================================================= Note about author information in version control (git) ------------------------------------------------------ For recent development history (since August 2008), the Ecasound git repository (see: - http://ecasound.git.sourceforge.net/git/gitweb.cgi?p=ecasound ) ... contains accurate author information. For earlier commits, the git repository does not provide an accurate view, as all of these pre-2008/Aug patches were committed by the release manager. However, even in the older commits, the original author (if different from commit author), is identified in the patch description (e.g. "Patch from.." or "Patch by.."). Main author, coordination of development ======================================== Kai Vehmanen [kaiv] (kvcontact -at- nosignal -dot- fi) New functionality, refactoring old code ======================================= Allie, Stuart [allies] (stuart -dot- allie -at- hydro -dot- com -dot- au) Added EIAM command set for controller parameters (ctrlp-*), bugfixes. Bowman, Brad [bowman] Perl ECI binding, bug hunting. Chappell, Jesse [jesse] (jesse -at- essej -dot- net) Improvements to libsndfile support, various bugfixes. Coker, Rob [rcs] (rcs -at- birch -dot- net) Pulse gate (-eemp) code. Cunningham, Jeffrey [jeffrey] (jeffrey -at- cunningham -dot- net) Various improvements to ecasignalview. Dobson, Julian [juliand] Improved mechanism for mp3 header parsing. Ewe, Michael [mewe] Signal handling bugfixes to ecasignalview and the ECI C impl. Fendt, Stefan (stefan -at- lionfish -dot- ping -dot- de) Original code for reverb (-ete) and RC-lowpass filter (-ef4). Ghedini, Alessandro [ghedo] Patches to build scripts, ecasound.el, documentation and others. Hall, Jeremy [jhall] (jhall -at- maoz -dot- com) Extensive testing, ALSA 0.6.x support, many design ideas. Halttunen, Janne [jhalttun] Helped in developing the EIAM, and specifically the new ECI concept. Wrote the native Python ECI implementation. Hamara, Arto [artham] (artham -at- utu -dot- fi) Ecasound logo(s), preset params, general linear envelope support, various bug fixes! Jeanneau, Aymeric [ajeanneau] (ajeanneau -at- cvf -dot- fr) Reentrant libecasoundc (C ECI) implementation. Lang, Mario [mlang] Ecasound.el, the ecasound emacs module. Leake, Tony [tonyleake] PHP ECI extension. Lees, Andrew [andrewl] Reopen functionality to threshold gate (-ge). Linson, Adam [alinson] Adding the cop-get command Lopez-Cabanillas, Pedro [pedrolc] (pedro -dot- lopez-cabanillas -at- gmail -dot -com) ALSA sequencer interface support. Massy, S. [smassy] Ecalength utility, extensive testing and debugging. Poelstra, Remco [rjpoelstra] ECI C API bug hunting. Polton, Richard [rpolton] The 250k gcc3.x patch. :) Salwen, Jeremy [jeremysalwen] LV2 support Tiedemann, Eric S. [est] Wrote the eci.py interface. Uekawa, Junichi [juekawa] Maintainer for Ecasound's Debian package. Improvements to build system and numerous bugfixes. Weil, Jan [janweil] (Jan -dot- Weil -at- web -dot- de) Wrote the Ruby ECI implementation. Contributions ============== Anarcat [anarcat] Work on Ecasound's FreeBSD port. Amundsen, Eric [amundsen] Bug hunting. Beaupre, Antoine [beaupran] Patches for FreeBSD compatibility. Berndtgen, Manfred [mb] Bugfix to ecasignalview. Bolton, Sean [smbolton] Patches for Mac OS X compability. Brulebois, Cyril [cyrilbrulebois] Patches for issues reported by GCC 3.4. Campbell, Ross [rcampbel] Tips concerning Solaris compatibility. Carmack, Michael [karmak] Tips concerning Solaris. Claassen, Julien [julien] Ideas for interface development, marketing work. Darilek, Nolan [nolan_d] Ogg vorbis fixes. Dye, Rob [rob] OSS compilation fixes. Eure, Ian [ieure] Work on the Ecasound debian packages. Fischer, Hans-Georg [hgfischer] Bug fix that solved edi-1. Grabner Markus [grabner] Updated RPM spec-file for x86_64 platforms. Groffen, Fabian [grobian] (grobian -at- gentoo -dot- org) OS X build fixes. Runge, David [dvzrv] fix to lv2 build checks Head, Chris [hawk777] Patches fixing ecasignalview build errors. Heller, Aaron [aheller] Fixes to big-endian support. Harris, Steve [swharris] gcc 2.96 (RH7.0) testing and fixes. Hughes, Jeremy [jedahu] Bugfix for JACK port muting Lavallée, Marc [marclava] Rpm-spec for Mandrake. Updates to Python3 support Merino, Pedro Antonio Fructuoso [pfructuoso] Various bugfix patches. Morris, Steve [smorris] Ewf-handling fixes. O'Toole David [dto] Patches to ecasound.el. Petit, Bertrand Helped with POSIX-compatibility issues. Poulton, Ron [thok] Helped to track down the mysterious chain-bug. Rzewnicki, Eric Dantan [ericdr] Lots of typo fixes and corrections to Ecasound docs. Sacré, Dominic [dsacre] Fixes to 'jack_generic'. Sassmannshausen, Ruediger [rsassman] Mp3 filename parsing fixes. Shchepin, Alexey [alexey] Bugfix to time crop gate operator (-gc). Sijrier, Remon [remon] Fix to a bug in setting -eca initial values. Smith, Richard A. Helped in solving the "gcc 2.95" bug. Sousa, Rui OSS bug fixes. Stradling, Rob [robstr] MIDI-MMC bug fixes. Tkachenko, Vadim - Helped to get started with autoconf. Yee-king, Matt [yeeking] Helped debugging big-endian troubles on PowerPC. Westbrook, Tim [iondiode] Autoconf 2.5x fixes. Wever, Mark de [koraq] Bugs in libecasoundc-config. Wróblewski, Artur [wrobell] PLD-Linux RPM-specfile, readline and destdir patches. Contributions - Patches, Bug Hunting and Feature Proposals ========================================================== Starting from 2.2.1 release (in Feb/2003), contributors have been listed in the release notes. For all past releases notes, see: - http://nosignal.fi/ecasound/relnotes/ Below is a list of all contributors to 2.2.1 and beyond, collected from the published releases notes, and listed in the order they appear in the release notes: Junichi Uekawa Kai Vehmanen Janne Halttunen Antti Boman William Goldsmith Oliver Thuns Mario Lang Michael Hellwig Janno Liivak Raoul Megelas Jan Stary Daniel Kruszyna Jeremy Hall Vegard Lima Carsten Bauer Ismail Donmez Lars Henrik Mai Stephan Niemz Al Oemens Tommi Uimonen Hirendra Hindocha Stefan Bundt Dave Phillips Jan Weil Mark de Wever Fernando Pablo Lopez-Lezcano Michael Ewe Eric Dantan Rzewnicki Pierre Lorenzon Jesse Chappell Sean Bolton Adam Linson Paul Winkler Didier Bellamy Manfred Berndtgen Stéphane Letz Paul Marquardt kito -at- gentoo-org jcwjcw -at- qwest-net Vitaly Belostotsky Steve Harris Tim Blechmann Aaron Heller Kamil Wencel Julien Claassen Erik de Castro Lopo Frederik Eaton Philippe Schelté aka Dubphil Julian Dobson Alexey Shchepin Brad Fuller Peter Lutek Stuart Allie Jeffrey Cunningham Kyle Kirkland Olivier Guilyardi Jack O'Quin Pierre Lorenzon Pedro Lopez-Cabanillas Pedro Antonio Fructuoso Merino Arieh Skliarouk Tom Rosenfeld Valery -at- vslash -dot com Markus Grabner Michael Willoughby Rocco Dave Serls Stephen Stocker Aaron Heller Chris Head Zrajm Akfohg Florian Ladstaedter Koen Kurt Konolige Brad Bowman Joel Roth Martin Michlmayr Joe Planisky Rémi Rouaud Etienne Deleflie Klaus Schulz Keith Creasy Cyril Brulebois Fabian Groffen Andrew Lees Sergei Steshenko Alexis Ballier Avuton Olrich Dominic Sacré Erik Nomitch Alessandro Ghedini Slack Knut Petersen Brett Koonce Code from other projects ======================== Davis Paul pthread_mutex_spinlock() from libpbd. Dyson, John S. The original advanced compressor (-eca) code. Furse, Richard W.E. Sine tone generation code from Computer Music Toolkit LADSPA plugin set is used in AUDIO_IO_TONE. Harris, Steve and Tim Blechmann Denormal handling code from swh-plugins package. Laydier, Antoine [SMF] Mp3 header parsing (layer.cpp). Note! The developer tags (for example [kaiv] is one) are used throughout Ecasound docs: NEWS, TODO-list, edi-list.txt, ChangeLog files and so on. ecasound-2.9.3/Makefile.am0000644000076400007640000000311011746753047012324 00000000000000# ---------------------------------------------------------------------- # File: ecasound/Makefile.am # Description: Ecasound multitrack audio processing tool # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- EXTRA_DIST = AUTHORS BUGS COPYING.GPL COPYING.LGPL NEWS RELNOTES TODO ecasoundrc.in effect_presets generic_oscillators SUBDIRS = kvutils libecasound ecasound libecasoundc pyecasound rubyecasound ecatools Documentation examples AUTOMAKE_OPTIONS = foreign PACKAGE = @PACKAGE@ VERSION = @VERSION@ RELEASE = 1 docs: cd Documentation ; $(MAKE) $(AM_MAKEFLAGS) docs install-data-local: ecasoundrc $(INSTALL) -d $(DESTDIR)$(pkgdatadir) $(INSTALL_DATA) $(top_builddir)/ecasoundrc $(DESTDIR)$(pkgdatadir)/ecasoundrc $(INSTALL_DATA) $(top_srcdir)/effect_presets $(DESTDIR)$(pkgdatadir)/effect_presets $(INSTALL_DATA) $(top_srcdir)/ecatools/ecasound.el $(DESTDIR)$(pkgdatadir)/ecasound.el $(INSTALL_DATA) $(top_srcdir)/generic_oscillators $(DESTDIR)$(pkgdatadir)/generic_oscillators uninstall-local: rm -f $(DESTDIR)$(pkgdatadir)/effect_presets \ $(DESTDIR)$(pkgdatadir)/ecasound.el \ $(DESTDIR)$(pkgdatadir)/generic_oscillators \ $(DESTDIR)$(pkgdatadir)/ecasoundrc rmdir $(DESTDIR)$(pkgdatadir) || echo "Skipping non-empty directory" ecasoundrc: ecasoundrc.in Makefile.am sed -e "s%[@]VERSION[@]%$(VERSION)%" \ -e "s%[@]prefix[@]%$(prefix)%" \ -e "s%[@]pkgdatadir[@]%$(pkgdatadir)%" \ < $(top_srcdir)/ecasoundrc.in > ecasoundrc clean-local: rm -fv ecasoundrc dist-hook: docs ecasound-2.9.3/acinclude.m40000644000076400007640000001256311547157307012471 00000000000000dnl --- dnl acinclude.m4 for ecasound dnl --- ## ------------------------------------------------------------------------ ## Check for JACK support ## ## defines: ECA_AM_COMPILE_JACK, ECA_S_JACK_LIBS, ECA_S_JACK_INCLUDES, ## ECA_COMPILE_JACK, ECA_JACK_TRANSPORT_API, ECA_JACK_FEATSET ## ------------------------------------------------------------------------ AC_DEFUN([AC_CHECK_JACK], [ AC_CHECK_HEADER(jack/jack.h,jack_support=yes,jack_support=no) AC_ARG_WITH(jack, [ --with-jack=DIR Compile against JACK installed in DIR], [ ECA_S_JACK_LIBS="-L${withval}/lib" ECA_S_JACK_INCLUDES="-I${withval}/include" jack_support=yes ]) AC_ARG_ENABLE(jack, [ --enable-jack Enable JACK support (default=yes, if found)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) jack_support=yes ;; n | no) AC_MSG_RESULT(no) jack_support=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-jack: $enableval]) ;; esac ]) AM_CONDITIONAL(ECA_AM_COMPILE_JACK, test x$jack_support = xyes) if test x$jack_support = xyes; then AC_DEFINE([ECA_COMPILE_JACK], 1, [enable JACK support]) ECA_S_JACK_LIBS="${ECA_S_JACK_LIBS} -ljack" case "$host" in *darwin*) AM_LDFLAGS="$AM_LDFLAGS -framework CoreAudio" ;; esac fi AC_LANG_C old_cppflags=$CPPFLAGS old_ldflags=$LDFLAGS old_INCLUDES=$INCLUDES CPPFLAGS="$CPPFLAGS $ECA_S_JACK_INCLUDES" LDFLAGS="$LDFLAGS $ECA_S_JACK_LIBS" AC_TRY_LINK( [ #include ], [ jack_position_t t; int *a = (void*)&jack_transport_query; int *b = (void*)&jack_transport_start; int *c = (void*)&jack_transport_stop; int *d = (void*)&jack_transport_locate; t.frame = 0; t.valid = 0; return 0; ], [ ECA_JACK_TRANSPORT_API="3" ], [ ECA_JACK_TRANSPORT_API="0" ] ) # note: check for the new latency API added to JACK 0.120.1 AC_TRY_LINK( [ #include ], [ jack_latency_range_t t; t.min = 0; t.max = 0; return 0; ], [ ECA_JACK_FEATSET="1" ], [ ECA_JACK_FEATSET="0" ] ) CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" INCLUDES="$old_INCLUDES" echo "Using JACK transport API version:" ${ECA_JACK_TRANSPORT_API} AC_DEFINE_UNQUOTED([ECA_JACK_TRANSPORT_API], ${ECA_JACK_TRANSPORT_API}, [version of JACK transport API to use]) echo "Using JACK feature set (ecasound specific):" ${ECA_JACK_FEATSET} AC_DEFINE_UNQUOTED([ECA_JACK_FEATSET], ${ECA_JACK_FEATSET}, [ecasound specific versioning of JACK interface features ]) AC_SUBST(ECA_S_JACK_LIBS) AC_SUBST(ECA_S_JACK_INCLUDES) ]) ## ------------------------------------------------------------------------ ## Check for LFS (now deprecated, v3 is only a stub that doesn't ## peform any checks) ## ## version: 3 ## ## refs: ## - http://www.gnu.org/software/libtool/manual/libc/Feature-Test-Macros.html ## - http://www.suse.de/~aj/linux_lfs.html ## - http://en.wikipedia.org/wiki/Large_file_support ## ## modifies: AM_CXXFLAGS, AM_CFLAGS ## defines: enable_largefile ## ------------------------------------------------------------------------ ## AC_DEFUN([AC_CHECK_LARGEFILE], [ echo "checking for largefile support (>2GB files)..." dnl note: this is only for backwards compatibility AC_ARG_WITH(largefile, [ --with-largefile deprecated option, now used by default], []) AC_SYS_LARGEFILE if test x$ac_cv_sys_file_offset_bits = x64 ; then dnl note: Just to be sure that the define is there even dnl if config.h is not included in right order w.r.t. dnl the system headers. AM_CXXFLAGS="$AM_CXXFLAGS -D_FILE_OFFSET_BITS=64" AM_CFLAGS="$AM_CFLAGS -D_FILE_OFFSET_BITS=64" enable_largefile=yes fi dnl old checks dnl ---------- dnl [ if test "x$withval" = "xyes" ; then dnl enable_largefile="yes" dnl fi dnl ] dnl if test "x$enable_largefile" = "xyes"; then dnl dnl AC_DEFINE(_FILE_OFFSET_BITS, 64) dnl dnl AC_DEFINE(_LARGEFILE_SOURCE) dnl AM_CXXFLAGS="$AM_CXXFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" dnl AM_CFLAGS="$AM_CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" dnl AC_MSG_RESULT(yes.) dnl else dnl AC_MSG_RESULT(no.) dnl fi ]) ## ------------------------------------------------------------------------ ## Check whether namespaces are supported. ## ## version: 3 ## ## defines: ECA_USE_CXX_STD_NAMESPACE ## ------------------------------------------------------------------------ ## AC_DEFUN([AC_CHECK_CXX_NAMESPACE_SUPPORT], [ AC_MSG_CHECKING(if C++ compiler supports namespaces) AC_LANG_CPLUSPLUS old_cxx_flags=$CXXFLAGS CXXFLAGS="-fno-exceptions $CXXFLAGS" # hack around gcc3.x feature AC_TRY_RUN( [ #include #include using std::string; int main(void) { string s ("foo"); std::vector v; return(0); } ], [ AC_MSG_RESULT(yes.) AC_DEFINE([ECA_USE_CXX_STD_NAMESPACE], 1, [use C++ std namespace]) ], [ AC_MSG_RESULT(no.) AC_MSG_WARN([C++ compiler has problems with namespaces. Build process can fail because of this.]) ] , [ AC_MSG_RESULT(no.) ] ) CXXFLAGS=$old_cxx_flags ]) ## ------------------------------------------------------------------------ ## Find a file (or one of more files in a list of dirs) ## ## version: 1 ## ------------------------------------------------------------------------ ## AC_DEFUN([AC_FIND_FILE], [ $3=NO for i in $2; do for j in $1; do if test -r "$i/$j"; then $3=$i break 2 fi done done ]) ecasound-2.9.3/Documentation/0000755000076400007640000000000013606336217013157 500000000000000ecasound-2.9.3/Documentation/ecasoundrc.50000644000076400007640000002355212260765172015323 00000000000000.TH "ecasoundrc" "5" "22\&.03\&.2009" "" "Multimedia software" .PP .SH "NAME" ecasoundrc \- ecasound rcfile .PP .SH "SYNOPSIS" {prefix}/share/ecasound/ecasoundrc (for instance \(cq\&/usr/local/share/ecasound/ecasoundrc\(cq\&) $HOME/\&.ecasound/ecasoundrc .PP .SH "DESCRIPTION" .PP \fBecasoundrc\fP is the main configuration file for ecasound\&. Any user\-specific modification should be done to $HOME/\&.ecasound/ecasoundrc, not to the global resource file\&. Ecasound also allows one to disable the normal policy and only read from a specific resource file (see ecasound (1) and documentation for the \fB\-R\fP option)\&. .PP The format is quite simple\&. One line consists of a configuration variable and its value\&. Variable and value are separated with either \(cq\&=\(cq\& or \(cq\& \(cq\&\&. Lines beginning with a \(dq\&#\(dq\& are ignored (comment lines)\&. .PP .SH "VARIABLES" .PP .IP "midi\-device" MIDI\-device\&. If the device name is given in \fIrawmidi,/dev/midi*\fP format, OSS/Linux or OSS/Lite drivers are used\&. Device \fIrawmidi,/dev/snd/midiCxDy\fP opens an ALSA raw\-MIDI device with card number \(cq\&x\(cq\& and device number \(cq\&y\(cq\&\&. See ecasound (1) man page (the \(cq\&\-Md option) for more info\&. Defaults to \fIrawmidi,/dev/midi\fP\&. .IP .IP "default\-output" Output device to use by default\&. If a chainsetup with zero outputs, but with one or more inputs, is connected, a default output is added and all the chains are connected to it\&. If the special\-case value \(cq\&autodetect\(cq\& is specified, ecasound will try to auto\-detect a suitable device (JACK \-> ALSA \-> OSS \-> rtnull)\&. Defaults to \fIautodetect\fP\&. .IP .IP "default\-audio\-format" Default values for sample format, channel count, sampling rate and channel interleaving\&. Syntax is the same as used by ecasound\(cq\&s \fI\-f\fP option (see ecasound (1))\&. Defaults to \fIs16_le,2,44100,i\fP\&. .IP .IP "default\-to\-precise\-sample\-rates" Whether to ignore sample rate differences (and possibly avoid resampling)\&. Currently only affects OSS\-devices\&. Defaults to \fIfalse\fP\&. .IP .IP "default\-mix\-mode" If \fIdefault\-mix\-mode\fP is \fIsum\fP, engine will mix multiple channels into one output channel by summing all input channels\&. In mode \fIavg\fP, mixing is done by taking the average of all input channels\&. The \fIavg\fP mode is safe from clipping, while \fIsum\fP is closer to the way analog mixers work\&. Defaults to \fIavg\fP\&. .IP .IP "bmode\-defaults\-nonrt" Selects the default parameters to use with buffering mode \(cq\&nonrt\(cq\& (other modes are \(cq\&rt\(cq\& and \(cq\&rtlowlatency)\&. Parameters are given as a comma\-separated tuple of values: 1) buffersize (number,\-b), 2) raised priority (true/false,\-r), 3) sched_priority (number,\-r:X), 4) double buffering (true/false,\-z:db), 5) db\-bufsize (number,\-z:db,X), and 6) max intbuf (true/false,\-z:intbuf)\&. Defaults to \fI1024,false,50,false,100000,true\fP\&. .IP .IP "bmode\-defaults\-rt" See \(cq\&bmode\-defaults\-nonrt\(cq\&\&. Defaults to \fI1024,true,50,true,100000,true\fP\&. .IP .IP "bmode\-defaults\-rtlowlatency" See \(cq\&bmode\-defaults\-nonrt\(cq\&\&. Defaults to \fI256,true,50,true,100000,false\fP\&. .IP .IP "resource\-directory" Directory for global ecasound configuration files\&. Defaults to \fI{prefix\-dir}/share/ecasound\fP\&. Note! User\-specific resource files can be be stored to \(cq\&$(HOME)/\&.ecasound/\(cq\&\&. For instance you can add your own presets definitions to \(cq\&$(HOME)/\&.ecasound/effect_presets\(cq\&\&. .IP .IP "resource\-file\-genosc\-envelopes" Configuration file for generic oscillators\&. Is located in the resource directory\&. Defaults to \fIgeneric_oscillators\fP\&. .IP .IP "resource\-file\-effect\-presets" Configuration file for effect presets\&. Is located in the resource directory\&. Defaults to \fIeffect_presets\fP\&. .IP .IP "ladspa\-plugin\-directory" Directory containing LADSPA effect plugins\&. Defaults to \fI{prefix\-dir}/lib/ladspa\fP\&. If environment variable \fILADSPA_PATH\fP exists, directories specified in it are automatically searched for plugins\&. Note! To match the syntax of the \fILADSPA_PATH\fP environment variable, \(cq\&ladspa\-plugin\-directory\(cq\& can contain multiple directories, separated by \(cq\&:\(cq\& characters\&. .IP .IP "ext\-cmd\-text\-editor" If \fIext\-cmd\-text\-editor\-use\-getenv\fP is \fIfalse\fP or \(dq\&EDITOR\(dq\& is null, value of this field is used\&. .IP .IP "ext\-cmd\-text\-editor\-use\-getenv" Should ecasound try to query environment variable \(dq\&EDITOR\(dq\&\&. Defaults to \fItrue\fP\&. .IP .IP "ext\-cmd\-mp3\-input" Command for starting mp3 input\&. Ecasound expects to read signed, 16bit, little\-endian stereo audio samples from its standard input\&. Ecsound will query other audio format parameters by parsing the mp3 file header\&. Before execution, %f is replaced with path to the input mp3\&. If exists, \(dq\&%o\(dq\& is replaced with he start offset in mp3 frames\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default, \fImpg123\fP is launched\&. .IP .IP "ext\-cmd\-mp3\-output" Command for starting mp3 output\&. Ecasound will write stereo, signed, 16bit, little\-endian samples to standard output\&. Sample rate is configurable\&. Before execution, %f is replaced with path to the output mp3, %S with sample rate in kHz, and %B with encoding bitrate in kbps\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch \fIlame\fP\&. As a special exception (added to Ecasound 2\&.7\&.0), if the output program is \(dq\&lame\(dq\& and options include \(dq\&\-\-big\-endian\(dq\&, Ecasound will detect this and output big\-endian samples\&. .IP .IP "ext\-cmd\-ogg\-input" Command for starting Ogg Vorbis input\&. Ecasound expects that audio samples are written to standard output\&. It should be noted that Ecasound is not able to query the audio format parameters from ogg files, so these need to be set manually by the user\&. Before execution, %f is replaced with path to the input ogg\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch (ogg123)\&. .IP .IP "ext\-cmd\-ogg\-output" Command for starting Ogg Vorbis output\&. Ecasound will write samples in little\-endian format to standard output\&. Other audio parameters are configurable\&. Before execution, %f is replaced with path to the output ogg, %c, %s and %b with matching audio format parameters, and %B with encoding bitrate in kbps\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch (oggenc)\&. .IP .IP "ext\-cmd\-mikmod" Command for starting mikmod input\&. Ecasound expects that signed, 16bit, stereo audio samples are written to standard output\&. Before execution, %f is replaced with file path, and %s with selected sample rate\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch \fImikmod\fP\&. .IP .IP "ext\-cmd\-timidity" Command for starting timidity++ input\&. Ecasound expects that signed, 16bit, stereo audio samples are written to standard output\&. Before execution, %f is replaced with file path, and %s with sample rate\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch \fItimidity\fP\&. .IP .IP "ext\-cmd\-flac\-input" Command for starting FLAC input\&. Ecasound expects that audio samples are written to standard output\&. It should be noted that Ecasound is not able to query the audio format parameters from FLAC files, so these need to be set manually by the user\&. Before execution, %f is replaced with path to the input FLAC file\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch (flac)\&. .IP .IP "ext\-cmd\-flac\-output" Command for starting FLAC output\&. Ecasound will write samples to standard output\&. All audio parameters are configurable\&. Before execution, %f is replaced with path to the output flac, %c, %b and %s with matching audio format parameters, %I with either \(cq\&signed\(cq\& or \(cq\&unsigned\(cq\&, and %E with either \(cq\&little\(cq\& or \(cq\&big\(cq\&\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch (flac)\&. .IP .IP "ext\-cmd\-aac\-input" Command for starting AAC input\&. Ecasound expects that signed, 16bit, stereo, big\-endian audio samplesare written to standard output\&. It should be noted that Ecasound is not able to query the input sample rate, so this needs to be set manually by the user\&. Before execution, %f is replaced with path to the input AAC file\&. Note! FAAC must be compiled with MP4 support\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to laucnh \fIfaad\fP\&. .IP .IP "ext\-cmd\-aac\-output" Command for starting AAC output\&. Ecasound will write big\-endian audio samples to standard output\&. All other audio parameters are configurable\&. Before execution, %f is replaced with path to the output AAC file, %c, %b and %s with matching audio format parameters\&. Note! FAAC must be compiled with MP4 support\&. Double\-quotes and backslash\-espacing can be used to include white\-space to individual parameters\&. By default Ecasound will try to launch \fIfaac\fP\&. .IP .SH "DEPRECATED" .PP .IP "ext\-cmd\-wave\-editor" .IP .SH "SEE ALSO" .PP ecasound (1), ecatools (1), ecasound\-iam (1) .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/users_guide/0000755000076400007640000000000013606336217015475 500000000000000ecasound-2.9.3/Documentation/users_guide/Makefile.am0000644000076400007640000000314211144366232017444 00000000000000# ---------------------------------------------------------------------- # File: ecasound/Documentation/users_guide/Makefile.am # Description: Ecasound documentation - user's guide # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- # --------------------------------------------------------------------- # Files going into distribution: EXTRA_DIST = users_guide.latex DISTCLEANFILES = \ users_guide.log \ users_guide.aux \ users_guide.out \ users_guide.dvi \ users_guide.toc \ users_guide.ps \ ecasound_users_guide.pdf \ html_uguide/users_guide.html \ html_uguide/users_guide.haux \ html_uguide/users_guide.htoc all: docs: ecasound_users_guide.pdf ecasound_eci_doc.pdf: eci_doc.latex eci_doc.dvi # note: to create the table of contents (which spans multiple pages), and # re-calculate the page numbers after the page offset generated by table # of contents, latex needs to be ran 3 times. (Junichi Uekawa, 2007-08-06) users_guide.dvi: $(srcdir)/users_guide.latex latex $(srcdir)/users_guide.latex latex $(srcdir)/users_guide.latex latex $(srcdir)/users_guide.latex dvips -Ppdf -o users_guide.ps users_guide.dvi ps2pdf users_guide.ps ecasound_users_guide.pdf mkdir -p html_uguide hevea -o html_uguide/users_guide.html $(srcdir)/users_guide.latex hevea -o html_uguide/users_guide.html $(srcdir)/users_guide.latex ecasound_users_guide.pdf: users_guide.dvi clean-docs: rm -fv ecasound_users_guide.pdf rm -fv users_guide.log users_guide.toc users_guide.dvi users_guide.aux users_guide.ps users_guide.dvi rm -fv html_uguide/* ecasound-2.9.3/Documentation/users_guide/users_guide.latex0000644000076400007640000012175712260765762021015 00000000000000\documentclass{report} \usepackage[T1]{fontenc} \usepackage{ae} \usepackage{hevea} \usepackage{hyperref} \title{Ecasound User's Guide} \author{Kai Vehmanen} \date{19042009} \begin{document} \maketitle \tableofcontents \clearpage % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Preface} This document describes Ecasound from the user's point of view. In addition to the actual user/client-programs, all essential Ecasound library concepts and features are also discussed. To avoid duplicating documentation, I've used references to other sources whenever suitable. For instance, Ecasound's man pages are a very good (and up-to-date!) source of information. They are also available in HTML-format. If not otherwise specified, all documentation refers to the latest Ecasound version. % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Document history} \begin{itemize} \item 19.04.2009 - Removed duplicate Ecasound history section and added more web URLs pointing to other sources of documentation. \item 31.01.2009 - Lots of minor improvements in preparation for 2.6.0 release. \item 29.01.2009 - Updated ``JACK Audio Server'' section to match the changes in 2.6.0 release. \item 05.08.2008 - Fixed a bug in example of loop device usage. \item 09.03.2008 - Updated the EWF file section. Replace uses of ``/dev/dsp'' with ``alsa'' in many examples. \item 06.12.2006 - Added notes concerning quoting EOS arguments containing commas. \item 04.06.2006 - Some minor improvements to the text. Updated the descriptions of realtime-lsm and rlimits-rtprio mechanisms. \item 25.04.2005 - From now on, only major changes are logged to this changelog section. For detailed change history, refer to CVS history. \item 23.04.2005 - Started using the ``hevea'' style-package and converted all links to use the hevea macros (resulting in real hyperlinks in the HTML output). Renamed the section ``Security considerations when running with root privileges'' to shorter ``Security Considerations'', added info about Realtime LSM module. \item 01.04.2005 - Updated ``Ecasignalview'' documentation. \item 30.03.2005 - Added sections on ``Preset parameters'' and ``Parameter descriptors''. \item 11.12.2004 - Added section ``Filenames with commas not handled correctly'' \item 18.12.2003 - Many typo fixes and other corrections from Eric Rzewnicki. \item 18.11.2003 - Typo fixes. \item 20.08.2003 - Capitalize Ecasound in all cases where talking about the software package, not the console mode user-interface. Updated JACK documentation with a description of JACK and Ecasound states. \item 13.08.2003 - Updated documentation concerning JACK transport functions. \item 31.10.2002 - Few section layout bugs fixed. \item 30.10.2002 - Added JACK documentation, minor layout changes. \item 17.10.2002 - Updated Ecasound overview. \item 17.07.2002 - Added documentation for ecasignalview. \item 18.05.2002 - Fixed a few typos. \item 21.10.2001 - Added material from the Ecasound FAQ. \item 21.10.2001 - Added this history section. Document was restructured and all major chapters reviewed. \item 01.02.2001 - Updated the ``Current position'' section. \end{itemize} % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Introduction} % ---------------------------------------------------------------------- \section{What is Ecasound?} Ecasound is a software package designed for multitrack audio processing. It can be used for simple tasks like audio playback, recording and format conversions, as well as for multitrack effect processing, mixing, recording and signal recycling. Ecasound supports a wide range of audio inputs, outputs and effect algorithms. Effects and audio objects can be combined in various ways, and their parameters can be controlled by operator objects like oscillators and MIDI-CCs. A versatile console mode user-interface is included in the package. % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Ecasound concepts} % ---------------------------------------------------------------------- \section{Audio object} Audio objects are used to transfer audio from and to Ecasound. Usually audio objects are either files (like wav, mp3 or ogg) or devices (soundcard input/output). There are also some special audio object types for transferring data between applications. % ---------------------------------------------------------------------- \section{Chain} Chain is the central signal flow abstraction. In many ways chains are similar to audio cables. You have one input and one output to which you can connect audio producers and consumers (like guitar and amplifier for instance). But there are some differences. First it's possible to attach chain operators (usually effects) to chains. This is somewhat like replacing one cable with two, and putting an effect box between them, but with chains it's just easier. A second important difference is that chains can transport multiple channels of audio. It's possible to attach mono, stereo or 24ch (or bigger) audio feeds to one chain. Also all chain operators can handle these multichannel streams. In addition to chain operators, chains also have separate ``mute'' and ``bypass'' functions. % ---------------------------------------------------------------------- \section{Chain operators and controllers} Chain operators are used to process and analyze sample data. They can be divided into gates, converters, signal analyzers and to traditional effects like reverbs, delays and filters. It's also possible to attach special controller objects to chains. These controllers are used to control chain operator parameters. The typical examples are various oscillators and MIDI continous controllers (knobs, sliders, etc found on MIDI-devices). Both types of objects are attached to chains. The term \emph{chain object} refers to all objects that can be attached to chains - ie. operators and controllers. % ---------------------------------------------------------------------- \section{Chainsetup} Chainsetup is the central data object. All other objects (inputs, outputs, chains, etc) are connected to some chainsetup. Many chainsetups can exist at the same time (during one session), but only one of them can be in use. In Ecasound documentation, the term \emph{connected} is used to describe a chainsetup that is in use. Another important chainsetup concept is that of a \emph{selected} chainsetup. All editing operations are done on the currently selected chainsetup. It is possible to have one chainsetup connected (currently processing audio), while editing another, chainsetup that is selected for editing. Loading and saving chainsetups is the primary mechanism for storing and restoring state information. When saving to files, the \emph{.ecs} file format is used. The file syntax uses the same notation as Ecasound's console (and command-line) interface. This makes it easy to edit the chainsetup files outside Ecasound, either manually or using external utils. See \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} man page for details. % ---------------------------------------------------------------------- \section{Current position} Information about current position is only stored for audio objects and chainsetups. When you change chainsetup position, all audio objects are affected. On the other hand, positions of different audio objects can be changed independently. % ---------------------------------------------------------------------- \section{Ecasound Control Interface - ECI} Ecasound Control Interface is an API for application developers who want to take advantage of libecasound in their own apps. See ``Ecasound Control Interface Guide'' and ``Ecasound Programmer's Guide'' for more information. % ---------------------------------------------------------------------- \section{Ecasound Interactive Mode - EIAM} Most of Ecasound's functionality is located in one central library (libecasound). One thing that this library provides is a simple interpreter, which can be used for controlling Ecasound. This mode of operation is better known as Ecasound's Interactive Mode (EIAM) The most common frontend for the Interactive Mode is the console-mode Ecasound program. You can enter its Enteractive Mode by issuing ``ecasound -c''. For more detailed information the available commands, see \texttt{ecasound-iam(1)} man page. % ---------------------------------------------------------------------- \section{Ecasound Option Syntax - EOS} One very notable feature of the console-mode ecasound program is its command-line option syntax. You can do pretty much everything from the command-line. But it doesn't end with the console mode ecasound. In fact, interpreting these options is located in the main libecasound library, and is very closely tied to the interactive mode. As a result, the same syntax (tokens that look like ``-prefix:arg1,arg2,...,argN''), is used in various parts of libecasound. Note that if any of the arguments contain commas, those arguments need to be enclosed in double-quotes (for example ``-prefix:"ar,g1",arg2''). Following is a partial list of the places where EOS syntax has been used: \begin{itemize} \item parsing command-line options \item the interactive-mode (as arguments to the 'cs-option' command [2.1dev4 and newer]) \item saved chainsetup-files (.ecs format) \item effect preset definitions (see for example ``/usr/share/ecasound/effect\_presets'') \item generic oscillator definitions (see for example ``/usr/share/ecasound/generic\_oscillators'' \end{itemize} % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Using} % ---------------------------------------------------------------------- \section{Where to start?} There's no one single right way to use Ecasound. You can use it as a simple glue component for doing tasks that aren't handled by other applications you are using, or because Ecasound does these tasks more easily (or better even :)). But Ecasound can also serve as the centre of your studio setup, doing everything from effects processing to multitrack recording and mixing. This flexibility doesn't come for free. It's difficult to describe Ecasound's features in a few phrases. Because of this, new users are encouraged to start from the \texttt{Examples page} at \url{http://nosignal.fi/ecasound/Documentation/examples.html}. It isn't a perfect introduction, and definitely shows only one way to use the software, but it does give an overall view of what can be done, and more importantly, it shows that many tasks are actually quite simple to do. % ---------------------------------------------------------------------- \section{Rules for creating and modifying chainsetups} Here are a few rules that help writing valid chainsetups. Whether you are editing chainsetup files (.ecs), some graphical frontend, just using command-line options, etc; these rules always apply: \begin{itemize} \item Every chain has exactly \_one\_ input and \_one\_ output. \item All inputs and outputs must be connected to some chain. \item For every input/output, there is one and only one definition (example: ``-i:file.wav''). \item All routing from and to chains is based on selecting a set of chains and then specifying an input or output (example: ``-a:1,2 -i:file.ext''). \item All audio copying and mixing is done channel-wise. If you attach a 4-channel input and a two-channel output to a chain, that chain will have 4 channels of audio, but only the first two channels will be written to the output file. \end{itemize} Note that these rules are checked only when \emph{connecting} the chainsetup (when issuing commands such as ``cs-connect'', or ``start''). % ---------------------------------------------------------------------- \section{Chain operators and controllers} The best place to start is to read through the \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} man page, which contains documentation for all native Ecasound chain objects. % ---------------------------------------------------------------------- \section{Configuration} User preferences are stored in \emph{\textasciitilde /.ecasound/ecasoundrc}. See the \href{http://nosignal.fi/ecasound/Documentation/ecasoundrc\_manpage.html}{ecasoundrc(5)} manual page for details. By default, files for effect presets and oscillator presets are in \emph{/usr/share/ecasound}. % ---------------------------------------------------------------------- \section{Common problems} \subsection{I get occasional audio dropouts during operation? How to get rid of them?} Check \url{http://www.oreillynet.com/pub/a/linux/2000/11/17/low_latency.html} where you'll find a very good article written by Dave Phillips on Linux low-latency issues. If you are in a hurry (or desperate :)), here's a quick list of things to try: \begin{itemize} \item Tune your disks (see the article) \item Enable ecasound's double-buffering system by using the \emph{-z:db} option [note! this is only necessary with Ecasound 2.0.x and older] \item If you're still having problems, run ecasound as root (or with SUID-bit set) and use ecasound's \emph{-r} option. This will raise ecasound's scheduling priority to realtime (SCHED\_FIFO). [with ecasound 2.1 and newer, just run ecasound as root and it will take care of tuning the settings] \item Try increasing ecasound's buffersize with the \emph{-b:sample\_frames} option. Something like \emph{-b:4096} should do the trick. \item If all else fails, try the various low-latency kernel patches (again, check the article) \end{itemize} There has been a lot of discussion about tuning your system for better performance on linux-audio-dev and linux-audio-user mailing lists. You can browse the list archives at \url{http://www.linuxdj.com/audio/lad/archive.php}. Here are links to selected messages from the ecasound-list archives: \begin{itemize} \item Tuning parameters for reliable recording \url{http://nosignal.fi/ecasound-list/2005/04/0038.html}. \item Smart Buffering \url{http://nosignal.fi/ecasound-list/2001/10/0020.html}. \item Ecasound for Recording \url{http://nosignal.fi/ecasound-list/2001/06/0016.html}. \end{itemize} \subsection{Can I use multiple soundcards?} This is possible, but there are some issues you should be aware of. If you try using multiple cheap soundcards to get more simultaneous inputs for recording, it's likely that the resulting streams will not be in sync. This problem is explained in detail in the Linux Audio-Quality HOWTO section "Notes on Full Duplex Recording, and Other Realtime Issues": \url{http://karmak.org/archive/2003/02/audio_quality_HOWTO.htm}. The original page at \url{http://www.linuxdj.com/audio/quality/} is no longer available. \subsection{Problems with panning mono files} In situations where you need to convert mono audio objects to multichannel objects, Ecasound can behave in a somewhat unexpected manner. For instance, the correct way to set panning for three individual mono input files, and mix the resulting stereo output to soundcard, is: \begin{verbatim} ecasound -a:1 -i:monofile1.wav -erc:1,2 -epp:0 \ -a:2 -i:monofile2.wav -erc:1,2 -epp:50 \ -a:3 -i:monofile3.wav -erc:1,2 -epp:100 \ -a:all -f:16,2,44100 -o:alsa \end{verbatim} The actual signal chain is something like: \begin{verbatim} monofile1.wav |--'1'---- erc ----| epp |---\ \-----| |---\\ \\ monofile2.wav |--'2'---- erc ----| epp |------- | alsa \-----| |------- | // monofile3.wav |--'3'---- erc ----| epp |---// \-----| |---/ ('---' = mono channel) \end{verbatim} The critical points to notice are: \begin{itemize} \item ecasound automatically notices that the three input files are mono files so chains are initialized with one mono input \item chains contain mono signal until -erc operator, which transforms the chain into a stereo chain by copying the data from ch1 to ch2 \item now -epp works as expected (sets the stereo balance for one input) \item chains are mixed to the soundcard device channel-wise \end{itemize} If you leave out the -erc operators, chains will still be converted to stereo (as -epp is a stereo operator), but on each chain, only the first channel (left) will contain any audio from the input files. \subsection{Filenames with commas not handled correctly} There are some pitfalls in how commas in filenames are handled by ecasound. If you have a filename ``foo,bar.ogg'', the following will not work: \begin{verbatim} ecasound -i foo,bar.ogg -o alsa \end{verbatim} The only way around this is to escape all the commas with backslashes: \begin{verbatim} ecasound -i foo\\,bar.ogg -o alsa \end{verbatim} The backslash has to be a double-backslash as the shell strips one of the backslashes away before passing the string to ecasound. % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{User interfaces and Applications} For a complete list of user-interfaces and applications built on top of Ecasound, visit Ecasound's web site at \url{http://www.eca.cx}. % ---------------------------------------------------------------------- \section{Ecasound} The standalone program ``ecasound'' is the primary user interface for Ecasound. See \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} man page and the \texttt{Examples web page} at \url{http://nosignal.fi/ecasound/Documentation/examples.html}. % ---------------------------------------------------------------------- \section{Ecasignalview} Ecasignalview is an utility program for monitoring signal amplitude and peak statistics. It's primarily used when adjusting signal levels for recording. \subsection{Basic use} The basic use scenario is to record audio from a soundcard device, visualize it with vu-meters and write it to a null output. \begin{verbatim} # OSS-drivers (or properly installed ALSA OSS-emulation) ecasignalview /dev/dsp null # native ALSA-mode, recording from the 'default' device ecasignalview alsa,default null \end{verbatim} It is possible to reset the max-peak and clipped-samples counters by sending a SIGHUP signal to the process (i.e. from another console: "killall -v -HUP ecasignalview"). To monitor the input signal you can either use the soundcard's analog (or in some cases, digital) monitoring functions by enabling line/mic-in monitoring using \emph{alsamixer} (ALSA), \emph{aumix} (OSS) or some other mixer application. Another option is to use ecasignalview to do the monitoring. In this case the correct command is: \begin{verbatim} # OSS input and output ecasignalview /dev/dsp /dev/dsp # corresponding ALSA command ecasignalview alsa,default alsa,default \end{verbatim} Ecasignalview command-line options allow you to fine-tune the way monitoring is done: \begin{verbatim} # increased refresh rate 20Hz ecasignalview -r:50 alsa null # larger buffersize (1024 samples) ecasignalview -b:1024 alsa null # recording in mode 32bit/10channels/96000Hz with # interleaved channels ecasignalview -f:s32,10,96000,i alsa null \end{verbatim} It can also be used with files and real-time devices like JACK inputs and outputs: \begin{verbatim} # monitor audio recorded by JACK system input (first 2ch) ecasignalview -f:f32,2 jack,system null # monitor audio from JACK application ``foosynth'' ecasignalview -f:f32,2 jack,foosynth null # play and monitor a file input ecasignalview foo.wav alsa \end{verbatim} \subsection{Further Reading} See \texttt{ecatools(1)} man page for a detailed listing of available command-line options. % ---------------------------------------------------------------------- \section{Ecatools} See \texttt{ecatools(1)} man page. % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Advanced features} % ---------------------------------------------------------------------- \section{Audio loop devices} Just by using normal chain connections it's not possible to route audio from one Ecasound chain to another. One way around this limitation is loop devices. They were introduced in Ecasound 1.7.0. \subsection{Example of use} An example use-case where we route audio from chains ``1'' and ``2'' to chain ``3'' which is amplified and send to a soundcard output (``alsa''). \begin{verbatim} --cut-- # note, the second loop parameter is the loop id-number; # it is used to associate loop inputs with correct loop outputs ecasound -a:1 -i:some.mp3 -a:2 -i:another.mp3 -a:1,2 -o:loop,1 -a:3 -ea:200 -i:loop,1 -o alsa --cut-- \end{verbatim} Both inputs are eventually routed to chain "3", where a -ea:200 is applied to the signal. This does have one downside, loop device adds latency (-b:x -> latency of x frames). % ---------------------------------------------------------------------- \section{Ecasound Wave Files - the EWF (.ewf) format} \subsection{General} Ecasound Wave File (.ewf) is a simple wrapper format for controlling other audio objects. Ewf files are useful for offsetting or time-shifting audio files (for instance play a short audio clip in the middle of a long multitrack mix), for minimizing diskspace usage during multitrack recording (output offsetting ) and looping. Starting from Ecasound version 2.5.0, similar functionality is provided by special purpose audio object types 'audioloop', 'audioselect' and others. You may choose between EWF and these audio object types based on your specific needs. See \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} man page and the \texttt{Examples web page} at \url{http://nosignal.fi/ecasound/Documentation/examples.html} for many examples of using these. Writing to EWF file is nowadays considered to be a deprecated feature and it may be removed in a future release. \subsection{File format} Ewf-files are stored in ascii format. The syntax is based on ``key=value'' pairs. The same syntax is used with Ecasound resource files. See \href{http://nosignal.fi/ecasound/Documentation/ecasoundrc\_manpage.html}{ecasoundrc(5)} man page for detailed info. Currently recognized ewf keywords are: \begin{itemize} \item source - audio object name (string) {[}read,write{]} \item offset - insert audio object at offset (time) {[}read,write{]} \item start-position - start offset inside audio object (time) {[}read{]} \item length - how much of audio object data is used (time) {[}read{]} \item looping - whether to loop sample data (true or false) {[}read{]} \end{itemize} All time values are interpreted as seconds (need not be an integer but can be given as a decimal number, e.g. ``1.05''). However if the value is an integer number and has a postfix of ``sa'' (e.g. ``44100sa''), it is interpreted as time expressed as samples (in case of a multichannel stream, time in sample frames). \subsection{Example of ewf use} Let's look at a simple example .ewf file: \begin{verbatim} -- test.ewf -- source = test.wav offset = 5.0 start-position = 2.0 length = 3.0 looping = true --cut-- \end{verbatim} Now what happens when you issue "ecasound -i test.ewf -o alsa"? Because of the ``offset'' definition, the first 5 seconds will be silent. After that ecasound will start to read data from ``test.wav''. But as ``start-position'' is not zero, ecasound will skip the first 2 seconds. After 8 seconds has passed (``offset'' + ``length''), ecasound will loop back to ``start-position''. This looping will continue until the user interrupts the operation. % ---------------------------------------------------------------------- \section{Effect presets} \subsection{General} Ecasound has a powerful effect preset system that allows you to create new effects by combining basic effects and controllers. Presets can be stored into separate files or they can be stored into a global database. Either way, the preset format is the same (also see \href{http://nosignal.fi/ecasound/Documentation/ecasoundrc\_manpage.html}{ecasoundrc(5)} man page, the same file format and syntax is used): \begin{verbatim} preset_name = effects controllers | ... | effects controllers \end{verbatim} Effects and controllers are specified using the EOS syntax, the same syntax that is used for parsing command-line options (``-ea:100'', ``-kl:1,0,100,5'', etc). The pipe character is used to separate parallel chains. Just like in shell scripts, the '$\backslash$' character can be used to spread definitions across multiple lines. \subsection{Example of preset use} Ecasound effect presets are in fact small Ecasound engines that behave just like native effects. Here's an example of a multi-chain effect preset: \begin{verbatim} --cut file 'bassbooster.ecp'-- # let's put the low freqs into one chain and high freqs in another bassbooster = -efl:2000 -ea:200 | -efh:2000 -ea:50 # note, the '|' sign separates parallel chains --cut-- \end{verbatim} Once defined, you can use the preset in the following way: \begin{verbatim} --cut-- ecasound -a:1 -i:some.mp3 -pf:bassbooster.ecp -a:2 -i:another.mp3 -pf:bassbooster.ecp -a:1,2 -o:alsa --cut-- \end{verbatim} When separate files are used (the ``-pf:name'' option), Ecasound always loads the first preset it finds. If the file contains more presets (additional ``key=value'' -pairs), they are ignored. An alternative way to define presets is to put the definition in the global preset list (usually in ``/usr/local/share/ecasound/effect\_presets''. Once you've added a line defining ``bassbooster'', you can use it like: \begin{verbatim} --cut-- ecasound -a:1 -i:some.mp3 -pn:bassbooster -a:2 -i:another.mp3 -pn:bassbooster -a:1,2 -o:alsa --cut-- \end{verbatim} \subsection{Preset parameters} Parameters of operators belonging to a preset can be exposed as preset paramters. Example: \begin{verbatim} --cut preset definition-- f_res_lowpass = -ef3:%1,1.5,0.7 --cut-- \end{verbatim} In the above example, the lowpass filter cutoff is exposed as a parameter of the ``f\_res\_lowpass'' preset. The preset can be used just like any other Ecasound operator. The following two commands will results in identical output: \begin{verbatim} --cut-- ecasound -i:foo.mp3 -o:alsa -pn:f_res_lowpass,800 ecasound -i:foo.mp3 -o:alsa -ef3:800,1.5,0.7 --cut-- \end{verbatim} \subsection{Parameter descriptors} Ecasound preset parameters can be described using the following set of descriptors: \begin{verbatim} -pd:name_of_preset = preset description -ppn:par1,...,parN = parameter names (public params) -ppd:val1,...,valN = default param values -ppl:val1,...,valN = lower bounds for param values -ppu:val1,...,valN = upper bounds for param values -ppt:flags1,...,flagsN = special flags for param N ('i'=integer, 'l'=logarithmic, 'o'=output, 't'=toggle) \end{verbatim} The option can only be used inside preset definitions (in ``effect\_presets'' files, or individual ``*.ecp'' files). An example preset parameter definition: \begin{verbatim} --cut-- f_two_filters = -efl:800 -ea:%1 | -efh:800 -ea:%2 \ -pd:Parallel_highpass_and_lowpass_filters \ -ppl:0,0 -ppu:1000,- \ -ppd:100,100 -ppn:lowgain,highgain --cut-- \end{verbatim} The above preset ``f\_two\_filters'' has two parameters, which are described using the ``-pd'' descriptor. Recommended lower and upper bounds for the parameters are defined with ``-ppl'' and ``-ppu'' descriptors. Default values for the parameters are specified with ``-ppd''. % ---------------------------------------------------------------------- \section{Gate operators} Gates are just like any other chain operators. They are assigned to a chain, and process passing audio data buffers. One special feature of gates is the ability to crop sections of audio files, for instance to achieve automatic volume-based cutting of audio streams: \subsection{Example of use} The following sequence cuts the section {[}60:00 sec -> 61:00 sec{]} from ``guitar.wav'' into ``gate-test.wav'': \begin{verbatim} --cut-- |\$ ls -la guitar.wav -rw-rw-r-- 1 kaiv kaiv 15790124 Sep 30 23:27 guitar.wav |\$ ecasound -i guitar.wav -o gate-test.wav -gc:60,1 |\$ ls -la gate-test.wav -rw-rw-r-- 1 kaiv kaiv 180268 Dec 12 22:13 gate-test.wav --cut-- \end{verbatim} The threshold gate is used similarly: \begin{verbatim} --cut-- |\$ ecasound -i gate-test.wav -o gate-test-rms.wav -ge:11.2,5,1 |\$ ecasound -i gate-test.wav -o gate-test-peak.wav -ge:5,5,0 |\$ ls -la gate*wav -rw-rw-r-- 1 kaiv kaiv 163884 Dec 12 22:18 gate-test-peak.wav -rw-rw-r-- 1 kaiv kaiv 143404 Dec 12 22:17 gate-test-rms.wav -rw-rw-r-- 1 kaiv kaiv 180268 Dec 12 22:13 gate-test.wav --cut-- \end{verbatim} In the first case, the gate is opened when the RMS-volume goes over the ``11.2\%'' threshold, and closed when RMS-volume falls below ``5\%''. In the second, case, both entry and close thresholds are ``5\%'' (peak volume). % ---------------------------------------------------------------------- \section{LADSPA plugins} Ecasound supports LADSPA-effect plugins (Linux Audio Developer's Simple Plugin API). See \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} man page and the LADSPA web site at ``www.ladspa.org'' for more information. \subsection{Ecasound is not able to find any LADSPA plugins I have installed!} Just installing the LADSPA SDK - ``www.ladspa.org'' - should be enough. The plugins themselves are stored in shared library files (.so). They are usually stored in ``/usr/local/lib/ladspa''. To test whether Ecasound finds the plugins, issue: echo "ladspa-register" | ecasound -c You should get a list of all installed LADSPA plugins. If this doesn't work, you need to make sure Ecasound is compiled with LADSPA enabled (ie. ladspa.h header was present when Ecasound was compiled). The precompiled rpm-binaries have this, but if you've compiled Ecasound yourself you should recompile after installing the LADSPA SDK. Also, check Dave Phillips' great article on Oreillynet - \url{http://www.oreillynet.com/pub/a/linux/2001/02/02/ladspa.html}. % ---------------------------------------------------------------------- \section{JACK Audio Server} \label{JACK Audio Server} JACK is system for handling real-time, low latency audio. It allows multiple independent applications to access the system audio hardware and also to route audio between applications. JACK is different from other audio server efforts in that it has been designed from the ground up to be suitable for professional audio work. This means that it focuses on two key areas: synchronous execution of all clients, and low latency operation. Note that Ecasound must be compiled with JACK support enabled (the ``--with-jack'' configure option) to take advantage of the functionality described in this section. \subsection{Basic Input and Output} Let's start with how to play a file using Ecasound and JACK: \begin{verbatim} ecasound -i foo.wav -o jack,system \end{verbatim} This will create a separate JACK output port for each channel of ``foo.wav'', and automatically connect these Ecasound ports to the JACK system PCM output ports. Note that ecasound does not allow to mix objects with different sampling rates (without explicitly inserting ``samplerate'' conversion objects). That means that if sampling rate of ``foo.wav'' does not match the current JACK system rate, the above command wil fail. The connections creadted are as follows: \begin{verbatim} ecasound:out_1 --> system:playback_1 ecasound:out_2 --> system:playback_2 \end{verbatim} If ``foo.wav'' was a four channel file, the same command would connect all channels: \begin{verbatim} ecasound:out_1 --> system:playback_1 ecasound:out_2 --> system:playback_2 ecasound:out_3 --> system:playback_3 ecasound:out_4 --> system:playback_4 \end{verbatim} To record a file, you'd issue: \begin{verbatim} ecasound -f:,2 -i jack,system -o foo.wav ecasound -f:f32,2,44100 -i jack,system -o foo.wav \end{verbatim} Here we use ``-f:bits,channels,srate'' to set how many channels to record from the sound device using JACK. As described in the \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} man page, the parameters to ``-f'' may be overridden by the audio objects. In case of JACK, the server always sets the sampling rate, and also the sample format is fixed to 32bit floats. Because of this, the above two examples achieve the same result (but you may find the latter command more readable). It is possible to add another ``-f'' before ``-o foo.wav'' if you want to write the file in a different format. For example to convert the sample format to 16bit fixed: \begin{verbatim} ecasound -f:f32,2 -i jack,system -f:s16,2 -o foo.wav \end{verbatim} \subsection{More Advanced Port Creation} Ecasound also offers the following alternative ways to create input and output ports: \begin{verbatim} ecasound -i foo.wav -o jack ecasound -i foo.wav -o jack,remote_client ecasound -i foo.wav -o jack,remote_client,local_portprefix ecasound -i foo.wav -o jack,,local_portprefix ecasound -i foo.wav -o jack_multi,remote_client:port_1,system:port_2 ecasound -i jack -o foo.wav ecasound -i jack,remote_client -o foo.wav ecasound -i jack,local_portprefix -o foo.wav \end{verbatim} See \href{http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html}{ecasound(1)} manual page for descriptions of the ``jack\_multi'' audio object and the variants of ``jack'' usage. \subsection{Transport Control} Transport controls are functions like ``start'', ``stop'', ``seek'', etc, that are commonly available in audio applications that maintain some kind of current position. JACK's transport control interface allows controlling the transport state of all the apps connected to one JACK server from a single application. Ecasound can support this functionality in four different modes (``notransport'', ``send'', ``recv'' and ``sendrecv''). By default Ecasound will both send and reveive transport events (position and state) to other JACK clients (mode ``sendrecv''): \begin{verbatim} ecasound -c -i null -o jack \end{verbatim} To use transport control in Ecasound, you have to have at least one published input or output JACK port. Here we publish one null output port. After giving the initial ``engine-launch'' command in Ecasound interactive mode, you are now able to use further EIAM commands to control all other JACK apps connected to the same server. Commands like ``stop'', ``setpos 20'', ``rw 10'', ``fw 10'', and so should affect other apps. By default, Ecasound doesn't react to outside transport control. To enable this: \begin{verbatim} ecasound -c -i foo.wav -o jack,system -G:jack,eca_slave,recv \end{verbatim} After giving an initial ``engine-launch'' to Ecasound, you should now be able to use other JACK apps to control Ecasound's playback of ``foo.wav''. To combine external control with the ability to control the transport from ecasound's user-interface: \begin{verbatim} ecasound -c -i foo.wav -o jack,system -G:jack,eca_slave,sendrecv \end{verbatim} \subsection{JACK and Ecasound states} To have a good understanding of the overall system, it's important to understand how Ecasound and JACK states relate to each other. When an Ecasound chainsetup is connected (EIAM-command ``cs-connect''), a connection is established with the JACK server, and all the JACK ports in that chainsetup are registered to it. Once Ecasound's engine is launched with EIAM-command ``engine-launch'', connections (if any are specified) are made to the ports of other JACK clients. In this state Ecasound is ready to process incoming transport state and position changes. When Ecasound processing is started (either with ``start'' or by an incoming transport event), Ecasound's engine runs as a node in the JACK system. When processing is stopped (either with ``stop'', or by a transport event), Ecasound's engine is not run. Any connections (initiated by Ecasound) to other clients, are disconnected once ``engine-halt'' is issued and engine operation is stopped. Connection to the remote JACK server as well as unregistering any ports is performed when chainsetup is disconnected (``cs-disconnect''). Note! Normally you don't need to go through all the steps one by one. Instead issuing ``start'' will automatically connect the chainsetup and launch the engine. Similarly ``cs-disconnect'' will stop processing and halt the engine if needed. \subsection{Troubleshooting} Ecasound v2.2 and earlier don't have the capability to change the engine buffersize and sampling rate dynamically during processing. As a consequence, running Ecasound will fail if the currrent values for these parameters do not match the ones used by the JACK server. In other words, you have to correctly set the buffersize (with ``-b:xxx'') and sampling rate (with ``-f:bits,channels,srate'' and possibly using the \emph{resample} audio object). This is the first thing to check if communication with JACK does not work. Future versions of Ecasound will hopefully solve this problem. This issue is covered by Ecasound development item ``edi-31 - Support for dynamic sampling rate and buffersize changes.''. \subsection{Deprecated JACK input/output syntax} Ecasound 2.5 and older supported ``jack\_alsa'', ``jack\_auto'' and ``jack\_generic'' object types, but these are now replaced by a more generic ``jack'' interface. The old variants this work, but are now considered deprecated (they work but may be removed in a future Ecasound release). % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \chapter{Miscellaneous} % ---------------------------------------------------------------------- \section{Security Considerations} When given the -r option (raise priority), Ecasound tries to raise its scheduling priority (to so called SCHED\_FIFO realtime scheduling) and to avoid swapping, locks all its memory. To do this, root-privileges are required. So either Ecasound has to be run as root (logged in as root, or using the 'sudo' program), it has to be installed with the suid-root bit set, or otherwise be granted necessary privileges to turn on real-time schedule (see below). Now is this a safe thing to do? Although there are no known vulnerabilities, setting Ecasound suid-root is not safe. Whether this is a real problem depends on the particular setup (whether connected to a network or not, any untrusted users with shell access, ...). The basic problem is that Ecasound (or at least 2.0 and earlier) doesn't contain any code for altering privilege levels. If it is run with root-privileges, it does everything as root - including forking external programs such as mp3 and ogg utilities and editors. But all in all, this shouldn't be that big of an issue for many users. For noncritical uses, just don't set the suid-bit, but run as a normal user. If you have an untrusted setup, and you don't want to login as root, but still need to run in raised-priority mode, the following can help to limit the risk of suid-root use: \begin{verbatim} cd /usr/local/bin chown root.ecausers ecasound chmod 4750 ecasound \end{verbatim} In other words, the ecasound binary is set as suid-root (so it is run with root-privileges), but only root and members of the 'ecausers' group can start it. You of course first have to create the 'ecausers' group to your system. The ideal solution would be that ecasound would not need full root-privileges, but privileges for changing scheduling and locking memory. On recent Linux systems, there are couple ways to achieve this. The Realtime Linux Security Module (LSM) is one practical solution (see \url{http://sourceforge.net/projects/realtime-lsm/} and \url{http://lwn.net/Articles/106009/}). This module is a loadable extension for Linux 2.6 kernels. It selectively grants realtime permissions to specific user groups or applications. Unfortunately Realtime LSM does not yet come with the standard Linux kernel, so you need to install it separately. A more recent approach, and one that might be adopted by popular GNU/Linux distributions, is the \emph{rtprio} extension to Linux resource limits. See \href{http://lwn.net/Articles/134460/} for a good overview of this approach and how it compared to the LSM mechanism described above. \end{document} ecasound-2.9.3/Documentation/users_guide/Makefile.in0000644000076400007640000003307013606336177017472 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/Documentation/users_guide/Makefile.am # Description: Ecasound documentation - user's guide # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- # --------------------------------------------------------------------- # Files going into distribution: srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = Documentation/users_guide DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = users_guide.latex DISTCLEANFILES = \ users_guide.log \ users_guide.aux \ users_guide.out \ users_guide.dvi \ users_guide.toc \ users_guide.ps \ ecasound_users_guide.pdf \ html_uguide/users_guide.html \ html_uguide/users_guide.haux \ html_uguide/users_guide.htoc all: all-am .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Documentation/users_guide/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Documentation/users_guide/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 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 installdirs: 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 -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am all: docs: ecasound_users_guide.pdf ecasound_eci_doc.pdf: eci_doc.latex eci_doc.dvi # note: to create the table of contents (which spans multiple pages), and # re-calculate the page numbers after the page offset generated by table # of contents, latex needs to be ran 3 times. (Junichi Uekawa, 2007-08-06) users_guide.dvi: $(srcdir)/users_guide.latex latex $(srcdir)/users_guide.latex latex $(srcdir)/users_guide.latex latex $(srcdir)/users_guide.latex dvips -Ppdf -o users_guide.ps users_guide.dvi ps2pdf users_guide.ps ecasound_users_guide.pdf mkdir -p html_uguide hevea -o html_uguide/users_guide.html $(srcdir)/users_guide.latex hevea -o html_uguide/users_guide.html $(srcdir)/users_guide.latex ecasound_users_guide.pdf: users_guide.dvi clean-docs: rm -fv ecasound_users_guide.pdf rm -fv users_guide.log users_guide.toc users_guide.dvi users_guide.aux users_guide.ps users_guide.dvi rm -fv html_uguide/* # 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: ecasound-2.9.3/Documentation/ecafixdc.10000644000076400007640000001555212260765172014740 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/ecaconvert.10000644000076400007640000001555212260765172015323 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/ecasignalview.10000644000076400007640000001555212260765172016013 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/programmers_guide/0000755000076400007640000000000013606336217016672 500000000000000ecasound-2.9.3/Documentation/programmers_guide/ecasound_programmers_guide.txt0000644000076400007640000012560312260765741024761 00000000000000:editor: -*- mode: fundamental; tab-width: 4; indent-tabs-mode: nil -*- :version: 20090419-9 :syntax: loosely follows restructured text, http://docutils.sourceforge.net/rst.html :author: Kai Vehmanen =========================== Ecasound Programmer's Guide =========================== .. ################################################################# .. ################################################################# .. contents:: Preface ~~~~~~~ This document describes how Ecasound and the related libraries work, how to use them, how to extend and add features and other similar issues. Before reading this document, you should first take a look at other available documentation (especially Ecasound Users's Guide). If not otherwise specified, all documentation refers to the latest Ecasound version. .. ################################################################# .. ################################################################# Document history ~~~~~~~~~~~~~~~~ Hmm, why doesn't this work...? :: | 19.04.2009 - Minor updates to NetECI and ECA_CONTROL. | 21.08.2005 - Typos fixed, removed duplicated section on audio | routing. Minor updates to various sections. | 25.04.2005 - Minor updates. | 28.03.2005 - Added section about "Source code markup", update the | "Design principles" section. | 13.03.2005 - Converted from LaTeX to ascii. | 23.10.2004 - Added section "EIAM commands" that covers adding | new EIAM commands. | 18.11.2003 - Typo fixes. Updated documentation to reflect the new | naming convention (ecasound refers to the binary, | Ecasound refers to the whole package). | 07.11.2002 - Added documentation for NetECI. | 25.10.2002 - Added "Checklist for Audio Object Implementations". | 17.10.2002 - Added a warning against direct use of libecasound | and libkvutils. Using ECI is from now on the | preferred way of using ecasound as a development | platform. Rewrote the "Versioning" section. | 02.10.2002 - Added the "Protocols and Interfaces" chapter. | 29.04.2002 - Added chapter about "Unit Tests". | 28.04.2002 - Revised namespace policy (see chapter | on namespaces), replaced references to | obsolete ECA_DEBUG with a description | of the new ECA_LOGGER subsystem. | 27.02.2002 - Rewrote the "Control flows" chapter according | to the structural changes made in 2.1dev8. Added | a "References" section. | 31.01.2002 - Reorganization of document structure. New chapter | about "Library organization". | 19.12.2001 - Added chapter about include hierarchies. | 28.10.2001 - Lots of changes to the "Object maps" chapter. | 21.10.2001 - Added this history section. .. ################################################################# .. ################################################################# General programming guidelines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Design and programming principles ================================= The following sections describe some of the key design principles that have been guiding Ecasound development. Open and generic design ----------------------- Over the years Ecasound's core design has been revised many times. The aim has been to keep the core flexible enough, so it can be easily adapted to new use cases. Object-orientation ------------------ Ecasound is written in C++ (as specified in 1997 ANSI/ISO C++ standard). Common object-oriented design practices should be utilized. At same time overuse of object-orientation should be avoided. Object-orientation is a very effective design method, but not the only one. Sometimes other approaches work better. Data hiding ----------- This design principle deserves to be mentioned separately. Whenever possible, the actual data representation and implementation details should always be hidden. This allows to make local implementation changes without affecting other parts of the code base. It cannot be emphasized enough how important this goal is for large software projects like Ecasound. Design by contract ------------------ When writing a new routine, in addition to the actual code, also routine's behaviour should be described as accurately as possible using preconditions and postconditions to describe the external side-effects (how it changes the object state, what is the relation between arguments and return values). The preconditions should specify all requirements and assumptions related to routine's inputs. If the caller violates this specification, routine is not responsible for the error. The postconditions should specify what statements hold true when routine has been executed. This information helps the caller to better understand how the routine works and to identify implementation bugs. Ideally, these conditions prove that the routine works correctly. Writing a complete description of a routine can be difficult, but the benefits of this approach should be clear. When you call a well-defined routine, a) you know what parameter values it accepts, b) you know what it does and c) if errors occur, it's easier to pinpoint the faulty routine. In practice describing routines is done by combining verbose comments and defining pre/postconditions. As C++ doesn't directly support pre/postconditions, the DEFINITION_BY_CONTRACT and DBC tools provided by libkvutils are used. Routine side effects -------------------- A clear distinction should be made between routines that have side-effects (=methods, processors, modifiers; routines that change object's state) and const routines (=functions, observers). To make monitoring side effects easier, all Ecasound classes should be const-correct. A object is const-correct if a function taking only a single argument that is a const reference to that object is not able, without explicit casting, to obtain a non-const reference to that same object (or a portion thereof) from within the function body. Sanity checks ------------- Sanity checks are done only to prevent crashes. All effects and operators should accept also "insane" parameters. For example, the amplifier effect accepts -100.0% as the gain value. This of course results in inverted sample data, which is a useful outcome. As Ecasound is supposed to be a tool for creative work and experimenting, the decisions on which parameters are useful for audio processing should not be made in source code. Error handling -------------- Two specific things worth mentioning: First, the standard UNIX-style error handling, where functions performing actions return an integer value, is not used in Ecasound. As described in the above section Routine side effects, all routines are either modifiers or observers, not both. So when using Ecasound APIs, you first perform an action (modifying function), and then afterwards check what happened (using an observer function). Exceptions ---------- C++ exceptions are used in Ecasound. Exception based error handling has its problems, but in some cases it is clearly the best option. Exceptions are most useful in situations where controlled error recovery is very difficult, and in situations where errors occurs only very rarely. This allows callers to avoid constantly checking returns values for functions that in normal use never fail. Another special case is handling critical errors that occur in class contructors. Using exceptions for anything other than pure error handling is to be avoided at all cost. And when exceptions are used, their use must be specified in function prototypes. This is important, as clients need to know what exceptions can be thrown. C++ unfortunately doesn't require strict exception prototypes, so this issue requires extra care. A list of specific cases where exceptions are used follows: AUDIO_IO - open() This method is used for initializing external connections (opening files or devices, loading shared libraries, opening IPC connections). It's impossible to know in advance what might happen. In many cases it is also useful to get more verbose information about the problem that caused open() to fail. Throwing an exception is an excellent way to achieve this. ECA_CHAINSETUP - enable() TBD ECA_CHAINSETUP - load_from_file, save() and save_to_file TBD ECA_SESSION - constructor TBD Coding style, naming conventions and source code markup ======================================================= This section describes some of the conventions used in Ecasound development. As a general rule, one should adapt to whatever style and conventions used in already existing code. Variable and type naming ------------------------ Variable names are all lower case and words are separated with underscores (int very_long_variable_name_with_underscores). Class data members are marked with "_rep" postfix. Data members which are pointers are marked with "_repp". Index-style short variable names (n, m, etc.) are only used in local scopes. Enum types have capitalized names (Some_enum). Use of macro processing should be avoided, but when necessary, macro names should be capitalized. Package specific ---------------- libecasound, ecasound, ecatools, libkvutils Class names are all in upper case and words separated with underscores (class ECA_CONTROL_BASE). This a standard style in Eiffel programming. libqtecasound, qtecasound, ecawave Qt-style is used when naming classes (class QELevelMeter), otherwise same as above. Private classes --------------- Some classes are divided into public and private parts. This is done to make it easier to maintain binary-level compatibility between library versions, and to get rid of header file dependencies. Private classes have a "_impl" postfix in their name. They are usually stored into separate files which also use the "_impl" notation. For instance the ECA_ENGINE class (eca-engine.h) has a private class ECA_ENGINE_impl (eca-engine_impl.h). Access to ECA_ENGINE_impl is only allowed to ECA_ENGINE member functions. In addition, the private header file (eca-engine_impl.h) is only included from the ECA_ENGINE implementation file (eca-engine.cpp). This allows us to add new data members to ECA_ENGINE_impl without breaking the binary interface. Unit tests ---------- Unit tests are used for verifying that modules work as intended. A test for component, with a public interface defined in "prefix-component.h", should located in "prefix-component_test.h". The test itself should implement the ECA_TEST_CASE interface. In addition, generic test cases should be added to ECA_TEST_REPOSITORY - see "libecasound/eca-test-repository.cpp". Source code markup ------------------ In addition to the Javadoc-style source code documentation (see 'Documentation style' section), inline commentary markup is used to document important code segments. Use of common markup notation is preferred (for example it is nice to be able to grep for a list of open items in certain part of the codebase): - Known bugs, unhandled cases, and missing features should be marked with "FIXME: description" comments. - Explanatory notes that help to understand the code should be marked with "NOTE: description". Style updates ------------- The general rule is to use consistant style within one source file (i.e. compilation unit). Updates to style issues are also done with the same granularity. The following global updates have been made so far to the sources: eca-style-version: 1 The opening braces of multi-line functions should be put on a separate line, at column 1, instead of being on the same line with function signature. This change only applies to functions, in other words the K&R style is followed. eca-style-version: 2 Extra parenthesis around "return" values should be removed ("return" is a keyword, not a function). eca-style-version: 3 The module name prefix, for example "(eca-session) ", should be removed from ECA_LOG_MSG() statements. The module prefix is added automatically to the debug messages when debug level "module_names" is activated. If a file has been updated according to these guidelines, the appropriate style version should be mentioned at the start of the file ("Attributes: eca-style-version: XXX"). Physical level organization =========================== Ecasound libraries and applications are divided into distribution packages, directories and file groups. Include hierarchies ------------------- Include statements that are not stricly necessary should be dropped! Not only do they cause unwanted dependencies, they also create more work for the compiler (Ecasound already takes painfully long to compile). Some rules to follow: - In header files, no extra header files should be defined. For instance in many cases it's enough to state that object SOME_TYPE is a class without need for the full implementation; so instead of "\#include "sometype.h", use "class SOME_TYPE;". - For modules with separate implementation and header files, dependencies to other modules need not be stated in both. - Direct dependencies to outside modules must always be mentioned directly. It's easy to unknowingly include a required header file via some other header file. This should be avoided as it hides real dependencies. - When including headers for more special services, it's good to add a comment why this header file is needed. Distribution packages --------------------- As an example, Ecasound and Ecawave are distributed as separate packages. This decision has been made because a) they are clearly independent, b) they have different external dependencies, and c) they address different target uses. Directories ----------- It's convenient to organize larger sets of source code into separate directories. For instance libecasound and ecatools components of the Ecasound package are located in separate directories. File groups ----------- Although files are divided in directories and subdirectories, there's still a need to logically group a set of source files based on their use and role in the overall design. As the use of C++ namespaces is very limited in Ecasound (to avoid portability problems), filename prefixes are used for grouping files. Here's a short list of commonly used prefixes. audioio*.{cpp,h} Audio device and file input/output. audiofx*.{cpp,h} Audio effects and other DSP-related code. audiogate*.{cpp,h} Gate operators. eca*.{cpp,h} Core functionality. midi*.{cpp,h} MIDI input/output devices, handlers and controller code. osc*.{cpp,h} Oscillator and other controller sources. qe*.{cpp,h} Generic prefix for files utilizing both Qt and Ecasound libraries. samplebuffer*.{cpp,h} Routines and helper functions for processing audio data buffers. You should note that these are just recommendations - there are no strict rules on how files should be named. C++ std namespace ----------------- The preferred way to access C++ standard library functions is to use explicit namespace selectors ("std::string") in public headers files, and "using declarations" in the implementation parts ("using std::string"). It's also possible to import the whole std namespace ("using namespace std;") in the beginning of an implementation file (but never in headers!). Documentation style =================== Javadoc-style class documentation is the preferred style. Class members can be documented either when they are declared (header files), or when they are defined. Especially when specifying complicated interfaces, it's better to put documentation in the definition files. This way the header files remain compact and serve better as a reference. Here's a few general documentation guide lines: Use of 3rd person "Writes samples to memory." instead of "Write samples to memory." Sentences start with a verb "Writes samples to memory." instead of "Samples are written to memory." Use "this" instead of "the" "Get controllers connected to this effect." instead of "Get controllers connected to the effect. Versioning ========== All Ecasound releases have a distinct version number. The version number syntax is x.y[.z][-extraT], where x and y are the major and minor numbers, and z is an optional revision number. To test major changes, separate -preX or -rcX versions can be distributed before the official release. In addition, all Ecasound libraries have a separate interface version. The libtool-style version:revision:age versioning is used. See the libtool documentation for details. One important thing to note is that the library interface version numbers are tied to the source-code level interfaces, not the binary interfaces. Because binary interfaces are not explicitly versioned, applications should always statically link against the Ecasound libraries. Also, any private source-code interfaces, ie. header files with a "_impl.h" postfix, are not part of the versioned public interface. Applications should not rely on these interfaces! All changes in the public interfaces are documented in library specific ChangeLog files. These files are usually located in the top-level source directory of the versioned library. One thing to note is that Ecasound's versioning practises have changed quite a few times during the project's history. The rules described above only apply to Ecasound 2.2.0 and newer releases. .. ################################################################# .. ################################################################# How Ecasound works? ~~~~~~~~~~~~~~~~~~~ Example use cases ================= Here's a few common use cases how Ecasound can be used. Simple non-interactive processing --------------------------------- One input is processed and then written to one output. This includes effect processing, normal sample playback, format conversions, etc. Multitrack mixing ----------------- Multiple inputs are mixed into one output. Real-Time effect processing --------------------------- There's at least one real-time input and one real-time output. Signal is sampled from the real-time input, processed and written to the real-time output. One-track recording ------------------- One real-time input is processed and written to one or more outputs. Multitrack recording -------------------- The most common situation is that there are two separate chains. First one consists of real-time input routed to a non-real-time output. This is the recording chain. The other one is the monitor chain and it consists of one or more non-real-time inputs routed to a real-time output. You could also route your real-time input to the monitoring chain, but this is not recommended because of severe timing problems. To synchronize these two separate chains, Ecasound uses a special multitrack mode (which should be enabled automatically). Recycling a signal through external devices ------------------------------------------- Just like multirack recording. The only difference is that real-time input and output are externally connected. Audio signal routing ==================== Basic audio flow inside an Ecasound chainsetup is as follows: Audio data is routed from input audio objects to a group of chains. In the chains audio data is processed using chain operators. After processing data is routed to output objects. Using internal loop devices, it's also possible to route signals from one chain to another. Looping causes extra latency of one engine cycle. Routing of signals is based on the ability to assign inputs and outputs to multiple chains. Assigning an input object to multiple chains divides the audio signal generating multiple copies of the original input data. Similarly with an output object, data from multiple chains is mixed together to one output object. Control flow ============ Batch operation --------------- When Ecasound is run in batch mode, the program flow is simple. To store the session data, a ECA_SESSION object is first created. The created object is then passed as an argument for ECA_CONTROL class constructor. All required configuration of inputs, outputs and chain operators is done using the services provided by ECA_CONTROL. Once a valid chainsetup is ready for processing, batch operation is initiated by issuing ECA_CONTROL::run(). This function will block until processing is finished. Interactive operation --------------------- Interactive operation is similar to batch operation. The important difference is that processing is started with ECA_CONTROL::start(). Unlike run(), start() does not block the calling thread. This makes it possible to continue using the ECA_CONTROL interface while engine is running in the background. Two important concepts to understand when working with ECA_CONTROL are the selected and connected chainsetups. ECA_CONTROL allows working with multiple chainsetups, but only one of them can be edited at a time, and similarly only one at a time can be connected to the processing engine. For instance if you add a new input object with add_audio_input(), it is added to the selected chainsetup. Similarly when you issue start(), the connected chainsetup is started. .. ################################################################# .. ################################################################# Library organization ~~~~~~~~~~~~~~~~~~~~ The primary source for class documentation is header files. A browsable version of header documentation is at http://nosignal.fi/ecasound/Documentation Anyway, let's look at the some central classes. Interfaces for external use =========================== The following classes of libecasound are designed as primary interfaces for external use. The approach is based on the Facade (GoF185) design pattern. The primary goals are concentrating functionality, and maintaining a higher level of interface stability. ECA_CONTROL - eca-control.h --------------------------- ECA_CONTROL represents the whole public interface offered by libecasound. The primary purpose of ECA_CONTROL is to offer a consistent, straightforward interface for controlling Ecasound. The interface is also designed to be more stable than other parts of the library. On important part of ECA_CONTROL is the functionality for interpreting EOS (Ecasound Option Syntax) and EAIM (Ecasound Interactive Mode) commands. ECA_CONTROL_MAIN (eca-control-main.h) is an abstract base class that defines a subset of core ECA_CONTROL functionality. This interface is implemented by e.g. ECA_CONTROL (the default implementation) and ECA_CONTROL_MT (a thread-safe variant that allows simultaneous use from multiple threads). It is recommended that applications use the subset defined by ECA_CONTROL_MAIN. ECA_CONTROL_INTERFACE - eca-control-interface.h ----------------------------------------------- C++ implementation of the Ecasound Control Interface (ECI) API. See section "Ecasound Control Interface" for more information. Core classes ============ This section introduces the core classes, which define the central data types and are responsible for the main program logic. AUDIO_IO_PROXY_SERVER - audioio-proxy-server.h ---------------------------------------------- Implements a audio input/output subsystem that adds a second layer of buffering between the main processing engine and non-real-time audio input and output objects. Double buffering is needed to guarantee a real-time constrained data stream even when dealing with non-real-time objects like disk files. CHAIN - eca-chain.h ------------------- Class representing one abstract audio signal chain. CHAIN objects consist of chain operators, controllers and their state information. ECA_CHAINSETUP - eca-chainsetup.h --------------------------------- ECA_CHAINSETUP is the central class for storing user-visible objects. All inputs, output, chain operator and controller objects are attached to some ECA_CHAINSETUP object. ECA_ENGINE - eca-engine.h ------------------------- ECA_ENGINE is the actual processing engine. It is initialized with a pointer to a ECA_CHAINSETUP object, which has all information needed at runtime. In other words ECA_ENGINE is used to execute the chainsetup. You could say ECA_ENGINE renders the final product according to instruction given in ECA_CHAINSETUP. Processing is started with the exec() member function and after that, ECA_ENGINE runs on its own. If 'batch_mode' is selected (parameter to exec()), one started ECA_ENGINE will run until a 'finished' condition is met and then exit automatically. Finished means that we have read all available data from input sources. Of course if some input has infinite length (soundcards for example), processing will never finish. To get around this limitation, it's possible to set the processing length (see ECA_CONTROL_OBJECTS::set_chainsetup_processing_length_in_seconds()). If batch mode is not enabled, engine will just perform the init phase and starts waiting for further instructions. These instructions can be send to the engine using the ECA_ENGINE::command() member function. ECA_ENGINE has the following states: not_ready ECA_SESSION object is not ready for processing or ECA_ENGINE hasn't been created running processing stopped processing hasn't been started or it has been stopped before completion finished processing has been completed error an error has occured during prosessing ECA_SESSION - eca-session.h --------------------------- ECA_SESSION is an abtraction used to represents a group of chainsetups. At any time, only one chainsetup object at a time can be active (connected). For modification, one chainsetup can be set as 'selected'. This means that all configuration operations are targeted to the selected chainsetup. The only public access to ECA_SESSION objects is through ECA_CONTROL objects. MIDI_SERVER - midi-server.h --------------------------- Engine that handles all MIDI input and output. SAMPLEBUFFER - samplebuffer.h ----------------------------- Basic unit for representing blocks of sample data. The data type used to represent single samples, valid value ranges, channel count and system endianess are all specified in "samplebuffer.h" and "sample_specs.h". Feature and capability interface classes ======================================== Many libecasound classes have similar attribute sets and capabilities. To make use of these shared features, most common features have their own virtual base classes. All objects that have a particular feature, inherit the same virtual base class. This makes object grouping and management easier and less error prone. DYNAMIC_PARAMETERS - dynamic-parameters.h -------------------------------------------- Implemented by all classes that provide a set of generic parameters of type T. Parameter can be observed and modified, and they usually are identified by a unique name and a more verbose description. Number of parameters can vary dynamically. Other objects can access these parameters without detailed knowledge of the object itself. ECA_AUDIO_FORMAT - eca-audio-format.h ------------------------------------- Implemented by all classes that an audio format attribute set that can be observed and modified. ECA_AUDIO_POSITION - eca-audio-position.h ----------------------------------------- Implemented by all classes that need to maintain current audio position and length. ECA_SAMPLERATE_AWARE - eca-samplerate-aware.h --------------------------------------------- Implemented by all classes that need knowledge of current sampling rate. MIDI_CLIENT - midi-client.h --------------------------- Implemented b all classes that require a connection to an instance of MIDI_SERVER. Object interfaces ================= Object interfaces define the behaviour for common objects used by libecasound. The core classes rarely operate on specific object types, but instead use object interfaces (abstract interfaces). Object interfaces are usually abstract C++ classes (instances of these classes cannot be created as some of functions don't yet have a concreate implementation, ie. they pure virtual functions). AUDIO_IO - audioio.h -------------------- Virtual base class for all audio I/O objects. Different types of audio objects include files, audio devices, sound producing program modules, audio server clients, and so on. More specialized interface classesa are AUDIO_IO_DEVICE (for real-time audio objects) and AUDIO_IO_BUFFERED (for POSIX-style buffered i/o). There's also a special AUDIO_IO_MANAGER interface for managing multiple audio objects of same type inside one chainsetup. CHAIN_OPERATOR - eca-chainop.h ------------------------------ Virtual base class for chain operators. CONTROLLER_SOURCE - ctrl-source.h --------------------------------- Virtual base class for all controller sources. MIDI_IO - midiio.h ------------------ Virtual base for objects capable of reading and writing raw MIDI data. MIDI_HANDLER - midi-server.h ---------------------------- Virtual base class for objects capable of receiving and processing MIDI data. Object interface implementations - plugins ========================================== Majority of the classes in libecasound fall to this category. They implement the behaviour of some object interface type. As other parts of the library only use the object interfaces, these implementation classes are fairly isolated. Changes made inside object implementation have no effect to other parts of the library. Similarly new object interface implementations can be added without modifying the core classes. Utility classes =============== TBD eca-logger.h - ECA_LOGGER ------------------------- Singleton class that provides an interface to Ecasound's logging subsystem. Libecasound sends all log messages to this interface. The actual logger implementation can be done in many ways. For example in the console mode user-interface of Ecasound, TEXTDEBUG class implements the ECA_LOGGER_INTERFACE class interface. It sends all messages that have a suitable debug level to the console's standard output. On the other hand, in qtecasound, ECA_LOGGER_INTERFACE is implemented using a Qt widget. New ECA_LOGGER_INTERFACE implementations can be registered at runtime with the ECA_LOGGER::attach_logger() member function (declared in eca-logger.h). Object maps =========== Object maps are central repositories for commonly used objects. Their main purpose is to add flexibility to handling different object types - especially to handling dynamic addition and removal of whole object types. They provide the following services: - listing all object types in any of the available categories (for instance, list all effect types) - creating new object instances based on keyword strings (for instance, returns an mp3 object if "foo.mp3" is given as keyword) - adding new object types (object map item is identified by tuple of "keyword, regex expression, object type") - removing object types - reverse mapping objects back to keyword strings In Ecasound, all access to object maps goes throuh the library-wide ECA_OBJECT_FACTORY class, which provides a set of static functions to access the object maps. This system may sound a bit complex, but in practise it is quite simple and makes a lot of things more easier. For instance, when adding new object types to the library, you only have to add one function call which registers the new object; no need to modify any other part of the library. It also makes it possible to add new types at runtime, including dynamically loaded plugins. One special use-case is where an application linked against libecasound adds its own custom object types on startup. All parts of libecasound can use the custom objects, although they are not part of library itself. All objects defined in libecasound are registered in the file eca-static-object-maps.cpp. eca-object.h - ECA_OBJECT ------------------------- A virtual base class that represents an Ecasound object. All objects handled by the object factory must inherit this class. eca-object-factory.h - ECA_OBJECT_FACTORY ----------------------------------------- The public interface to Ecasound's object maps. All its functions are static. .. ################################################################# .. ################################################################# Adding new features and components to Ecasound? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Things to remember when writing new C++ classes =============================================== TBD Copy constructor and assignment operator ---------------------------------------- Always take a moment to check your copy constructor and the assign operation (=operation()). Basicly you have three alternatives: - Trust the automatically created default definitons. If you don't have any pointers as data members, this isn't necessarily a bad choice at all. At least the compiler remembers to copy all members! - If you have pointers to objects as class data members, you should write definitions for both the copy-constructor and the assign operation. - If you are lazy, just declare the two functions as null functions, and put them in "private:"_ access scope. At least this way nobody will use the functions by accident! Audio objects ============= To implement a new audio object type, you must first select which top-level class to derive from. Usually this is either AUDIO_IO (the top-level class), AUDIO_IO_BUFFERED (a more low level interface) or AUDIO_IO_DEVICE (real-time devices). The second step is to implement the various virtual functions declared in the parent classes. These functions can be divided into four categories: 1) attributes (describes the object and its capabilities), 2) configuration (routines used for setting up the object), 3) main functionality (open, close, input, output, etc) and 4) runtime information (status info). Adding the new object to Ecasound is much like adding a new effect (see the next section). Basicly you just add it to the makefiles and then register it to the appropriate object map (see below). Checklist for Audio Object Implementations ------------------------------------------ 1. Check that read_buffer() and write_buffer() change the internal position with either set_position_in_samples() or change_position_in_samples() functions of ECA_AUDIO_POSITION. Also, when writing a new file, extend_position() should also be called. All this is done automatically if using read_samples() and write_samples() from AUDIO_IO_BUFFERED. 2. If implementing a proxy object, separately consider all public functions of audioio-proxy.h (whether to reimplement or use as they are). 3. Check that open() and close() call AUDIO_IO::open() and AUDIO_IO::close(), and in the right order. 4. If the object supports seeking, seek_position() must be implemented. 5. Check that the set_parameter() and get_parameter() methods work correctly when they are used for saving and restoring audio object state (for example cs-edit EIAM command). Effects and other chain operators ================================= Write a new class that inherits from CHAIN_OPERATOR or any of its successors. Implement the necessary routines (init, set/get_parameter, process and a default constructor) and add your source files to libecasound's makefiles. Then all that's left to do is to add your effect to libecasound/eca-static-object-maps.cpp, register_default_objects(). Now the new effect can be used just like any other Ecasound effect (parameters control, effect presets, etc). Another way to add effects to Ecasound is to write them as LADSPA plugins. The API is well documented and there's plenty of example code available. See http://www.ladspa.org for more information. Differences between audio objects and chain operators ===================================================== Design-wise, audio objects and effects (chain operators) aren't that far away from each other. Many audio apps don't separate these concepts at all (for instance most UG based synthesizers). In Ecasound though, there are some differences: Input/output: - audio objects can be opened for reading writing or read\&write - ... effects are not modal (i.e. modeless) - audio objects read from, or write to, a buffer - ... effects get a buffer which they operate on (in-place processing) Audio format: - audio objects have a distinct audio format (sample rate, bits, channels) - .... effects should be capable of accepting audio data in any format (this is usually easy as Ecasound converts all input data to its internal format) Control: - audio objects can be opened, closed, prepared, started and stopped - ... effects have a much simpler running state: either uninitialized or ready-for-processing Position: - audio objects have length and position attributes - ... effects just process buffers and don't need to care about position information A good example of the similarity between the two types are LADSPA oscillator plugins. Although they are effects, you can easily use them as audio sources (inputs) by specifying: :: "ecasound -i null -o /dev/dsp -el:sine_fcac,440,1" LADSPA plugins ============== Ecasound supports LADSPA-effect plugins (Linux Audio Developer's Simple Plugin API). See LAD mailing list web site for more info about LADSPA. Other useful sites are LADSPA home page and LADSPA documentation. EIAM commands ============= Adding a new interactive mode commands requires changes to the following files: - libecasound/eca-iamode-parser_impl.h: Unique id for the new command has to be added to enum Commands. - libecasound/eca-iamode-parser.cpp: The new command must be added to the appropriate register_commands_*() function. - libecasound/eca-iamode-parser.cpp: The new command must be added to the appropriate action_requires_*() sets. - libecasound/eca-control.cpp: The actual implementation of the new command. - Documentation/ecasound-iam_manpage.yo: Documentation must be added. .. ################################################################# .. ################################################################# Application development using the Ecasound framework ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Console mode ecasound - [all languages] ======================================= This is the easiest way to take advantage of Ecasound features in your own programs. You can fork ecasound, pipe commands to ecasound's interactive mode or you can create chainsetup (.ecs) files and load them to ecasound. You'll be able to do practically anything. The only real problem is getting information from ecasound. You'll have to parse ecasound's ascii output if you want to do this. To make this a bit easier, Ecasound offers the wellformed output mode and dump-* commands. These can be used to easily parse configuration and status information. Ecasound Control Interface - [C++, C, Python, Perl, ...] ======================================================== Idea behind Ecasound Control Interface (ECI) is to take a subset of functionality provided by libecasound, write a simple API for it, and port it to various languages. At the moment, at least C++, C and Python implementations of the ECI API are available and part of the main Ecasound distribution. ECI is heavily based on the Ecasound Interactive Mode (EIAM), and the services it provides. Specific tasks ECI is aimed at: - 1. automating (scripting in its traditional sense) - 2. frontends (generic / specialized) - 3. sound services to other apps NetECI - [various] ================== NetECI is a network version of the ECI API. When Ecasound is started in server mode (see ecasound(1) for the related options), it listens for incoming NetECI commands on a TCP socket. Client applications can connect to this socket and use the connection to control and observe the active session. Multiple clients can connect to the same session. The protocol is identical to one used in ECI (see section "Ecasound Interactive Mode - Well-Formed Output Mode" below). Clients write EIAM commands to the socket, followed by a CRLF pair. The server will reply using the well-formed output mode syntax. See implementation of ecamonitor (part of ecatools), for a working example. Libecasound's ECA_CONTROL class - [C++] =========================================== Note! Direct use of libecasound and libkvutils is not recommended anymore! Please use the Ecasound Control Interface (ECI) instead. By linking your program to libecasound, you can use the ECA_CONTROL class for controlling Ecasound. This is a large interface class that offers routines for controlling all Ecasound features. It's easy to use while still powerful. Best examples are the utils in ecatools directory (most of them are just a couple screenfuls of code). Also, qtecasound and ecawave heavily use ECA_CONTROL. Here's a few lines of example code: :: | --cut-- | ECA_SESSION esession; | ECA_CONTROL ctrl (&esession); | ctrl.new_chainsetup("default"); | [... other setup routines ] | ctrl.start(); // starts processing in another thread (doesn't block) | --cut-- If you don't want to use threads, you can run the setup in batch mode: :: | --cut-- | ECA_SESSION esession; | ECA_CONTROL ctrl (&esession); | ctrl.add_chainsetup("default"); | [... other setup routines ] | ctrl.run(); // blocks until processing is finished | --cut-- Ecasound classes as building blocks - [C++] =============================================== Note! Direct use of libecasound and libkvutils is not recommended anymore! Please use the Ecasound Control Interface (ECI) instead. You can also use individual Ecasound classes directly. This means more control, but it also means more work. Here's another short sample: | --cut-- | - create a SAMPLE_BUFFER object for storing the samples | - read samples with an audio I/O object - for example WAVEFILE | - process sample data with some effect class - for example EFFECT_LOWPASS | - maybe change the filter frequency with EFFECT_LOWPASS::set_parameter(1, new_value) | - write samples with an audio I/O object - OSSDEVICE, WAVEFILE, etc. | --cut-- .. ################################################################# .. ################################################################# Protocols and Interfaces ~~~~~~~~~~~~~~~~~~~~~~~~ Ecasound Interactive Mode - Well-Formed Output Mode =================================================== By issuing the EIAM command "int-output-mode-wellformed", Ecasound will start printing all messages using the following format: :: | = ( | ) | | = ; loglevel number | ; size of content in octets | = ; generic log message | = | ; EIAM return value message | = | ; actual content of the message | = "i" | "li" | "f" | "s" | "S" | "e" | ; type of the return value (see ECI/EIAM docs) | = * ; zero or more octets of message content | | = 0x20 ; space | = 0x00-0xff ; 8bits of data | = ; new line | = 0x0d ; carriage return | = 0x0a ; line feed | = + ; one or more digits | = 0x30-0x39 ; digits 0-9 ecasound-2.9.3/Documentation/programmers_guide/Makefile.am0000644000076400007640000000334011144366232020641 00000000000000# ---------------------------------------------------------------------- # File: ecasound/Documentation/programmers_guide/Makefile.am # Description: Ecasound documentation - programmer's guide # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- # --------------------------------------------------------------------- # Files going into distribution: EXTRA_DIST = ecasound_programmers_guide.txt \ eci_doc.latex DISTCLEANFILES = \ ecasound_programmers_guide.html \ eci_doc.log \ eci_doc.aux \ eci_doc.toc \ eci_doc.dvi \ eci_doc.ps \ ecasound_eci_doc.pdf \ html_ecidoc/eci_doc.html \ html_ecidoc/eci_doc.haux \ html_ecidoc/eci_doc.htoc all: docs: ecasound_programmers_guide.html ecasound_eci_doc.pdf ecasound_programmers_guide.html: $(srcdir)/ecasound_programmers_guide.txt rst2html $(srcdir)/ecasound_programmers_guide.txt ecasound_programmers_guide.html # note: to create the table of contents (which spans multiple pages), and # re-calculate the page numbers after the page offset generated by table # of contents, latex needs to be ran 3 times. (Junichi Uekawa, 2007-08-06) ecasound_eci_doc.pdf: $(srcdir)/eci_doc.latex eci_doc.dvi latex $(srcdir)/eci_doc.latex latex $(srcdir)/eci_doc.latex latex $(srcdir)/eci_doc.latex dvips -Ppdf -o eci_doc.ps eci_doc.dvi ps2pdf eci_doc.ps ecasound_eci_doc.pdf mkdir -p html_ecidoc hevea -o html_ecidoc/eci_doc.html $(srcdir)/eci_doc.latex hevea -o html_ecidoc/eci_doc.html $(srcdir)/eci_doc.latex eci_doc.dvi: $(srcdir)/eci_doc.latex clean-docs: rm -fv ecasound_programmers_guide.html ecasound_eci_doc.pdf rm -fv eci_doc.log eci_doc.toc eci_doc.dvi eci_doc.aux eci_doc.ps eci_doc.dvi rm -fv html_ecidoc/* ecasound-2.9.3/Documentation/programmers_guide/Makefile.in0000644000076400007640000003331313606336177020667 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/Documentation/programmers_guide/Makefile.am # Description: Ecasound documentation - programmer's guide # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = Documentation/programmers_guide DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ # --------------------------------------------------------------------- # Files going into distribution: EXTRA_DIST = ecasound_programmers_guide.txt \ eci_doc.latex DISTCLEANFILES = \ ecasound_programmers_guide.html \ eci_doc.log \ eci_doc.aux \ eci_doc.toc \ eci_doc.dvi \ eci_doc.ps \ ecasound_eci_doc.pdf \ html_ecidoc/eci_doc.html \ html_ecidoc/eci_doc.haux \ html_ecidoc/eci_doc.htoc all: all-am .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Documentation/programmers_guide/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Documentation/programmers_guide/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 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 installdirs: 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 -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-info-am all: docs: ecasound_programmers_guide.html ecasound_eci_doc.pdf ecasound_programmers_guide.html: $(srcdir)/ecasound_programmers_guide.txt rst2html $(srcdir)/ecasound_programmers_guide.txt ecasound_programmers_guide.html # note: to create the table of contents (which spans multiple pages), and # re-calculate the page numbers after the page offset generated by table # of contents, latex needs to be ran 3 times. (Junichi Uekawa, 2007-08-06) ecasound_eci_doc.pdf: $(srcdir)/eci_doc.latex eci_doc.dvi latex $(srcdir)/eci_doc.latex latex $(srcdir)/eci_doc.latex latex $(srcdir)/eci_doc.latex dvips -Ppdf -o eci_doc.ps eci_doc.dvi ps2pdf eci_doc.ps ecasound_eci_doc.pdf mkdir -p html_ecidoc hevea -o html_ecidoc/eci_doc.html $(srcdir)/eci_doc.latex hevea -o html_ecidoc/eci_doc.html $(srcdir)/eci_doc.latex eci_doc.dvi: $(srcdir)/eci_doc.latex clean-docs: rm -fv ecasound_programmers_guide.html ecasound_eci_doc.pdf rm -fv eci_doc.log eci_doc.toc eci_doc.dvi eci_doc.aux eci_doc.ps eci_doc.dvi rm -fv html_ecidoc/* # 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: ecasound-2.9.3/Documentation/programmers_guide/eci_doc.latex0000644000076400007640000005744711541135170021246 00000000000000\documentclass{article} \usepackage[T1]{fontenc} \usepackage{ae} %\usepackage{html} %\bodytext{link="#662a00" vlink="#666655" bgcolor="#ffffff"} \title{Ecasound Control Interface Guide} \author{Kai Vehmanen, Brad Bowman, Tony Leake, Jan Weil, Mario Lang} \date{03062006} \begin{document} \maketitle \tableofcontents \clearpage % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \section{Introduction} The idea behind the Ecasound Control Interface (ECI) is to take a subset of functionality provided by libecasound, provide a simple API for it, and port it to various languages. At the moment, implementations of the ECI API are available for C, C++, elisp, Python and Ruby. These all come by default with the Ecasound package. Additional implementations, for example for Perl and PHP, are distributed independently. ECI is heavily based on Ecasound's interactive mode (EIAM), and the services it provides. See \texttt{ecasound-iam(1) manual page} for a detailed EIAM documentation. % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \section{Document history} \begin{itemize} \item 04.06.2006 - Added more information to the ``Tips for debugging'' section. \item 21.03.2005 - Updated the ``Tips for debugging'' section. \item 25.09.2004 - Updated the ``Return values'' section based on feedback from Adam Linson. \item 02.05.2004 - ``Emacs'' section added (written by Mario Lang). \item 28.11.2003 - ``Ruby'' section added (written by Jan Weil). Updated the introduction. \item 26.11.2003 - Fix filename for the alternative Python API (eci.py). \item 18.11.2003 - Typo fixes. Updated documentation to reflect the new naming convention (ecasound refers to the binary, Ecasound refers to the whole package). \item 26.10.2002 - Changed the C++ linking example. \item 24.10.2002 - Added ``Notes Concerning Standalone ECI Implementations'' section. Added compilation examples. \item 06.10.2002 - Added ``Application development'' section. \item 05.10.2002 - Changed the libecasoundc link path. \item 29.09.2002 - ``PHP'' section added (written by Tony Leake). \item 25.04.2002 - Changed headers path from ``'' to ``'' and added library version number to link instructions. \item 21.10.2001 - Added this history section. Minor changes to ECI examples. \end{itemize} % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \section{General} ECI doesn't provide any routines that directly manipulate audio or Ecasound objects. What it does provide is an easy and generic way to issue EIAM (Ecasound Inter-Active Mode) commands, access the command return-values and perform error handling. This approach has two benefits. First, it is possible to keep the API small, and thus make it easier to port ECI to new languages. Secondly, it's possible to keep ECI relatively stable. Ecasound itself is a large, developing library. New features are added all the time, and from time to time, older parts of the library will get rewritten to better suit new uses. Now for application developers wanting to take advantage of libecasound, these constant changes are very annoying, especially if your specific app doesn't need the latest new features. In these cases, ECI is the best platform for application development. % ---------------------------------------------------------------------- \subsection{What's it good for?} Specific tasks ECI is aimed at: \begin{itemize} \item 1. automating (scripting in its traditional sense) \item 2. frontends (generic / specialized) \item 3. sound services to other apps \end{itemize} % ---------------------------------------------------------------------- \subsection{Services and behaviour} Here is a list of services provided by all ECI implementations: \subsubsection{Actions} \begin{description} \item[command(string)] Issue an EIAM command. \item[command\_float\_arg(string, float)] Issue an EIAM command. This function can be used instead of \emph{command(string)}, if the command in question requires exactly one numerical parameter. This way it's possible to avoid the extra string -> float conversion, which would lead to lost precision. \end{description} \subsubsection{Return values} Each EIAM command has exactly one return value type. After a command has been issued, only one last\_type() functions returns a non-empty value. For example, last\_float() only returns a valid value if \emph{last\_type() == 'f'} holds true. Not all EIAM commands return a value (return type is void). \begin{description} \item[last\_string()] Returns the last string return value. \item[last\_string\_list()] Returns the last collection of strings (one or more strings). \item[last\_float()] Returns the last floating-point return value. Note! last\_float() doesn't refer to the C/C++ type 'float'. In most implementations, floats are 64bit values (doubles in C/C++). \item[last\_integer()] Returns the last integer return value. This function is also used to return boolean values, where non-zero means 'true' and zero 'false'. \item[last\_long\_integer()] Returns the last long integer return value. Long integers are used to pass values like 'length\_in\_samples' and 'length\_in\_bytes'. It's implementation specific whether there's any real difference between integers and long integers. \end{description} \subsubsection{Errors} \begin{description} \item[error()] Returns true (!= 0) if error has occured during the execution of last EIAM command. Otherwise returns false (= 0). \item[last\_error()] Returns a string describing the last error. If the last EIAM command was executed successfully, last\_error() returns an empty string. \end{description} \subsubsection{Other} \begin{description} \item[initialize()] Reserve resources. \item[cleanup()] Free all reserved resources. \end{description} % ---------------------------------------------------------------------- \subsection{Porting to new environments} Porting ECI to new languages should be easy. All there is to do is to implement the services listed in the previous section to the target language. In most cases it's to easiest to use the C++ or C ECI as the underlying implementation to build upon. % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \section{Implementations} % ---------------------------------------------------------------------- \subsection{General} \subsubsection{Overview} This section contains overview of how ECI is implemented in the discussed language (eg. as a single class, set of classes, set of routines, etc). \subsubsection{Usage} A quick tutorial to get you started. \subsubsection{Example} Implementation of the following: \begin{enumerate} \item Setup ECI to read audio from file, apply a 100Hz lowpass filter, and send it to the soundcard (/dev/dsp). \item Every second, check the current position. If the stream has been running for over 15 seconds, exit immediately. Also, every second, increase the lowpass filter's cutoff frequency by 500Hz. \item Stop the stream (if not already finished) and disconnect the chainsetup. Print chain operator status info. \end{enumerate} % ---------------------------------------------------------------------- \subsection{Notes Concerning Standalone ECI Implementations} The C implementation of ECI is not directly linked against the main Ecasound libraries. Instead, the ecasound executable is launched on the background and command pipes are used to communicate with it. The launched ecasound executable can be selected by using the \emph{ECASOUND} environment variable. If it is not defined, the C ECI implementation will try to launch ``ecasound'' (ie. has to be somewhere in PATH). In addition to the C implementation, this also affects all ECI implementations that are based on the C version. Currently this includes at least the Perl, PHP and Python ECI modules. % ---------------------------------------------------------------------- \subsection{C++} \subsubsection{Overview} C++ implementation is based around the ECA\_CONTROL\_INTERFACE class. STL vector is used for representing collections of objects (last\_string\_list()). \subsubsection{Usage} \begin{enumerate} \item \#include \item create an instance of the ECA\_CONTROL\_INTERFACE class and use its member functions \item link you app agains libecasoundc (-lecasoundc) \item compilation example: \emph{c++ -o ecidoc\_example ecidoc\_example.cpp `libecasoundc-config --cflags --libs`} \end{enumerate} \subsubsection{Example} \begin{verbatim} #include #include #include int main(int argc, char *argv[]) { double cutoff_inc = 500.0; ECA_CONTROL_INTERFACE e; e.command("cs-add play_chainsetup"); e.command("c-add 1st_chain"); e.command("ai-add some_file.wav"); e.command("ao-add /dev/dsp"); e.command("cop-add -efl:100"); e.command("cop-select 1"); e.command("copp-select 1"); e.command("cs-connect"); e.command("start"); while(1) { sleep(1); e.command("engine-status"); if (e.last_string() != "running") break; e.command("get-position"); double curpos = e.last_float(); if (curpos > 15.0) break; e.command("copp-get"); double next_cutoff = cutoff_inc + e.last_float(); e.command_float_arg("copp-set", next_cutoff); } e.command("stop"); e.command("cs-disconnect"); e.command("cop-status"); cerr << "Chain operator status: " << e.last_string() << endl; return(0); } \end{verbatim} % ---------------------------------------------------------------------- \subsection{C} \subsubsection{Overview} All C ECI functions are prefixed with "eci\_". When returning string values, a const pointer to a null-terminated char array (const char*) is returned. It's important to keep in mind that these are "borrowed" references. If you need to later use the data, you must copy it to application's own buffers. Returning a list of strings is implemented using two functions: \emph{eci\_last\_string\_list\_count()} returns the number of strings available, and \emph{eci\_last\_string\_list\_item(int n)} returns a pointer (const char*) to the string at index \emph{n}. \emph{Note!} As of Ecasound 2.0.1, the C ECI implementation also provides reentrant access to the ECI API. These alternative routines are marked with '\_r' postfix. \subsubsection{Usage} \begin{enumerate} \item \#include \item use the eci\_* routines \item link your app against libecasoundc (-lecasoundc) \item compilation example: \emph{gcc -o ecidoc\_example ecidoc\_example.c `libecasoundc-config --cflags --libs`} \end{enumerate} \subsubsection{Example} \begin{verbatim} #include #include #include int main(int argc, char *argv[]) { double cutoff_inc = 500.0; eci_init(); eci_command("cs-add play_chainsetup"); eci_command("c-add 1st_chain"); eci_command("ai-add some_file.wav"); eci_command("ao-add /dev/dsp"); eci_command("cop-add -efl:100"); eci_command("cop-select 1"); eci_command("copp-select 1"); eci_command("cs-connect"); eci_command("start"); while(1) { double curpos, next_cutoff; sleep(1); eci_command("engine-status"); if (strcmp(eci_last_string(), "running") != 0) break; eci_command("get-position"); curpos = eci_last_float(); if (curpos > 15.0) break; eci_command("copp-get"); next_cutoff = cutoff_inc + eci_last_float(); eci_command_float_arg("copp-set", next_cutoff); } eci_command("stop"); eci_command("cs-disconnect"); eci_command("cop-status"); printf("Chain operator status: %s", eci_last_string()); eci_cleanup(); return(0); } \end{verbatim} % ---------------------------------------------------------------------- \subsection{Emacs} \subsubsection{Overview} The Ecasound package comes with an 'Ecasound' library for Emacs included. ecasound.el is a implementation of the ECI API for Emacs, as well as an interactive interface to Ecasound sessions implemented on top of that. Simply use "M-x ecasound RET" to fire up an interactive Ecasound session. All Emacs Lisp ECI functions are prefixed with ``eci\-''. 'ecasound.el' is implemented in a high level manner which means that you won't find most of the commands known from libecasoundc like last\_string, last\_float, etc. Instead of that every call to function "eci-command", which accepts all the well known IAM commands, returns ecasound's response in an appropriate type automatically. If an error occurs, e. g. there's a typo in a command or a file is not found, the function returns ``nil''. In all other cases, either an automatically converted Lisp value is returned, or ``t'' in the case where there was no particular value returned. Additionally, most of the available IAM commands have their own Emacs Lisp function including documentation and possibly a parameter list. All these functions are interactive, so you can use them in ecasound-iam-mode simply by invoking them via M-x or by pressing an assigned key combination. Emacs will prompt you for the required parameters, providing completion wherever possible. As a convention, "eci-command" and its variants do take a buffer or process as an optional last argument. If this is ``nil'', the current buffer is assumed to be the ecasound session refered to by this call. This makes it possible to use several ECI sessions concurrently, dispatching on the buffer or process in use. \subsubsection{Usage} \begin{enumerate} \item make ecasound.el available in your ``load-path'' \item (require 'ecasound) \item create a buffer with an associated Ecasound session (``eci-init'') \item use ``eci\-'' functions with the new buffer \end{enumerate} \subsubsection{Example} \begin{verbatim} (require 'ecasound) (defun example (file &optional cutoff-increment session) (unless cutoff-increment (setq cutoff-increment 500.0)) (with-current-buffer (or session (eci-init)) (eci-cs-add "play_chainsetup") (eci-c-add "1st_chain") (eci-ai-add file) (eci-ao-add "/dev/dsp") (eci-cop-add "-efl:100") (eci-cop-select 1) (eci-copp-select 1) (eci-cs-connect) (eci-start) (sit-for 1) (while (and (string= (eci-engine-status) "running") (<= (eci-get-position) 15)) (eci-copp-set (+ cutoff-increment (eci-copp-get))) (sit-for 1)) (eci-command "stop") (when (eci-cs-disconnect) (destructuring-bind ((cop n1 (copp n2 val))) (cdr (assoc "1st_chain" (eci-cop-status))) (message "%s %s is now %f" cop copp val))))) \end{verbatim} NOTE: function ``eci-cop-status'' is actually a very high level function which already converts the returned information to a nested list structure. For more complex examples of the Emacs Lisp ECI implementation, see function ``eci-example'', ``ecasound-normalize'' and ``ecasound-signalview'' in ecasound.el. % ---------------------------------------------------------------------- \subsection{Python} \subsubsection{Overview} Python implementation is based around the ECA\_CONTROL\_INTERFACE class. Lists are used for representing collections of objects. Note! Eric S. Tiedemann has written an alternative Python interface to ECI. You'll find this interface included in the main Ecasound packege, in ``pyecasound/eci.py''. To use this instead of the standard interface, just 'import eci' and you're set! :) \subsubsection{Usage} \begin{enumerate} \item import pyeca \item create an instance of the ECA\_CONTROL\_INTERFACE class and use its member functions \item python 'yourapp.py' and that's it :) \end{enumerate} \subsubsection{Example} \begin{verbatim} #!/usr/local/bin/python import time from pyeca import * e = ECA_CONTROL_INTERFACE() e.command("cs-add play_chainsetup") e.command("c-add 1st_chain") e.command("ai-add some_file.wav") e.command("ao-add /dev/dsp") e.command("cop-add -efl:100") e.command("cop-select 1") e.command("copp-select 1") e.command("cs-connect") e.command("start") cutoff_inc = 500.0 while 1: time.sleep(1) e.command("engine-status") if e.last_string() != "running": break e.command("get-position") curpos = e.last_float() if curpos > 15: break e.command("copp-get") next_cutoff = cutoff_inc + e.last_float() e.command_float_arg("copp-set", next_cutoff) e.command("stop") e.command("cs-disconnect") e.command("cop-status") print "Chain operator status: ", e.last_string() \end{verbatim} % ---------------------------------------------------------------------- \subsection{Perl} \subsubsection{Overview} Audio::Ecasound provides perl bindings to the Ecasound control interface of the Ecasound program. You can use perl to automate or interact with Ecasound so you don't have to turn you back on the adoring masses packed into Wembly Stadium. Audio::Ecasound was written by Brad Bowman. At the moment this module is not distributed with Ecasound. To get the latest version, check the following \texttt{CPAN link}. \subsubsection{Usage} See the below example. For more info, here's another \texttt{CPAN link}. \subsubsection{Example} use Audio::Ecasound qw(:simple); \begin{verbatim} eci("cs-add play_chainsetup"); eci("c-add 1st_chain"); eci("ai-add some_file.wav"); eci("ao-add /dev/dsp"); # multiple \n separated commands eci("cop-add -efl:100 # with comments cop-select 1 copp-select 1 cs-connect"); eci("start"); my $cutoff_inc = 500.0; while (1) { sleep(1); last if eci("engine-status") ne "running"; my $curpos = eci("get-position"); last if $curpos > 15; my $next_cutoff = $cutoff_inc + eci("copp-get"); # Optional float argument eci("copp-set", $next_cutoff); } eci("stop"); eci("cs-disconnect"); print "Chain operator status: ", eci("cop-status"); \end{verbatim} % ---------------------------------------------------------------------- \subsection{PHP} \subsubsection{Overview} This PHP extension provides bindings to the Ecasound control interface. It is useful both for scripting Ecasound and for writing graphical audio applications with PHP Gtk. The PHP Ecasound extension was written by Tony Leake. At the moment this module is not distributed with Ecasound. The latest version and example scripts, are available from \texttt{http://www.webwise-data.co.uk/php\_audio/php\_audio\_extension.html}. \subsubsection{Usage} \begin{enumerate} \item Obtain and build the Ecasound PHP extension \item Initialise Ecasound, eci\_int(); \item Issue EAM commands eg, eci\_command("cs-add my\_chain\_setup"); \item Free resources, eci\_cleanup(); \end{enumerate} \subsubsection{Example} \begin{verbatim} Implementation of the following: 1. Setup ECI to read audio from file, apply a 100Hz lowpass filter, and send it to the soundcard (/dev/dsp). 2. Every second, check the current position. If the stream has been running for over 15 seconds, exit immediately. Also, every second, increase the lowpass filter's cutoff frequency by 500Hz. 3. Stop the stream (if not already finished) and disconnect the chainsetup. Print chain operator status info 15.0){ break; } eci_command("copp-get"); $next_cutoff = $cutoff_inc + eci_last_float(); eci_command_float_arg("copp-set",$next_cutoff); } eci_command("stop"); eci_command("cs-disconnect"); eci_command("cop-status"); printf("Chain operator status: %s", eci_last_string()); eci_cleanup(); ?> \end{verbatim} % ---------------------------------------------------------------------- \subsection{Ruby} \subsubsection{Overview} The Ecasound package comes with an 'Ecasound' module for Ruby included. If ruby is detected during the installation process it is installed automatically (assuming you are installing ecasound from source code). The module contains the class definition of a native ecasound control interface called "ControlInterface". 'Ecasound::ControlInterface' is implemented in a high level manner which means that you won't find most of the commands known from libecasoundc like last\_string, last\_float, etc. Instead of that every call to the instance method "command", which accepts all the well known IAM commands, returns ecasound's response in an appropriate type automatically. If an error occurs, e. g. there's a typo in a command or a file is not found, an exception of type EcasoundError is raised. \subsubsection{Usage} \begin{enumerate} \item require 'ecasound' \item create an instance of Ecasound::ControlInterface \item use it's command method to send IAM commands to ecasound \item catch an EcasoundError if necessary \end{enumerate} \subsubsection{Example} \begin{verbatim} #!/usr/bin/env ruby require "ecasound" SOME_FILE = "path/to/file.wav" e = Ecasound::ControlInterface.new() e.command("cs-add play_chainsetup") e.command("c-add 1st_chain") e.command("ai-add #{SOME_FILE}") e.command("ao-add /dev/dsp") e.command("cop-add -efl:100") e.command("cop-select 1") e.command("copp-select 1") e.command("cs-connect") e.command("start") cutoff_inc = 500.0 loop do sleep(1) break if e.command("engine-status") != "running" break if e.command("get-position") > 15 e.command("copp-set #{cutoff_inc + e.command('copp-get')}") end e.command("stop") e.command("cs-disconnect") $stdout << "Chain operator status: " + e.command("cop-status") + "\n" \end{verbatim} % ---------------------------------------------------------------------- % ---------------------------------------------------------------------- \section{Application development} % ---------------------------------------------------------------------- \subsection{Tips for debugging} Here's a few tips what to do if the ECI app you have developed is not working correctly. \begin{enumerate} \item Check your Ecasound installation. Try to run the ``ecasound'' console user-interface and verify that the basic functionality is working (ie. something like ``ecasound -i foo.wav -o /dev/dsp''. \item If developing in C or C++, check that your application is correcly linked: ``ldd /path/to/myapp''. All the libraries should be properly found. \item Check error conditions. You should remember to check for errors in your ECI apps using the eci\_error() and eci\_last\_error() functions. Especially when intializing ECI for the first time and after important commands like ``cs-connect'', you should always check for errors. \item Use the ECASOUND\_LOGFILE environment variable to write all engine output to a separate logfile. See ecasound(1) manpage for details on how to use this mechanism. Requires Ecasound version 2.4.5 or newer. \item Utilize the ``int-log-history'' ECI command added to version 2.4.0 of Ecasound. Recent messages from the engine can help to track down the problem. Before use, you need to first set the history length to a non-zero value with ``int-set-log-history-length''. \item Launch Ecasound in interactive mode (``ecasound -c''), and issue the commands your ECI application is using, manually one-by-one and see what happens. If something goes wrong, increase Ecasound's debug level (for instance ``-ddd'') and re-run the test. \end{enumerate} \end{document} ecasound-2.9.3/Documentation/Makefile.am0000644000076400007640000000705611222225340015125 00000000000000# ---------------------------------------------------------------------- # File: ecasound/Documentation/Makefile.am # Description: Ecasound documentation files # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- prefix = @prefix@ mandir = @mandir@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SUBDIRS = users_guide programmers_guide # --------------------------------------------------------------------- # Files going into distribution: man1_pages_to_install = \ ecasound.1 \ ecasound-iam.1 \ ecatools.1 \ ecaconvert.1 \ ecafixdc.1 \ ecalength.1 \ ecaplay.1 \ ecamonitor.1 \ ecanormalize.1 \ ecasignalview.1 man5_pages_to_install = \ ecasoundrc.5 html_man_pages = \ ecasound_manpage.html \ ecasoundrc_manpage.html \ ecatools_manpage.html \ ecalength_manpage.html \ ecasound-iam_manpage.html EXTRA_DIST = $(man1_pages_to_install) \ $(man5_pages_to_install) \ $(html_man_pages) $(srcdir)/ecasound_manpage.yo \ $(srcdir)/ecasoundrc_manpage.yo \ $(srcdir)/ecasound-iam_manpage.yo \ $(srcdir)/ecatools_manpage.yo \ $(srcdir)/ecalength_manpage.yo \ $(srcdir)/index.html \ $(srcdir)/examples.html \ $(srcdir)/manpages.html \ $(srcdir)/tutorials.html \ $(srcdir)/style_ecasound.css \ $(srcdir)/ecasound_osc_interface.txt # --------------------------------------------------------------------- # local targets for generating docs from latex and yodl sources all: docs: docs-guides docs-manpages docs-guides: cd programmers_guide; $(MAKE) $(AM_MAKEFLAGS) docs cd users_guide; $(MAKE) $(AM_MAKEFLAGS) docs docs-manpages: $(man1_pages_to_install) \ $(man5_pages_to_install) \ $(html_man_pages) # --------------------------------------------------------------------- # Man pages # following are copies of ecatools.1 ecaconvert.1: ecatools.1 cp ecatools.1 ecaconvert.1 ecafixdc.1: ecatools.1 cp ecatools.1 ecafixdc.1 ecamonitor.1: ecatools.1 cp -v ecatools.1 ecamonitor.1 ecanormalize.1: ecatools.1 cp -v ecatools.1 ecanormalize.1 ecaplay.1: ecatools.1 cp -v ecatools.1 ecaplay.1 ecasignalview.1: ecatools.1 cp -v ecatools.1 ecasignalview.1 %.1: $(srcdir)/%_manpage.yo yodl2man -o $@ $< %.5: $(srcdir)/%_manpage.yo yodl2man -o $@ $< %.html: $(srcdir)/%.yo yodl2html -o $@ $< # --------------------------------------------------------------------- # doxygen (target removed 2009/Feb) #doxygen: # doxygen doxygen_libkvutils_config # doxygen doxygen_libecasound_config # --------------------------------------------------------------------- # Clean targets clean: clean-docs: clean-manpages clean-guides clean-guides: cd programmers_guide; $(MAKE) $(AM_MAKEFLAGS) clean-docs cd users_guide; $(MAKE) $(AM_MAKEFLAGS) clean-docs clean-manpages: rm -f $(man1_pages_to_install) \ $(man5_pages_to_install) \ $(html_man_pages) # --------------------------------------------------------------------- # Install targets install-data-local: mkdir -p $(DESTDIR)$(mandir)/man1 mkdir -p $(DESTDIR)$(mandir)/man5 for f in $(man1_pages_to_install) ; do if test -f $$f ; then cp -v $$f $(DESTDIR)$(mandir)/man1/; fi ; done for f in $(man5_pages_to_install) ; do if test -f $$f ; then cp -v $$f $(DESTDIR)$(mandir)/man5/; fi ; done # --------------------------------------------------------------------- # Uninstall targets uninstall-local: for f in $(man1_pages_to_install) ; do if test -f $$f ; then rm -vf $(DESTDIR)$(mandir)/man1/$$f ; fi ; done for f in $(man5_pages_to_install) ; do if test -f $$f ; then rm -vf $(DESTDIR)$(mandir)/man5/$$f ; fi ; done ecasound-2.9.3/Documentation/ecatools_manpage.html0000644000076400007640000001675212260765173017303 00000000000000 ecatools

ecatools

12.11.2005


ecatools(1)

ecatools(1)

Multimedia software

12.11.2005

NAME

ecatools - audio processing utils based on ecasound

SYNOPSIS

ecaconvert .extension file1 [ file2 ... fileN ]

ecafixdc file1 [ file2 ... fileN ]

ecalength file1 [ file2 ... fileN ]

ecamonitor [host][:port]

ecanormalize file1 [ file2 ... fileN ]

ecaplay [-dfhklopq] [ file1 file2 ... fileN ]

ecasignalview [ options ] [ input ] [ output ]

DESCRIPTION

Ecatools are simple command line utils for audio file processing. Each tool is designed to perform one specific operation. Most of the tools also support batch processing.

ECACONVERT

A tool for converting a set of files to a common target format. This target format is given as the first command line argument, and its syntax is .ext.

ECAFIXDC

A simple command-line tool for fixing DC-offset.

ECALENGTH

See the separate ecalength(1) man page.

ECAMONITOR

Ecamonitor is a util program that can be used to monitor an active ecasound session. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things.

By default ecamonitor will try to connect to IP4 address "localhost", to port "2868". A different address can be specified when starting ecamonitor, for example "ecamonitor foo.mynetwork.com" or "ecamonitor foo.mynetwork.com:4500".

To enable inbound connections, ecasound has to be started with the --daemon option. Ecamonitor is implemented in Python using the NetECI API.

ECANORMALIZE

Ecanormalize is a command-line tool for normalizing audio files to utilize the full available sample resolution. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file.

ECAPLAY

Ecaplay is a command-line tool for playing audio files. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library.

Files can be selected for playback either by specifying the filenames on the command-line, or by using the playlist mechanism. In playlist mode, files can be added to the playlist using the -q option. The -p option can then be used to play all tracks on the playlist. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl-C). Playlist can be flushed with -f and its contents listed with -l option.

If not otherwise specified, ecaplay will use the audio output device specified in ~/.ecasound/ecasoundrc for playback. A different output device can be selected with ECAPLAY_OUTPUT_DEVICE shell environment variable or with the -o:output_device command-line option.

Playback can be stopped at any time with Ctrl-C. If multiple files are played, first Ctrl-C will stop the current file and move on to play the next one. Issuing Ctrl-C twice (within one second), will cause ecaplay to exit.

-d:debuglevel
Set libecasound debug level. See ecasound(1).

-f
Flush the playlist contents. See also options -l, -p and -q.

-h
Print usage information and exit.

-k:number
Skip 'number' of files.

-l
List the current playlist contents to stdout. See also options -f, -p and -q.

-o:output_device
Use 'output_device' instead of the default output device (as specified in ~/.ecasound/ecasoundrc). Syntax is same as used by "-o" ecasound option (see ecasound(1) man page). This option overrides the ECAPLAY_OUTPUT_DEVICE environment variable (more info below).

-p
Play tracks in the playlist (in looped mode). See also options -f, -l and -q.

-q
Queue new tracks to the playlist. All filenames given on the command-line will be added to the the playlist. It is possible to queue new tracks while another instance of ecaplay is using the playlist. See also options -f, -l and -p.

ECASIGNALVIEW

Ecasignalview is meant for monitoring signal amplitude and peak statistics. It accepts the following options:

input
The first option not starting with a '-' is interpreted as an input string. This can be a device or a filename. All formats supported by libecasound are accepted. Defaults to '/dev/dsp'.

output
Similarly to input, second option not starting with a '-' is interpreted as output. Defaults to 'null'.

-b:buffersize
Buffersize in sample frames. Defaults to 128.

-c
Enable cumulative mode. Counters are not reseted after refresh. *deprecated*

-d
Enable debug mode.

-f:format_string
Specify default audio format. See ecasound(1) for details.

-r:rate_msec
Specify screen refresh rate in milliseconds.

-I
Use linear scale for showing audio sample amplitude.

-L
Use logarithmic scale for showing audio sample amplitude.

-G, -B, -M*, -r, -z
Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details.

When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control):

spacebar
Reset statistics (max-peak, avg-amplitude and clipped samples count).

q or Q or Esc
Quit ecasignalview.

It is also possible to reset the max-peak and clipped-samples counters by sending a SIGHUP signal to the process (i.e. from another console: "killall -v -HUP ecasignalview").

More complete documentation for ecasignalview can be found from "Ecasound User's Guide" (see ''http://nosignal.fi/ecasound -> Documentation'').

ENVIRONMENT

ECASOUND Path to the ecasound executable. Used by many ecatools.

ECAPLAY_OUTPUT_DEVICE Device ecaplay should use for audio output. Same syntax as for ecaplay/ecasound "-o" option.

FILES

~/.ecasound/ecasoundrc The default ecasound resource file. See ecasoundrc(5) for details.

~/.ecasound/ecaplay_queue File used to store the ecaplay playlist (one track per line with full path).

SEE ALSO

ecasound (1), ecalength(1), "HTML docs in the Documentation subdirectory"

AUTHOR

Kai Vehmanen, <kvehmanen -at- eca -dot- cx> ecasound-2.9.3/Documentation/ecasound-iam_manpage.html0000644000076400007640000010372111762513505020024 00000000000000 ecasound-iam


ecasound-iam

03.06.2012


ecasound-iam(1)

ecasound-iam(1)

Multimedia software

03.06.2012

NAME

ecasound-iam - ecasound interactive mode

SYNOPSIS

DESCRIPTION

Ecasound library contains an interpreter module that understands a set of commands aimed at controlling various library services. This is called the ecasound interactive mode (EIAM). All programs linked to ecasound library can use this facility.

ECI API and return types

A special case of interactive mode use is ecasound's control interface (ECI), which is a small library providing easy access to the interactive mode commands from outside of libecasound. When issuing inter commands using the control interface, it's possible that commands also return information. Currently supported return value types are: string [s], list of strings [S] (elements separated by commas; escaped if necessary), integer [i], long integer [li] and floating-point number [f]. These definitions are used throughout this document. Commands that return nothing (void) are marked with [-]. Additionally, return type [e] marks an error condition. When an interactive mode command results in an error, an error string explaining the condition is returned.

Limitations related to real-time control and modifications

It's not possible to use all interactive mode commands to modify and control objects that belong to a connected chainsetup. Ecasound will automatically disconnect (and later try to reconnect) the chainsetup in case these commands are received while connected. Commands that have this limitation are:

cs-remove, cs-set-length, cs-set-length-samples, cs-toggle-loop, cs-set-param, cs-option, c-add, c-remove, c-rename, c-clear, ai-add, ai-remove, ai-attach, ai-forward, ai-rewind, ai-set-position, ai-set-position-samples, ao-add, ao-add-default, ao-remove, ao-attach, ao-forward, ao-rewind, ao-set-position, ao-set-position-samples.

The following commands may be used on with a connected chainsetup, but they require pausing the engine temporarily (if running) and this can cause audible gaps to playback and recording. In practise this means it is currently not possible to add or remove chain operators in a gapless/seamless fashion. The affected commands:

cop-add, ctrl-add,

The following commands can be used on a connected chainsetup and when the engine is running (not a complete list but at least these commands are supported):

cop-set, copp-set, ctrlp-set, c-bypass, c-muting, setpos, cs-set-position, *-describe *-deselect, *-get, *-list, *-register *-select, *-selected, *-status, dump-*, int-*, jack-*, map-*

GENERAL

quit, q
Quit ecasound session. What this means in practice depends on the client implementation. In ecasound interactive mode, 'quit' terminates the ecasound process. When sent over ecasound server connection (aka NetECI), 'quit' terminates the active network connection, but does not terminate the ecasound server process. [-]

start, t
Processing is started (play). Error string is return if any errors upon startup are encountered. [e]

stop, s
Stop processing. [-]

stop-sync, s
Stop processing with a blocking call (do not return until engine has actually stopped). [-]

run
Like 'start' but blocks until processing is finished. Error string is return if any errors upon startup, or during process, are encountered. [e]

debug 'debug-level'
Set debug level to 'debug-level'. Notice that client programs can reimplement the debug routines. [-]

resource-file 'path-to-file'
Overrides the global and user resource files. Does not affect already created objects. This command is equivalent to '-R' ecasound option (see ecasound (1) man page).

-prefix:arg1,...,argN
Equivalent to issuing 'cs-option -prefix:arg1,...,argN). See documentation for 'cs-option'.

help', 'h'
Help! [-]

GLOBAL

engine-status
Returns a string describing the engine status (running, stopped, finished, error, not ready). See also cs-status. [s]

engine-launch
Starts the real-time engine. Engine will execute the currently connected chainsetup (see 'cs-connect). This action does not yet start actual processing (see start and stop). When ecasound is used as a JACK client, issuing engine-launch makes ecasound an active JACK client (i.e. ecasound's ports can be connected to other JACK clients). [-]

engine-halt
Stops the engine. Does not disconnect the chainsetup that was running. See also cs-disconnet and stop. When ecasound is used as a JACK client, engine-halt will cause ecasound to become a deactivated client (all JACK connections are torn down). [-]

CHAINSETUPS

Chainsetup is the central data object. All other objects (inputs, outputs, chains, etc) are connected to some chainsetup. There can be many chainsetups but only one can be connected. Similarly only one chainsetup can be selected. If not otherwise specified operations are done on the selected chainsetup. Some operations also require that selected chainsetup is not connected.

cs-add 'name'
Adds a new chainsetup with name 'name'. 'name' is now the selected chainsetup. [-]

cs-remove
Removes currently selected chainsetup. [-]

cs-list
Returns a list of all chainsetups. [S]

cs-select 'name'
Selects chainsetup 'name'. [-]

cs-selected
Returns the name of currently selected chainsetup. [s]

cs-index-select 'cs_index', cs-iselect 'cs_index'
Selects a chainsetup based on a short index string. Chainsetup names can be rather long. This command can be used to avoid typing these long names. 'cs_index' is an integer value, where '1' refers to the first audio input/output. You can use 'cs-list' and 'cs-status' to get a full list of currently available chainsetups. [-]

cs-load 'filename'
Adds a new chainsetup by loading it from file 'filename'. 'filename' is now the selected chainsetup. [-]

cs-save
Saves the currently selected chainsetup to file. If chainsetup was loaded from a file, the saved version will replace the original. If it doesn't have a default filename, it's saved to "chainsetup_name.ecs". [-]

cs-save-as 'filename'
Saves currently selected chainsetup to file 'filename'. [-]

cs-edit
Currently selected chainsetup is saved to a temporary file. This file is loaded to an external editor (see ecasoundrc (5)). After editing, the chainsetup is loaded back to ecasound. [-]

cs-is-valid
Whether currently selected chainsetup is valid (=can be connected)? [i]

cs-connect
Connect currently selected chainsetup to engine. When connecting, all resources (e.g. files, soundcard devices, external programs) needed to execute the chainsetup are reserved. Only one chainsetup can be connected at a time. Error string is returned if connection fails (for instance due to error in allocating the resources). [e]

cs-disconnect
Disconnect currently connected chainsetup. This action will free all external resources needed by the chainsetup. [-]

cs-connected
Returns the name of currently connected chainsetup. [s]

cs-rewind 'time-in-seconds', rewind 'time-in-seconds', rw 'time-in-seconds'
Rewinds the current chainsetup position by 'time-in-seconds' seconds. Position of all inputs and outputs attached to the selected chainsetup is also affected. [-]

cs-forward 'time-in-seconds', forward 'time-in-seconds', fw 'ttime-in-seconds'
The current chainsetup position is forwarded by 'time-in-seconds' seconds. Position of all inputs and outputs attached to the selected chainsetup is also affected. [-]

cs-set-position 'time-in-seconds', cs-setpos 'time-in-seconds', setpos 'time-in-seconds', set-position 'time-in-seconds'
Sets the chainsetup position to 'time-in-seconds' seconds from the beginning. Position of all inputs and outputs attached to the selected chainsetup is also affected. [-]

cs-set-position-samples 'time-in-samples'
Sets the chainsetup position to 'time-in-samples' samples from the beginning. Position of all inputs and outputs attached to the selected chainsetup is also affected. [-]

cs-get-position, cs-getpos, getpos, get-position
Returns the current chainsetup position in seconds. [f]

cs-get-position-samples
Returns the current chainsetup position in samples. [li]

cs-get-length, get-length
Returns the chainsetup length in seconds (if known). [f]

cs-get-length-samples, get-length-samples
Returns the chainsetup length in samples (if known). [li]

cs-set-length 'seconds'
Sets processing time in seconds (doesn't have to be an integer value). A special-case value of '-1' will set the chainsetup length according to the longest input object. [-]

cs-set-length-samples 'samples'
Sets processing time in samples. [-]

cs-toggle-loop
Toggle looping. When processing is finished, engine will start again from the initial position. It's not always possible to enable looping (for instance all inputs and outputs have infinite length and chainsetup length is not explicitly set with 'cs-set-length'). [-]

cs-set-param
Interpret general chainsetup parameters like for example "-b" (buffersize), "-n" (name), etc. See ecasound (1) for more info. [-]

cs-set-audio-format 'bits,channels,sample_rate'
Set the default sample parameters for currently selected chainsetup. For example cd-quality audio would be "16,2,44100". This does the same as command-line argument "-f" (see ecasound (1)). [-]

cs-status, status, st
Prints out status information about available chainsetup. Detailed information is printed out for connected (=available for running) nd selected (=available for editing) chainsetups. Other chainsetups are listed, but further details are suppressed. To get full details of a specific chainsetup, select it with 'cs-select' or 'cs-iselect', and then issue 'cs-select'. [s]

cs-option '-prefix:arg1,...,argN'
One powerful feature of the interactive-mode is that it provides full access to ecasound's command-line syntax. For instance, command "cs-option -efb:400,200" means that a bandpass filter is added to the currently selected chain, with initial parameters 400 (center frequency) and 200 (width in Hz).

Note that session level options (such as setting debug level) can not be used with 'cs-option' (i.e. only options that modify chainsetups).

Note! Ecasound interactive mode implicitly interprets all strings beginning with a '-' as "cs-option string".

CHAINS

Chain is a simple signal flow abstraction. Every chain has one input and one output. All chain operators and their controllers are attached to chains. Chains can be muted, unmuted and be bypassed. If not otherwise stated, all operations are done to currently selected chainsetup.

c-add 'cname1,...,cnameN'
Adds a set of chains. Added chains are automatically selected. Note that commas in chain names are not allowed. [-]

c-remove
Removes selected chains. [-]

c-list
Returns a list of all chains. [S]

c-select 'cname1,...,cnameN'
Selects chains. Other chains are automatically deselected. [-]

c-index-select 'index1,...,indexN', c-iselect 'index1,...,indexN'
Selects a set of chains based on the list of indixes. Each index is an integer value, where '1' refers to the first chain. You can use 'c-list' and 'c-status' to get a full list of currently available chains. [-]

c-select-all
Selects all chains. [-]

c-select-add 'cname1,...,cnameN'
Selects more chains. [-]

c-deselect 'cname1,...,cnameN'
Deselects chains. [-]

c-selected
Returns a list of selected chains. [S]

c-clear
Clear selected chains by removing all chain operators and controllers. Doesn't change how chains are connected to inputs and outputs. [-]

c-rename 'new_name'
Renames the selected chain. When using this command, exactly one chain must be selected. [-]

c-mute <on|off|toggle>
Set the mute state of the currently selected chain. When chain is muted, it will only output silence.

The command takes a single parameter: "on" -> chain is muted, "off" -> not muted, and "toggle" -> change the muting state. If parameter is omitted, "toggle" is assumed (muting is either enabled or disabled, depending on previous state).

Control of chain and chain operator muting states is independent. If "c-mute off" is executed, the states of individual cop-bypass commands will take effect. If chain is muted, the chain will output silence irrespective of the individual chain operator muting state. [-]

c-bypass <on|off|toggle>
Set the bypass state of the currently selected chain. When chain is bypassed, sample data is passed through unprocessed (all chain operators are disabled for the given chain).

The command takes a single parameter: "on" -> chain is bypassed, "off" -> no bypass, and "toggle" -> change the bypass state. If parameter is omitted, "toggle" is assumed (bypass is either enabled or disabled, depending on previous state).

Control of chain and chain operator bypass states is independent. If chain bypass is disabled, the states of individual cop-bypass commands will take effect. If chain is bypassed, all operators are bypassed independetly of their cop-bypass state. [-]

c-status, cs
Print status info about all chains. [s]

c-is-bypassed
Returns true if selected chain is currently bypassed (none of the chain operators are run). See 'c-bypass'. [i]

c-is-mute
Returns true if selected chain is currently muted (outputs silence as its output). See 'c-mute'. [i]

AUDIO INPUT/OUTPUT OBJECTS

If not otherwise stated, all operations are done to currently selected object. All commands with ai- prefix operate on audio inputs, while commands with ao- operate on outputs.

ai-add 'input_format_string'
Adds a new input object. See ecasound (1) man page for more info about the argument format ('-i' option). Note on syntax: if any of the parameters (such as a filename) contains commas, the parameter should be enclosed in double-quotes. [-]

ao-add 'output_format_string'
Adds a new output object. See ecasound (1) man page for more info about the argument format ('-o' option). If argument is omitted, a default output device is added (see ecasoundrc (5)). Note on syntax: if any of the parameters (such as a filename) contains commas, the parameter should be enclosed in double-quotes. [-]

ao-add-default
Adds the default output device (see ecasoundrc (5)). [-]

ai-describe, ao-describe
Returns a Ecasound Option Syntax (EOS) compliant string describing the input/output. See the Ecasound User's Guide for more information about EOS. This command was introduced in ecasound 2.4.4. [s]

ai-select 'aobject_name', ao-select 'aobject_name'
Selects an audio object. 'aobject_name' refers to the string used when creating the object (the first argument given to ai-add/ao-add). Note that as a important difference to ai-add/ao-add, one should not enclose the object name in double quotes for ai-select/ao-select. In the case a chainsetup contains multiple inputs, or outputs, with identical name, 'ai-select' and 'ao-select' will select the first matching instance. In order to select a specific instance, the 'ai-iselect' and 'ao-iselect' commands need to be used. [-]

ai-index-select 'aobject_index', ai-iselect 'aobject_index', ao-index-select 'aobject_index', ao-iselect 'aobject_index'
Select some audio object based on a short index string. Especially file names can be rather long. This command can be used to avoid typing these long names when selecting audio objects. 'aobject_index' is an integer value, where '1' refers to the first audio input/output. You can use 'ai-list' and 'ao-list' to get a full list of currently available inputs/outputs. [-]

ai-selected, ao-selected
Returns the name of the currently selected audio object. [s]

ai-attach, ao-attach
Attaches the currently selected audio object to all selected chains. [-]

ai-remove, ao-remove
Removes the currently selected audio object from the chainsetup. [-]

ai-forward 'time_in_seconds', ai-fw 'time_in_seconds', ao-forward 'time_in_seconds', ao-fw 'time_in_seconds'
Selected audio object is forwarded by 'time-in-seconds' seconds. Time should be given as a floating point value (eg. 0.001 is the same as 1ms). [-]

ai-rewind 'time_in_seconds', ai-rw 'time_in_seconds', ao-rewind 'time_in_seconds', ao-rw 'time_in_seconds'
Selected audio object is rewinded by 'time-in-seconds' seconds. Time should be given as a floating point value (eg. 0.001 is the same as 1ms). [-]

ai-setpos 'time_in_seconds', ai-set-position 'time_in_seconds', ao-setpos 'time_in_seconds', ao-set-position 'time_in_seconds'
Set audio object position to 'time_in_seconds'. [-]

ai-set-position-samples 'time_in_samples', ao-set-position-samples 'time_in_samples'
Set audio object position to 'time_in_samples'. [-]

ai-getpos, ai-get-position, ao-getpos, ao-get-position
Returns the audio object position in seconds. [f]

ai-get-position-samples, ao-get-position-samples
Returns the audio object position in samples. [li]

ai-get-length, ao-get-length
Returns the audio object length in seconds. [f]

ai-get-length-samples, ao-get-length-samples
Returns the audio object length in samples. [li]

ai-get-format, ao-get-format
Returns the audio format of the selected audio input/output as a formatted string. See documentation for '-f' command-line option. [s]

ai-list, ao-list
Returns a list of all input/output objects. [S]

aio-register
Prints a list of registered audio object types. [s]

aio-status
Audio object status (index strings, position, length, etc). [s]

CHAIN OPERATORS

Chain operators are used to process and analyze sample data. They are attached to chains. If not otherwise stated, currently selected chainsetup and chain are used. Also, 'chainop_id' and 'param_id' are used to select chain operators and their parameters. First valid value for these parameters is 1.

cop-add 'cop_format_string'
Adds a new chain operator. In addition to normal chain operators, this commmand can also be used to add effect presets and various plugins. Note; it is not possible to add operators to multiple chains at once. In other words only one chain should be selected when issuing 'cop-add'. See ecasound (1) man page for more info. [-]

cop-bypass <on|off|toggle>
Set the bypass state of the currently selected chain operator. The command takes a single parameter: "on" -> operator is bypassed, "off" -> no bypass, and "toggle" -> change the bypass state. If parameter is omitted, "toggle" is assumed (bypass is either enabled or disabled, depending on previous state). [-]

cop-is-bypassed
Returns true if selected chain operator is currently bypassed (temporarily not part of the processing chain). [i]

cop-describe
Returns a Ecasound Option Syntax (EOS) compliant string describing the chain operator. See the Ecasound User's Guide for more information about EOS. This command was introduced in ecasound 2.4.4. [s]

cop-remove
Removes the selected chain operator. [-]

cop-list
Returns a list of all chain operators attached to the currently selected chain. [S]

cop-select 'param_id', cop-index-select 'param_id', cop-iselect 'param_id'
Selects a chain operator. [-]

cop-selected
Returns the index number of currently selected chain operator. [i]

cop-set 'chainop_id,param_id,value'
Changes the value of a single chain operator parameter. Unlike other chain operator commands, this can also be used during processing. See also 'cop-get'. [-]

cop-get 'chainop_id,param_id'
Returns the current value of chain operator parameter identified by 'chainop_id' and 'param_id'. This command is a shorthand for 'cop-select chainop_id ; copp-iselect param_id ; copp-get'. [f]

cop-status
Returns info about chain operator status. [s]

copp-list
Returns a list of selected chain operator's parameters. [S]

copp-select 'param_id', copp-index-select 'param_id', copp-iselect 'param_id'
Selects a chain operator parameter. [-]

copp-selected
Returns the index number of currently selected chain operator parameter. [i]

copp-set 'value'
Sets the selected parameter value to 'value'. [-]

copp-get
Returns the selected parameter value. See also 'cop-get'. [f]

cop-register
Prints a list of registered chain operators. [s]

preset-register
Prints a list of registered effect presets. [s]

ladspa-register
Prints a list of registered LADSPA plugins. [s]

CONTROLLERS

Controllers are used to control individual chain operator parameters. They are attached to chains. If not otherwise stated, currently selected chainsetup and chains are used.

ctrl-add 'copc_format_string'
Adds a new controller and attach it to currently selected chain operator. The argument syntax is either "-<id_string>:par1,...,parN" or just "<id_string>:par1,...,parN". If parameter itself contains commas, the parameter should be enclosed in double-quotes. See ecasound (1) man page for more info. [-]

ctrl-describe
Returns a Ecasound Option Syntax (EOS) compliant string describing the controller. See the Ecasound User's Guide for more information about EOS. This command was introduced in ecasound 2.4.4. [s]

ctrl-remove
Removes the selected controller. [-]

ctrl-list
Returns a list of all controllers attached to the currently selected chain. [S]

ctrl-select 'param_id', ctrl-index-select 'param_id', ctrl-iselect 'param_id'
Selects a controller. [-]

ctrl-selected
Returns the index number of currently selected controller. [i]

ctrl-status
Returns info about controller status. [s]

ctrl-register
Prints a list of registered controllers. [s]

ctrl-get-target
Returns the index number of the chain operator that is connected to the selected controller. The returned index refers to the currently selected chain (see 'cop-list'). [i]

ctrlp-list
Returns a list of all controller parameters. This command was introduced in ecasound 2.4.2. [S]

ctrlp-select
Selects a controller parameter. This command was introduced in ecasound 2.4.2. [-]

ctrlp-selected
Returns the index number of currently selected controller parameter. This command was introduced in ecasound 2.4.2. [i]

ctrlp-get
Returns the selected controller parameter value. This command was introduced in ecasound 2.4.2. [f]

ctrlp-set
Sets the selected controller parameter value to 'value'. This command was introduced in ecasound 2.4.2. [-]

JACK CONNECTION MANAGEMENT

If Ecasound is compiled with support for JACK audio server, the following set of commands is provided for controlling connections between JACK ports.

jack-connect 'src-port' 'dest-port'
Make a connection between the two ports given as parameters. This command is similar to the 'jack_connect' command line tool that is distributed with JACK package. [-]

jack-disconnect 'src-port' 'dest-port'
Disconnect the two ports given as parameters. This command is similar to the 'jack_disconnect' command line tool that is distributed with JACK package. [-]

jack-list-connections
Returns a list of all JACK ports and a list of connections for each port. This command is similar to the 'jack_lsp' command line tool (e.g. 'jack_lsp -c') that is distributed with JACK package. [s]

INTERNAL COMMANDS

Internal commands are not directly aimed at normal use. They are primarily meant for use in scripting and frontends.

int-cmd-list
Returns a list of all registered interactive mode commands. [S]

int-log-history
Returns recent log messages sent by libecasound modules. This is a good tool for debugging ECI/EIAM scripts and applications. This command was introduced in ecasound 2.4.0. [s]

int-output-mode-wellformed
Select the well-format output format for log messages. [-]

int-set-float-to-string-precision
Sets precision used in float to text conversions. Note that this can be used to control the precision of float return values for ECI commands. [-]

int-set-log-history-length
Sets the log history length. Defaults to 0 items. This command was introduced in ecasound 2.4.0. [-]

int-cmd-version-string
Returns ecasound interactive mode parser version string. [s]

int-cmd-version-lib-current
Returns ecasound interactive mode library interface version (libtool). [i]

int-cmd-version-lib-revision
Returns ecasound interactive mode library interface revision (libtool). [i]

int-cmd-version-lib-age
Returns ecasound interactive mode library interface age (libtool). [i]

OBJECT MAPS

Object maps are central repositories for commonly used object types. By querying the maps, applications can get a list of all registered object types and their properties.

map-cop-list
Prints a list of registered chain operators using the format specified in section OPERATOR DESCRIPTIONS. [s]

map-preset-list
Prints a list of registered effect presets using the format specified in section OPERATOR DESCRIPTIONS. [s]

map-ladspa-list
Prints a list of registered LADSPA plugins using the format specified in section OPERATOR DESCRIPTIONS. [s]

map-ladspa-id-list
Prints a list of registered LADSPA plugins using the format specified in section OPERATOR DESCRIPTIONS. Numerical LADPSA plugin identifiers are used. [s]

map-ctrl-list
Prints a list of registered controllers using the format specified in section OPERATOR DESCRIPTIONS. [s]

DUMP COMMANDS

The following dump commands are not meant for normal use. Their primary purpose is to provide an easy way to get internal state information from libecasound. All dump commands output a single line with syntax "key value" to the selected output stream (defaults to stdout).

dump-target 'filename'
Set target stream for dumping. [-]

dump-status
Dumps engine status - 'running', 'stopped', 'finished' or 'notready'. [-]

dump-position
Dumps the global position. Printed in seconds using a floating-point representation. [-]

dump-length
Dumps the overall processing length. Printed in seconds using a floating-point representation. [-]

dump-cs-status
Dumps status string for the currently selected chainsetup - 'connected', 'selected' or an empty string. [-]

dump-c-selected
Dumps the name of currently selected chain. [-]

dump-ai-selected
Dumps label of currently selected audio input. If no input is selected, dumps an empty string. [-]

dump-ai-position
Dumps position of currently selected audio inputs. Printed in seconds, using a floating-point representation. [-]

dump-ai-length
Dumps length of currently selected audio input. Printed in seconds, using a floating-point representation. [-]

dump-ai-open-state
Dumps audio input state info. Either 'open' or 'closed'. [-]

dump-ao-selected
Dumps label of currently selected audio output. If no output is selected, dumps an empty string. [-]

dump-ao-position
Dumps position of currently selected audio outputs. Printed in seconds, using a floating-point representation. [-]

dump-ao-length
Dumps length of currently selected audio output. Printed in seconds, using a floating-point representation. [-]

dump-ao-open-state
Dumps audio output state info. Either 'open' or 'closed'. [-]

dump-cop-value 'chainop,param'
Dumps chain operator parameter value. 'chainop' and 'param' are operator and parameter index values (1...n). [-]

OPERATOR DESCRIPTIONS

The map-xxx-list commands return a string containing all registered objects of the given type xxx. Each line of the output describes one registered type. The used syntax is:

'keyword,name,description,num_of_params,par1_def,par2_def,...'

parX_def describes one object parameter. This definition is present for all parameters of the described object type. The used syntax is:

'name,description,defaultvalue,upper_bound_flag,upper_bound, lower_bound_flag,lower_bound,toggled_flag,integer_flag, logarithmic_flag,output_flag'

For exact descriptions of these fields, please see the header file ecasound/libecasound/eca-operator.h.

DEPRECATED COMMANDS

Use of following commands is deprecated. They still work in current version of Ecasound, but will be dropped in the future:

ai-wave-edit, ao-wave-edit

SEE ALSO

ecasound (1), ecatools (1), ecasoundrc (5)

AUTHOR

Kai Vehmanen, <kvehmanen -at- eca -dot- cx> ecasound-2.9.3/Documentation/ecaplay.10000644000076400007640000001555212260765172014610 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/ecamonitor.10000644000076400007640000001555212260765172015332 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/ecasound_manpage.html0000644000076400007640000015371612260765172017274 00000000000000 ecasound

ecasound

05.05.2011


ecasound(1)

ecasound(1)

Multimedia software

05.05.2011

NAME

ecasound - sample editor, multitrack recorder, fx-processor, etc.

SYNOPSIS

ecasound [ general_options ] { [ chain_setup ] [ effect_setup ] [ input_setup ] [ output_setup ] }

DESCRIPTION

Ecasound is a software package designed for multitrack audio processing. It can be used for simple tasks like audio playback, recording and format conversions, as well as for multitrack effect processing, mixing, recording and signal recycling. Ecasound supports a wide range of audio inputs, outputs and effect algorithms. Effects and audio objects can be combined in various ways, and their parameters can be controlled by operator objects like oscillators and MIDI-CCs. A versatile console mode user-interface is included in the package.

OPTIONS

Note! All options except those mentioned in ecasound options and Global options, can be used in ecasound chainsetup files (.ecs).

ECASOUND OPTIONS

These options are parsed and handled by the ecasound frontend binary and are not passed to backend library. This means that these options may not work in other applications that use ecasound libraries for their functionality.

-c
Starts ecasound in interactive mode. In interactive mode you can control ecasound with simple commands ("start", "stop", "pause", etc.). See ecasound-iam .

-C
Disables ecasound's interactive mode (see '-c' and '-K').

-D
Print all debug information to stderr (unbuffered, plain output without ncurses).

-s[:]chainsetup-file
Create a new chainsetup from file 'chainsetup-file' and add it to the current session. Chainsetup files commonly have a filename ending to the '.ecs' extension. A chainsetup can contain inputs, outputs, chains, effects, controllers -- i.e. objects one one specific configuration of audio processing elements. A session, on the other hand, is a collection of one or more chainsetups. Only one of the chainsetups may be connected (i.e. it can be run/processed). But it is possible to have another chainsetup select (i.e. can be configured) while other one is current connteced (i.e. running).

-E "cmd1 [[args] ; cmd2 args ; ... ; cmdN]"
Execute a set of Ecasound Interactive mode (EIAM) commands at launch. These commands are executed immediately after ecasound is started. If the command line contains sufficient options to create a valid chainsetup that will be executed, the launch commands are executed after the other command line options are parsed, but before the processing engine is started. Note that this command is a feature of the ecasound frontend binary and not supported by the library backend. This means that other clients may not support the '-E' option, and also that the launch commands are not saved as part of chainsetup or session state.

--server
Enables the so called NetECI mode, in which ecasound can be controlled remotely over a socket connection. When activated, clients can connect to the running ecasound session, and use interactive mode commands to control and observe ecasound processing.

The NetECI protocol is defined in Ecasound's Programmer Guide

One example client using this feature is ecamonitor(1). This utility is included in the Ecasound distribution package (requires a working Python environment).

Warning! If the machine running ecasound, is connected to a public network, be sure to block ecasound's port in your firewall! As there is no access control implemented for incoming connections, anyone can otherwise connect, control and observe your ecasound sessions. This option replaces '--daemon' (deprecated in 2.6.0).

--server-tcp-port=NNN
Set the TCP port used by the daemon mode. By default ecasound will use port number 2868. This option replaces '--daemon-port' (deprecated in 2.6.0).

--no-server
Disable ecasound's daemon mode. This is the default. This option replaces '--nodaemon' (deprecated in 2.6.0).

--osc-udp-port=NNN
Enables support for Open Source Control (OSC). Ecasound will listen for incoming OSC messages on UDP port NNN. Ecasound's OSC interface is documented at: <http://ecasound.git.sourceforge.net/git/gitweb.cgi?p=ecasound/ecasound;a=blob;f=Documentation/ecasound_osc_interface.txt;hb=HEAD>

Note that OSC support is still experimental and the interface might change in later versions of Ecasound.

This option was added to ecasound 2.7.0.

--keep-running,-K
Do not exit when processing is finished/stopped. Only affects non-interactive operating mode (see -c/-C). Option added to ecasound 2.4.2.

--help,-h
Show this help.

--version
Print version info.

GLOBAL OPTIONS

-d, -dd, -ddd
Increase the amount of printed debug messages. -d adds some verbosity, while -ddd results in very detailed output.

-d:debug_level
Set the debug level mask to 'debug_level'. This a bitmasked value with the following classes: errors (1), info (2), subsystems (4), module_names (8), user_objects (16), system_objects 32, functions (64), continuous (128) and eiam_return_values (256). Default is 271 (1+2+4+8+256). See sourcode documentation for the ECA_LOGGER class for more detailed information.

-R[:]path-to-file
Use ecasound resource file (see ecasoundrc man page) 'path-to-file' as the only source of setting resource value. Specifying this option will disable the normal policy of querying both global and user (if exists) resource files.

-q
Quiet mode, no output. Same as -d:0.

GENERAL CHAINSETUP OPTIONS

-a:chainname1, chainname2, ...
Selects active signal chains. All inputs and outputs following this '-a' option are assigned to selected chains (until a new -a option is specified). When adding effects, controllers and other chain operators, only one chain can be selected at a time. If no -a option has been given, chain 'default' is used instead when adding objects. Chain name 'all' is also reserved. It will cause all existing chains to be selected. By giving multiple -a options, you can control to which chains effects, inputs and outputs are assigned to. Look at the EXAMPLES section for more detailed info about the usage of this option.

-n:name
Sets the name of chainsetup to 'name'. If not specified, defaults either to "command-line-setup" or to the file name from which chainsetup was loaded. Whitespaces are not allowed.

-x
Truncate outputs. All output object are opened in overwrite mode. Any existing files will be truncated.

-X
Open outputs for updating. Ecasound opens all outputs - if target format allows it - in readwrite mode.

-z:feature
Enables 'feature'. Most features can be disabled using notation -z:nofeature. '-z:db,dbsize' enables double-buffering for audio objects that support it (dbsize=0 for default, otherwise buffer size in sample frames). '-z:nodb' disables double-buffering. '-z:intbuf' and '-z:nointbuf' control whether extra internal buffering is allowed for realtime devices. Disabling this can reduce latency times in some situations. With '-z:xruns', processing will be halted if an under/overrun occurs. '-z:multitrack' and 'z:nomultitrack' can be used to force ecasound to enable or disable multitrack-mode. In rare cases you may want to explicitly specify the recording offset with '-z:multitrack,offset-in-samples'. The offset is the amount of samples skipped when recording from real-time inputs. '-z:psr' enables the precise-sample-rates mode for OSS-devices. '-z:mixmode,sum' enables mixing mode where channels are mixed by summing all channels. The default is '-z:mixmode,avg', in which channels are mixed by averaging. Mixmode selection was first added to ecasound 2.4.0. See ecasoundrc man page.

CHAINSETUP BUFFERING AND PERFORMANCE OPTIONS

-B:buffering_mode
Selects the default buffering mode. Mode is one of: 'auto' (default), 'nonrt', 'rt', 'rtlowlatency'.

-b:buffer_size
Sets the processing engine buffer size in samples. The size must be an exponent of 2, and it is independent of channel count (e.g. -b:1024 at 48kHz will result in 21.333ms buffer length whether input is mono, stereo or 5.1).

This is an important option as this defines the length of one processing engine iteration and affects ecasound behaviour in many ways. If not explicitly specified, ecasound will try to choose an optimal value based on current buffering mode (see -B option). For real-time processing, you can try to set this as low as possible to reduce the processing delay. Some machines can handle buffer values as low as 64 and 128. In some circumstances (for instance when using oscillator envelopes) small buffer sizes will make envelopes act more smoothly. When not processing in real-time (all inputs and outputs are normal files), larger values may help to avoid buffer overruns, lower CPU usage and/or otherwise improve performance.

Note that when any JACK input/outputs are used, the buffer size setting is overridden and set to period/buffer size reported by JACK server (e.g. jackd's '-p' option). It is not possible to turn off this behaviour.

If not explicitly specified, the default buffer size is chosen based on current buffering mode (see -B).

-r:sched_priority
Use realtime scheduling policy (SCHED_FIFO). This is impossible if ecasound doesn't have root priviledges. Beware! This gives better performance, but can cause total lock-ups if something goes wrong. The 'sched_priority' can be omitted (0=omitted). If given, this is the static priority to the highest priority ecasound thread. Other ecasound threads run with priority 'sched_priority-1...n'. Value '-1' can be used to disable raised-priority mode.

-z:feature
Relevant features are -z:db,xxx (-z:nodb) and -z:intbuf (-z:nointbuf). See section General chainsetup options for details.

PROCESSING CONTROL

-t:seconds
Sets processing time in seconds (doesn't have to be an integer value). If processing time isn't set, engine stops when all inputs are finished. This option is equivalent to the 'cs-set-length' EIAM command. A special-case value of '-1' will set the chainsetup length according to the longest input object.

-tl
Enables looping. When processing is finished, engine will start again from beginning. This option is equivalent to the 'cs-loop' EIAM command.

INPUT/OUTPUT SETUP

See ecasound user's guide for more detailed documentation.

-G:mgrtype,optstring
Sets options for audio object manager type 'mgrtype'. For available options, see "OBJECT TYPE SPECIFIC NOTES" below.

-f:sample_format,channel,sample-rate,interleaving
Sets the audio stream parameters for subsequent audio objects. To set different parameters for different audio objects, multiple '-f' options have to be specified (note the ordering, the '-f' options should precede the audio objects for them to have any effect). See documentation for '-i' and '-o' options.

When an audio object is opened (e.g. a file or sound device is opened, or connection is made to a sound server), the audio stream parameters are passed to the object. It should be noted that not all audio objects allow to set any or all of the parameters. For instance when opening existing audio files, many file formats have a header describing the file audio parameters. In these cases the audio file header overrides the parameters passed with '-f' option. Similarly when creating JACK inputs and outputs, the JACK server mandates the sampling rate and sample format.

If no '-f' option is specified, or some of the argument fields are left empty (e.g. '-f:,2,44100'), ecasound will use default values. These default values are defined in ecasoundrc configuration file. See ecasoundrc(5) manual page.

Note that ecasound opens out files by default in update mode. Unless option '-x' (overwrite outputs) option is given, audio parameters of an existing audio file take preference over the params set with '-f'.

Sample format is given as a formatted string. The first letter is either "u", "s" and "f" (unsigned, signed, floating point). The following number specifies sample size in bits. If sample is little endian, "_le" is added to the end. Similarly if big endian, "_be" is added. If endianness is not specified, host byte-order is used. Currently supported formats are "u8" (same as "8"), "s16_le" (same as "16"), "s16_be", "s24_le", "s24_be", "s32_le", "s32_be", "f32_le" and "f32_be". An empty string "" picks the system default sample format.

The 4th parameter defines the channel layout. The available options are 'i' (interleaved' and 'n' (noninterleaved). With the noninterleaved setting, ecasound will process samples one channel at a time, and the blocksize is set with '-b'. The default setting is 'i'.

-y:seconds
Sets starting position for last specified input/output. If you need more flexible control over audio objects, you should use the .ewf format.

-i[:]input-file-or-device[,params]
Specifies a new input source that is connected to all selected chains (chains are selected with '-a:...'). Connecting multiple inputs to the same chain is not possible, but one input can be connected to multiple chains. Input can be a a file, device or some other audio object (see below). If the input is a file, its type is determined using the file name extension. If the object name contains any commas, the name must be enclosed in backquotes to avoid confusing the parser. Currently supported formats are RIFF WAVE files (.wav), audio-cd tracks (.cdr), ecasound EWF files (.ewf), RAW audio data (.raw) and MPEG audio files (.mp2,.mp3). More audio formats are supported via libaudiofile and libsndfile libraries (see documentation below). MikMod is also supported (.xm, .mod, .s3m, .it, etc). MIDI files (.mid) are supported using Timidity++. Similarly Ogg Vorbis (.ogg) can be read, and written if ogg123 and vorbize tools are installed; FLAC files (.flac) with flac command-line tools or using libsndfile; and AAC files (.aac/.m4a/.mp4) with faad2/faac tools. Supported realtime devices are OSS audio devices (/dev/dsp*), ALSA audio and loopback devices and JACK audio subsystem. If no inputs are specified, the first non-option (doesn't start with '-') command line argument is considered to be an input.

-o[:]output-file-or-device[,params]
Works in the same way as the -i option. If no outputs are specified, the default output device is used (see ~/.ecasoundrc). If the object name contains any commas, the name must be enclosed in backquotes to avoid confusing the parser. Note, many object types do not support output (e.g. MikMod, MIDI and many others).

OBJECT TYPE SPECIFIC NOTES

ALSA devices - 'alsa'
When using ALSA drivers, instead of a device filename, you need to use the following option syntax: -i[:]alsa,pcm_device_name.

ALSA direct-hw and plugin access - 'alsahw', 'alsaplugin'
It's also possible to use a specific card and device combination using the following notation: -i[:]alsahw,card_number,device_number,subdevice_number. Another option is the ALSA PCM plugin layer. It works just like the normal ALSA pcm-devices, but with automatic channel count and sample format conversions. Option syntax is -i[:]alsaplugin,card_number,device_number,subdevice_number.

aRts input/output - 'arts'
If enabled at compile-time, ecasound supports audio input and output using aRts audio server. Option syntax is -i:arts, -o:arts.

Audio file sequencing - 'audioloop', 'select', 'playat'
Ecasound provides a set of special audio object types that can be used for temporal sequencing of audio files - i.e. looping, playing only a select portion of a file, playing file at a spefific time, and other such operation.

Looping is possible with -i:audioloop,file.ext,params. The file name (or any object type understood by Ecasound) given as the second parameter is played back continuously looping back to the beginning when the end of file is reached. Any additional parameters given are passed unaltered to the file object. Parameters 3...N are passed as is to the child object (i.e. "-i audioloop,foo.wav,bar1,bar2" will pass parameters "bar1,bar2" to the "foo.wav" object.

To select and use only a specific segment of an audio object, the -i:select,start-time,duration,file.ext,params can be used. This will play "duration" of "file.ext", starting at "start-time". The time values should be given as seconds (e.g. "2.25", or as samples (e.g. "25000sa"). Parameters 4...N are passed as is to the child object.

To play an audio object at a given moment in time, the -i:playat,play-at-time,file.ext,params can be used. This will play "file.ext" after position reaches "play-at-time". The time values should be given as seconds (e.g. "2.25", or as samples (e.g. "25000sa"). Parameters 2...N are passed as is to the child object.

Ecasound Wave Files (EWF) - '*.ewf'
A special file format that allows one to slice and loop full (or segments) of audio files. This format is specific to Ecasound. See ecasound user's guide for more detailed information.

See also audio object types 'audioloop', 'select' and 'playat'.

JACK input/outputs - Overview
JACK is a low-latency audio server that can be used to connect multiple independent audio application to each other. It is different from other audio server efforts in that it has been designed from the ground up to be suitable for low-latency professional audio work.

JACK input/outputs - 'jack'
Ecasound provides multiple ways to communicate with JACK servers. To create a JACK input or output object, one should use -i jack and -o jack. These create JACK client ports "ecasound:in_N" and "ecasound:out_n" respectively ('N' is replaced by the channel number). Ecasound automatically creates one JACK port for each channel (number of channels is set with -f:bits,channels,rate option).

It is important to note that by default JACK ports are not connected anywhere (e.g. to soundcard input/outputs, or to other apps). One thus has to connect the ports with an external program (e.g. "QJackCtl" or "jack_connect").

JACK input/outputs - 'jack,clientname,portprefix'
"jack,clientname" For simple use scanerios, ecasound provides a way to autoconnect the ecasound ports. This can be done with by giving the peer client name as the second parameter to the "jack" object, e.g. -o jack,clientname. As an example, -o jack,system will create an output that is automatically connected to outputs of the default system soundcard. The client parameter can be omitted, in which case no automatic connections are made.

If one needs to change the port prefix (e.g. "in" in client name "ecasound:in_N"), the prefix can be specified as the third parameter to "jack" object, e.g. -o jack,,fxout. Also the third parameter can be omitted, in which case the default prefixes "in" and "out" are used.

JACK input/outputs - 'jack_multi'
A variant of 'jack' object type is 'jack_multi'. The full object syntax is jack_multi,destport1,...,destportN. When a 'jack_multi' object is connected to a JACK server, first channel of the object is connected to JACK port 'destport1', second to 'destport2' and so forth. For instance "-f:32,2,44100 -o jack_multi,foo:in,bar:in" creates a stereo ecasound output object, with its left and right channels routed to two difference JACK clients. The destination ports must be active when the ecasound engine is launched, or otherwise the connections cannot be established. If destination ports are not specified for all channels, or zero length strings are given, those ports are not connected at launch by ecasound.

JACK input/outputs - 'jack_alsa', 'jack_auto', 'jack_generic' (**deprecated since 2.6.0**)
Ecasound 2.5 and older supported "jack_alsa", "jack_auto" and "jack_generic" object types, but these are now replaced by a more generic "jack" interface, and thus are now deprecated (they work but are no longer documented).

JACK input/outputs - client options
Additionally global JACK options can be set using -G:jack,client_name,operation_mode option. 'client_name' is the name used when registering ecasound to the JACK system. If 'operation_mode' is "notransport", ecasound will ignore any transport state changes in the JACK-system; in mode "send" it will send all start, stop and position-change events to other JACK clients; in mode "recv" ecasound will follow JACK start, stop and position-change events; and mode "sendrecv" which is a combination of the two previous modes.

If not explicitly set, in interactive mode ('-c' option), the default mode is "sendrecv", while in batchmode default is "notransport". In both cases the mode can be changed with -G option as described above.

More details about ecasound's JACK support can be found from Ecasound User's Guide.

Libaudiofile - 'audiofile'
If libaudiofile support was enabled at compile-time, this option allows you to force Ecasound to use libaudiofile for reading/writing a certain audio file. Option syntax is -i:audiofile,foobar.ext (same for -o).

Libsndfile - 'sndfile'
If libsndfile support was enabled at compile-time, this option allows you to force Ecasound to use libsndfile for reading/writing a certain audio file. Option syntax is -i:sndfile,foobar.ext[,.format-ext] (same for -o). The optional third parameter "format" can be used to override the audio format (for example you can create an AIFF file with filename "foo.wav").

Loop device - 'loop'
Loop devices make it possible to route (loop back) data between chains. Option syntax is -[io][:]loop,tag. If you add a loop output with tag '1', all data written to this output is routed to any loop input with tag '1'. The tag can be either numerical (e.g. '-i:loop,1') or a string (e.g. "-i:loop,vocals"). Like with other input/output objects, you can attach the same loop device to multiple chains and this way split/mix the signal.

Note: this 'loop' device is different from 'audioloop' (latter added to ecasound v2.5.0).

Mikmod - 'mikmod'
If mikmod support was enabled at compile-time, this option allows you to force Ecasound to use Mikmod for reading/writing a certain module file. Option syntax is -i:mikmod,foobar.ext.

Null inputs/outputs - 'null'
If you specify "null" or "/dev/null" as the input or output, a null audio device is created. This is useful if you just want to analyze sample data without writing it to a file. There's also a realtime variant, "rtnull", which behaves just like "null" objects, except all i/o is done at realtime speed.

Resample - 'resample'
Object type 'resample' can be used to resample audio object's audio data to match the sampling rate used in the active chainsetup. For example, ecasound -f:16,2,44100 -i resample,22050,foo.wav -o /dev/dsp, will resample file from 22.05kHz to 44.1kHz and write the result to the soundcard device. Child sampling rate can be replaced with keyword 'auto'. In this case ecasound will try to query the child object for its sampling rate. This works with files formats such as .wav which store meta information about the audio file format. To use 'auto' in the previous example, ecasound -f:16,2,44100 -i resample,auto,foo.wav -o /dev/dsp.

Parameters 4...N are passed as is to the child object (i.e. "-i resample,22050,foo.wav,bar1,bar2" will pass parameters "bar1,bar2" to the "foo.wav" object.

If ecasound was compiled with support for libsamplerate, you can use 'resample-hq' to use the highest quality resampling algorithm available. To force ecasound to use the internal resampler, 'resampler-lq' (low-quality) can be used.

Reverse - 'reverse'
Object type 'reverse' can be used to reverse audio data coming from an audio object. As an example, ecasound -i reverse,foo.wav -o /dev/dsp will play 'foo.wav' backwards. Reversing output objects is not supported. Note! Trying to reverse audio object types with really slow seek operation (like mp3), works extremely badly. Try converting to an uncompressed format (wav or raw) first, and then do reversation.

Parameters 3...N are passed as is to the child object (i.e. "-i reverse,foo.wav,bar1,bar2" will pass parameters "bar1,bar2" to the "foo.wav" object.

System standard streams and named pipes - 'stdin', 'stdout'
You can use standard streams (stdin and stdout) by giving stdin or stdout as the file name. Audio data is assumed to be in raw/headerless (.raw) format. If you want to use named pipes, create them with the proper file name extension before use.

Tone generator - 'tone'
To generate a test tone, input -i:tone,type,freq,duration-secs can be used. Parameter 'type' specifies the tone type: currently only 'sine' is supported. The 'freq' parameter sets the frequency of the generated tone and 'duration-secs' the length of the generated stream. Specifying zero, or a negative value, as the duration will produce an infinite stream. This feature was first added to Ecasound 2.4.7.

Typeselect - 'typeselect'
The special 'typeselect' object type can be used to override how ecasound maps filename extensions and object types. For instance ecasound -i typeselect,.mp3,an_mp3_file.wav -o /dev/dsp. would play the file 'an_mp3_file.wav' as an mp3-file and not as an wav-file as would happen without typeselect.

Parameters 4...N are passed as is to the child object (i.e. "-i typeselect,.au,foo.wav,bar1,bar2" will pass parameters "bar1,bar2" to the "foo.wav" object.

MIDI SETUP

MIDI I/O devices - general
If no MIDI-device is specified, the default MIDI-device is used (see ecasoundrc(5)).

-Md:rawmidi,device_name
Add a rawmidi MIDI I/O device to the setup. 'device_name' can be anything that can be accessed using the normal UNIX file operations and produces raw MIDI bytes. Valid devices are for example OSS rawmidi devices (/dev/midi00), ALSA rawmidi devices (/dev/snd/midiC2D0), named pipes (see mkfifo man page), and normal files.

-Md:alsaseq,sequencer-port
Adds a ALSA MIDI sequencer port to the setup. 'sequencer-port' identifies a port to connect to. It can be numerical (e.g. 128:1), or a client name (e.g. "KMidimon").

-Mms:device_id
Sends MMC start ("Deferred Play") and stop ("Stop") with device ID 'device_id'.

While Ecasound does not directly support syncing transport state to incoming MMC messages, this can be achieved by connecting Ecasound to JACK input/outputs, and using a tool such as JackMMC and JackCtlMMC ( see <http://jackctlmmc.sourceforge.net/>) to convert MMC messages into JACK transport change events.

-Mss
Sends MIDI-sync (i.e. "MIDI Start" and "MIDI Stop" system realtime messages) .to the selected MIDI-device. Notice that as Ecasound will not send MIDI-clock, but only the start and stop messages.

EFFECT SETUP

PRESETS

Ecasound has a powerful effect preset system that allows you create new effects by combining basic effects and controllers. See ecasound user's guide for more detailed information.

-pf:preset_file.eep
Uses the first preset found from file 'preset_file.eep' as a chain operator.

-pn:preset_name
Find preset 'preset_name' from global preset database and use it as a chain operator. See ecasoundrc man page for info about the preset database.

SIGNAL ANALYSIS

-ev
Analyzes sample data to find out how much the signal can be amplified without clipping. The resulting percent value can be used as a parameter to '-ea' (amplify). A statistical summary, containing info about the stereo-image and distribution of sample values, is printed out at the end of processing.

-evp
Peak amplitude watcher. Maintains peak information for each processed channels. Peak information is resetted on every read.

-ezf
Finds the optimal value for DC-adjusting. You can use the result as a parameter to -ezx effect.

GENERAL SIGNAL PROCESSING ALGORITHMS

-eS:stamp-id
Audio stamp. Takes a snapshot of passing audio data and stores it using id 'stamp-id' (integer number). This data can later be used by controllers and other operators.

-ea:amplify%
Adjusts the signal amplitude to 'amplify%' percent (linear scale, i.e. individual samples are multiplied by 'amplify%/100'). See also '-eadb'.

-eac:amplify%,channel
Amplifies signal of channel 'channel' by amplify-% percent (linear scale, i.e. individual samples are multiplied by 'amplify%/100'). 'channel' ranges from 1...n where n is the total number of channels. See also '-eadb'.

-eadb:gain-dB[,channel]
Adjusts signal level by 'gain-dB', with a gain of 0dB having no effect to the signal, negative gains attenuating the signal and positive gain values amplifying it. The 'channel' parameter (1...n) is optional. If 'channel' parameter is specified, and its value is nonzero, gain is only applied to the given channel (1...n).

-eaw:amplify%,max-clipped-samples
Amplifies signal by amplify-% percent (linear scale, i.e. individual samples are multiplied by 'amplify%/100'). If number of consecutive clipped samples (resulting sample value is outside the nominal [-1,1] range), a warning will be issued.

-eal:limit-%
Limiter effect. Limits audio level to 'limit-%' (linear scale) with values equal or greater than 100% resulting in no change to the signal.

-ec:rate,threshold-%
Compressor (a simple one). 'rate' is the compression rate in decibels ('rate' dB change in input signal causes 1dB change in output). 'threshold' varies between 0.0 (silence) and 1.0 (max amplitude).

-eca:peak-level-%, release-time-sec, fast-crate, crate
A more advanced compressor (original algorithm by John S. Dyson). If you give a value of 0 to any parameter, the default is used. 'peak-level-%' essentially specifies how hard the peak limiter is pushed. The default of 69% is good. 'release_time' is given in seconds. This compressor is very sophisticated, and actually the release time is complex. This is one of the dominant release time controls, but the actual release time is dependent on a lot of factors regarding the dynamics of the audio in. 'fastrate' is the compression ratio for the fast compressor. This is not really the compression ratio. Value of 1.0 is infinity to one, while the default 0.50 is 2:1. Another really good value is special cased in the code: 0.25 is somewhat less than 2:1, and sounds super smooth. 'rate' is the compression ratio for the entire compressor chain. The default is 1.0, and holds the volume very constant without many nasty side effects. However the dynamics in music are severely restricted, and a value of 0.5 might keep the music more intact.

-enm:threshold-level-%,pre-hold-time-msec,attack-time-msec,post-hold-time-msec,release-time-msec
Noise gate. Supports multichannel processing (each channel processed separately). When signal amplitude falls below 'threshold_level_%' percent (100% means maximum amplitude), gate is activated. If the signal stays below the threshold for 'th_time' ms, it's faded out during the attack phase of 'attack' ms. If the signal raises above the 'threshold_level' and stays there over 'hold' ms the gate is released during 'release' ms.

-ei:pitch-shift-%
Pitch shifter. Modifies audio pitch by altering its length.

-epp:right-%
Stereo panner. Changes the relative balance between the first two channels. When 'right-%' is 0, only signal on the left (1st) channel is passed through. Similarly if it is '100', only right (2nd) channel is let through.

-ezx:channel-count,delta-ch1,...,delta-chN
Adjusts the signal DC by 'delta-chX', where X is the channel number. Use -ezf to find the optimal delta values.

ENVELOPE MODULATION

-eemb:bpm,on-time-%
Pulse gate (pulse frequency given as beats-per-minute).

-eemp:freq-Hz,on-time-%
Pulse gate.

-eemt:bpm,depth-%
Tremolo effect (tremolo speed given as beats-per-minute).

FILTER EFFECTS

-ef1:center_freq, width
Resonant bandpass filter. 'center_freq' is the center frequency. Width is specified in Hz.

-ef3:cutoff_freq, reso, gain
Resonant lowpass filter. 'cutoffr_freq' is the filter cutoff frequency. 'reso' means resonance. Usually the best values for resonance are between 1.0 and 2.0, but you can use even bigger values. 'gain' is the overall gain-factor. It's a simple multiplier (1.0 is the normal level). With high resonance values it often is useful to reduce the gain value.

-ef4:cutoff, resonance
Resonant lowpass filter (3rd-order, 36dB, original algorithm by Stefan M. Fendt). Simulates an analog active RC-lowpass design. Cutoff is a value between [0,1], while resonance is between [0,infinity).

-efa:delay-samples,feedback-%
Allpass filter. Passes all frequencies with no change in amplitude. However, at the same time it imposes a frequency-dependent phase-shift.

-efc:delay-samples,radius
Comb filter. Allows the spikes of the comb to pass through. Value of 'radius' should be between [0, 1.0).

-efb:center-freq,width
Bandpass filter. 'center_freq' is the center frequency. Width is specified in Hz.

-efh:cutoff-freq
Highpass filter. Only frequencies above 'cutoff_freq' are passed through.

-efi:delay-samples,radius
Inverse comb filter. Filters out the spikes of the comb. There are 'delay_in_samples-2' spikes. Value of 'radius' should be between [0, 1.0). The closer it is to the maximum value, the deeper the dips of the comb are.

-efl:cutoff-freq
Lowpass filter. Only frequencies below 'cutoff_freq' are passed through.

-efr:center-freq,width
Bandreject filter. 'center_freq' is the center frequency. Width is specified in Hz.

-efs:center-freq,width
Resonator. 'center_freq' is the center frequency. Width is specified in Hz. Basicly just another resonating bandpass filter.

CHANNEL MIXING / ROUTING

-chcopy:from-channel, to-channel
Copy channel 'from_channel' to 'to_channel'. If 'to_channel' doesn't exist, it is created. Channel indexing starts from 1. Option added to ecasound 2.4.5.

-chmove:from-channel, to-channel
Copy channel 'from_channel' to 'to_channel', and mutes the source channel 'from_channel'. Channel indexing starts from 1. Option added to ecasound 2.4.5.

-chorder:ch1,...,chN
Reorder, omit and/r duplicate chain channels. The resulting audio stream has total of 'N' channels. Each parameter specifies the source channel to use for given output channel. As an example, '-chorder:2,1' would reverse the channels of a stereo stream ('out1,out2' = 'in2,in1'). Specifying the same source channel multiple times is allowed. For example, '-chorder:2,2' would route the second channel to both two output channels ('out1,out2' = 'in2,in2'). If 'chX' is zero, the given channel 'X' will be muted in the output stream. Option added to ecasound 2.7.0.

-chmix:to-channel
Mix all source channels to channel 'to_channel'. If 'to_channel' doesn't exist, it is created. Channel indexing starts from 1. Option added to ecasound 2.4.5.

-chmute:channel
Mutes the channel 'channel'. Channel indexing starts from 1. Option added to ecasound 2.4.5.

-erc:from-channel,to-channel
Deprecated, see -chcopy.

-erm:to-channel
Deprecated, see -chmix.

TIME-BASED EFFECTS

-etc:delay-time-msec,variance-time-samples,feedback-%,lfo-freq
Chorus.

-etd:delay-time-msec,surround-mode,number-of-delays,mix-%,feedback-%
Delay effect. 'delay time' is the delay time in milliseconds. 'surround-mode' is a integer with following meanings: 0 = normal, 1 = surround, 2 = stereo-spread. 'number_of_delays' should be obvious. Beware that large number of delays and huge delay times need a lot of CPU power. 'mix-%' expresses the mix balance between the original and delayed signal, with 0 meaning no delayed signal, 100 meaning no original signal, and 50 (the default) achieving an equal balance. 'feedback-%' represents how much of the signal is recycled in each delay or, if you prefer, at what rate the repeated snippet of delayed audio fades. Note that sufficiently low feedback values may result in a number of audible repetitions lesser than what you have specified for 'number_of_delays', especially if you have set a low value for 'mix-%'. By default the value for this parameter is 100% (No signal loss.).

-ete:room_size,feedback-%,wet-%
A more advanced reverb effect (original algorithm by Stefan M. Fendt). 'room_size' is given in meters, 'feedback-%' is the feedback level given in percents and 'wet-%' is the amount of reverbed signal added to the original signal.

-etf:delay-time-msec
Fake-stereo effect. The input signal is summed to mono. The original signal goes to the left channels while a delayed version (with delay of 'delay time' milliseconds) is goes to the right. With a delay time of 1-40 milliseconds this adds a stereo-feel to mono-signals.

-etl:delay-time-msec,variance-time-samples,feedback-%,lfo-freq
Flanger.

-etm:delay-time-msec,number-of-delays,mix-%
Multitap delay. 'delay time' is the delay time in milliseconds. 'number_of_delays' should be obvious. 'mix-%' determines how much effected (wet) signal is mixed to the original.

-etp:delay-time-msec,variance-time-samples,feedback-%,lfo-freq
Phaser.

-etr:delay-time,surround-mode,feedback-%
Reverb effect. 'delay time' is the delay time in milliseconds. If 'surround-mode' is 'surround', reverbed signal moves around the stereo image. 'feedback-%' determines how much effected (wet) signal is fed back to the reverb.

LADSPA-PLUGINS

-el:plugin_unique_name,param-1,...,param-N
Ecasound supports LADSPA-effect plugins (Linux Audio Developer's Simple Plugin API). Parameters 1..N are set as values of the plugin's control ports.

If plugin has more than one audio input and/or output port, only one plugin is instance is created, and the chain channels are fed to the same plugin instance. If plugin has at most one input and at most one output audio port, a separate plugin instance is created for each channel of the ecasound chain (e.g. for a stereo audio channel, two LADSPA plugins of same type are created, with one per channel).

Plugins are located in shared library (.so) files. Ecasound looks for plugins in @prefix@/lib/ladspa (e.g. "/usr/local/lib/ladspa"), directories listed in environment variable LADSPA_PATH. Plugin search path can be configured also via ecasoundrc, see ecasoundrc(5) man page. One shared library file can contain multiple plugin objects, but every plugin has a unique plugin name. This name is used for selecting plugins.

See LAD mailing list web site for more info about LADSPA. Other useful sites are LADSPA home page and LADSPA documentation.

-eli:plugin_unique_number,param-1,...,param-N
Same as above (-el) expect plugin's unique id-number is used. It is guaranteed that these id-numbers are unique among all LADSPA plugins.

LV2 PLUGINS

-elv2:plugin-id-uri,param-1,...,param-N
Ecasound also supports LV2 audio plugins. LV2 plugins are identified by a globally unique, case-sensitive identifier.

If plugin has more than one audio input and/or output port, only one plugin is instance is created, and the chain channels are fed to the same plugin instance. If plugin has at most one input and at most one output audio port, a separate plugin instance is created for each channel of the ecasound chain (e.g. for a stereo audio channel, two LV2 plugins of same type are created, with one per channel).

LV2 is a plugin standard for audio systems.

GATE SETUP

-gc:start-time,len
Time crop gate. Initially gate is closed. After 'start-time' seconds has elapsed, gate opens and remains open for 'len' seconds. When closed, passing audio buffers are trucated to zero length.

-ge:open-threshold-%,close-thold-%,volume-mode,reopen-count
Threshold gate. Initially gate is closed. It is opened when volume goes over 'othreshold' percent. After this, if volume drops below 'cthold' percent, gate is closed and won't be opened again, unless the 'reopen-count' is set to anything other than zero. If 'value_mode' is 'rms', average RMS volume is used. Otherwise peak average is used. When closed, passing audio buffers are trucated to zero length. If the 'reopen-count' is set to a positive number, then the gate will restart its operation that many times. So for example, a reopen count of 1 will cause up to 2 openings of the gate. A negative value for 'reopen-count' will result in the gate reopening indefinitely. The 'reopen-count' is invaluable in recording vinyl and tapes, where you can set things up and then recording starts whenever the needle is on the vinyl, and stops when it's off. As many sides as you like can be recorded in one session. You will need to experiment with buffer lengths and start/stop levels to get reliable settings for your equipment.

-gm:state
Manual gate. If 'state' is 1, gate is open and all samples are passed through. If 'state' is zero, gate is closed an no samples are let through. This chain operator is useful when writing to an output needs to be stopped dynamically (without stopping the whole engine).

CONTROL ENVELOPE SETUP

Controllers can be used to dynamically change effect parameters during processing. All controllers are attached to the selected (=usually the last specified effect/controller) effect. The first three parameters are common for all controllers. 'fx_param' specifies the parameter to be controlled. Value '1' means the first parameter, '2' the second and so on. 'start_value' and 'end_value' set the value range. For examples, look at the the EXAMPLES section.

-kos:fx-param,start-value,end-value,freq,i-phase
Sine oscillator with frequency of 'freq' Hz and initial phase of 'i_phase' times pi.

-kog:fx-param,start-value,end-value,freq,mode,point-pairs,first-value,last-value,pos1,value1,...
Generic oscillator. Frequency 'freq' Hz, mode either '0' for static values or '1' for linear interpolation. 'point-pairs' specifies the number of 'posN' - 'valueN' pairs to include. 'first-value' and 'last-value' are used as border values (values for position 0.0/first and position 1.0/last). All 'posN' and 'valueN' must be between 0.0 and 1.0. Also, for all 'posN' values 'pos1 < pos2 < ... < posN' must be true.

-kf:fx-param,start-value,end-value,freq,mode,genosc-number
Generic oscillator. 'genosc_number' is the number of the oscillator preset to be loaded. Mode is either '0' for static values or '1' for linear interpolation. The location for the preset file is taken from ./ecasoundrc (see ecasoundrc man page).

-kl:fx-param,start-value,end-value,time-seconds
Linear envelope that starts from 'start_value' and linearly changes to 'end_value' during 'time_in_seconds'. Can be used for fadeins and fadeouts.

-kl2:fx-param,start-value,end-value,1st-stage-length-sec,2nd-stage-length-sec
Two-stage linear envelope, a more versatile tool for doing fade-ins and fade-outs. Stays at 'start_value' for '1st_stage_length' seconds and then linearly changes towards 'end_value' during '2nd_stage_length' seconds.

-klg:fx-param,low-value,high-value,point_count,pos1,value1,...,posN,valueN
Generic linear envelope. This controller source can be used to map custom envelopes to chain operator parameters. Number of envelope points is specified in 'point_count'. Each envelope point consists of a position and a matching value. Number of pairs must match 'point_count' (i.e. 'N==point_count'). The 'posX' parameters are given as seconds (from start of the stream). The envelope points are specified as float values in range '[0,1]'. Before envelope values are mapped to operator parameters, they are mapped to the target range of '[low-value,high-value]'. E.g. a value of '0' will set operator parameter to 'low-value' and a value of '1' will set it to 'high-value'. For the initial segment '[0,pos1]', the envelope will output value of 'value1' (e.g. 'low-value').

-km:fx-param,start-value,end-value,controller,channel
MIDI continuous controller (control change messages). Messages on the MIDI-channel 'channel' that are coming from controller number 'controller' are used as the controller source. As recommended by the MIDI-specification, channel numbering goes from 1 to 16. Possible controller numbers are values from 0 to 127. The MIDI-device where bytes are read from can be specified using -Md option. Otherwise the default MIDI-device is used as specified in ~ecasound/ecasoundrc (see ecasoundrc man page). Defaults to /dev/midi.

-ksv:fx-param,start-value,end-value,stamp-id,rms-toggle
Volume analyze controller. Analyzes the audio stored in stamp 'stamp-id' (see '-eS:id' docs), and creates control data based on the results. If 'rms-toggle' is non-zero, RMS-volume is used to calculate the control value. Otherwise average peak-amplitude is used.

-kx
This is a special switch that can be used when you need to control controller parameters with another controller. When you specify -kx, the last specified controller will be set as the control target. Then you just add another controller as usual.

INTERACTIVE MODE

See ecasound-iam(1) man page.

ENVIRONMENT

ECASOUND
If defined, some utility programs and scripts will use the ECASOUND environment as the default path to ecasound executable.

ECASOUND_LOGFILE
Output all debugging messages to a separate log file. If defined, ECASOUND_LOGFILE defines the logfile path. This is a good tool for debugging ECI/EIAM scripts and applications.

ECASOUND_LOGLEVEL
Select which messages are written to the logfile defined by ECASOUND_LOGFILE. The syntax for -d:level is used. If not defined, all messages are written. Defaults to -d:319 (everything else but 'functions (64)' and 'continuous (128)' class messages).

COLUMNS
Ecasound honors the COLUMNS environment variable when formatting printed trace messages. If COLUMNS is not set, a default of 74 is used.

TMPDIR
Some functions of Ecasound (e.g. "cs-edit" interactive command) require creation of temporary files. By default, these files are created under "/tmp", but this can be overridden by setting the TMPDIR environment variable.

RETURN VALUES

In interactive mode, ecasound always returns zero.

In non-interactive (batch) mode, a non-zero value is returned for the following errors:

1
Unable to create a valid chainsetup with the given parameters. Can be caused by invalid option syntax, etc.

2
Unable to start processing. This can be caused by insufficient file permissions, inability to access some system resources, etc.

3
Error during processing. Possible causes: output object has run out of free disk space, etc.

4
Error during process termination and/or cleanup. See section on 'SIGNALS' for further details.

SIGNALS

When ecasound receives any of the POSIX signals SIGINT (ctrl-c), SIGHUP, SIGTERM or SIGQUIT, normal cleanup and exit procedure is initiated. Here normal exit means that e.g. file headers are updated before closing, helper processes are terminated in normal way, and so forth.

If, while doing the cleanup described above, ecasound receives another signal (of the same set of POSIX signals), ecasound will skip the normal cleanup procedure, and terminate immediately. Any remaining cleanup tasks will be skipped. Depending on the runtime state and configuration, this brute force exit may have some side-effects. Ecasound will return exit code of '4' if normal cleanup was skipped.

Special case handling is applied to the SIGINT (ctrl-c) signal. If a SIGINT signal is received during the cleanup procedure, ecasound will ignore the signal once, and emit a notice to 'stderr' that cleanup is already in progress. Any subsequent SIGINT signals will no longer get special handling, and instead process will terminate immediately (and possibly without proper cleanup).

FILES

~/.ecasound The default directory for ecasound user resource files. See the ecasoundrc (5) man page man page.

*.ecs Ecasound Chainsetup files. Syntax is more or less the same as with command-line arguments.

*.ecp Ecasound Chain Preset files. Used for storing effect and chain operator presets. See ecasound user's guide for more better documentation.

*.ews Ecasound Wave Stats. These files are used to cache waveform data.

EXAMPLES

Examples of how to perform common tasks with ecasound can be found at http://nosignal.fi/ecasound/Documentation/examples.html.

SEE ALSO

ecatools (1) man page, ecasound-iam (1) man page ecasoundrc (5) man page, "HTML docs in the Documentation subdirectory"

BUGS

See file BUGS. If ecasound behaves weirdly, try to increase the debug level to see what's going on.

AUTHOR

Kai Vehmanen, <kvehmanen -at- eca -dot- cx> ecasound-2.9.3/Documentation/ecasoundrc_manpage.html0000644000076400007640000002502212260765172017605 00000000000000 ecasoundrc


ecasoundrc

22.03.2009


ecasoundrc(5)

ecasoundrc(5)

Multimedia software

22.03.2009

NAME

ecasoundrc - ecasound rcfile

SYNOPSIS

{prefix}/share/ecasound/ecasoundrc (for instance '/usr/local/share/ecasound/ecasoundrc') $HOME/.ecasound/ecasoundrc

DESCRIPTION

ecasoundrc is the main configuration file for ecasound. Any user-specific modification should be done to $HOME/.ecasound/ecasoundrc, not to the global resource file. Ecasound also allows one to disable the normal policy and only read from a specific resource file (see ecasound (1) and documentation for the -R option).

The format is quite simple. One line consists of a configuration variable and its value. Variable and value are separated with either '=' or ' '. Lines beginning with a "#" are ignored (comment lines).

VARIABLES

midi-device
MIDI-device. If the device name is given in rawmidi,/dev/midi* format, OSS/Linux or OSS/Lite drivers are used. Device rawmidi,/dev/snd/midiCxDy opens an ALSA raw-MIDI device with card number 'x' and device number 'y'. See ecasound (1) man page (the '-Md option) for more info. Defaults to rawmidi,/dev/midi.

default-output
Output device to use by default. If a chainsetup with zero outputs, but with one or more inputs, is connected, a default output is added and all the chains are connected to it. If the special-case value 'autodetect' is specified, ecasound will try to auto-detect a suitable device (JACK -> ALSA -> OSS -> rtnull). Defaults to autodetect.

default-audio-format
Default values for sample format, channel count, sampling rate and channel interleaving. Syntax is the same as used by ecasound's -f option (see ecasound (1)). Defaults to s16_le,2,44100,i.

default-to-precise-sample-rates
Whether to ignore sample rate differences (and possibly avoid resampling). Currently only affects OSS-devices. Defaults to false.

default-mix-mode
If default-mix-mode is sum, engine will mix multiple channels into one output channel by summing all input channels. In mode avg, mixing is done by taking the average of all input channels. The avg mode is safe from clipping, while sum is closer to the way analog mixers work. Defaults to avg.

bmode-defaults-nonrt
Selects the default parameters to use with buffering mode 'nonrt' (other modes are 'rt' and 'rtlowlatency). Parameters are given as a comma-separated tuple of values: 1) buffersize (number,-b), 2) raised priority (true/false,-r), 3) sched_priority (number,-r:X), 4) double buffering (true/false,-z:db), 5) db-bufsize (number,-z:db,X), and 6) max intbuf (true/false,-z:intbuf). Defaults to 1024,false,50,false,100000,true.

bmode-defaults-rt
See 'bmode-defaults-nonrt'. Defaults to 1024,true,50,true,100000,true.

bmode-defaults-rtlowlatency
See 'bmode-defaults-nonrt'. Defaults to 256,true,50,true,100000,false.

resource-directory
Directory for global ecasound configuration files. Defaults to {prefix-dir}/share/ecasound. Note! User-specific resource files can be be stored to '$(HOME)/.ecasound/'. For instance you can add your own presets definitions to '$(HOME)/.ecasound/effect_presets'.

resource-file-genosc-envelopes
Configuration file for generic oscillators. Is located in the resource directory. Defaults to generic_oscillators.

resource-file-effect-presets
Configuration file for effect presets. Is located in the resource directory. Defaults to effect_presets.

ladspa-plugin-directory
Directory containing LADSPA effect plugins. Defaults to {prefix-dir}/lib/ladspa. If environment variable LADSPA_PATH exists, directories specified in it are automatically searched for plugins. Note! To match the syntax of the LADSPA_PATH environment variable, 'ladspa-plugin-directory' can contain multiple directories, separated by ':' characters.

ext-cmd-text-editor
If ext-cmd-text-editor-use-getenv is false or "EDITOR" is null, value of this field is used.

ext-cmd-text-editor-use-getenv
Should ecasound try to query environment variable "EDITOR". Defaults to true.

ext-cmd-mp3-input
Command for starting mp3 input. Ecasound expects to read signed, 16bit, little-endian stereo audio samples from its standard input. Ecsound will query other audio format parameters by parsing the mp3 file header. Before execution, %f is replaced with path to the input mp3. If exists, "%o" is replaced with he start offset in mp3 frames. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default, mpg123 is launched.

ext-cmd-mp3-output
Command for starting mp3 output. Ecasound will write stereo, signed, 16bit, little-endian samples to standard output. Sample rate is configurable. Before execution, %f is replaced with path to the output mp3, %S with sample rate in kHz, and %B with encoding bitrate in kbps. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch lame. As a special exception (added to Ecasound 2.7.0), if the output program is "lame" and options include "--big-endian", Ecasound will detect this and output big-endian samples.

ext-cmd-ogg-input
Command for starting Ogg Vorbis input. Ecasound expects that audio samples are written to standard output. It should be noted that Ecasound is not able to query the audio format parameters from ogg files, so these need to be set manually by the user. Before execution, %f is replaced with path to the input ogg. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch (ogg123).

ext-cmd-ogg-output
Command for starting Ogg Vorbis output. Ecasound will write samples in little-endian format to standard output. Other audio parameters are configurable. Before execution, %f is replaced with path to the output ogg, %c, %s and %b with matching audio format parameters, and %B with encoding bitrate in kbps. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch (oggenc).

ext-cmd-mikmod
Command for starting mikmod input. Ecasound expects that signed, 16bit, stereo audio samples are written to standard output. Before execution, %f is replaced with file path, and %s with selected sample rate. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch mikmod.

ext-cmd-timidity
Command for starting timidity++ input. Ecasound expects that signed, 16bit, stereo audio samples are written to standard output. Before execution, %f is replaced with file path, and %s with sample rate. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch timidity.

ext-cmd-flac-input
Command for starting FLAC input. Ecasound expects that audio samples are written to standard output. It should be noted that Ecasound is not able to query the audio format parameters from FLAC files, so these need to be set manually by the user. Before execution, %f is replaced with path to the input FLAC file. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch (flac).

ext-cmd-flac-output
Command for starting FLAC output. Ecasound will write samples to standard output. All audio parameters are configurable. Before execution, %f is replaced with path to the output flac, %c, %b and %s with matching audio format parameters, %I with either 'signed' or 'unsigned', and %E with either 'little' or 'big'. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch (flac).

ext-cmd-aac-input
Command for starting AAC input. Ecasound expects that signed, 16bit, stereo, big-endian audio samplesare written to standard output. It should be noted that Ecasound is not able to query the input sample rate, so this needs to be set manually by the user. Before execution, %f is replaced with path to the input AAC file. Note! FAAC must be compiled with MP4 support. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to laucnh faad.

ext-cmd-aac-output
Command for starting AAC output. Ecasound will write big-endian audio samples to standard output. All other audio parameters are configurable. Before execution, %f is replaced with path to the output AAC file, %c, %b and %s with matching audio format parameters. Note! FAAC must be compiled with MP4 support. Double-quotes and backslash-espacing can be used to include white-space to individual parameters. By default Ecasound will try to launch faac.

DEPRECATED

ext-cmd-wave-editor

SEE ALSO

ecasound (1), ecatools (1), ecasound-iam (1)

AUTHOR

Kai Vehmanen, <kvehmanen -at- eca -dot- cx> ecasound-2.9.3/Documentation/ecanormalize.10000644000076400007640000001555212260765172015643 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/ecalength_manpage.html0000644000076400007640000000510612260765173017413 00000000000000 ecalength


ecalength

18.04.2004


ecalength(1)

ecalength(1)

Multimedia software

18.04.2004

NAME

ecalength - prints audio file length and other information

SYNOPSIS

ecalength [-ahtsfmbcr] FILE1 [FILE2] [FILEn]

DESCRIPTION

This is ecalength, a few lines of code pompously named so because they let one retrieve the length of an audio file from the command line using ecasound's engine.

Limitations:

- With files without header information (raw files), ecalength will only work correctly if the audio file is at a sampling rate of 44100 hz. (Addressed with the -a switch.)

- It is not foolproof, feeding it with something other than an audio file WILL result in ugly things being spewed back. (A bit better)

- A thousand more that I haven't thought of.

OPTIONS

-h
Prints this usage message. (help)

-a[:]bits,channels,rate
Changes the format assumed by default for headerless data. (adjust)

-t
Prints the summed length of all the files processed. (total) (Ignored if with -s)

-s
Enables script mode: One info type per file per line. (script) (Defaults to length in secs.)

-f
With -s will return the format string as info, alone it will add it to the main display. (format)

-b
If -s and -f are enabled with this the info printed will be the sample's bitwidth. (bits)

-c
If -s and -f are enabled with this the info printed will be the channel count. (channel count)

-r
If -s and -f are enabled with this the info printed will be the sampling rate. (rate)

-m
Will print human computable time as in main display but in batch fashion. (minutes) (Only with -s)

SEE ALSO

ecasound(1), ecatools(1)

AUTHOR

S.Massy, <observer |at| colba.net> ecasound-2.9.3/Documentation/ecasound-iam.10000644000076400007640000010144311762513505015527 00000000000000.TH "ecasound\-iam" "1" "03\&.06\&.2012" "" "Multimedia software" .PP .SH "NAME" ecasound\-iam \- ecasound interactive mode .SH "SYNOPSIS" .PP .SH "DESCRIPTION" .PP Ecasound library contains an interpreter module that understands a set of commands aimed at controlling various library services\&. This is called the ecasound interactive mode (EIAM)\&. All programs linked to ecasound library can use this facility\&. .PP .SH "ECI API and return types" A special case of interactive mode use is ecasound\(cq\&s control interface (ECI), which is a small library providing easy access to the interactive mode commands from outside of libecasound\&. When issuing inter commands using the control interface, it\(cq\&s possible that commands also return information\&. Currently supported return value types are: string [s], list of strings [S] (elements separated by commas; escaped if necessary), integer [i], long integer [li] and floating\-point number [f]\&. These definitions are used throughout this document\&. Commands that return nothing (void) are marked with [\-]\&. Additionally, return type [e] marks an error condition\&. When an interactive mode command results in an error, an error string explaining the condition is returned\&. .PP .SH "Limitations related to real\-time control and modifications" It\(cq\&s not possible to use all interactive mode commands to modify and control objects that belong to a connected chainsetup\&. Ecasound will automatically disconnect (and later try to reconnect) the chainsetup in case these commands are received while connected\&. Commands that have this limitation are: .PP .RS cs\-remove, cs\-set\-length, cs\-set\-length\-samples, cs\-toggle\-loop, cs\-set\-param, cs\-option, c\-add, c\-remove, c\-rename, c\-clear, ai\-add, ai\-remove, ai\-attach, ai\-forward, ai\-rewind, ai\-set\-position, ai\-set\-position\-samples, ao\-add, ao\-add\-default, ao\-remove, ao\-attach, ao\-forward, ao\-rewind, ao\-set\-position, ao\-set\-position\-samples\&. .RE .PP The following commands may be used on with a connected chainsetup, but they require pausing the engine temporarily (if running) and this can cause audible gaps to playback and recording\&. In practise this means it is currently not possible to add or remove chain operators in a gapless/seamless fashion\&. The affected commands: .PP .RS cop\-add, ctrl\-add, .RE .PP The following commands can be used on a connected chainsetup and when the engine is running (not a complete list but at least these commands are supported): .PP .RS cop\-set, copp\-set, ctrlp\-set, c\-bypass, c\-muting, setpos, cs\-set\-position, *\-describe *\-deselect, *\-get, *\-list, *\-register *\-select, *\-selected, *\-status, dump\-*, int\-*, jack\-*, map\-* .RE .PP .SH "GENERAL" .IP "quit, q" Quit ecasound session\&. What this means in practice depends on the client implementation\&. In ecasound interactive mode, \(cq\&quit\(cq\& terminates the ecasound process\&. When sent over ecasound server connection (aka NetECI), \(cq\&quit\(cq\& terminates the active network connection, but does not terminate the ecasound server process\&. \fI[\-]\fP .IP .IP "start, t" Processing is started (play)\&. Error string is return if any errors upon startup are encountered\&. \fI[e]\fP .IP .IP "stop, s" Stop processing\&. \fI[\-]\fP .IP .IP "stop\-sync, s" Stop processing with a blocking call (do not return until engine has actually stopped)\&. \fI[\-]\fP .IP .IP "run" Like \(cq\&start\(cq\& but blocks until processing is finished\&. Error string is return if any errors upon startup, or during process, are encountered\&. \fI[e]\fP .IP .IP "debug \(cq\&debug\-level\(cq\&" Set debug level to \(cq\&debug\-level\(cq\&\&. Notice that client programs can reimplement the debug routines\&. \fI[\-]\fP .PP .IP "resource\-file \(cq\&path\-to\-file\(cq\&" Overrides the global and user resource files\&. Does not affect already created objects\&. This command is equivalent to \(cq\&\-R\(cq\& ecasound option (see ecasound (1) man page)\&. .PP .IP "\-prefix:arg1,\&.\&.\&.,argN" Equivalent to issuing \(cq\&cs\-option \-prefix:arg1,\&.\&.\&.,argN)\&. See documentation for \(cq\&cs\-option\(cq\&\&. .PP .IP "help\(cq\&, \(cq\&h\(cq\&" Help! \fI[\-]\fP .PP .SH "GLOBAL" .IP .IP "engine\-status" Returns a string describing the engine status (running, stopped, finished, error, not ready)\&. See also \fIcs\-status\fP\&. \fI[s]\fP .PP .IP "engine\-launch" Starts the real\-time engine\&. Engine will execute the currently connected chainsetup (see \(cq\&cs\-connect)\&. This action does not yet start actual processing (see \fIstart\fP and \fIstop\fP)\&. When ecasound is used as a JACK client, issuing \fIengine\-launch\fP makes ecasound an active JACK client (i\&.e\&. ecasound\(cq\&s ports can be connected to other JACK clients)\&. \fI[\-]\fP .PP .IP "engine\-halt" Stops the engine\&. Does not disconnect the chainsetup that was running\&. See also \fIcs\-disconnet\fP and \fIstop\fP\&. When ecasound is used as a JACK client, \fIengine\-halt\fP will cause ecasound to become a deactivated client (all JACK connections are torn down)\&. \fI[\-]\fP .PP .SH "CHAINSETUPS" Chainsetup is the central data object\&. All other objects (inputs, outputs, chains, etc) are connected to some chainsetup\&. There can be many chainsetups but only one can be connected\&. Similarly only one chainsetup can be selected\&. If not otherwise specified operations are done on the selected chainsetup\&. Some operations also require that selected chainsetup is not connected\&. .IP .IP "cs\-add \(cq\&name\(cq\&" Adds a new chainsetup with name \(cq\&name\(cq\&\&. \(cq\&name\(cq\& is now the selected chainsetup\&. \fI[\-]\fP .PP .IP "cs\-remove" Removes currently selected chainsetup\&. \fI[\-]\fP .PP .IP "cs\-list" Returns a list of all chainsetups\&. \fI[S]\fP .PP .IP "cs\-select \(cq\&name\(cq\&" Selects chainsetup \(cq\&name\(cq\&\&. \fI[\-]\fP .PP .IP "cs\-selected" Returns the name of currently selected chainsetup\&. \fI[s]\fP .PP .IP "cs\-index\-select \(cq\&cs_index\(cq\&, cs\-iselect \(cq\&cs_index\(cq\&" Selects a chainsetup based on a short index string\&. Chainsetup names can be rather long\&. This command can be used to avoid typing these long names\&. \(cq\&cs_index\(cq\& is an integer value, where \(cq\&1\(cq\& refers to the first audio input/output\&. You can use \(cq\&cs\-list\(cq\& and \(cq\&cs\-status\(cq\& to get a full list of currently available chainsetups\&. \fI[\-]\fP .PP .IP "cs\-load \(cq\&filename\(cq\&" Adds a new chainsetup by loading it from file \(cq\&filename\(cq\&\&. \(cq\&filename\(cq\& is now the selected chainsetup\&. \fI[\-]\fP .PP .IP "cs\-save" Saves the currently selected chainsetup to file\&. If chainsetup was loaded from a file, the saved version will replace the original\&. If it doesn\(cq\&t have a default filename, it\(cq\&s saved to \(dq\&chainsetup_name\&.ecs\(dq\&\&. \fI[\-]\fP .PP .IP "cs\-save\-as \(cq\&filename\(cq\&" Saves currently selected chainsetup to file \(cq\&filename\(cq\&\&. \fI[\-]\fP .PP .IP "cs\-edit" Currently selected chainsetup is saved to a temporary file\&. This file is loaded to an external editor (see ecasoundrc (5))\&. After editing, the chainsetup is loaded back to ecasound\&. \fI[\-]\fP .PP .IP "cs\-is\-valid" Whether currently selected chainsetup is valid (=can be connected)? \fI[i]\fP .PP .IP "cs\-connect" Connect currently selected chainsetup to engine\&. When connecting, all resources (e\&.g\&. files, soundcard devices, external programs) needed to execute the chainsetup are reserved\&. Only one chainsetup can be connected at a time\&. Error string is returned if connection fails (for instance due to error in allocating the resources)\&. \fI[e]\fP .PP .IP "cs\-disconnect" Disconnect currently connected chainsetup\&. This action will free all external resources needed by the chainsetup\&. \fI[\-]\fP .PP .IP "cs\-connected" Returns the name of currently connected chainsetup\&. \fI[s]\fP .PP .IP "cs\-rewind \(cq\&time\-in\-seconds\(cq\&, rewind \(cq\&time\-in\-seconds\(cq\&, rw \(cq\&time\-in\-seconds\(cq\&" Rewinds the current chainsetup position by \(cq\&time\-in\-seconds\(cq\& seconds\&. Position of all inputs and outputs attached to the selected chainsetup is also affected\&. \fI[\-]\fP .PP .IP "cs\-forward \(cq\&time\-in\-seconds\(cq\&, forward \(cq\&time\-in\-seconds\(cq\&, fw \(cq\&ttime\-in\-seconds\(cq\&" The current chainsetup position is forwarded by \(cq\&time\-in\-seconds\(cq\& seconds\&. Position of all inputs and outputs attached to the selected chainsetup is also affected\&. \fI[\-]\fP .PP .IP "cs\-set\-position \(cq\&time\-in\-seconds\(cq\&, cs\-setpos \(cq\&time\-in\-seconds\(cq\&, setpos \(cq\&time\-in\-seconds\(cq\&, set\-position \(cq\&time\-in\-seconds\(cq\&" Sets the chainsetup position to \(cq\&time\-in\-seconds\(cq\& seconds from the beginning\&. Position of all inputs and outputs attached to the selected chainsetup is also affected\&. \fI[\-]\fP .PP .IP "cs\-set\-position\-samples \(cq\&time\-in\-samples\(cq\&" Sets the chainsetup position to \(cq\&time\-in\-samples\(cq\& samples from the beginning\&. Position of all inputs and outputs attached to the selected chainsetup is also affected\&. \fI[\-]\fP .PP .IP "cs\-get\-position, cs\-getpos, getpos, get\-position" Returns the current chainsetup position in seconds\&. \fI[f]\fP .PP .IP "cs\-get\-position\-samples" Returns the current chainsetup position in samples\&. \fI[li]\fP .PP .IP "cs\-get\-length, get\-length" Returns the chainsetup length in seconds (if known)\&. \fI[f]\fP .PP .IP "cs\-get\-length\-samples, get\-length\-samples" Returns the chainsetup length in samples (if known)\&. \fI[li]\fP .PP .IP "cs\-set\-length \(cq\&seconds\(cq\&" Sets processing time in seconds (doesn\(cq\&t have to be an integer value)\&. A special\-case value of \(cq\&\-1\(cq\& will set the chainsetup length according to the longest input object\&. \fI[\-]\fP .PP .IP "cs\-set\-length\-samples \(cq\&samples\(cq\&" Sets processing time in samples\&. \fI[\-]\fP .PP .IP "cs\-toggle\-loop" Toggle looping\&. When processing is finished, engine will start again from the initial position\&. It\(cq\&s not always possible to enable looping (for instance all inputs and outputs have infinite length and chainsetup length is not explicitly set with \(cq\&cs\-set\-length\(cq\&)\&. \fI[\-]\fP .PP .IP "cs\-set\-param" Interpret general chainsetup parameters like for example \(dq\&\-b\(dq\& (buffersize), \(dq\&\-n\(dq\& (name), etc\&. See ecasound (1) for more info\&. \fI[\-]\fP .PP .IP "cs\-set\-audio\-format \(cq\&bits,channels,sample_rate\(cq\&" Set the default sample parameters for currently selected chainsetup\&. For example cd\-quality audio would be \(dq\&16,2,44100\(dq\&\&. This does the same as command\-line argument \(dq\&\-f\(dq\& (see ecasound (1))\&. \fI[\-]\fP .PP .IP "cs\-status, status, st" Prints out status information about available chainsetup\&. Detailed information is printed out for connected (=available for running) nd selected (=available for editing) chainsetups\&. Other chainsetups are listed, but further details are suppressed\&. To get full details of a specific chainsetup, select it with \(cq\&cs\-select\(cq\& or \(cq\&cs\-iselect\(cq\&, and then issue \(cq\&cs\-select\(cq\&\&. \fI[s]\fP .PP .IP "cs\-option \(cq\&\-prefix:arg1,\&.\&.\&.,argN\(cq\&" One powerful feature of the interactive\-mode is that it provides full access to ecasound\(cq\&s command\-line syntax\&. For instance, command \(dq\&cs\-option \-efb:400,200\(dq\& means that a bandpass filter is added to the currently selected chain, with initial parameters 400 (center frequency) and 200 (width in Hz)\&. .PP Note that session level options (such as setting debug level) can not be used with \(cq\&cs\-option\(cq\& (i\&.e\&. only options that modify chainsetups)\&. .PP Note! Ecasound interactive mode implicitly interprets all strings beginning with a \(cq\&\-\(cq\& as \(dq\&cs\-option string\(dq\&\&. .IP .SH "CHAINS" Chain is a simple signal flow abstraction\&. Every chain has one input and one output\&. All chain operators and their controllers are attached to chains\&. Chains can be muted, unmuted and be bypassed\&. If not otherwise stated, all operations are done to currently selected chainsetup\&. .IP .IP "c\-add \(cq\&cname1,\&.\&.\&.,cnameN\(cq\&" Adds a set of chains\&. Added chains are automatically selected\&. Note that commas in chain names are not allowed\&. \fI[\-]\fP .PP .IP "c\-remove" Removes selected chains\&. \fI[\-]\fP .PP .IP "c\-list" Returns a list of all chains\&. \fI[S]\fP .PP .IP "c\-select \(cq\&cname1,\&.\&.\&.,cnameN\(cq\&" Selects chains\&. Other chains are automatically deselected\&. \fI[\-]\fP .PP .IP "c\-index\-select \(cq\&index1,\&.\&.\&.,indexN\(cq\&, c\-iselect \(cq\&index1,\&.\&.\&.,indexN\(cq\&" Selects a set of chains based on the list of indixes\&. Each index is an integer value, where \(cq\&1\(cq\& refers to the first chain\&. You can use \(cq\&c\-list\(cq\& and \(cq\&c\-status\(cq\& to get a full list of currently available chains\&. \fI[\-]\fP .PP .IP "c\-select\-all" Selects all chains\&. \fI[\-]\fP .PP .IP "c\-select\-add \(cq\&cname1,\&.\&.\&.,cnameN\(cq\&" Selects more chains\&. \fI[\-]\fP .PP .IP "c\-deselect \(cq\&cname1,\&.\&.\&.,cnameN\(cq\&" Deselects chains\&. \fI[\-]\fP .PP .IP "c\-selected" Returns a list of selected chains\&. \fI[S]\fP .PP .IP "c\-clear" Clear selected chains by removing all chain operators and controllers\&. Doesn\(cq\&t change how chains are connected to inputs and outputs\&. \fI[\-]\fP .PP .IP "c\-rename \(cq\&new_name\(cq\&" Renames the selected chain\&. When using this command, exactly one chain must be selected\&. \fI[\-]\fP .PP .IP "c\-mute " Set the mute state of the currently selected chain\&. When chain is muted, it will only output silence\&. .PP The command takes a single parameter: \(dq\&on\(dq\& \-> chain is muted, \(dq\&off\(dq\& \-> not muted, and \(dq\&toggle\(dq\& \-> change the muting state\&. If parameter is omitted, \(dq\&toggle\(dq\& is assumed (muting is either enabled or disabled, depending on previous state)\&. .PP Control of chain and chain operator muting states is independent\&. If \(dq\&c\-mute off\(dq\& is executed, the states of individual cop\-bypass commands will take effect\&. If chain is muted, the chain will output silence irrespective of the individual chain operator muting state\&. \fI[\-]\fP .PP .IP "c\-bypass " Set the bypass state of the currently selected chain\&. When chain is bypassed, sample data is passed through unprocessed (all chain operators are disabled for the given chain)\&. .PP The command takes a single parameter: \(dq\&on\(dq\& \-> chain is bypassed, \(dq\&off\(dq\& \-> no bypass, and \(dq\&toggle\(dq\& \-> change the bypass state\&. If parameter is omitted, \(dq\&toggle\(dq\& is assumed (bypass is either enabled or disabled, depending on previous state)\&. .PP Control of chain and chain operator bypass states is independent\&. If chain bypass is disabled, the states of individual cop\-bypass commands will take effect\&. If chain is bypassed, all operators are bypassed independetly of their cop\-bypass state\&. \fI[\-]\fP .PP .IP "c\-status, cs" Print status info about all chains\&. \fI[s]\fP .PP .IP "c\-is\-bypassed" Returns true if selected chain is currently bypassed (none of the chain operators are run)\&. See \(cq\&c\-bypass\(cq\&\&. \fI[i]\fP .PP .IP "c\-is\-mute" Returns true if selected chain is currently muted (outputs silence as its output)\&. See \(cq\&c\-mute\(cq\&\&. \fI[i]\fP .PP .SH "AUDIO INPUT/OUTPUT OBJECTS" If not otherwise stated, all operations are done to currently selected object\&. All commands with \fIai\-\fP prefix operate on audio inputs, while commands with \fIao\-\fP operate on outputs\&. .IP .IP "ai\-add \(cq\&input_format_string\(cq\&" Adds a new input object\&. See ecasound (1) man page for more info about the argument format (\(cq\&\-i\(cq\& option)\&. Note on syntax: if any of the parameters (such as a filename) contains commas, the parameter should be enclosed in double\-quotes\&. \fI[\-]\fP .PP .IP "ao\-add \(cq\&output_format_string\(cq\&" Adds a new output object\&. See ecasound (1) man page for more info about the argument format (\(cq\&\-o\(cq\& option)\&. If argument is omitted, a default output device is added (see ecasoundrc (5))\&. Note on syntax: if any of the parameters (such as a filename) contains commas, the parameter should be enclosed in double\-quotes\&. \fI[\-]\fP .PP .IP "ao\-add\-default" Adds the default output device (see ecasoundrc (5))\&. \fI[\-]\fP .PP .IP "ai\-describe, ao\-describe" Returns a Ecasound Option Syntax (EOS) compliant string describing the input/output\&. See the Ecasound User\(cq\&s Guide for more information about EOS\&. This command was introduced in ecasound 2\&.4\&.4\&. \fI[s]\fP .PP .IP "ai\-select \(cq\&aobject_name\(cq\&, ao\-select \(cq\&aobject_name\(cq\&" Selects an audio object\&. \(cq\&aobject_name\(cq\& refers to the string used when creating the object (the first argument given to ai\-add/ao\-add)\&. Note that as a important difference to ai\-add/ao\-add, one should not enclose the object name in double quotes for ai\-select/ao\-select\&. In the case a chainsetup contains multiple inputs, or outputs, with identical name, \(cq\&ai\-select\(cq\& and \(cq\&ao\-select\(cq\& will select the first matching instance\&. In order to select a specific instance, the \(cq\&ai\-iselect\(cq\& and \(cq\&ao\-iselect\(cq\& commands need to be used\&. \fI[\-]\fP .PP .IP "ai\-index\-select \(cq\&aobject_index\(cq\&, ai\-iselect \(cq\&aobject_index\(cq\&, ao\-index\-select \(cq\&aobject_index\(cq\&, ao\-iselect \(cq\&aobject_index\(cq\&" Select some audio object based on a short index string\&. Especially file names can be rather long\&. This command can be used to avoid typing these long names when selecting audio objects\&. \(cq\&aobject_index\(cq\& is an integer value, where \(cq\&1\(cq\& refers to the first audio input/output\&. You can use \(cq\&ai\-list\(cq\& and \(cq\&ao\-list\(cq\& to get a full list of currently available inputs/outputs\&. \fI[\-]\fP .PP .IP "ai\-selected, ao\-selected" Returns the name of the currently selected audio object\&. \fI[s]\fP .PP .IP "ai\-attach, ao\-attach" Attaches the currently selected audio object to all selected chains\&. \fI[\-]\fP .PP .IP "ai\-remove, ao\-remove" Removes the currently selected audio object from the chainsetup\&. \fI[\-]\fP .PP .IP "ai\-forward \(cq\&time_in_seconds\(cq\&, ai\-fw \(cq\&time_in_seconds\(cq\&, ao\-forward \(cq\&time_in_seconds\(cq\&, ao\-fw \(cq\&time_in_seconds\(cq\&" Selected audio object is forwarded by \(cq\&time\-in\-seconds\(cq\& seconds\&. Time should be given as a floating point value (eg\&. 0\&.001 is the same as 1ms)\&. \fI[\-]\fP .PP .IP "ai\-rewind \(cq\&time_in_seconds\(cq\&, ai\-rw \(cq\&time_in_seconds\(cq\&, ao\-rewind \(cq\&time_in_seconds\(cq\&, ao\-rw \(cq\&time_in_seconds\(cq\&" Selected audio object is rewinded by \(cq\&time\-in\-seconds\(cq\& seconds\&. Time should be given as a floating point value (eg\&. 0\&.001 is the same as 1ms)\&. \fI[\-]\fP .PP .IP "ai\-setpos \(cq\&time_in_seconds\(cq\&, ai\-set\-position \(cq\&time_in_seconds\(cq\&, ao\-setpos \(cq\&time_in_seconds\(cq\&, ao\-set\-position \(cq\&time_in_seconds\(cq\&" Set audio object position to \(cq\&time_in_seconds\(cq\&\&. \fI[\-]\fP .PP .IP "ai\-set\-position\-samples \(cq\&time_in_samples\(cq\&, ao\-set\-position\-samples \(cq\&time_in_samples\(cq\&" Set audio object position to \(cq\&time_in_samples\(cq\&\&. \fI[\-]\fP .PP .IP "ai\-getpos, ai\-get\-position, ao\-getpos, ao\-get\-position" Returns the audio object position in seconds\&. \fI[f]\fP .PP .IP "ai\-get\-position\-samples, ao\-get\-position\-samples" Returns the audio object position in samples\&. \fI[li]\fP .PP .IP "ai\-get\-length, ao\-get\-length" Returns the audio object length in seconds\&. \fI[f]\fP .PP .IP "ai\-get\-length\-samples, ao\-get\-length\-samples" Returns the audio object length in samples\&. \fI[li]\fP .PP .IP "ai\-get\-format, ao\-get\-format" Returns the audio format of the selected audio input/output as a formatted string\&. See documentation for \(cq\&\-f\(cq\& command\-line option\&. \fI[s]\fP .PP .IP "ai\-list, ao\-list" Returns a list of all input/output objects\&. \fI[S]\fP .PP .IP "aio\-register" Prints a list of registered audio object types\&. \fI[s]\fP .PP .IP "aio\-status" Audio object status (index strings, position, length, etc)\&. \fI[s]\fP .PP .SH "CHAIN OPERATORS" Chain operators are used to process and analyze sample data\&. They are attached to chains\&. If not otherwise stated, currently selected chainsetup and chain are used\&. Also, \(cq\&chainop_id\(cq\& and \(cq\¶m_id\(cq\& are used to select chain operators and their parameters\&. First valid value for these parameters is 1\&. .IP .IP "cop\-add \(cq\&cop_format_string\(cq\&" Adds a new chain operator\&. In addition to normal chain operators, this commmand can also be used to add effect presets and various plugins\&. Note; it is not possible to add operators to multiple chains at once\&. In other words only one chain should be selected when issuing \(cq\&cop\-add\(cq\&\&. See ecasound (1) man page for more info\&. \fI[\-]\fP .PP .IP "cop\-bypass " Set the bypass state of the currently selected chain operator\&. The command takes a single parameter: \(dq\&on\(dq\& \-> operator is bypassed, \(dq\&off\(dq\& \-> no bypass, and \(dq\&toggle\(dq\& \-> change the bypass state\&. If parameter is omitted, \(dq\&toggle\(dq\& is assumed (bypass is either enabled or disabled, depending on previous state)\&. \fI[\-]\fP .PP .IP "cop\-is\-bypassed" Returns true if selected chain operator is currently bypassed (temporarily not part of the processing chain)\&. \fI[i]\fP .PP .IP "cop\-describe" Returns a Ecasound Option Syntax (EOS) compliant string describing the chain operator\&. See the Ecasound User\(cq\&s Guide for more information about EOS\&. This command was introduced in ecasound 2\&.4\&.4\&. \fI[s]\fP .PP .IP "cop\-remove" Removes the selected chain operator\&. \fI[\-]\fP .PP .IP "cop\-list" Returns a list of all chain operators attached to the currently selected chain\&. \fI[S]\fP .PP .IP "cop\-select \(cq\¶m_id\(cq\&, cop\-index\-select \(cq\¶m_id\(cq\&, cop\-iselect \(cq\¶m_id\(cq\&" Selects a chain operator\&. \fI[\-]\fP .PP .IP "cop\-selected" Returns the index number of currently selected chain operator\&. \fI[i]\fP .PP .IP "cop\-set \(cq\&chainop_id,param_id,value\(cq\&" Changes the value of a single chain operator parameter\&. Unlike other chain operator commands, this can also be used during processing\&. See also \(cq\&cop\-get\(cq\&\&. \fI[\-]\fP .PP .IP "cop\-get \(cq\&chainop_id,param_id\(cq\&" Returns the current value of chain operator parameter identified by \(cq\&chainop_id\(cq\& and \(cq\¶m_id\(cq\&\&. This command is a shorthand for \(cq\&cop\-select chainop_id ; copp\-iselect param_id ; copp\-get\(cq\&\&. \fI[f]\fP .PP .IP "cop\-status" Returns info about chain operator status\&. \fI[s]\fP .PP .IP "copp\-list" Returns a list of selected chain operator\(cq\&s parameters\&. \fI[S]\fP .PP .IP "copp\-select \(cq\¶m_id\(cq\&, copp\-index\-select \(cq\¶m_id\(cq\&, copp\-iselect \(cq\¶m_id\(cq\&" Selects a chain operator parameter\&. \fI[\-]\fP .PP .IP "copp\-selected" Returns the index number of currently selected chain operator parameter\&. \fI[i]\fP .PP .IP "copp\-set \(cq\&value\(cq\&" Sets the selected parameter value to \(cq\&value\(cq\&\&. \fI[\-]\fP .PP .IP "copp\-get" Returns the selected parameter value\&. See also \(cq\&cop\-get\(cq\&\&. \fI[f]\fP .PP .IP "cop\-register" Prints a list of registered chain operators\&. \fI[s]\fP .PP .IP "preset\-register" Prints a list of registered effect presets\&. \fI[s]\fP .PP .IP "ladspa\-register" Prints a list of registered LADSPA plugins\&. \fI[s]\fP .PP .SH "CONTROLLERS" Controllers are used to control individual chain operator parameters\&. They are attached to chains\&. If not otherwise stated, currently selected chainsetup and chains are used\&. .IP .IP "ctrl\-add \(cq\&copc_format_string\(cq\&" Adds a new controller and attach it to currently selected chain operator\&. The argument syntax is either \(dq\&\-:par1,\&.\&.\&.,parN\(dq\& or just \(dq\&:par1,\&.\&.\&.,parN\(dq\&\&. If parameter itself contains commas, the parameter should be enclosed in double\-quotes\&. See ecasound (1) man page for more info\&. \fI[\-]\fP .IP .IP "ctrl\-describe" Returns a Ecasound Option Syntax (EOS) compliant string describing the controller\&. See the Ecasound User\(cq\&s Guide for more information about EOS\&. This command was introduced in ecasound 2\&.4\&.4\&. \fI[s]\fP .IP .IP "ctrl\-remove" Removes the selected controller\&. \fI[\-]\fP .IP .IP "ctrl\-list" Returns a list of all controllers attached to the currently selected chain\&. \fI[S]\fP .IP .IP "ctrl\-select \(cq\¶m_id\(cq\&, ctrl\-index\-select \(cq\¶m_id\(cq\&, ctrl\-iselect \(cq\¶m_id\(cq\&" Selects a controller\&. \fI[\-]\fP .IP .IP "ctrl\-selected" Returns the index number of currently selected controller\&. \fI[i]\fP .IP .IP "ctrl\-status" Returns info about controller status\&. \fI[s]\fP .IP .IP "ctrl\-register" Prints a list of registered controllers\&. \fI[s]\fP .IP .IP "ctrl\-get\-target" Returns the index number of the chain operator that is connected to the selected controller\&. The returned index refers to the currently selected chain (see \(cq\&cop\-list\(cq\&)\&. \fI[i]\fP .IP .IP "ctrlp\-list" Returns a list of all controller parameters\&. This command was introduced in ecasound 2\&.4\&.2\&. \fI[S]\fP .IP .IP "ctrlp\-select" Selects a controller parameter\&. This command was introduced in ecasound 2\&.4\&.2\&. \fI[\-]\fP .IP .IP "ctrlp\-selected" Returns the index number of currently selected controller parameter\&. This command was introduced in ecasound 2\&.4\&.2\&. \fI[i]\fP .IP .IP "ctrlp\-get" Returns the selected controller parameter value\&. This command was introduced in ecasound 2\&.4\&.2\&. \fI[f]\fP .IP .IP "ctrlp\-set" Sets the selected controller parameter value to \(cq\&value\(cq\&\&. This command was introduced in ecasound 2\&.4\&.2\&. \fI[\-]\fP .IP .SH "JACK CONNECTION MANAGEMENT" If Ecasound is compiled with support for JACK audio server, the following set of commands is provided for controlling connections between JACK ports\&. .IP .IP "jack\-connect \(cq\&src\-port\(cq\& \(cq\&dest\-port\(cq\&" Make a connection between the two ports given as parameters\&. This command is similar to the \(cq\&jack_connect\(cq\& command line tool that is distributed with JACK package\&. \fI[\-]\fP .IP .IP "jack\-disconnect \(cq\&src\-port\(cq\& \(cq\&dest\-port\(cq\&" Disconnect the two ports given as parameters\&. This command is similar to the \(cq\&jack_disconnect\(cq\& command line tool that is distributed with JACK package\&. \fI[\-]\fP .IP .IP "jack\-list\-connections" Returns a list of all JACK ports and a list of connections for each port\&. This command is similar to the \(cq\&jack_lsp\(cq\& command line tool (e\&.g\&. \(cq\&jack_lsp \-c\(cq\&) that is distributed with JACK package\&. \fI[s]\fP .IP .SH "INTERNAL COMMANDS" Internal commands are not directly aimed at normal use\&. They are primarily meant for use in scripting and frontends\&. .IP .IP "int\-cmd\-list" Returns a list of all registered interactive mode commands\&. \fI[S]\fP .IP .IP "int\-log\-history" Returns recent log messages sent by libecasound modules\&. This is a good tool for debugging ECI/EIAM scripts and applications\&. This command was introduced in ecasound 2\&.4\&.0\&. \fI[s]\fP .IP .IP "int\-output\-mode\-wellformed" Select the well\-format output format for log messages\&. \fI[\-]\fP .IP .IP "int\-set\-float\-to\-string\-precision" Sets precision used in float to text conversions\&. Note that this can be used to control the precision of float return values for ECI commands\&. \fI[\-]\fP .IP .IP "int\-set\-log\-history\-length" Sets the log history length\&. Defaults to 0 items\&. This command was introduced in ecasound 2\&.4\&.0\&. \fI[\-]\fP .IP .IP "int\-cmd\-version\-string" Returns ecasound interactive mode parser version string\&. \fI[s]\fP .IP .IP "int\-cmd\-version\-lib\-current" Returns ecasound interactive mode library interface version (libtool)\&. \fI[i]\fP .IP .IP "int\-cmd\-version\-lib\-revision" Returns ecasound interactive mode library interface revision (libtool)\&. \fI[i]\fP .IP .IP "int\-cmd\-version\-lib\-age" Returns ecasound interactive mode library interface age (libtool)\&. \fI[i]\fP .IP .SH "OBJECT MAPS" Object maps are central repositories for commonly used object types\&. By querying the maps, applications can get a list of all registered object types and their properties\&. .IP .IP "map\-cop\-list" Prints a list of registered chain operators using the format specified in section \fIOPERATOR DESCRIPTIONS\fP\&. \fI[s]\fP .IP .IP "map\-preset\-list" Prints a list of registered effect presets using the format specified in section \fIOPERATOR DESCRIPTIONS\fP\&. \fI[s]\fP .IP .IP "map\-ladspa\-list" Prints a list of registered LADSPA plugins using the format specified in section \fIOPERATOR DESCRIPTIONS\fP\&. \fI[s]\fP .IP .IP "map\-ladspa\-id\-list" Prints a list of registered LADSPA plugins using the format specified in section \fIOPERATOR DESCRIPTIONS\fP\&. Numerical LADPSA plugin identifiers are used\&. \fI[s]\fP .IP .IP "map\-ctrl\-list" Prints a list of registered controllers using the format specified in section \fIOPERATOR DESCRIPTIONS\fP\&. \fI[s]\fP .IP .SH "DUMP COMMANDS" The following dump commands are not meant for normal use\&. Their primary purpose is to provide an easy way to get internal state information from libecasound\&. All dump commands output a single line with syntax \(dq\&key value\(dq\& to the selected output stream (defaults to stdout)\&. .IP .IP "dump\-target \(cq\&filename\(cq\&" Set target stream for dumping\&. \fI[\-]\fP .IP .IP "dump\-status" Dumps engine status \- \(cq\&running\(cq\&, \(cq\&stopped\(cq\&, \(cq\&finished\(cq\& or \(cq\¬ready\(cq\&\&. \fI[\-]\fP .IP .IP "dump\-position" Dumps the global position\&. Printed in seconds using a floating\-point representation\&. \fI[\-]\fP .IP .IP "dump\-length" Dumps the overall processing length\&. Printed in seconds using a floating\-point representation\&. \fI[\-]\fP .IP .IP "dump\-cs\-status" Dumps status string for the currently selected chainsetup \- \(cq\&connected\(cq\&, \(cq\&selected\(cq\& or an empty string\&. \fI[\-]\fP .IP .IP "dump\-c\-selected" Dumps the name of currently selected chain\&. \fI[\-]\fP .IP .IP "dump\-ai\-selected" Dumps label of currently selected audio input\&. If no input is selected, dumps an empty string\&. \fI[\-]\fP .IP .IP "dump\-ai\-position" Dumps position of currently selected audio inputs\&. Printed in seconds, using a floating\-point representation\&. \fI[\-]\fP .IP .IP "dump\-ai\-length" Dumps length of currently selected audio input\&. Printed in seconds, using a floating\-point representation\&. \fI[\-]\fP .IP .IP "dump\-ai\-open\-state" Dumps audio input state info\&. Either \(cq\&open\(cq\& or \(cq\&closed\(cq\&\&. \fI[\-]\fP .IP .IP "dump\-ao\-selected" Dumps label of currently selected audio output\&. If no output is selected, dumps an empty string\&. \fI[\-]\fP .IP .IP "dump\-ao\-position" Dumps position of currently selected audio outputs\&. Printed in seconds, using a floating\-point representation\&. \fI[\-]\fP .IP .IP "dump\-ao\-length" Dumps length of currently selected audio output\&. Printed in seconds, using a floating\-point representation\&. \fI[\-]\fP .IP .IP "dump\-ao\-open\-state" Dumps audio output state info\&. Either \(cq\&open\(cq\& or \(cq\&closed\(cq\&\&. \fI[\-]\fP .IP .IP "dump\-cop\-value \(cq\&chainop,param\(cq\&" Dumps chain operator parameter value\&. \(cq\&chainop\(cq\& and \(cq\¶m\(cq\& are operator and parameter index values (1\&.\&.\&.n)\&. \fI[\-]\fP .IP .SH "OPERATOR DESCRIPTIONS" The \fImap\-xxx\-list\fP commands return a string containing all registered objects of the given type \fIxxx\fP\&. Each line of the output describes one registered type\&. The used syntax is: .IP \(cq\&keyword,name,description,num_of_params,par1_def,par2_def,\&.\&.\&.\(cq\& .IP \fIparX_def\fP describes one object parameter\&. This definition is present for all parameters of the described object type\&. The used syntax is: .IP \(cq\&name,description,defaultvalue,upper_bound_flag,upper_bound, lower_bound_flag,lower_bound,toggled_flag,integer_flag, logarithmic_flag,output_flag\(cq\& .IP For exact descriptions of these fields, please see the header file \fIecasound/libecasound/eca\-operator\&.h\fP\&. .IP .SH "DEPRECATED COMMANDS" Use of following commands is deprecated\&. They still work in current version of Ecasound, but will be dropped in the future: .IP .RS ai\-wave\-edit, ao\-wave\-edit .RE .IP .SH "SEE ALSO" ecasound (1), ecatools (1), ecasoundrc (5) .IP .SH "AUTHOR" Kai Vehmanen, > ecasound-2.9.3/Documentation/ecalength.10000644000076400007640000000363212260765172015120 00000000000000.TH "ecalength" "1" "18\&.04\&.2004" "" "Multimedia software" .PP .SH "NAME" ecalength \- prints audio file length and other information .PP .SH "SYNOPSIS" \fBecalength\fP [\-ahtsfmbcr] FILE1 [FILE2] [FILEn] .PP .SH "DESCRIPTION" .PP This is ecalength, a few lines of code pompously named so because they let one retrieve the length of an audio file from the command line using ecasound\(cq\&s engine\&. .PP Limitations: .IP "" \- With files without header information (raw files), ecalength will only work correctly if the audio file is at a sampling rate of 44100 hz\&. (Addressed with the \-a switch\&.) .IP "" \- It is not foolproof, feeding it with something other than an audio file WILL result in ugly things being spewed back\&. (A bit better) .IP "" \- A thousand more that I haven\(cq\&t thought of\&. .PP .SH "OPTIONS" .PP .IP "\-h" Prints this usage message\&. (help) .IP .IP "\-a[:]bits,channels,rate" Changes the format assumed by default for headerless data\&. (adjust) .IP .IP "\-t" Prints the summed length of all the files processed\&. (total) (Ignored if with \-s) .IP .IP "\-s" Enables script mode: One info type per file per line\&. (script) (Defaults to length in secs\&.) .IP .IP "\-f" With \-s will return the format string as info, alone it will add it to the main display\&. (format) .IP .IP "\-b" If \-s and \-f are enabled with this the info printed will be the sample\(cq\&s bitwidth\&. (bits) .IP .IP "\-c" If \-s and \-f are enabled with this the info printed will be the channel count\&. (channel count) .IP .IP "\-r" If \-s and \-f are enabled with this the info printed will be the sampling rate\&. (rate) .IP .IP "\-m" Will print human computable time as in main display but in batch fashion\&. (minutes) (Only with \-s) .PP .SH "SEE ALSO" .PP ecasound(1), ecatools(1) .PP .SH "AUTHOR" .PP S\&.Massy, > ecasound-2.9.3/Documentation/ecatools.10000644000076400007640000001555212260765172015003 00000000000000.TH "ecatools" "1" "12\&.11\&.2005" "" "Multimedia software" .PP .SH "NAME" ecatools \- audio processing utils based on ecasound .PP .SH "SYNOPSIS" \fBecaconvert\fP \&.extension file1 [ file2 \&.\&.\&. fileN ] .PP \fBecafixdc\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecalength\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecamonitor\fP [host][:port] .PP \fBecanormalize\fP file1 [ file2 \&.\&.\&. fileN ] .PP \fBecaplay\fP [\-dfhklopq] [ file1 file2 \&.\&.\&. fileN ] .PP \fBecasignalview\fP [ options ] [ input ] [ output ] .PP .SH "DESCRIPTION" .PP Ecatools are simple command line utils for audio file processing\&. Each tool is designed to perform one specific operation\&. Most of the tools also support batch processing\&. .PP \fBECACONVERT\fP .PP A tool for converting a set of files to a common target format\&. This target format is given as the first command line argument, and its syntax is \fI\&.ext\fP\&. .PP \fBECAFIXDC\fP .PP A simple command\-line tool for fixing DC\-offset\&. .PP \fBECALENGTH\fP .PP See the separate ecalength(1) man page\&. .PP \fBECAMONITOR\fP .PP Ecamonitor is a util program that can be used to monitor an active ecasound session\&. Ecamonitor is able to show information about the current chainsetup such as list of inputs, outputs, current position, effects, the engine status and numerous other things\&. .PP By default ecamonitor will try to connect to IP4 address \(dq\&localhost\(dq\&, to port \(dq\&2868\(dq\&\&. A different address can be specified when starting ecamonitor, for example \(dq\&ecamonitor foo\&.mynetwork\&.com\(dq\& or \(dq\&ecamonitor foo\&.mynetwork\&.com:4500\(dq\&\&. .PP To enable inbound connections, ecasound has to be started with the \fI\-\-daemon\fP option\&. Ecamonitor is implemented in Python using the NetECI API\&. .PP \fBECANORMALIZE\fP .PP Ecanormalize is a command\-line tool for normalizing audio files to utilize the full available sample resolution\&. Ecanormalize first finds out how much the input file can be amplified without clipping and if there is room for increase, a static gain will be applied to the file\&. .PP \fBECAPLAY\fP .PP Ecaplay is a command\-line tool for playing audio files\&. Ecaplay uses the libecasound engine and is thus able to handle all audio formats supported by the library\&. .PP Files can be selected for playback either by specifying the filenames on the command\-line, or by using the playlist mechanism\&. In playlist mode, files can be added to the playlist using the \fI\-q\fP option\&. The \fI\-p\fP option can then be used to play all tracks on the playlist\&. Ecaplay will repeat the playlist tracks until explicitly stopped (with double Ctrl\-C)\&. Playlist can be flushed with \fI\-f\fP and its contents listed with \fI\-l\fP option\&. .PP If not otherwise specified, ecaplay will use the audio output device specified in \fI~/\&.ecasound/ecasoundrc\fP for playback\&. A different output device can be selected with \fIECAPLAY_OUTPUT_DEVICE\fP shell environment variable or with the \fI\-o:output_device\fP command\-line option\&. .PP Playback can be stopped at any time with Ctrl\-C\&. If multiple files are played, first Ctrl\-C will stop the current file and move on to play the next one\&. Issuing Ctrl\-C twice (within one second), will cause ecaplay to exit\&. .PP .IP "\-d:debuglevel" Set libecasound debug level\&. See ecasound(1)\&. .IP .IP "\-f" Flush the playlist contents\&. See also options \fI\-l, \-p and \-q\fP\&. .IP .IP "\-h" Print usage information and exit\&. .IP .IP "\-k:number" Skip \(cq\&number\(cq\& of files\&. .IP .IP "\-l" List the current playlist contents to stdout\&. See also options \fI\-f, \-p and \-q\fP\&. .IP .IP "\-o:output_device" Use \(cq\&output_device\(cq\& instead of the default output device (as specified in \fI~/\&.ecasound/ecasoundrc\fP)\&. Syntax is same as used by \(dq\&\-o\(dq\& ecasound option (see ecasound(1) man page)\&. This option overrides the \fIECAPLAY_OUTPUT_DEVICE\fP environment variable (more info below)\&. .IP .IP "\-p" Play tracks in the playlist (in looped mode)\&. See also options \fI\-f, \-l and \-q\fP\&. .IP .IP "\-q" Queue new tracks to the playlist\&. All filenames given on the command\-line will be added to the the playlist\&. It is possible to queue new tracks while another instance of ecaplay is using the playlist\&. See also options \fI\-f, \-l and \-p\fP\&. .IP \fBECASIGNALVIEW\fP .PP Ecasignalview is meant for monitoring signal amplitude and peak statistics\&. It accepts the following options: .PP .IP "input" The first option not starting with a \(cq\&\-\(cq\& is interpreted as an input string\&. This can be a device or a filename\&. All formats supported by libecasound are accepted\&. Defaults to \(cq\&/dev/dsp\(cq\&\&. .IP .IP "output" Similarly to input, second option not starting with a \(cq\&\-\(cq\& is interpreted as output\&. Defaults to \(cq\&null\(cq\&\&. .IP .IP "\-b:buffersize" Buffersize in sample frames\&. Defaults to 128\&. .IP .IP "\-c" Enable cumulative mode\&. Counters are not reseted after refresh\&. \fI*deprecated*\fP .IP .IP "\-d" Enable debug mode\&. .IP .IP "\-f:format_string" Specify default audio format\&. See ecasound(1) for details\&. .IP .IP "\-r:rate_msec" Specify screen refresh rate in milliseconds\&. .IP .IP "\-I" Use linear scale for showing audio sample amplitude\&. .IP .IP "\-L" Use logarithmic scale for showing audio sample amplitude\&. .IP .IP "\-G, \-B, \-M*, \-r, \-z" Ecasound options use to modify the engine behaviour, see ecasound(1) manpage for details\&. .IP When ecasignalview is running, the following keyboard commands can be used to control the operation (requires system support for UNIX terminal interface control): .PP .IP "spacebar" Reset statistics (max\-peak, avg\-amplitude and clipped samples count)\&. .IP .IP "q or Q or Esc" Quit ecasignalview\&. .IP It is also possible to reset the max\-peak and clipped\-samples counters by sending a SIGHUP signal to the process (i\&.e\&. from another console: \(dq\&killall \-v \-HUP ecasignalview\(dq\&)\&. .PP More complete documentation for ecasignalview can be found from \(dq\&Ecasound User\(cq\&s Guide\(dq\& (see \(cq\&\(cq\&http://nosignal\&.fi/ecasound \-> Documentation\(cq\&\(cq\&)\&. .PP .SH "ENVIRONMENT" .PP \fIECASOUND\fP Path to the ecasound executable\&. Used by many ecatools\&. .PP \fIECAPLAY_OUTPUT_DEVICE\fP Device ecaplay should use for audio output\&. Same syntax as for ecaplay/ecasound \(dq\&\-o\(dq\& option\&. .PP .SH "FILES" .PP \fI~/\&.ecasound/ecasoundrc\fP The default ecasound resource file\&. See ecasoundrc(5) for details\&. .PP \fI~/\&.ecasound/ecaplay_queue\fP File used to store the ecaplay playlist (one track per line with full path)\&. .PP .SH "SEE ALSO" .PP ecasound (1), ecalength(1), \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/Documentation/Makefile.in0000644000076400007640000005127113606336177015157 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/Documentation/Makefile.am # Description: Ecasound documentation files # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = Documentation DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = users_guide programmers_guide # --------------------------------------------------------------------- # Files going into distribution: man1_pages_to_install = \ ecasound.1 \ ecasound-iam.1 \ ecatools.1 \ ecaconvert.1 \ ecafixdc.1 \ ecalength.1 \ ecaplay.1 \ ecamonitor.1 \ ecanormalize.1 \ ecasignalview.1 man5_pages_to_install = \ ecasoundrc.5 html_man_pages = \ ecasound_manpage.html \ ecasoundrc_manpage.html \ ecatools_manpage.html \ ecalength_manpage.html \ ecasound-iam_manpage.html EXTRA_DIST = $(man1_pages_to_install) \ $(man5_pages_to_install) \ $(html_man_pages) 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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Documentation/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Documentation/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 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # 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): @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; \ (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" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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 || \ tags="$$tags $$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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && 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)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ 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) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-exec-am: install-info: install-info-recursive install-man: 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: uninstall-info-am uninstall-local uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-local $(srcdir)/ecasound_manpage.yo \ $(srcdir)/ecasoundrc_manpage.yo \ $(srcdir)/ecasound-iam_manpage.yo \ $(srcdir)/ecatools_manpage.yo \ $(srcdir)/ecalength_manpage.yo \ $(srcdir)/index.html \ $(srcdir)/examples.html \ $(srcdir)/manpages.html \ $(srcdir)/tutorials.html \ $(srcdir)/style_ecasound.css \ $(srcdir)/ecasound_osc_interface.txt # --------------------------------------------------------------------- # local targets for generating docs from latex and yodl sources all: docs: docs-guides docs-manpages docs-guides: cd programmers_guide; $(MAKE) $(AM_MAKEFLAGS) docs cd users_guide; $(MAKE) $(AM_MAKEFLAGS) docs docs-manpages: $(man1_pages_to_install) \ $(man5_pages_to_install) \ $(html_man_pages) # --------------------------------------------------------------------- # Man pages # following are copies of ecatools.1 ecaconvert.1: ecatools.1 cp ecatools.1 ecaconvert.1 ecafixdc.1: ecatools.1 cp ecatools.1 ecafixdc.1 ecamonitor.1: ecatools.1 cp -v ecatools.1 ecamonitor.1 ecanormalize.1: ecatools.1 cp -v ecatools.1 ecanormalize.1 ecaplay.1: ecatools.1 cp -v ecatools.1 ecaplay.1 ecasignalview.1: ecatools.1 cp -v ecatools.1 ecasignalview.1 %.1: $(srcdir)/%_manpage.yo yodl2man -o $@ $< %.5: $(srcdir)/%_manpage.yo yodl2man -o $@ $< %.html: $(srcdir)/%.yo yodl2html -o $@ $< # --------------------------------------------------------------------- # doxygen (target removed 2009/Feb) #doxygen: # doxygen doxygen_libkvutils_config # doxygen doxygen_libecasound_config # --------------------------------------------------------------------- # Clean targets clean: clean-docs: clean-manpages clean-guides clean-guides: cd programmers_guide; $(MAKE) $(AM_MAKEFLAGS) clean-docs cd users_guide; $(MAKE) $(AM_MAKEFLAGS) clean-docs clean-manpages: rm -f $(man1_pages_to_install) \ $(man5_pages_to_install) \ $(html_man_pages) # --------------------------------------------------------------------- # Install targets install-data-local: mkdir -p $(DESTDIR)$(mandir)/man1 mkdir -p $(DESTDIR)$(mandir)/man5 for f in $(man1_pages_to_install) ; do if test -f $$f ; then cp -v $$f $(DESTDIR)$(mandir)/man1/; fi ; done for f in $(man5_pages_to_install) ; do if test -f $$f ; then cp -v $$f $(DESTDIR)$(mandir)/man5/; fi ; done # --------------------------------------------------------------------- # Uninstall targets uninstall-local: for f in $(man1_pages_to_install) ; do if test -f $$f ; then rm -vf $(DESTDIR)$(mandir)/man1/$$f ; fi ; done for f in $(man5_pages_to_install) ; do if test -f $$f ; then rm -vf $(DESTDIR)$(mandir)/man5/$$f ; fi ; done # 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: ecasound-2.9.3/Documentation/ecasound.10000644000076400007640000015530212260765172014771 00000000000000.TH "ecasound" "1" "05\&.05\&.2011" "" "Multimedia software" .PP .SH "NAME" ecasound \- sample editor, multitrack recorder, fx\-processor, etc\&. .PP .SH "SYNOPSIS" \fBecasound\fP [ general_options ] { [ chain_setup ] [ effect_setup ] [ input_setup ] [ output_setup ] } .PP .SH "DESCRIPTION" .PP Ecasound is a software package designed for multitrack audio processing\&. It can be used for simple tasks like audio playback, recording and format conversions, as well as for multitrack effect processing, mixing, recording and signal recycling\&. Ecasound supports a wide range of audio inputs, outputs and effect algorithms\&. Effects and audio objects can be combined in various ways, and their parameters can be controlled by operator objects like oscillators and MIDI\-CCs\&. A versatile console mode user\-interface is included in the package\&. .PP .SH "OPTIONS" .PP Note! All options except those mentioned in \fIecasound options\fP and \fIGlobal options\fP, can be used in ecasound chainsetup files (\&.ecs)\&. .PP \fBECASOUND OPTIONS\fP .IP These options are parsed and handled by the ecasound frontend binary and are not passed to backend library\&. This means that these options may not work in other applications that use ecasound libraries for their functionality\&. .IP .IP "\-c" Starts ecasound in interactive mode\&. In interactive mode you can control ecasound with simple commands (\(dq\&start\(dq\&, \(dq\&stop\(dq\&, \(dq\&pause\(dq\&, etc\&.)\&. See ecasound\-iam \&. .IP .IP "\-C" Disables ecasound\(cq\&s interactive mode (see \(cq\&\-c\(cq\& and \(cq\&\-K\(cq\&)\&. .IP .IP "\-D" Print all debug information to stderr (unbuffered, plain output without ncurses)\&. .IP .IP "\-s[:]chainsetup\-file" Create a new chainsetup from file \(cq\&chainsetup\-file\(cq\& and add it to the current session\&. Chainsetup files commonly have a filename ending to the \(cq\&\&.ecs\(cq\& extension\&. A chainsetup can contain inputs, outputs, chains, effects, controllers \-\- i\&.e\&. objects one one specific configuration of audio processing elements\&. A session, on the other hand, is a collection of one or more chainsetups\&. Only one of the chainsetups may be connected (i\&.e\&. it can be run/processed)\&. But it is possible to have another chainsetup select (i\&.e\&. can be configured) while other one is current connteced (i\&.e\&. running)\&. .IP .IP "\-E \(dq\&cmd1 [[args] ; cmd2 args ; \&.\&.\&. ; cmdN]\(dq\&" Execute a set of Ecasound Interactive mode (EIAM) commands at launch\&. These commands are executed immediately after ecasound is started\&. If the command line contains sufficient options to create a valid chainsetup that will be executed, the launch commands are executed after the other command line options are parsed, but before the processing engine is started\&. Note that this command is a feature of the ecasound frontend binary and not supported by the library backend\&. This means that other clients may not support the \(cq\&\-E\(cq\& option, and also that the launch commands are not saved as part of chainsetup or session state\&. .IP .IP "\-\-server" Enables the so called NetECI mode, in which ecasound can be controlled remotely over a socket connection\&. When activated, clients can connect to the running ecasound session, and use interactive mode commands to control and observe ecasound processing\&. .IP The NetECI protocol is defined in Ecasound\(cq\&s Programmer Guide .IP One example client using this feature is ecamonitor(1)\&. This utility is included in the Ecasound distribution package (requires a working Python environment)\&. .IP \fIWarning!\fP If the machine running ecasound, is connected to a public network, be sure to block ecasound\(cq\&s port in your firewall! As there is no access control implemented for incoming connections, anyone can otherwise connect, control and observe your ecasound sessions\&. This option replaces \(cq\&\-\-daemon\(cq\& (deprecated in 2\&.6\&.0)\&. .IP .IP "\-\-server\-tcp\-port=NNN" Set the TCP port used by the daemon mode\&. By default ecasound will use port number \fI2868\fP\&. This option replaces \(cq\&\-\-daemon\-port\(cq\& (deprecated in 2\&.6\&.0)\&. .IP .IP "\-\-no\-server" Disable ecasound\(cq\&s daemon mode\&. This is the default\&. This option replaces \(cq\&\-\-nodaemon\(cq\& (deprecated in 2\&.6\&.0)\&. .IP .IP "\-\-osc\-udp\-port=NNN" Enables support for Open Source Control (OSC)\&. Ecasound will listen for incoming OSC messages on UDP port NNN\&. Ecasound\(cq\&s OSC interface is documented at: .IP Note that OSC support is still experimental and the interface might change in later versions of Ecasound\&. .IP This option was added to ecasound 2\&.7\&.0\&. .IP .IP "\-\-keep\-running,\-K" Do not exit when processing is finished/stopped\&. Only affects non\-interactive operating mode (see \-c/\-C)\&. Option added to ecasound 2\&.4\&.2\&. .IP .IP "\-\-help,\-h" Show this help\&. .IP .IP "\-\-version" Print version info\&. .IP \fBGLOBAL OPTIONS\fP .PP .IP "\-d, \-dd, \-ddd" Increase the amount of printed debug messages\&. \fI\-d\fP adds some verbosity, while \fI\-ddd\fP results in very detailed output\&. .IP .IP "\-d:debug_level" Set the debug level mask to \(cq\&debug_level\(cq\&\&. This a bitmasked value with the following classes: errors (1), info (2), subsystems (4), module_names (8), user_objects (16), system_objects 32, functions (64), continuous (128) and eiam_return_values (256)\&. Default is 271 (1+2+4+8+256)\&. See sourcode documentation for the ECA_LOGGER class for more detailed information\&. .IP .IP "\-R[:]path\-to\-file" Use ecasound resource file (see ecasoundrc man page) \(cq\&path\-to\-file\(cq\& as the only source of setting resource value\&. Specifying this option will disable the normal policy of querying both global and user (if exists) resource files\&. .IP .IP "\-q" Quiet mode, no output\&. Same as \fI\-d:0\fP\&. .IP \fBGENERAL CHAINSETUP OPTIONS\fP .IP .IP "\-a:chainname1, chainname2, \&.\&.\&." Selects active signal chains\&. All inputs and outputs following this \(cq\&\-a\(cq\& option are assigned to selected chains (until a new \-a option is specified)\&. When adding effects, controllers and other chain operators, only one chain can be selected at a time\&. If no \-a option has been given, chain \(cq\&default\(cq\& is used instead when adding objects\&. Chain name \(cq\&all\(cq\& is also reserved\&. It will cause all existing chains to be selected\&. By giving multiple \-a options, you can control to which chains effects, inputs and outputs are assigned to\&. Look at the \fBEXAMPLES\fP section for more detailed info about the usage of this option\&. .IP .IP "\-n:name" Sets the name of chainsetup to \(cq\&name\(cq\&\&. If not specified, defaults either to \(dq\&command\-line\-setup\(dq\& or to the file name from which chainsetup was loaded\&. Whitespaces are not allowed\&. .IP .IP "\-x" Truncate outputs\&. All output object are opened in overwrite mode\&. Any existing files will be truncated\&. .IP .IP "\-X" Open outputs for updating\&. Ecasound opens all outputs \- if target format allows it \- in readwrite mode\&. .IP .IP "\-z:feature" Enables \(cq\&feature\(cq\&\&. Most features can be disabled using notation \fI\-z:nofeature\fP\&. \(cq\&\-z:db,dbsize\(cq\& enables double\-buffering for audio objects that support it (dbsize=0 for default, otherwise buffer size in sample frames)\&. \(cq\&\-z:nodb\(cq\& disables double\-buffering\&. \(cq\&\-z:intbuf\(cq\& and \(cq\&\-z:nointbuf\(cq\& control whether extra internal buffering is allowed for realtime devices\&. Disabling this can reduce latency times in some situations\&. With \(cq\&\-z:xruns\(cq\&, processing will be halted if an under/overrun occurs\&. \(cq\&\-z:multitrack\(cq\& and \(cq\&z:nomultitrack\(cq\& can be used to force ecasound to enable or disable multitrack\-mode\&. In rare cases you may want to explicitly specify the recording offset with \(cq\&\-z:multitrack,offset\-in\-samples\(cq\&\&. The offset is the amount of samples skipped when recording from real\-time inputs\&. \(cq\&\-z:psr\(cq\& enables the \fIprecise\-sample\-rates\fP mode for OSS\-devices\&. \(cq\&\-z:mixmode,sum\(cq\& enables mixing mode where channels are mixed by summing all channels\&. The default is \(cq\&\-z:mixmode,avg\(cq\&, in which channels are mixed by averaging\&. Mixmode selection was first added to ecasound 2\&.4\&.0\&. See ecasoundrc man page\&. .IP \fBCHAINSETUP BUFFERING AND PERFORMANCE OPTIONS\fP .IP .IP "\-B:buffering_mode" Selects the default buffering mode\&. Mode is one of: \(cq\&auto\(cq\& (default), \(cq\&nonrt\(cq\&, \(cq\&rt\(cq\&, \(cq\&rtlowlatency\(cq\&\&. .IP .IP "\-b:buffer_size" Sets the processing engine buffer size in samples\&. The size must be an exponent of 2, and it is independent of channel count (e\&.g\&. \fI\-b:1024\fP at 48kHz will result in 21\&.333ms buffer length whether input is mono, stereo or 5\&.1)\&. .IP This is an important option as this defines the length of one processing engine iteration and affects ecasound behaviour in many ways\&. If not explicitly specified, ecasound will try to choose an optimal value based on current buffering mode (see \fI\-B\fP option)\&. For real\-time processing, you can try to set this as low as possible to reduce the processing delay\&. Some machines can handle buffer values as low as 64 and 128\&. In some circumstances (for instance when using oscillator envelopes) small buffer sizes will make envelopes act more smoothly\&. When not processing in real\-time (all inputs and outputs are normal files), larger values may help to avoid buffer overruns, lower CPU usage and/or otherwise improve performance\&. .IP Note that when any JACK input/outputs are used, the buffer size setting is overridden and set to period/buffer size reported by JACK server (e\&.g\&. jackd\(cq\&s \(cq\&\-p\(cq\& option)\&. It is not possible to turn off this behaviour\&. .IP If not explicitly specified, the default buffer size is chosen based on current buffering mode (see \fI\-B\fP)\&. .IP .IP "\-r:sched_priority" Use realtime scheduling policy (SCHED_FIFO)\&. This is impossible if ecasound doesn\(cq\&t have root priviledges\&. Beware! This gives better performance, but can cause total lock\-ups if something goes wrong\&. The \(cq\&sched_priority\(cq\& can be omitted (0=omitted)\&. If given, this is the static priority to the highest priority ecasound thread\&. Other ecasound threads run with priority \(cq\&sched_priority\-1\&.\&.\&.n\(cq\&\&. Value \(cq\&\-1\(cq\& can be used to disable raised\-priority mode\&. .IP .IP "\-z:feature" Relevant features are \-z:db,xxx (\-z:nodb) and \-z:intbuf (\-z:nointbuf)\&. See section \fIGeneral chainsetup options\fP for details\&. .IP \fBPROCESSING CONTROL\fP .IP "\-t:seconds" Sets processing time in seconds (doesn\(cq\&t have to be an integer value)\&. If processing time isn\(cq\&t set, engine stops when all inputs are finished\&. This option is equivalent to the \(cq\&cs\-set\-length\(cq\& EIAM command\&. A special\-case value of \(cq\&\-1\(cq\& will set the chainsetup length according to the longest input object\&. .IP .IP "\-tl" Enables looping\&. When processing is finished, engine will start again from beginning\&. This option is equivalent to the \(cq\&cs\-loop\(cq\& EIAM command\&. .IP \fBINPUT/OUTPUT SETUP\fP .PP See ecasound user\(cq\&s guide for more detailed documentation\&. .PP .IP "\-G:mgrtype,optstring" Sets options for audio object manager type \(cq\&mgrtype\(cq\&\&. For available options, see \(dq\&OBJECT TYPE SPECIFIC NOTES\(dq\& below\&. .IP .IP "\-f:sample_format,channel,sample\-rate,interleaving" Sets the audio stream parameters for subsequent audio objects\&. To set different parameters for different audio objects, multiple \(cq\&\-f\(cq\& options have to be specified (note the ordering, the \(cq\&\-f\(cq\& options should precede the audio objects for them to have any effect)\&. See documentation for \(cq\&\-i\(cq\& and \(cq\&\-o\(cq\& options\&. .IP When an audio object is opened (e\&.g\&. a file or sound device is opened, or connection is made to a sound server), the audio stream parameters are passed to the object\&. It should be noted that not all audio objects allow to set any or all of the parameters\&. For instance when opening existing audio files, many file formats have a header describing the file audio parameters\&. In these cases the audio file header overrides the parameters passed with \(cq\&\-f\(cq\& option\&. Similarly when creating JACK inputs and outputs, the JACK server mandates the sampling rate and sample format\&. .IP If no \(cq\&\-f\(cq\& option is specified, or some of the argument fields are left empty (e\&.g\&. \(cq\&\-f:,2,44100\(cq\&), ecasound will use default values\&. These default values are defined in ecasoundrc configuration file\&. See ecasoundrc(5) manual page\&. .IP Note that ecasound opens out files by default in update mode\&. Unless option \(cq\&\-x\(cq\& (overwrite outputs) option is given, audio parameters of an existing audio file take preference over the params set with \(cq\&\-f\(cq\&\&. .IP Sample format is given as a formatted string\&. The first letter is either \(dq\&u\(dq\&, \(dq\&s\(dq\& and \(dq\&f\(dq\& (unsigned, signed, floating point)\&. The following number specifies sample size in bits\&. If sample is little endian, \(dq\&_le\(dq\& is added to the end\&. Similarly if big endian, \(dq\&_be\(dq\& is added\&. If endianness is not specified, host byte\-order is used\&. Currently supported formats are \(dq\&u8\(dq\& (same as \(dq\&8\(dq\&), \(dq\&s16_le\(dq\& (same as \(dq\&16\(dq\&), \(dq\&s16_be\(dq\&, \(dq\&s24_le\(dq\&, \(dq\&s24_be\(dq\&, \(dq\&s32_le\(dq\&, \(dq\&s32_be\(dq\&, \(dq\&f32_le\(dq\& and \(dq\&f32_be\(dq\&\&. An empty string \(dq\&\(dq\& picks the system default sample format\&. .IP The 4th parameter defines the channel layout\&. The available options are \(cq\&i\(cq\& (interleaved\(cq\& and \(cq\&n\(cq\& (noninterleaved)\&. With the noninterleaved setting, ecasound will process samples one channel at a time, and the blocksize is set with \(cq\&\-b\(cq\&\&. The default setting is \(cq\&i\(cq\&\&. .IP .IP "\-y:seconds" Sets starting position for last specified input/output\&. If you need more flexible control over audio objects, you should use the \fI\&.ewf\fP format\&. .IP .IP "\-i[:]input\-file\-or\-device[,params]" Specifies a new input source that is connected to all selected chains (chains are selected with \(cq\&\-a:\&.\&.\&.\(cq\&)\&. Connecting multiple inputs to the same chain is not possible, but one input can be connected to multiple chains\&. Input can be a a file, device or some other audio object (see below)\&. If the input is a file, its type is determined using the file name extension\&. If the object name contains any commas, the name must be enclosed in backquotes to avoid confusing the parser\&. Currently supported formats are RIFF WAVE files (\&.wav), audio\-cd tracks (\&.cdr), ecasound EWF files (\&.ewf), RAW audio data (\&.raw) and MPEG audio files (\&.mp2,\&.mp3)\&. More audio formats are supported via libaudiofile and libsndfile libraries (see documentation below)\&. MikMod is also supported (\&.xm, \&.mod, \&.s3m, \&.it, etc)\&. MIDI files (\&.mid) are supported using Timidity++\&. Similarly Ogg Vorbis (\&.ogg) can be read, and written if ogg123 and vorbize tools are installed; FLAC files (\&.flac) with flac command\-line tools or using libsndfile; and AAC files (\&.aac/\&.m4a/\&.mp4) with faad2/faac tools\&. Supported realtime devices are OSS audio devices (/dev/dsp*), ALSA audio and loopback devices and JACK audio subsystem\&. If no inputs are specified, the first non\-option (doesn\(cq\&t start with \(cq\&\-\(cq\&) command line argument is considered to be an input\&. .IP .IP "\-o[:]output\-file\-or\-device[,params]" Works in the same way as the \-i option\&. If no outputs are specified, the default output device is used (see ~/\&.ecasoundrc)\&. If the object name contains any commas, the name must be enclosed in backquotes to avoid confusing the parser\&. Note, many object types do not support output (e\&.g\&. MikMod, MIDI and many others)\&. .IP \fIOBJECT TYPE SPECIFIC NOTES\fP .IP "ALSA devices \- \(cq\&alsa\(cq\&" When using ALSA drivers, instead of a device filename, you need to use the following option syntax: \fB\-i[:]alsa,pcm_device_name\fP\&. .IP .IP "ALSA direct\-hw and plugin access \- \(cq\&alsahw\(cq\&, \(cq\&alsaplugin\(cq\&" It\(cq\&s also possible to use a specific card and device combination using the following notation: \fB\-i[:]alsahw,card_number,device_number,subdevice_number\fP\&. Another option is the ALSA PCM plugin layer\&. It works just like the normal ALSA pcm\-devices, but with automatic channel count and sample format conversions\&. Option syntax is \fB\-i[:]alsaplugin,card_number,device_number,subdevice_number\fP\&. .IP .IP "aRts input/output \- \(cq\&arts\(cq\&" If enabled at compile\-time, ecasound supports audio input and output using aRts audio server\&. Option syntax is \fB\-i:arts\fP, \fB\-o:arts\fP\&. .IP .IP "Audio file sequencing \- \(cq\&audioloop\(cq\&, \(cq\&select\(cq\&, \(cq\&playat\(cq\&" Ecasound provides a set of special audio object types that can be used for temporal sequencing of audio files \- i\&.e\&. looping, playing only a select portion of a file, playing file at a spefific time, and other such operation\&. .IP Looping is possible with \fB\-i:audioloop,file\&.ext,params\fP\&. The file name (or any object type understood by Ecasound) given as the second parameter is played back continuously looping back to the beginning when the end of file is reached\&. Any additional parameters given are passed unaltered to the file object\&. Parameters 3\&.\&.\&.N are passed as is to the child object (i\&.e\&. \(dq\&\-i audioloop,foo\&.wav,bar1,bar2\(dq\& will pass parameters \(dq\&bar1,bar2\(dq\& to the \(dq\&foo\&.wav\(dq\& object\&. .IP To select and use only a specific segment of an audio object, the \fB\-i:select,start\-time,duration,file\&.ext,params\fP can be used\&. This will play \(dq\&duration\(dq\& of \(dq\&file\&.ext\(dq\&, starting at \(dq\&start\-time\(dq\&\&. The time values should be given as seconds (e\&.g\&. \(dq\&2\&.25\(dq\&, or as samples (e\&.g\&. \(dq\&25000sa\(dq\&)\&. Parameters 4\&.\&.\&.N are passed as is to the child object\&. .IP To play an audio object at a given moment in time, the \fB\-i:playat,play\-at\-time,file\&.ext,params\fP can be used\&. This will play \(dq\&file\&.ext\(dq\& after position reaches \(dq\&play\-at\-time\(dq\&\&. The time values should be given as seconds (e\&.g\&. \(dq\&2\&.25\(dq\&, or as samples (e\&.g\&. \(dq\&25000sa\(dq\&)\&. Parameters 2\&.\&.\&.N are passed as is to the child object\&. .IP .IP "Ecasound Wave Files (EWF) \- \(cq\&*\&.ewf\(cq\&" A special file format that allows one to slice and loop full (or segments) of audio files\&. This format is specific to Ecasound\&. See ecasound user\(cq\&s guide for more detailed information\&. .IP See also audio object types \(cq\&audioloop\(cq\&, \(cq\&select\(cq\& and \(cq\&playat\(cq\&\&. .IP .IP "JACK input/outputs \- Overview" JACK is a low\-latency audio server that can be used to connect multiple independent audio application to each other\&. It is different from other audio server efforts in that it has been designed from the ground up to be suitable for low\-latency professional audio work\&. .IP .IP "JACK input/outputs \- \(cq\&jack\(cq\&" Ecasound provides multiple ways to communicate with JACK servers\&. To create a JACK input or output object, one should use \fB\-i jack\fP and \fB\-o jack\fP\&. These create JACK client ports \(dq\&ecasound:in_N\(dq\& and \(dq\&ecasound:out_n\(dq\& respectively (\(cq\&N\(cq\& is replaced by the channel number)\&. Ecasound automatically creates one JACK port for each channel (number of channels is set with \fB\-f:bits,channels,rate\fP option)\&. .IP It is important to note that by default JACK ports are not connected anywhere (e\&.g\&. to soundcard input/outputs, or to other apps)\&. One thus has to connect the ports with an external program (e\&.g\&. \(dq\&QJackCtl\(dq\& or \(dq\&jack_connect\(dq\&)\&. .IP .IP "JACK input/outputs \- \(cq\&jack,clientname,portprefix\(cq\&" \fB\(dq\&jack,clientname\(dq\&\fP For simple use scanerios, ecasound provides a way to autoconnect the ecasound ports\&. This can be done with by giving the peer client name as the second parameter to the \(dq\&jack\(dq\& object, e\&.g\&. \fB\-o jack,clientname\fP\&. As an example, \fB\-o jack,system\fP will create an output that is automatically connected to outputs of the default system soundcard\&. The client parameter can be omitted, in which case no automatic connections are made\&. .IP If one needs to change the port prefix (e\&.g\&. \(dq\&in\(dq\& in client name \(dq\&ecasound:in_N\(dq\&), the prefix can be specified as the third parameter to \(dq\&jack\(dq\& object, e\&.g\&. \fB\-o jack,,fxout\fP\&. Also the third parameter can be omitted, in which case the default prefixes \(dq\&in\(dq\& and \(dq\&out\(dq\& are used\&. .IP .IP "JACK input/outputs \- \(cq\&jack_multi\(cq\&" A variant of \(cq\&jack\(cq\& object type is \(cq\&jack_multi\(cq\&\&. The full object syntax is \fBjack_multi,destport1,\&.\&.\&.,destportN\fP\&. When a \(cq\&jack_multi\(cq\& object is connected to a JACK server, first channel of the object is connected to JACK port \(cq\&destport1\(cq\&, second to \(cq\&destport2\(cq\& and so forth\&. For instance \(dq\&\-f:32,2,44100 \-o jack_multi,foo:in,bar:in\(dq\& creates a stereo ecasound output object, with its left and right channels routed to two difference JACK clients\&. The destination ports must be active when the ecasound engine is launched, or otherwise the connections cannot be established\&. If destination ports are not specified for all channels, or zero length strings are given, those ports are not connected at launch by ecasound\&. .IP .IP "JACK input/outputs \- \(cq\&jack_alsa\(cq\&, \(cq\&jack_auto\(cq\&, \(cq\&jack_generic\(cq\& (**deprecated since 2\&.6\&.0**)" Ecasound 2\&.5 and older supported \(dq\&jack_alsa\(dq\&, \(dq\&jack_auto\(dq\& and \(dq\&jack_generic\(dq\& object types, but these are now replaced by a more generic \(dq\&jack\(dq\& interface, and thus are now deprecated (they work but are no longer documented)\&. .IP .IP "JACK input/outputs \- client options" Additionally global JACK options can be set using \fB\-G:jack,client_name,operation_mode\fP option\&. \(cq\&client_name\(cq\& is the name used when registering ecasound to the JACK system\&. If \(cq\&operation_mode\(cq\& is \(dq\¬ransport\(dq\&, ecasound will ignore any transport state changes in the JACK\-system; in mode \(dq\&send\(dq\& it will send all start, stop and position\-change events to other JACK clients; in mode \(dq\&recv\(dq\& ecasound will follow JACK start, stop and position\-change events; and mode \(dq\&sendrecv\(dq\& which is a combination of the two previous modes\&. .IP If not explicitly set, in interactive mode (\fB\(cq\&\-c\(cq\&\fP option), the default mode is \(dq\&sendrecv\(dq\&, while in batchmode default is \(dq\¬ransport\(dq\&\&. In both cases the mode can be changed with \fB\-G\fP option as described above\&. .IP More details about ecasound\(cq\&s JACK support can be found from Ecasound User\(cq\&s Guide\&. .IP .IP "Libaudiofile \- \(cq\&audiofile\(cq\&" If libaudiofile support was enabled at compile\-time, this option allows you to force Ecasound to use libaudiofile for reading/writing a certain audio file\&. Option syntax is \fB\-i:audiofile,foobar\&.ext\fP (same for \fB\-o\fP)\&. .IP .IP "Libsndfile \- \(cq\&sndfile\(cq\&" If libsndfile support was enabled at compile\-time, this option allows you to force Ecasound to use libsndfile for reading/writing a certain audio file\&. Option syntax is \fB\-i:sndfile,foobar\&.ext[,\&.format\-ext]\fP (same for \fB\-o\fP)\&. The optional third parameter \(dq\&format\(dq\& can be used to override the audio format (for example you can create an AIFF file with filename \(dq\&foo\&.wav\(dq\&)\&. .IP .IP "Loop device \- \(cq\&loop\(cq\&" Loop devices make it possible to route (loop back) data between chains\&. Option syntax is \fB\-[io][:]loop,tag\fP\&. If you add a loop output with tag \(cq\&1\(cq\&, all data written to this output is routed to any loop input with tag \(cq\&1\(cq\&\&. The tag can be either numerical (e\&.g\&. \(cq\&\-i:loop,1\(cq\&) or a string (e\&.g\&. \(dq\&\-i:loop,vocals\(dq\&)\&. Like with other input/output objects, you can attach the same loop device to multiple chains and this way split/mix the signal\&. .IP Note: this \(cq\&loop\(cq\& device is different from \(cq\&audioloop\(cq\& (latter added to ecasound v2\&.5\&.0)\&. .IP .IP "Mikmod \- \(cq\&mikmod\(cq\&" If mikmod support was enabled at compile\-time, this option allows you to force Ecasound to use Mikmod for reading/writing a certain module file\&. Option syntax is \fB\-i:mikmod,foobar\&.ext\fP\&. .IP .IP "Null inputs/outputs \- \(cq\&null\(cq\&" If you specify \(dq\&null\(dq\& or \(dq\&/dev/null\(dq\& as the input or output, a null audio device is created\&. This is useful if you just want to analyze sample data without writing it to a file\&. There\(cq\&s also a realtime variant, \(dq\&rtnull\(dq\&, which behaves just like \(dq\&null\(dq\& objects, except all i/o is done at realtime speed\&. .IP .IP "Resample \- \(cq\&resample\(cq\&" Object type \(cq\&resample\(cq\& can be used to resample audio object\(cq\&s audio data to match the sampling rate used in the active chainsetup\&. For example, \fBecasound \-f:16,2,44100 \-i resample,22050,foo\&.wav \-o /dev/dsp\fP, will resample file from 22\&.05kHz to 44\&.1kHz and write the result to the soundcard device\&. Child sampling rate can be replaced with keyword \(cq\&auto\(cq\&\&. In this case ecasound will try to query the child object for its sampling rate\&. This works with files formats such as \&.wav which store meta information about the audio file format\&. To use \(cq\&auto\(cq\& in the previous example, \fBecasound \-f:16,2,44100 \-i resample,auto,foo\&.wav \-o /dev/dsp\fP\&. .IP Parameters 4\&.\&.\&.N are passed as is to the child object (i\&.e\&. \(dq\&\-i resample,22050,foo\&.wav,bar1,bar2\(dq\& will pass parameters \(dq\&bar1,bar2\(dq\& to the \(dq\&foo\&.wav\(dq\& object\&. .IP If ecasound was compiled with support for libsamplerate, you can use \(cq\&resample\-hq\(cq\& to use the highest quality resampling algorithm available\&. To force ecasound to use the internal resampler, \(cq\&resampler\-lq\(cq\& (low\-quality) can be used\&. .IP .IP "Reverse \- \(cq\&reverse\(cq\&" Object type \(cq\&reverse\(cq\& can be used to reverse audio data coming from an audio object\&. As an example, \fBecasound \-i reverse,foo\&.wav \-o /dev/dsp\fP will play \(cq\&foo\&.wav\(cq\& backwards\&. Reversing output objects is not supported\&. Note! Trying to reverse audio object types with really slow seek operation (like mp3), works extremely badly\&. Try converting to an uncompressed format (wav or raw) first, and then do reversation\&. .IP Parameters 3\&.\&.\&.N are passed as is to the child object (i\&.e\&. \(dq\&\-i reverse,foo\&.wav,bar1,bar2\(dq\& will pass parameters \(dq\&bar1,bar2\(dq\& to the \(dq\&foo\&.wav\(dq\& object\&. .IP .IP "System standard streams and named pipes \- \(cq\&stdin\(cq\&, \(cq\&stdout\(cq\&" You can use standard streams (stdin and stdout) by giving \fBstdin\fP or \fBstdout\fP as the file name\&. Audio data is assumed to be in raw/headerless (\&.raw) format\&. If you want to use named pipes, create them with the proper file name extension before use\&. .IP .IP "Tone generator \- \(cq\&tone\(cq\&" To generate a test tone, input \fB\-i:tone,type,freq,duration\-secs\fP can be used\&. Parameter \(cq\&type\(cq\& specifies the tone type: currently only \(cq\&sine\(cq\& is supported\&. The \(cq\&freq\(cq\& parameter sets the frequency of the generated tone and \(cq\&duration\-secs\(cq\& the length of the generated stream\&. Specifying zero, or a negative value, as the duration will produce an infinite stream\&. This feature was first added to Ecasound 2\&.4\&.7\&. .IP .IP "Typeselect \- \(cq\&typeselect\(cq\&" The special \(cq\&typeselect\(cq\& object type can be used to override how ecasound maps filename extensions and object types\&. For instance \fBecasound \-i typeselect,\&.mp3,an_mp3_file\&.wav \-o /dev/dsp\fP\&. would play the file \(cq\&an_mp3_file\&.wav\(cq\& as an mp3\-file and not as an wav\-file as would happen without typeselect\&. .IP Parameters 4\&.\&.\&.N are passed as is to the child object (i\&.e\&. \(dq\&\-i typeselect,\&.au,foo\&.wav,bar1,bar2\(dq\& will pass parameters \(dq\&bar1,bar2\(dq\& to the \(dq\&foo\&.wav\(dq\& object\&. .IP \fBMIDI SETUP\fP .PP .IP "MIDI I/O devices \- general" If no MIDI\-device is specified, the default MIDI\-device is used (see ecasoundrc(5))\&. .IP .IP "\-Md:rawmidi,device_name" Add a rawmidi MIDI I/O device to the setup\&. \(cq\&device_name\(cq\& can be anything that can be accessed using the normal UNIX file operations and produces raw MIDI bytes\&. Valid devices are for example OSS rawmidi devices (/dev/midi00), ALSA rawmidi devices (/dev/snd/midiC2D0), named pipes (see mkfifo man page), and normal files\&. .IP .IP "\-Md:alsaseq,sequencer\-port" Adds a ALSA MIDI sequencer port to the setup\&. \(cq\&sequencer\-port\(cq\& identifies a port to connect to\&. It can be numerical (e\&.g\&. 128:1), or a client name (e\&.g\&. \(dq\&KMidimon\(dq\&)\&. .IP .IP "\-Mms:device_id" Sends MMC start (\(dq\&Deferred Play\(dq\&) and stop (\(dq\&Stop\(dq\&) with device ID \(cq\&device_id\(cq\&\&. .IP While Ecasound does not directly support syncing transport state to incoming MMC messages, this can be achieved by connecting Ecasound to JACK input/outputs, and using a tool such as JackMMC and JackCtlMMC ( see ) to convert MMC messages into JACK transport change events\&. .IP .IP "\-Mss" Sends MIDI\-sync (i\&.e\&. \(dq\&MIDI Start\(dq\& and \(dq\&MIDI Stop\(dq\& system realtime messages) \&.to the selected MIDI\-device\&. Notice that as Ecasound will not send \fIMIDI\-clock\fP, but only the \fIstart\fP and \fIstop\fP messages\&. .IP \fBEFFECT SETUP\fP .PP \fIPRESETS\fP .PP Ecasound has a powerful effect preset system that allows you create new effects by combining basic effects and controllers\&. See ecasound user\(cq\&s guide for more detailed information\&. .PP .IP "\-pf:preset_file\&.eep" Uses the first preset found from file \(cq\&preset_file\&.eep\(cq\& as a chain operator\&. .IP .IP "\-pn:preset_name" Find preset \(cq\&preset_name\(cq\& from global preset database and use it as a chain operator\&. See ecasoundrc man page for info about the preset database\&. .IP \fISIGNAL ANALYSIS\fP .PP .IP "\-ev" Analyzes sample data to find out how much the signal can be amplified without clipping\&. The resulting percent value can be used as a parameter to \(cq\&\-ea\(cq\& (amplify)\&. A statistical summary, containing info about the stereo\-image and distribution of sample values, is printed out at the end of processing\&. .IP .IP "\-evp" Peak amplitude watcher\&. Maintains peak information for each processed channels\&. Peak information is resetted on every read\&. .IP .IP "\-ezf" Finds the optimal value for DC\-adjusting\&. You can use the result as a parameter to \-ezx effect\&. .IP \fIGENERAL SIGNAL PROCESSING ALGORITHMS\fP .IP "\-eS:stamp\-id" Audio stamp\&. Takes a snapshot of passing audio data and stores it using id \(cq\&stamp\-id\(cq\& (integer number)\&. This data can later be used by controllers and other operators\&. .IP .IP "\-ea:amplify%" Adjusts the signal amplitude to \(cq\&lify%\(cq\& percent (linear scale, i\&.e\&. individual samples are multiplied by \(cq\&lify%/100\(cq\&)\&. See also \(cq\&\-eadb\(cq\&\&. .IP .IP "\-eac:amplify%,channel" Amplifies signal of channel \(cq\&channel\(cq\& by amplify\-% percent (linear scale, i\&.e\&. individual samples are multiplied by \(cq\&lify%/100\(cq\&)\&. \(cq\&channel\(cq\& ranges from 1\&.\&.\&.n where n is the total number of channels\&. See also \(cq\&\-eadb\(cq\&\&. .IP .IP "\-eadb:gain\-dB[,channel]" Adjusts signal level by \(cq\&gain\-dB\(cq\&, with a gain of 0dB having no effect to the signal, negative gains attenuating the signal and positive gain values amplifying it\&. The \(cq\&channel\(cq\& parameter (1\&.\&.\&.n) is optional\&. If \(cq\&channel\(cq\& parameter is specified, and its value is nonzero, gain is only applied to the given channel (1\&.\&.\&.n)\&. .IP .IP "\-eaw:amplify%,max\-clipped\-samples" Amplifies signal by amplify\-% percent (linear scale, i\&.e\&. individual samples are multiplied by \(cq\&lify%/100\(cq\&)\&. If number of consecutive clipped samples (resulting sample value is outside the nominal [\-1,1] range), a warning will be issued\&. .IP .IP "\-eal:limit\-%" Limiter effect\&. Limits audio level to \(cq\&limit\-%\(cq\& (linear scale) with values equal or greater than 100% resulting in no change to the signal\&. .IP .IP "\-ec:rate,threshold\-%" Compressor (a simple one)\&. \(cq\&rate\(cq\& is the compression rate in decibels (\(cq\&rate\(cq\& dB change in input signal causes 1dB change in output)\&. \(cq\&threshold\(cq\& varies between 0\&.0 (silence) and 1\&.0 (max amplitude)\&. .IP .IP "\-eca:peak\-level\-%, release\-time\-sec, fast\-crate, crate" A more advanced compressor (original algorithm by John S\&. Dyson)\&. If you give a value of 0 to any parameter, the default is used\&. \(cq\&peak\-level\-%\(cq\& essentially specifies how hard the peak limiter is pushed\&. The default of 69% is good\&. \(cq\&release_time\(cq\& is given in seconds\&. This compressor is very sophisticated, and actually the release time is complex\&. This is one of the dominant release time controls, but the actual release time is dependent on a lot of factors regarding the dynamics of the audio in\&. \(cq\&fastrate\(cq\& is the compression ratio for the fast compressor\&. This is not really the compression ratio\&. Value of 1\&.0 is infinity to one, while the default 0\&.50 is 2:1\&. Another really good value is special cased in the code: 0\&.25 is somewhat less than 2:1, and sounds super smooth\&. \(cq\&rate\(cq\& is the compression ratio for the entire compressor chain\&. The default is 1\&.0, and holds the volume very constant without many nasty side effects\&. However the dynamics in music are severely restricted, and a value of 0\&.5 might keep the music more intact\&. .IP .IP "\-enm:threshold\-level\-%,pre\-hold\-time\-msec,attack\-time\-msec,post\-hold\-time\-msec,release\-time\-msec" Noise gate\&. Supports multichannel processing (each channel processed separately)\&. When signal amplitude falls below \(cq\&threshold_level_%\(cq\& percent (100% means maximum amplitude), gate is activated\&. If the signal stays below the threshold for \(cq\&th_time\(cq\& ms, it\(cq\&s faded out during the attack phase of \(cq\&attack\(cq\& ms\&. If the signal raises above the \(cq\&threshold_level\(cq\& and stays there over \(cq\&hold\(cq\& ms the gate is released during \(cq\&release\(cq\& ms\&. .IP .IP "\-ei:pitch\-shift\-%" Pitch shifter\&. Modifies audio pitch by altering its length\&. .IP .IP "\-epp:right\-%" Stereo panner\&. Changes the relative balance between the first two channels\&. When \(cq\&right\-%\(cq\& is 0, only signal on the left (1st) channel is passed through\&. Similarly if it is \(cq\&100\(cq\&, only right (2nd) channel is let through\&. .IP .IP "\-ezx:channel\-count,delta\-ch1,\&.\&.\&.,delta\-chN" Adjusts the signal DC by \(cq\&delta\-chX\(cq\&, where X is the channel number\&. Use \-ezf to find the optimal delta values\&. .IP \fIENVELOPE MODULATION\fP .IP .IP "\-eemb:bpm,on\-time\-%" Pulse gate (pulse frequency given as beats\-per\-minute)\&. .IP .IP "\-eemp:freq\-Hz,on\-time\-%" Pulse gate\&. .IP .IP "\-eemt:bpm,depth\-%" Tremolo effect (tremolo speed given as beats\-per\-minute)\&. .IP \fIFILTER EFFECTS\fP .IP "\-ef1:center_freq, width" Resonant bandpass filter\&. \(cq\¢er_freq\(cq\& is the center frequency\&. Width is specified in Hz\&. .IP .IP "\-ef3:cutoff_freq, reso, gain" Resonant lowpass filter\&. \(cq\&cutoffr_freq\(cq\& is the filter cutoff frequency\&. \(cq\&reso\(cq\& means resonance\&. Usually the best values for resonance are between 1\&.0 and 2\&.0, but you can use even bigger values\&. \(cq\&gain\(cq\& is the overall gain\-factor\&. It\(cq\&s a simple multiplier (1\&.0 is the normal level)\&. With high resonance values it often is useful to reduce the gain value\&. .IP .IP "\-ef4:cutoff, resonance" Resonant lowpass filter (3rd\-order, 36dB, original algorithm by Stefan M\&. Fendt)\&. Simulates an analog active RC\-lowpass design\&. Cutoff is a value between [0,1], while resonance is between [0,infinity)\&. .IP .IP "\-efa:delay\-samples,feedback\-%" Allpass filter\&. Passes all frequencies with no change in amplitude\&. However, at the same time it imposes a frequency\-dependent phase\-shift\&. .IP .IP "\-efc:delay\-samples,radius" Comb filter\&. Allows the spikes of the comb to pass through\&. Value of \(cq\&radius\(cq\& should be between [0, 1\&.0)\&. .IP .IP "\-efb:center\-freq,width" Bandpass filter\&. \(cq\¢er_freq\(cq\& is the center frequency\&. Width is specified in Hz\&. .IP .IP "\-efh:cutoff\-freq" Highpass filter\&. Only frequencies above \(cq\&cutoff_freq\(cq\& are passed through\&. .IP .IP "\-efi:delay\-samples,radius" Inverse comb filter\&. Filters out the spikes of the comb\&. There are \(cq\&delay_in_samples\-2\(cq\& spikes\&. Value of \(cq\&radius\(cq\& should be between [0, 1\&.0)\&. The closer it is to the maximum value, the deeper the dips of the comb are\&. .IP .IP "\-efl:cutoff\-freq" Lowpass filter\&. Only frequencies below \(cq\&cutoff_freq\(cq\& are passed through\&. .IP .IP "\-efr:center\-freq,width" Bandreject filter\&. \(cq\¢er_freq\(cq\& is the center frequency\&. Width is specified in Hz\&. .IP .IP "\-efs:center\-freq,width" Resonator\&. \(cq\¢er_freq\(cq\& is the center frequency\&. Width is specified in Hz\&. Basicly just another resonating bandpass filter\&. .IP \fICHANNEL MIXING / ROUTING\fP .IP .IP "\-chcopy:from\-channel, to\-channel" Copy channel \(cq\&from_channel\(cq\& to \(cq\&to_channel\(cq\&\&. If \(cq\&to_channel\(cq\& doesn\(cq\&t exist, it is created\&. Channel indexing starts from 1\&. Option added to ecasound 2\&.4\&.5\&. .IP .IP "\-chmove:from\-channel, to\-channel" Copy channel \(cq\&from_channel\(cq\& to \(cq\&to_channel\(cq\&, and mutes the source channel \(cq\&from_channel\(cq\&\&. Channel indexing starts from 1\&. Option added to ecasound 2\&.4\&.5\&. .IP .IP "\-chorder:ch1,\&.\&.\&.,chN" Reorder, omit and/r duplicate chain channels\&. The resulting audio stream has total of \(cq\&N\(cq\& channels\&. Each parameter specifies the source channel to use for given output channel\&. As an example, \(cq\&\-chorder:2,1\(cq\& would reverse the channels of a stereo stream (\(cq\&out1,out2\(cq\& = \(cq\&in2,in1\(cq\&)\&. Specifying the same source channel multiple times is allowed\&. For example, \(cq\&\-chorder:2,2\(cq\& would route the second channel to both two output channels (\(cq\&out1,out2\(cq\& = \(cq\&in2,in2\(cq\&)\&. If \(cq\&chX\(cq\& is zero, the given channel \(cq\&X\(cq\& will be muted in the output stream\&. Option added to ecasound 2\&.7\&.0\&. .IP .IP "\-chmix:to\-channel" Mix all source channels to channel \(cq\&to_channel\(cq\&\&. If \(cq\&to_channel\(cq\& doesn\(cq\&t exist, it is created\&. Channel indexing starts from 1\&. Option added to ecasound 2\&.4\&.5\&. .IP .IP "\-chmute:channel" Mutes the channel \(cq\&channel\(cq\&\&. Channel indexing starts from 1\&. Option added to ecasound 2\&.4\&.5\&. .IP .IP "\-erc:from\-channel,to\-channel" Deprecated, see \fI\-chcopy\fP\&. .IP .IP "\-erm:to\-channel" Deprecated, see \fI\-chmix\fP\&. .IP \fITIME\-BASED EFFECTS\fP .IP .IP "\-etc:delay\-time\-msec,variance\-time\-samples,feedback\-%,lfo\-freq" Chorus\&. .IP .IP "\-etd:delay\-time\-msec,surround\-mode,number\-of\-delays,mix\-%,feedback\-%" Delay effect\&. \(cq\&delay time\(cq\& is the delay time in milliseconds\&. \(cq\&surround\-mode\(cq\& is a integer with following meanings: 0 = normal, 1 = surround, 2 = stereo\-spread\&. \(cq\&number_of_delays\(cq\& should be obvious\&. Beware that large number of delays and huge delay times need a lot of CPU power\&. \(cq\&mix\-%\(cq\& expresses the mix balance between the original and delayed signal, with 0 meaning no delayed signal, 100 meaning no original signal, and 50 (the default) achieving an equal balance\&. \(cq\&feedback\-%\(cq\& represents how much of the signal is recycled in each delay or, if you prefer, at what rate the repeated snippet of delayed audio fades\&. Note that sufficiently low feedback values may result in a number of audible repetitions lesser than what you have specified for \(cq\&number_of_delays\(cq\&, especially if you have set a low value for \(cq\&mix\-%\(cq\&\&. By default the value for this parameter is 100% (No signal loss\&.)\&. .IP .IP "\-ete:room_size,feedback\-%,wet\-%" A more advanced reverb effect (original algorithm by Stefan M\&. Fendt)\&. \(cq\&room_size\(cq\& is given in meters, \(cq\&feedback\-%\(cq\& is the feedback level given in percents and \(cq\&wet\-%\(cq\& is the amount of reverbed signal added to the original signal\&. .IP .IP "\-etf:delay\-time\-msec" Fake\-stereo effect\&. The input signal is summed to mono\&. The original signal goes to the left channels while a delayed version (with delay of \(cq\&delay time\(cq\& milliseconds) is goes to the right\&. With a delay time of 1\-40 milliseconds this adds a stereo\-feel to mono\-signals\&. .IP .IP "\-etl:delay\-time\-msec,variance\-time\-samples,feedback\-%,lfo\-freq" Flanger\&. .IP .IP "\-etm:delay\-time\-msec,number\-of\-delays,mix\-%" Multitap delay\&. \(cq\&delay time\(cq\& is the delay time in milliseconds\&. \(cq\&number_of_delays\(cq\& should be obvious\&. \(cq\&mix\-%\(cq\& determines how much effected (wet) signal is mixed to the original\&. .IP .IP "\-etp:delay\-time\-msec,variance\-time\-samples,feedback\-%,lfo\-freq" Phaser\&. .IP .IP "\-etr:delay\-time,surround\-mode,feedback\-%" Reverb effect\&. \(cq\&delay time\(cq\& is the delay time in milliseconds\&. If \(cq\&surround\-mode\(cq\& is \(cq\&surround\(cq\&, reverbed signal moves around the stereo image\&. \(cq\&feedback\-%\(cq\& determines how much effected (wet) signal is fed back to the reverb\&. .IP \fILADSPA\-PLUGINS\fP .IP "\-el:plugin_unique_name,param\-1,\&.\&.\&.,param\-N" Ecasound supports LADSPA\-effect plugins (Linux Audio Developer\(cq\&s Simple Plugin API)\&. Parameters 1\&.\&.N are set as values of the plugin\(cq\&s control ports\&. .IP If plugin has more than one audio input and/or output port, only one plugin is instance is created, and the chain channels are fed to the same plugin instance\&. If plugin has at most one input and at most one output audio port, a separate plugin instance is created for each channel of the ecasound chain (e\&.g\&. for a stereo audio channel, two LADSPA plugins of same type are created, with one per channel)\&. .IP Plugins are located in shared library (\&.so) files\&. Ecasound looks for plugins in @prefix@/lib/ladspa (e\&.g\&. \(dq\&/usr/local/lib/ladspa\(dq\&), directories listed in environment variable \fILADSPA_PATH\fP\&. Plugin search path can be configured also via \fIecasoundrc\fP, see ecasoundrc(5) man page\&. One shared library file can contain multiple plugin objects, but every plugin has a unique plugin name\&. This name is used for selecting plugins\&. .IP See LAD mailing list web site for more info about LADSPA\&. Other useful sites are LADSPA home page and LADSPA documentation\&. .IP .IP "\-eli:plugin_unique_number,param\-1,\&.\&.\&.,param\-N" Same as above (\fI\-el\fP) expect plugin\(cq\&s unique id\-number is used\&. It is guaranteed that these id\-numbers are unique among all LADSPA plugins\&. .IP \fILV2 PLUGINS\fP .IP "\-elv2:plugin\-id\-uri,param\-1,\&.\&.\&.,param\-N" Ecasound also supports LV2 audio plugins\&. LV2 plugins are identified by a globally unique, case\-sensitive identifier\&. .IP If plugin has more than one audio input and/or output port, only one plugin is instance is created, and the chain channels are fed to the same plugin instance\&. If plugin has at most one input and at most one output audio port, a separate plugin instance is created for each channel of the ecasound chain (e\&.g\&. for a stereo audio channel, two LV2 plugins of same type are created, with one per channel)\&. .IP LV2 is a plugin standard for audio systems\&. .PP \fIGATE SETUP\fP .PP .IP "\-gc:start\-time,len" Time crop gate\&. Initially gate is closed\&. After \(cq\&start\-time\(cq\& seconds has elapsed, gate opens and remains open for \(cq\&len\(cq\& seconds\&. When closed, passing audio buffers are trucated to zero length\&. .IP .IP "\-ge:open\-threshold\-%,close\-thold\-%,volume\-mode,reopen\-count" Threshold gate\&. Initially gate is closed\&. It is opened when volume goes over \(cq\&othreshold\(cq\& percent\&. After this, if volume drops below \(cq\&cthold\(cq\& percent, gate is closed and won\(cq\&t be opened again, unless the \(cq\&reopen\-count\(cq\& is set to anything other than zero\&. If \(cq\&value_mode\(cq\& is \(cq\&rms\(cq\&, average RMS volume is used\&. Otherwise peak average is used\&. When closed, passing audio buffers are trucated to zero length\&. If the \(cq\&reopen\-count\(cq\& is set to a positive number, then the gate will restart its operation that many times\&. So for example, a reopen count of 1 will cause up to 2 openings of the gate\&. A negative value for \(cq\&reopen\-count\(cq\& will result in the gate reopening indefinitely\&. The \(cq\&reopen\-count\(cq\& is invaluable in recording vinyl and tapes, where you can set things up and then recording starts whenever the needle is on the vinyl, and stops when it\(cq\&s off\&. As many sides as you like can be recorded in one session\&. You will need to experiment with buffer lengths and start/stop levels to get reliable settings for your equipment\&. .IP .IP "\-gm:state" Manual gate\&. If \(cq\&state\(cq\& is 1, gate is open and all samples are passed through\&. If \(cq\&state\(cq\& is zero, gate is closed an no samples are let through\&. This chain operator is useful when writing to an output needs to be stopped dynamically (without stopping the whole engine)\&. .IP \fICONTROL ENVELOPE SETUP\fP .IP Controllers can be used to dynamically change effect parameters during processing\&. All controllers are attached to the selected (=usually the last specified effect/controller) effect\&. The first three parameters are common for all controllers\&. \(cq\&fx_param\(cq\& specifies the parameter to be controlled\&. Value \(cq\&1\(cq\& means the first parameter, \(cq\&2\(cq\& the second and so on\&. \(cq\&start_value\(cq\& and \(cq\&end_value\(cq\& set the value range\&. For examples, look at the the \fBEXAMPLES\fP section\&. .IP .IP "\-kos:fx\-param,start\-value,end\-value,freq,i\-phase" Sine oscillator with frequency of \(cq\&freq\(cq\& Hz and initial phase of \(cq\&i_phase\(cq\& times pi\&. .IP .IP "\-kog:fx\-param,start\-value,end\-value,freq,mode,point\-pairs,first\-value,last\-value,pos1,value1,\&.\&.\&." Generic oscillator\&. Frequency \(cq\&freq\(cq\& Hz, mode either \(cq\&0\(cq\& for static values or \(cq\&1\(cq\& for linear interpolation\&. \(cq\&point\-pairs\(cq\& specifies the number of \(cq\&posN\(cq\& \- \(cq\&valueN\(cq\& pairs to include\&. \(cq\&first\-value\(cq\& and \(cq\&last\-value\(cq\& are used as border values (values for position 0\&.0/first and position 1\&.0/last)\&. All \(cq\&posN\(cq\& and \(cq\&valueN\(cq\& must be between 0\&.0 and 1\&.0\&. Also, for all \(cq\&posN\(cq\& values \(cq\&pos1 < pos2 < \&.\&.\&. < posN\(cq\& must be true\&. .IP .IP "\-kf:fx\-param,start\-value,end\-value,freq,mode,genosc\-number" Generic oscillator\&. \(cq\&genosc_number\(cq\& is the number of the oscillator preset to be loaded\&. Mode is either \(cq\&0\(cq\& for static values or \(cq\&1\(cq\& for linear interpolation\&. The location for the preset file is taken from \&./ecasoundrc (see \fIecasoundrc man page\fP)\&. .IP .IP "\-kl:fx\-param,start\-value,end\-value,time\-seconds" Linear envelope that starts from \(cq\&start_value\(cq\& and linearly changes to \(cq\&end_value\(cq\& during \(cq\&time_in_seconds\(cq\&\&. Can be used for fadeins and fadeouts\&. .IP .IP "\-kl2:fx\-param,start\-value,end\-value,1st\-stage\-length\-sec,2nd\-stage\-length\-sec" Two\-stage linear envelope, a more versatile tool for doing fade\-ins and fade\-outs\&. Stays at \(cq\&start_value\(cq\& for \(cq\&1st_stage_length\(cq\& seconds and then linearly changes towards \(cq\&end_value\(cq\& during \(cq\&2nd_stage_length\(cq\& seconds\&. .IP .IP "\-klg:fx\-param,low\-value,high\-value,point_count,pos1,value1,\&.\&.\&.,posN,valueN" Generic linear envelope\&. This controller source can be used to map custom envelopes to chain operator parameters\&. Number of envelope points is specified in \(cq\&point_count\(cq\&\&. Each envelope point consists of a position and a matching value\&. Number of pairs must match \(cq\&point_count\(cq\& (i\&.e\&. \(cq\&N==point_count\(cq\&)\&. The \(cq\&posX\(cq\& parameters are given as seconds (from start of the stream)\&. The envelope points are specified as float values in range \(cq\&[0,1]\(cq\&\&. Before envelope values are mapped to operator parameters, they are mapped to the target range of \(cq\&[low\-value,high\-value]\(cq\&\&. E\&.g\&. a value of \(cq\&0\(cq\& will set operator parameter to \(cq\&low\-value\(cq\& and a value of \(cq\&1\(cq\& will set it to \(cq\&high\-value\(cq\&\&. For the initial segment \(cq\&[0,pos1]\(cq\&, the envelope will output value of \(cq\&value1\(cq\& (e\&.g\&. \(cq\&low\-value\(cq\&)\&. .IP .IP "\-km:fx\-param,start\-value,end\-value,controller,channel" MIDI continuous controller (control change messages)\&. Messages on the MIDI\-channel \(cq\&channel\(cq\& that are coming from controller number \(cq\&controller\(cq\& are used as the controller source\&. As recommended by the MIDI\-specification, channel numbering goes from 1 to 16\&. Possible controller numbers are values from 0 to 127\&. The MIDI\-device where bytes are read from can be specified using \fI\-Md\fP option\&. Otherwise the default MIDI\-device is used as specified in \fI~ecasound/ecasoundrc\fP (see \fIecasoundrc man page\fP)\&. Defaults to \fI/dev/midi\fP\&. .IP .IP "\-ksv:fx\-param,start\-value,end\-value,stamp\-id,rms\-toggle" Volume analyze controller\&. Analyzes the audio stored in stamp \(cq\&stamp\-id\(cq\& (see \(cq\&\-eS:id\(cq\& docs), and creates control data based on the results\&. If \(cq\&rms\-toggle\(cq\& is non\-zero, RMS\-volume is used to calculate the control value\&. Otherwise average peak\-amplitude is used\&. .IP .IP "\-kx" This is a special switch that can be used when you need to control controller parameters with another controller\&. When you specify \fI\-kx\fP, the last specified controller will be set as the control target\&. Then you just add another controller as usual\&. .PP \fBINTERACTIVE MODE\fP .PP See \fIecasound\-iam(1)\fP man page\&. .PP .SH "ENVIRONMENT" .IP .IP "ECASOUND" If defined, some utility programs and scripts will use the \fIECASOUND\fP environment as the default path to ecasound executable\&. .PP .IP "ECASOUND_LOGFILE" Output all debugging messages to a separate log file\&. If defined, \fIECASOUND_LOGFILE\fP defines the logfile path\&. This is a good tool for debugging ECI/EIAM scripts and applications\&. .PP .IP "ECASOUND_LOGLEVEL" Select which messages are written to the logfile defined by \fIECASOUND_LOGFILE\fP\&. The syntax for \fI\-d:level\fP is used\&. If not defined, all messages are written\&. Defaults to \-d:319 (everything else but \(cq\&functions (64)\(cq\& and \(cq\&continuous (128)\(cq\& class messages)\&. .PP .IP "COLUMNS" Ecasound honors the \fICOLUMNS\fP environment variable when formatting printed trace messages\&. If \fICOLUMNS\fP is not set, a default of 74 is used\&. .PP .IP "TMPDIR" Some functions of Ecasound (e\&.g\&. \(dq\&cs\-edit\(dq\& interactive command) require creation of temporary files\&. By default, these files are created under \(dq\&/tmp\(dq\&, but this can be overridden by setting the \fITMPDIR\fP environment variable\&. .IP .SH "RETURN VALUES" .IP In interactive mode, ecasound always returns zero\&. .IP In non\-interactive (batch) mode, a non\-zero value is returned for the following errors: .IP .IP "1" Unable to create a valid chainsetup with the given parameters\&. Can be caused by invalid option syntax, etc\&. .PP .IP "2" Unable to start processing\&. This can be caused by insufficient file permissions, inability to access some system resources, etc\&. .PP .IP "3" Error during processing\&. Possible causes: output object has run out of free disk space, etc\&. .PP .IP "4" Error during process termination and/or cleanup\&. See section on \(cq\&SIGNALS\(cq\& for further details\&. .PP .SH "SIGNALS" .PP When ecasound receives any of the POSIX signals SIGINT (ctrl\-c), SIGHUP, SIGTERM or SIGQUIT, normal cleanup and exit procedure is initiated\&. Here normal exit means that e\&.g\&. file headers are updated before closing, helper processes are terminated in normal way, and so forth\&. .PP If, while doing the cleanup described above, ecasound receives another signal (of the same set of POSIX signals), ecasound will skip the normal cleanup procedure, and terminate immediately\&. Any remaining cleanup tasks will be skipped\&. Depending on the runtime state and configuration, this brute force exit may have some side\-effects\&. Ecasound will return exit code of \(cq\&4\(cq\& if normal cleanup was skipped\&. .PP Special case handling is applied to the SIGINT (ctrl\-c) signal\&. If a SIGINT signal is received during the cleanup procedure, ecasound will ignore the signal once, and emit a notice to \(cq\&stderr\(cq\& that cleanup is already in progress\&. Any subsequent SIGINT signals will no longer get special handling, and instead process will terminate immediately (and possibly without proper cleanup)\&. .PP .SH "FILES" .PP \fI~/\&.ecasound\fP The default directory for ecasound user resource files\&. See the ecasoundrc (5) man page man page\&. .PP \fI*\&.ecs\fP Ecasound Chainsetup files\&. Syntax is more or less the same as with command\-line arguments\&. .PP \fI*\&.ecp\fP Ecasound Chain Preset files\&. Used for storing effect and chain operator presets\&. See ecasound user\(cq\&s guide for more better documentation\&. .PP \fI*\&.ews\fP Ecasound Wave Stats\&. These files are used to cache waveform data\&. .PP .SH "EXAMPLES" .PP Examples of how to perform common tasks with ecasound can be found at http://nosignal\&.fi/ecasound/Documentation/examples\&.html\&. .PP .SH "SEE ALSO" .PP ecatools (1) man page, ecasound\-iam (1) man page ecasoundrc (5) man page, \(dq\&HTML docs in the Documentation subdirectory\(dq\& .PP .SH "BUGS" .PP See file BUGS\&. If ecasound behaves weirdly, try to increase the debug level to see what\(cq\&s going on\&. .PP .SH "AUTHOR" .PP Kai Vehmanen, > ecasound-2.9.3/README0000644000076400007640000003207313606327113011146 00000000000000======================================================================= *** Ecasound - README (author/maintainer: Kai Vehmanen) *** ======================================================================= ----------------------------------------------------------------------- What is it? ----------------------------------------------------------------------- Ecasound is a software package designed for multitrack audio processing. It can be used for simple tasks like audio playback, recording and format conversions, as well as for multitrack effect processing, mixing, recording and signal recycling. Ecasound supports a wide range of audio inputs, outputs and effect algorithms. Effects and audio objects can be combined in various ways, and their parameters can be controlled by operator objects like oscillators and MIDI-CCs. A versatile console mode user-interface is included in the package. Primary platform for running Ecasound is Linux. Ecasound also works on many UNIX-derived systems such as FreeBSD and Solaris. Limited support for Windows is available through Cygwin. ----------------------------------------------------------------------- How do you... (author: Kai Vehmanen) ----------------------------------------------------------------------- ... spell the name? I haven't been very consistent with this, but at least in principle, when capitalized, the name refers to the whole package. When in lower case, it refers to the console mode application which happens to have the same name. "Ecasound" = the whole package "ecasound" = the console mode client application (binary) ... pronounce the name? Any way you want! :) Personally I say something to the effect of "eck-uh-sound". Start from "megasound", and omit pronouncing the 'm' at the start, and replace 'g' with a sharper 'k' sound, like in the word "car". ----------------------------------------------------------------------- Story behind Ecasound (author: Kai Vehmanen) ----------------------------------------------------------------------- I started developing Ecasound because I needed an application to record, process and mix my own music. The first versions of Ecasound ran under IBM OS/2. I used those versions for finalizing my analog 4-track recordings. The analog 4-track - Tascam 414 - was a nice tool, but it had its limits. So eventually I started looking for PC software that supported multitrack recording. The first programs I used were for Windows. I still used the OS/2 version of Ecasound for effects processing and finalizing my mixes. Although I'm not fanatical about operating systems, I did prefer (and still do) to use Linux for my computing needs. I also hate rebooting between multiple systems all the time, so it was time to do a port. When I ported Ecasound to Linux, a lot of functionality was rewritten from scratch. During this work I also added multitrack capabilities to Ecasound. It took quite a lot of effort to put it all back together, but in the end I reached the point where I could do all the audio processing tasks on Linux. As an additional benefit I now had source code for - and thus control over - all tools I used for audio processing. Nowadays I still use Ecasound for my music projects. This is also the primary motivation for continuing the development work. There is always something to improve. ----------------------------------------------------------------------- Requirements ----------------------------------------------------------------------- To run Ecasound, you need...: - Operating system that provides standard POSIX/SUS interfaces. Ecasound has been reported to run successfully on various combinations of GNU/Linux (starting from Linux 2.2+ and glibc 2.1+), FreeBSD 4.x+, Solaris 2.6+, Mac OS X 10.3+ and Win32/Cygwin 1.3.20+. Optional when running Ecasound: - for real-time audio input/output: ALSA, JACK or OSS runtime - for mp3 support: mpg123 (input) and lame (output) packages - for Ogg Vorbis support, the vorbis-tools package (ogg123 and oggenc) - for .aac/.m4a/.mp4 file support, the FAAC/FAAD2 tools - for .flac support, the FLAC package - note: since ecasound 2.4.5, libsndfile is the preferred way for reading and writing FLAC files - for MIDI .mid file input: Timidity++ - for tracker module support: MikMod package - for aRts (legacy KDE) support: the aRts server suntime To compile Ecasound, you also need...: - POSIX/SUS development environment, compatible with 'The Single UNIX Specification, Version 3' (UNIX03): - http://www.unix.org/version3/ - http://pubs.opengroup.org/onlinepubs/000095399/toc.htm Ecasound requires the following feature groups: - "Realtime": http://www.opengroup.org/onlinepubs/007908799/xsh/realtime.html - "Realtime Threads": http://www.opengroup.org/onlinepubs/007908799/xsh/feature.html#tag_000_005_003 - Standard C++ build environment (with support for STL and exceptions); tested with egcs 1.1.2, gcc versions 2.91.66, 2.95.X, 3.0-3.4, 4.0-4.3, and Sun Workshop 6 C5.2 C++. - GNU make - http://www.gnu.org/software/make/ Optional when compiling Ecasound: - for extended file format support (aiff, snd, w64 and so forth): - libaudiofile (SGI audio file library) runtime, and/or - libsndfile - for higher quality resampling: libsamplerate - for pyecasound, the Python 2.7+ runtime - for curses support, the ncurses devel package - for LADSPA support, the LADSPA SDK package - for LV2 support, liblilv devel package newer than 0.5.0 - for ALSA support, the ALSA devel package - for JACK support, the JACK devel package - for aRts support, the aRts C-API devel package - for inner loop optimizations (performance improvements), the liboil package - for Open Sound Control (OSC) support, liblo package Additional packages needed, when building Ecasound from a clean version control checkout: - automake - http://www.gnu.org/software/automake/ - autoconf 2.50+ - http://www.gnu.org/software/autoconf/ - libtool - http://www.gnu.org/software/libtool/ - pkg-config - http://pkg-config.freedesktop.org/wiki/ ----------------------------------------------------------------------- Installing ----------------------------------------------------------------------- You should first try installing Ecasound from a binary package (files in rpm, dpkg, etc format -- depends on your system). On some systems Ecasound is part of the distribution and can be installed easily with tools such as apt-get, yum and others. This is probably the easiest and most straightforward way to install Ecasound. If you need to compile Ecasound, the file 'INSTALL' contains detailed instructions on how to do this. ----------------------------------------------------------------------- Documentation ----------------------------------------------------------------------- Ecasound documentation is updated whenever new features are added or existing features are modified. Some things are not documented in great detail, but on the other hand, documentation is kept up-to-date. So in short, correctness over volume. The primary documentation sources are: - Ecasound User's Guide - Ecasound Programmer's Guide - Ecasound Control Interface Guide - manual pages - ecasound(1) - ecatools(1): ecaplay(1), ecaconvert(1), ... - ecasound-iam(1) - ecasoundrc(5) - misc HTML-formatted docs (Documentation/*.html) - command line help - ecasound --help Probably the best place to start is the examples section of Ecasound's HTML-documentation (Documentation/examples.html). ----------------------------------------------------------------------- Mailing lists ----------------------------------------------------------------------- - ecasound-list at lists dot sourceforge dot net: A general discussion forum for developers and users of Ecasound and related tools. Announcements of new versions, bug warnings, etc will be posted to this list. If you have problems compiling, installing or using Ecasound, this is a good place to ask for help. Reports of working software/hardware combinations are also welcome. You can browse the message archives at http://nosignal.fi/ecasound-list/ You can join the lists using the following web front-end: http://nosignal.fi/ecasound/mlists.php - linux-audio-announce at lists.linuxaudio.org Announcements of Ecasound releases will, in addition to ecasound-list, be sent to the linux-audio-announce list. See the list home page at http://www.linuxdj.com/audio/lad/subscribelaa.php for more information. ----------------------------------------------------------------------- Reporting bugs ----------------------------------------------------------------------- See the 'BUGS' files. ----------------------------------------------------------------------- Web sites ----------------------------------------------------------------------- Ecasound home site - http://nosignal.fi/ecasound Download releases - http://ecasound.seul.org/download/ (primary site) - http://ecawave.sf.net/download/ (mirror) - http://nosignal.fi/download/ (mirror) Eca projects portal (links, apps based on Ecasound, etc) - http://nosignal.fi - http://ecasound.seul.org (US mirror) - http://ecasound.sourceforge.net (another US mirror) Examples of real-life Ecasound usage - http://nosignal.fi/ecasound_users.html ----------------------------------------------------------------------- About free open-source software (FOSS) development ----------------------------------------------------------------------- You should keep in mind that FOSS [1] development process differs greatly from closed commercial development. Active participation, both from developers and users, is what pushes a FOSS project forward. Every successful FOSS project has an active userbase behind it. This means that your comments, ideas and bug reports are extremely important. If something does not work, or some feature is missing, be active. Either try to fix the problem yourself, or report it on the ecasound-list mailing list. [1] Although Ecasound is free software (http://www.gnu.org), it also fits the definition of open-source software (http://www.opensource.org/). Although the two initiatives have different goals, they also share a lot in common. The term FOSS is used to refer to both of them, while still acknowledging the difference between the two. ----------------------------------------------------------------------- How stable is stable? ----------------------------------------------------------------------- Although publically released versions are called stable, this is not a guarantee of any kind. Before releases, a small set of test cases is run to verify that all basic features are working. The developers also use the very latest versions themselves, so hopefully at least all obvious bugs are found before stable releases are made. But otherwise no guarantees are given. On the other hand, as Ecasound is free software, you have the possibility to review the code yourself, perform tests, and fix any bugs you might find, or get someone to fix them for you. In the end you have the control. The more people there are involved in Ecasound development, testing and related discussions, the better Ecasound will become! ----------------------------------------------------------------------- Authors ----------------------------------------------------------------------- See the file 'AUTHORS'. ----------------------------------------------------------------------- Thanks to ----------------------------------------------------------------------- DotCX (www.nic.cx) For providing 'eca.cx' domain free of charge 2000-2004. SEUL (www.seul.org) For hosting Ecasound CVS, ftp, and http services since 1999. SourceForge.net For hosting Ecasound, Ecawave and Ecamegapedal ftp and http mirror sites since 1999. Wakkanet Oy (www.wakkanet.fi) For various hosting services 1999-2004. Linux-audio-dev community Always a great source of inspiration! Special thanks to Paul Davis, who has kept on pushing Linux audio forward all these years. Endersz, Viktor For sending me the adv.compressor source code! Phillips, Dave The 'Linux Sound & MIDI' website was the reason why I initially got interested in Linux audio! And of course, to all the contributors (see the file 'AUTHORS') and to users who have given feedback, ideas and helped with testing! ----------------------------------------------------------------------- Licensing/distribution policy ----------------------------------------------------------------------- Copyright (C) 1997-2020 Kai Vehmanen and others (see the file 'AUTHORS' for full list of copyright holders). Ecasound is freely distributable according to the terms of the GNU General Public License (see the file 'COPYING.GPL'). This program is distributed without any warranty. See the file 'COPYING.GPL' for details. As an exception to the above, the C, C++ and python implementations of the Ecasound Control Interface (ECI) are licensed under the LGPL (see the file 'COPYING.LGPL'). This allows writing ECI applications that are not licensed under GPL. ======================================================================= ecasound-2.9.3/INSTALL0000644000076400007640000002411111262077361011314 00000000000000======================================================================= *** Ecasound - INSTALL *** ======================================================================= The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It also creates the file `config.h' in the top-level source directory. This file contains system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Type `make install' to install the programs and any data files and documentation. 4. If you have not specified an alternative install prefix with --prefix option, make sure that you have `/usr/local/lib´ in your `/etc/ld.so.conf' and then run `/sbin/ldconfig´ (as root). 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Ecasound specific options ========================= `--enable-all-static' Build static binaries that are not linked against any shared libraries. Disabled by default. Note! This is an experimental option and may not work in all circumstances. `--enable-debug' Disables optimizations and other things preventing efficient debugging. Created executables and libraries have a "_debug" suffix. Disabled by default. `--enable-experimental' Turns on some suspicious features. Not recommended. Disabled by default. `--enable-python-force-site-packages' Force install of python modules into site-packages directory even when it doesn't exist. Disabled by default. `--enable-sys-readline' If installed, link to system's default libreadline. Disabled by default. `--disable-alsa' Don't compile support for ALSA-drivers (otherwise links to libasound). By default ALSA support is enabled if all the necessary header and library files are found. `--disable-arts' Don't compile aRts client support. See http://www.arts-project.org for more info about aRts. By default aRts support is enabled if all the necessary header and library files are found. `--disable-audiofile' Don't link to libaudiofile. By default libaudiofile support is enabled if all the necessary header and library files are found. `--disable-dbc' Don't check design-by-contract assertions. Enabled by default. `--disable-effects' Build ecasound without effect and controller components. Enabled by default. `--disable-jack' Don't compile JACK client support. See http://jackit.sf.net for more info about JACK. By default JACK support is enabled if all the necessary header and library files are found. `--disable-libsamplerate' Don't compile libsamplerate support. See http://www.mega-nerd.com/SRC for more info about libsamplerate. By default libsamplerate support is enabled if all the necessary header and library files are found. `--disable-ncurses' Don't link against ncurses (known bug: even if this is specified, you're still required to have a working ncurses/termcap installation to compile). Enabled by default. `--disable-oss' Don't compile support for OSS-drivers. Enabled by default. `--disable-osstrigger' Disable the use of OSS trigger functions. Enabled by default. `--disable-sndfile' Don't link to libsndfile. By default libsndfile support is enabled if all the necessary header and library files are found. `--disable-largefile' Explicitly disable large file (>2GB) support. `--with-jack=JACK_PREFIX' Enable JACK support and compile against JACK installed in 'JACK_PREFIX'. `--with-libsamplerate=LIBSAMPLERATE_PREFIX' Enable libsamplerate support and compile against libsamplerate installed in 'LIBSAMPLERATE_PREFIX'. `--enable-pyecasound={c,python,none}' Enable pyecasound and select which implementation to use. Default value based on target platform. `--with-python-includes=DIR' Python include files are located in 'DIR'. `--with-python-modules=DIR' Python modules should be installed to 'DIR'. `--enable-rubyecasound={yes,no}' Enable rubyecasound. Defaults to yes if Ruby interpreter is found on the system. `--with-extra-cppflags=ARG´ Pass extra options to preprocessor (cpp). This option should be used to add non-standard header paths to the search path. `--with-extra-libs=ARG´ Pass extra options to linked (ld). This option should be used to add non-standard library paths to the search path, as well as additional libraries to link against. Supported automake/autoconf features ==================================== Ecasound uses the autotools (automake, automake and libtool) build system framework. Standard practises (see below for references) are followed where applicable. Some features offered by the autotools do not work without explicit support from the package. Following is a short list of features that Ecasound _does_ support. If you encounter any problems in using these features with Ecasound, please report them as bugs. 1. Building Ecasound in a directory separate from the source directory. Example: "mkdir objdir ; cd objdir ; ../configure ; make" 2. 'uninstall' make target You should be able to uninstall Ecasound by running "make uninstall". Note that if you override any make variable when running "make install", you should specify the same variables also when running "make uninstall". Reference: Automake manual (see below) 3. 'DESTDIR' make variable for staging installs Reference: http://sources.redhat.com/automake/automake.html#Install 4. 'prefix', 'datadir', pkgdatadir' make variables You should be able to override any of the make variables on the make command-line. But remember to always override the same variables when you switch between make targets (see notes on (2)). Example: make prefix=/tmp/ecasound-foobar install 5. Overriding CPPFLAGS, CFLAGS, CXXFLAGS, etc variables. It is possible to override these parameters both before running the configure script (specify new values as environment variables), or at make time (specify new values on the make command-line). Note that these mechanisms are exclusive to each other. To specify extra preprocessing and compile flags that are applied when building libecasound components, but not when building the test programs run by 'configure' script, one can use the environment variables ECA_S_EXTRA_CPPFLAGS and ECA_S_EXTRA_CFLAGS (define before running 'configure'). General references: o Automake manual http://sources.redhat.com/automake/automake.html o Autoconf manual http://www.gnu.org/software/autoconf/manual/ o GNU Coding Standards http://www.gnu.org/prep/standards/ Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. ecasound-2.9.3/NEWS0000644000076400007640000043206413606335651010777 00000000000000----------------------------------------------------------------------- ** Ecasound - User-visible changes (NEWS) ** ----------------------------------------------------------------------- About the version numbers... "vX.Y[.Z[.R]][+extraT]" : ------------------------------------------------------ X = major version - incremented after major redesigns and/or major new features Y = minor version - incremented when new features are added and/or changes in core code that impact many use-cases Z = micro version - incremented if major.minor version is not modified (optional) R = revision - urgent fixes to planned releases (optional) extraT - 'beta', 'pre' and 'rc' releases (optional) Quick overview of various sources of change info ------------------------------------------------ - NEWS. This file. - 2.8.0 and newer: a compact list of user-visible changes - 2.7.2 and older: details of all user-visible changes. - RELNOTES. The release notes file describe the most important changes in a bit more detail. This is maintained in the git tree and is sent as the release announcement mail. - For notes of previous releases: http://nosignal.fi/ecasound/relnotes/ - Version control history. Describes all changes in implementation. - https://sourceforge.net/p/ecasound/code/ci/master/tree/ - Library interface changes are documented in ChangeLog files (these are distributed along with the source code). Howto for reading the entries (2.7.2 and older): ------------------------------------------------ added/removed = a new/removed feature, interfaces, or new implementation of some feature changed = changed behaviour, modified implementation, APIs, etc fixed = fixed bugs, "features" and other sources of problems *********************************************************************** 11012020 (v2.9.3) -** stable release **- - changed: python3 support to all ecasound python modules, including ECI (pyecasound) and ecamonitor - changed: the C python module implementation of ECI was removed (it was deprecated in 2.9.0 in 2012) -- python apps can use ECI using the pyeca.py module as before - changed: python3 support to ecamonitor, python2.7 new minimum requirement - fixed: configure check for LV2 updated to use "lv2" instead of deprecated "lv2core" - fixed: bugfix to LADSPA plugin port capability parsing - fixed: rubyecasound - silence continuous warnings about use of deprecated Object#timeout interface 16062019 (v2.9.2) -** stable release **- - changed: compiler hygiene -- C++ builds now pass "-std=c++98" by default as ecasound codebase does not use any c++11 features but codebase uses some features that are marked deprecated in c++11 and will be removed in c++17, so better start preparing for that - changed: update config.guess and config.sub to latest version (2019-06-10 and 2019-05-29) - fixed: in some cases (especially in TCP server mode), cop-set/ctrlp-set/c-mute/c-bypass/cop-bypass caused a full chain reinit, which depending on chain complexity caused a severe glitch in realtime operation - fixed: use of obsolete automake and ruby interface [ghedo] - fixed: LV2/liblilv build errors due to use deprecated Lilv::Instance::Instance - fixed: compiler warnings triggered by gcc-4.7.2 and newer - fixed: -ei with output to a ALSA/OSS device was broken in 2.9.1; output to JACK with -ei continues to be unsupported, see BUGS - fixed: default mpg123 launch command change to omit "-b 0" as that caused an error with mpg321 - fixed: alsa - do not ignore small differences in effective sampling rate without a warning with ALSA devices - fixed: alsa - fix xrun warning message, the xrun duration has been miscalculated incorrectly with all current versions of ALSA (ever since clock_monotonic became the default for trigger tstamp) 03012014 (v2.9.1) -** stable release **- - changed: configure.in renamed to configure.ac as automake 2.0 will drop support for configure.in [ghedo] - changed: ecatools now accepts file names with commas [ghedo] - changed: build with -D_XOPEN_SOURCE=600, see http://www.unix.org/version3/single_unix_v3.pdf and http://www.unix.org/version3/ - fixed: compilation errors with Mac Xcode 5.x versions that have dropped llvm-gcc support, reported by Brett Koonce - fixed: multiple bugs with ai-remove and ao-remove; reported by Rocco - fixed: multiple issues wih ALSA draining (playing the last samples at the end) code added to 2.8.0; reported by Knut Petersen - fixed: silenced invalid dbc/runtime warnings from audioio-seqbase.cpp; reported by Julien Claassen - fixed: -t:x inaccuracy that increased with larger buffersizes; reported by Knut Petersen 09062012 (v2.9.0) -** stable release **- - note: tested to build with the new gcc-4.7.0 - added: LV2 support using liblilv [jeremysalwen]; sffeat:2541460 - added: 'stop-sync' command to interactive mode, a syncronous stop call that blocks until engine has halted - added: 'cop-bypass' and 'cop-is-bypassed' commands added - added: 'c-is-muted' and 'c-is-bypassed' commands - changed: new params to 'c-mute' and 'c-bypass' - changed: pyeca - now requires python 2.4 or newer; fixes sfbug:3059303 - changed: removed ecasound.spec file from distribution - changed: flush chainop internal state when position is changed with a seek (setpos et al) - changed: cop-remove and ctrl-remove - fixed: resample, commas in filenames not handled correctly - fixed: bug in map-ladspa-list output, param names not printed out correctly - fixed: bug in RIFF header generation, incorrect chunk size - fixed: bug in saving jack input/output params - fixed: seeks with -kf did not work, sfbug:2013828 - fixed: seeks with -kog did not work, sfbug:2013824 - fixed: sndfile, seeking beyond end-of-file for inputs - fixed: regression with stop+start and -z:db 22052011 (v2.8.1) -** stable release **- - fixed: jack_multi did not work correctly when connecting to a single port - fixed: bugfix to mp3/ogg/aac output 11052011 (v2.8.0) -** stable release **- - note: NEWS format changed, see 01012011 meta entry below - changed: do not use deprecated jack_client_new() - changed: simplified signal handling for not-so-POSIX platforms - fixed: seeks with -klg did not work - fixed: bug in int-float conversions - fixed: some false DBC warnings removed - fixed: bug in setting jack_multi channel count - fixed: bug in signal handling caused rubyecasound scripts to fail (e.g. ecasound's own stresstest.rb) - fixed: at end of playback, properly wait until all buffered samples have been played out to ALSA devices - fixed: bug with live seeks and -z:db buffering; caused problems to e.g. JACK transport slaving and live seeks (repositioning without stopping transport) 01012011 meta: notes on provided change information in this file - the release entries will be shorter from now on, only listing the affected features (e.g. which objects), and type of change (addition, change, bugfix) - see RELNOTES and git commit history for a more detailed description - author tags will no longer be used, [foobar] used to indicate the author of the change, unless it was from someone from the main author(s); README still lists all the developer tags used; instead git history shows who did what 19082010 (v2.7.2) -** stable release **- - added: manual gate (-gm); see ecasound(1) man page - changed: liboil now enabled by default if the library development files are available when running configure - fixed: bug with 'resample' objects and early seeks (e.g. with '-y' offsets); reported by Artur - fixed: bugs in kvutils that broke some old/non-glibc builds (e.g. cygwin); bug reported by Al Oomens - fixed: bugs in saving chainsetups with stacked audio objects ("audioloop", "select", "playat") 20022010 (v2.7.1) -** stable release **- - note: key changes are described in more detail at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_7_1_relnotes.txt - fixed: glitches in ALSA capture/playback with some sound hardware/configurations, and using alsa-lib older than 1.0.15; related to deprecated ALSA API function snd_pcm_sw_params_set_xfer_align() - fixed: bug in removing audio objects when disk double buffering is used (-z:db); could cause a segfault in some scenarios (e.g. with ecasignalview) - fixed: interactive mode; c-selected segfauls if issued with no chainsetup selected - fixed: build errors when no liblo is available - fixed: interactive-mode; cs-setpos, cs-rewind and cs-forward did not work if chainsetup was connected, and no chains (or an invalid chain) was selected; bug reported by Joel Roth - fixed: ecalength choked filenames with whitespace; patch from FUJI project (http://students.mimuw.edu.pl/~tk197881/a8cas/) 17102009 (v2.7.0) -** stable release **- - note: key changes are described in more detail at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_7_0_relnotes.txt - added: new exit code of '4' to ecasound; see entry below about signal handling changes and ecasound(1) for more details - added: -eadb chainop, like -ea/-eac, but gain given in dB; documented in ecasound(1) - added: -chorder chainop; see ecasound(1) - added: optional inner loop optimizations using liboil; enable with '--enable-liboil' - added: OSC support added, see ecasound(1) and Documentation/ecasound_osc_interface.txt; sffeat:2541462 - added: in ncurses mode, honor COLUMNS environment variable - added: configure - added '--with-extra-cppflags' and '--with-extra-libs' options - added: new 'cop-get' command; see ecasound-iam(1) [alinson] - changed: ecasound now defines "-D_XOPEN_SOURCE=500" for all builds, expressing that the codebase expects the build environment be compatible with the Single UNIX Spec v2 (1998); thanks to Jussi Laako for reminding about this - changed: yet another change to signal handling in ecasound; now two level response to signals is supported in all stages of process termination -> first starting normal cleanup and exit procudere, and with second signal terminate immediately; see ecasound(1) for the full story (new 'SIGNALS' section) - changed: dropped "-funroll-loops" from the set of default compiler options - changed: comment out many entries in the global installed 'ecasoundrc' file (entries are redundant as the same defaults are already set in the program binaries) - changed: optimized inner loops in core chain routing and mixdown functions (with liboil if available) - changed: optimized inner loops of -ea, -eadb, -eac, and -epp - changed: dropped tracking of 'clipped samples' from -ev as the results were of little use (and misleading) - changed: '-ev' status output - changed: cosmetic changes to the default ncurses trace output; reduced number of subsystem-level trace messages - changed: the name for default chainsetup created from command line is now "untitled-chainsetup" - changed: do not automatically connect chainsetups loaded with '-s' - fixed: mp3 output was broken with lame 3.98 (and newer); the default lame parameters have now been updated and have been tested with lame 3.96, 3.97 and with the latest 3.98.2 - fixed: bad audio with 'resample' object, non-integer sampling rate change ratios and output to JACK; ecasound did emit warning about this, but did not raise a fatal error; now the underlying problem is fixed and now 'resample' and 'jack' objects maybe safely used together - fixed: minor bug in ecamonitor; "cop-status" was used with multiple chains selected - fixed: don't use '--ignore-fail-on-non-empty' rmdir option as it is not available on many platforms (e.g. OS X) and this breaks the uninstall target; sfbug:2772628 - fixed: bug in ecasound frontend parser for '-E' option that broken passing arguments containing the substring "-E"; introduced in 2.5.2 release - fixed: stale audio was written to JACK output ports in case of multiple streams, connected to different JACK ports, reaching end-of-stream at different times [jedahu] 08022009 (v2.6.0) -** stable release **- - note: key changes are described in more detail at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_6_0_relnotes.txt - added: new optional params to 'jack' -> 'jack,clientname,portprefix'; replaces old interfaces 'jack_auto', 'jack_generic' and 'jack_alsa'; see ecasound(1) for more details - added: interactive mode - new commands 'jack-connect', 'jack-disconnect' and 'jack-list-connections'; see ecasound-iam(1) for details; closes sffeat:2134183 - added: 'jack_multi', see ecasound(1); closes sffeat:1415822 - added: ecasound options '--server', '--server-tcp-port' and '--no-server'; these replace the misleading old options '--daemon', '--nodaemon' and '--daemon-port', which are now deprecated - added: extended unit tests to cover option parsing, with some initial test cases - added: unit test framework - minor improvements including abilitity to select which cases to run - added: ECI - functions eci_ready() and eci_ready_r() added to ecasoundc.h, and ECA_CONTROL_INTERACE::ready() to the C++ API - changed: deprecated 'jack_auto', 'jack_generic' and 'jack_alsa' - changed: numbering of JACK ports created with 'jack' and 'jack_generic' starts from "_1" separately for each prefix [dsacre] - changed: deprecated 'ai-wave-edit', 'ao-wave-edit' commands and the 'ext-cmd-wave-editor' ecasoundrc field - changed: emit a 'subsystem' level trace message when engine state changes to finished - changed: interactive mode - minor update to 'status' command output - changed: compile libecasoundc as PIC code to make it possible to use it from shared libraries; fixes problems with e.g. Audio::Ecasound on amd64 architecture ; closes sfbug:2505551 - changed: ecasound option -f now accepts empty arguments for sample format, channel count and sampling rate; empty argument states that ecasound can pick a suitable value, either the default value or e.g. the JACK system sampling rate; updated documentation, see ecasound(1) - changed: minor update to ecasound's "--help" - changed: when reading RIFF WAVE files, properly ignore any unknown subchunk types - changed: largefile support (+2GiB files) is now enabled by default and configure uses's default autoconf macro AC_SYS_LARGEFILE to perform the checks; to explicitly disable, use '--disable-largefile'; the old '--with-largefile' no longer has any effect - changed: refactored ECI C impl code to get rid of all fixed size buffers from the parser; this makes the implementation more robust, reduces memory usage and provides a small speed-up to most ECI apps; closes sfbug:1412409 - fixed: do not limit max-gain reported by '-ev' to [1,max] value range - fixed: avoid denormal numbers in '-ete' (leads to unusually high CPU load) - fixed: 'dump-cop-value' did not work as documented - fixed: ECI - signal an error (e.g. eci_error() returns true) if connection is lost to engine process (sync lost or an other error) - fixed: ecasignalview - exit if engine reports an error during operation - fixed: interactive mode - loop devices saved with incorrect syntax, affects cs-save, cs-save-as and cs-edit ; see http://nosignal.fi/ecasound-list/2009/01/0058.html - fixed: problems when seeking back to start with setups using loop devices; closes sfbug:2527049 - fixed: segfault if using a tone generator input with a fixed lenght, and a seek past the end of stream was performed - fixed: aac/ogg/mikmod/mid inputs - once object reached state 'finished' (all samples played), it cannot be played again by reconnecting the chainsetup - fixed: combination of '--server' and '-C' (disable interactive mode) had a bug that prevented processing of commands received over the server socket while the engine was running the batchmode - fixed: a nasty bug in 'playat' implementation causing audible artifacts ; see http://nosignal.fi/ecasound-list/2009/01/0089.html - fixed: sndfile and audiofile backends - emit a warning if a seek fails (e.g. when seeking beyond current end-of-file for output objects) - fixed: various improvements and fixes related to using non-seekable audio objects (especially interactive use); in most cases this means graceful recovery from failed seek attempts, and correct reporting of the objects actual current position - fixed: error is emitted if trying to use 'select' with objects that do not support seeking - fixed: bugs with passing 'auto' as the 2nd parameter of 'resample' - fixed: bug with seeking resampled audio objects - fixed: bug in combined use of 'audioloop' and 'resample' - fixed: catch and warn about various errors cases when given incorrect or missing params to audio types: typeselect, resample, reverse, playat, audioloop, select 24082008 (v2.5.2) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_5_2_relnotes.txt - fixed: bug in channel routing of LADSPA plugins that have more audio output ports than input ports 21082008 (v2.5.1) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_5_1_relnotes.txt - fixed: a last minute change in 2.5.0 that caused build errors with gcc-4.3.1 if ALSA support is disabled - fixed: a change in 2.5.0 how process cleanup is initiated from the signal handler caused severe problems on some systems when ecasound was interrupted with e.g. ctrl-c/SIGINT; worst case was a crashed X session which is of course really, really bad - fixed: a bug in registering LADSPA plugins; on some systems not all found plugins were registered properly to ecasound's object maps causing some plugins to be unusable; errors 16082008 (v2.5.0) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_5_0_relnotes.txt - notice: slightly modified the version numbering scheme - minor version is incremented whenever non-trivial new features are added - notice: verified to compile with minimal warnings with gcc-4.3.1 - edi-entries: edi-40 closed (Update to error and warning reporting mechanisms), edi-38 closed (see edi-7 partially implemented - added: ecasound.el: added missing ECI commands cs-option, cs-set-length, cs-set-position-samples, ai-get-length, ai-set-position, and ai-set-position-samples [dto, mlang] - added: tone generator input; '-i:tone,sine,440,10.3' will create a 440Hz sine tone with duration of 10.3 seconds; this input type will be especially useful for reproducing bugs in complicated chainsetups, without the need to exchange complete session data (which usually are composed of large amounts of audio data) - added: audio looper object; "-i:audioloop,foo.wav" will play 'foo.wav' and loop it indefinitely - added: audio selector object; "-i:select,5,15.2,foo.wav" will play 15.2sec of "foo.wav", starting at position 5sec; relates to (edi-7) - added: audio play-at object; "-i:playat,5,foo.wav" will start playing "foo.wav" after position reaches 5sec - added: EWF files; ability to specify positions in time in sample frames; "2.0" is interpreted as 2.0secs while "88200sa" is interpreted as 88200 samples - added: 'reopen-count' parameter to threshold gate (-ge); for instance when recording vinyl/tapes, this allows to automatically restart recording when a new track is started [andrewl] - added: ecasound frontend option '-E "cmds"' that allows to run a set of interactive mode commands at startup; see ecasound(1) for details; closes (edi-38) - added: a notice is printed in case audio object's audio format parameters differ from the chainsetup's default values (audio object's own params always override any value set by e.g. '-f:...'). - changed: most of the EWF support (Ecasound Wave Files, .ewf) has been rewritten in this version; numerous bugs are fixed - changed: eaim - commands 'cop-add' and 'ctrl-add' now allow an alternate syntax: both "-:par1,...,parN" and ":par1,...,parN" are now accepted - changed: ability to write to EWF file is now marked as a deprecated feature which will be removed in a later release - changed: mechanism to terminate forked child processes; properly wait for process termination in all circumstances (previously there were some unhandled corner cases) - changed: major updates to the examples.html page (available also at http://nosignal.fi/ecasound/Documentation/examples.html ) - changed: refactored logic for propagating seek events across chainsetups; warnings are now issued if one tries to seek objects that do not supports seeking; similarly warning is issued if a given audio object type doesn't support sample accurate seeks (for example mp3 inputs have this limitation) - changed: updated ecasound(1) man page description of '-klg' - changed: separate global (-d, -R, ...) and ecasound frontend specific (-c, --daemon, -s, ...) options in ecasound(1) man page - changed: changes to "cs-status" (aka "status", "st") output formatting; now more information about selected and connected setups is printed out - changed: minor changes to the information printed out when open audio input/outputs - changed: pipes, sockets and device nodes in LADSPA plugin directories are skipped (previously hidden files were already skipped) - changed: loop device identifier was changed from an integer to a generic string; both "-i:loop,1" and "-i:loop,myloop" are now valid - fixed: incorrect usage of the Python C API, which leads to segfaults when pyecasound is used under python2.5; fixes Debian bug #468965 - fixed: bugs in ewf-looping code - fixed: avoid terminating processing when invalid parameters are passed to channel copy (chcopy/erc), mix (chmix/erm) and move (chmove) chainops - fixed: eaim - buffering mode was sometimes incorrectly reported in 'cs-status' output (-B:auto instead of the actual set buffering mode) output; bug reported by Jan Weil - fixed: compilation warnings from GCC-4.3; fixes Debian bug #454890, patch from Cyril Brulebois - fixed: bug in passing multiple arguments to 'typeselect', 'resample', and 'resample' objects - fixed: with some glibc versions (tested with 2.3.6.ds1-13etch5), ecasound did not fully clean up all threads when it received a signal and terminated; the bug showed up as a stuck thread, with backtrace pointing to pthread_onexit_process() - fixed: compilation issue on Mac OS X 10.5 [grobian] - fixed: bug in saving control state with 'cs-save' or 'cs-save-as'; triggered if controller was followed by more chainops on the same chain - fixed: bugs with preserving state across seeks with many controller objects (-kl, -kl2 and -kos) - fixed: a bug in ecasound user's guide w.r.t. usage of loop devices - fixed: sloppy parsing of "-i:loop" and "-o:loop" arguments leading to confusing error messages when invalid input/output objects, containing the substring "loop" were passed as arguments to "-i" and "-o" 14082007 (v2.4.6.1) -** stable release **- - fixed: extra debugging, printed to stderr, for resource file values was accidentally left enabled in the 2.4.6 release 14082007 (v2.4.6) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_6_relnotes.txt - added: new option '-R:path-to-resource-file' to use a custom resource file and disable querying of global and user resource files; as a special case, by setting this to '/dev/null', one disable all access to resource files; requested by Klaus Schulz and Keith Creasy - added: eiam - new command 'resource-file'; see ecasoundrc(5) man page; related to previous item - changed: license of rubyecasound, the Ruby ECI API implementation, has been changed from GPL to LGPL - fixed: build errors caused by missing #includes, reported by GCC 4.3; bug report from Debian, bug #417178 - fixed: rounding errors with small buffersizes caused time crop gate (-gc) to function incorrectly; reported by Joe Planisky - fixed: force localization of decimal numbers to "POSIX" (i.e. use period as the separator) to avoid bugs with e.g. LADSPA plugins that call setlocale and break the ecasound option parser; for instance all swh-plugins call setlocale; reported by Rémi Rouaud - fixed: printing chain operator (e.g. the '-ev' operator) status at end of sessions was broken in 2.4.5; reported by Julien Claassen - fixed: bugs that led to infinitely running chainsetups when loop input/outputs were used; reported by Aaron Heller and Etienne Deleflie - fixed: incorrect page numbers in table of contents of the Ecasound Programmer's and User's Guides; patch from Junichi Uekawa - fixed: segfault when removing a chain operator with multiple associated controllers; reported by Adam Linson 07122006 (v2.4.5) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_5_relnotes.txt - added: ability to compile without a readline library (will disable the curses based console user-interface) - added: if libsndfile is found and supports flac (sndfile 1.0.12 or newer), it will be used as the default handler for flac files; use of sndfile makes random access for flac files possible (for example seeking in interactive mode) - added: section on 'RETURN VALUES' to ecasound(1) man page - added: ecasound-iam(1) - added documentation for error return values for 'run', 'start' and 'cs-connect' - added: ECASOUND_LOGFILE and ECASOUND_LOGLEVEL environment variables; see ecasound(1) for documentation - added: more detailed description of debug levels that can be set with 'd' to ecasound(1) manpage - added: examples section to ecasound(1), which points to the examples page at eca.cx/ecasound - added: new chain operators '-chmove' and '-chmute' - added: new aliases for chain operators: '-chmix' for '-erm', and '-chcopy' for '-erc' - added: ability to protect EOS arguments, like filenames, with double quotes, closes bug #1456510; see also the related BUGS entry about handling commas in filenames, and updated documentation in ecasound(1), ecasond-iam(1) and the User's Guide - removed: readline-4.0 subdir from the dist package; system readline library is now the only build option - changed: ecasoundrc - added "-f" to the default flac output exec command (although now libsndfile's flac support is the default) - changed: improved libsndfile integration, any libsndfile supported file format can be used as output for 'sndfile,foo.ext' (format selected based on filename extension) - changed: eiam - default int-log-history length set to zero - changed: updated config.guess and config.sub to more recent versions (timestamp 2006-07-02) - changed: updated the documentation for 'ai-select/ao-select', it is no longer required that input/outputs have a unique name within one chainsetup; problem reported by Kurt Konolige - changed: replaced the ECI C implementation's (libecasoundc) engine cleanup mechanism with a much more robust one - changed: the engine will now refuse to start if a start offset is given with '-y:secs' for an object not supporting seeking; this has been a very common source of end-user confusion - fixed: segfault when removing loop devices with a[io]-remove, reported by Pedro Antonio Fructuoso Merino - fixed: incorrect headers in created flac files (not related to sndfile/flac); fix can possibly affect other file formats handled by external apps (aac, midi, mikmod, mp3 and ogg files), problem reported by Florian Ladstaedter - fixed: errors during batch processing (running out of file space, etc) were not reported as a non-zero process return value, problem reported by Zrajm Akfohg - fixed: possible segfaults with ctrl-select, ctrlp-select and ctrlp-value [allies] - fixed: loop devices were not correctly saved with cs-save and cs-save-as [allies] - fixed: bug in handling big-ending 24/32bit samples [aheller] - fixed: ecasignalview build errors on cygwin [hawk777] - fixed: segfault when parsing "\" in interactive mode, reported by Koen [pfructuoso] - fixed: a subtle race-condition in the cleanup routines leading to segfaults when breaking a batch run with ctrl-c - fixed: bug causing audible glitching when seeking with chainsetups containing loop devices [pfructuoso] - fixed: "rw 0" caused the engine to skip ahead multiple seconds (reported by Kurt Konolige) - fixed: segfaults from invalid params to -f option, for example "-f:16" or "-f:16,2", reported by peppo on #lad at freenode.org - fixed: a severe string termination bug in libecasoundc that led to garbled output from ECI commands returning lists of strings, reported by Brad Bowman, Joel Roth and Stuart Allie 27012006 (v2.4.4) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_4_relnotes.txt - added: eiam - ai-describe, ao-describe, cop-describe and ctrl-describe commands; see ecasound-iam(1) - added: ecasignalview - ability to pass ecasound options -G, -B, -M*, -r and -z - added: BUGS file - added 'Reporting bugs' section - added: updated RPM spec-file for x86_64 support [grabner] - changed: minor changes to ecaplay console output - changed: ECI C impl. - increased the time engine has for processing ECI commands; fixes problems with the 'cs-disconnect' command with complex setups involving connections to external resources such as jackd - changed: error is raised if one tries to add chainops or controllers when multiple (or zero) chains are selected - changed: increased size of buffers used by the ECI-C parser (sfbug:1412409) [allies] - changed: it's now possible to set initial values for operator parameters controlled by MIDI-CCs - fixed: compile-time bug in ecasignalview.cpp - fixed: saving chainsetups in cases where a ctrl is connected to a effect preset - fixed: DBC_CHECK failure from eca-chainsetup.cpp when running cs-edit on a non-connected chainsetup - fixed: bug in seeking mp3 files - fixed: eiam - 'c-select' caused a segfault if no chainsetup was selected - fixed: -etf:0 caused a segfault - fixed: severe bug in mixdown code - in cases where an input is connected to multiple chains, and one or more inputs have reached end of stream, the resulting mix is not handled properly - fixed: bug in freeing references to buffers in effect preset code; triggered by externally terminating an ecasound session containing preset objects (sfbug:1412200) - fixed: ECI-C memory access errors reported by valgrind - fixed: allow commas in ecasignalview input/output params; makes it again possible to specify ALSA devices, etc 21082005 (v2.4.3) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_3_relnotes.txt - added: support for ALSA sequencer support; see ecasound(1) and examples.html [pedrolc] - added: runtime warning about possible problems when mixing resample and jack objects - changed: scheduling changes for MIDI and disk i/o subsystems; possibly affects performance in certain use-scenarios; fixes debian bug #317900 - changed: updated config.guess and config.sub to more recent versions (timestamp 2005-04-22) - fixed: failed runtime check from eca-fileio-stream.cpp:159 - fixed: eiam - ao-remove'ing JACK input/outputs caused a segfault - fixed: --disable-jack/--enable-jack did not work - fixed: system-hangs when run in realtime mode and using a large disk i/o double-buffer (-z:db) - fixed: ewf-debugging output was left enabled in 2.4.2 release - fixed: bug in detecting finished-state with .ewf files when used with -z:db mode enabled -> caused flood of underrun warnings with multi .ewf file sessions - fixed: externally terminating, e.g. via JACK transport system, a batch chainsetup would cause a segfault 07082005 (v2.4.2) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_2_relnotes.txt - note: verified to compile ok with gcc-4.0.0 and gcc-4.0.1 [kaiv] - added: eiam - ctrlp-list, ctrlp-selected, ctrlp-get, ctrlp-select and ctrlp-set commands; the last two are RT-commands; see ecasound-iam(1) for more info [allies] - added: ecasignalview - ability to reset stats with 'spacebar' and quit with 'q/Q/Esc'; separate logarithmic mode (enable with -L, see also -I which is still the default); display of per-channel average amplitude; see ecasignalview(1) man page for details [jeffrey] - added: ecatrimsilence.sh to examples subdir [kaiv] - added: --keep-running (or -K) option to ecasound, do not exit from batch mode when processing is finished/stopped; especially useful when used in combination with JACK inputs/outputs [kaiv] - changed: various small updates to User's Guide [kaiv] - changed: ecasound user-visible copyright string changed [kaiv] - changed: minor changes to ecasignalview user-interface [jeffrey,kaiv] - changed: --daemon-mode does not anymore require running in interactive mode [kaiv] - fixed: using ecasound.spec with recent versions of rpm results in a "%package debuginfo" error [kaiv] - fixed: problems in saving ewf objects with cs-save, cs-save-as and cs-edit [kaiv] - fixed: controllers were always added to the last chainop, not to the selected chain operator [allies] - fixed: --enable-jack and --disable-jack both disabled JACK support [kaiv] - fixed: serious bug in the "reverse" audio objects, caused audible noise in the reversed signal [kaiv] - fixed: segfaults at exit when LADSPA plugins had been used; the error did not happen every time and with every type of plugin; problem was a race between atexit handlers of ecasound, and the dynamically loaded plugins [kaiv] - fixed: ecasignalview - do not send or receive transport events [kaiv] - fixed: ecasound daemon mode, correctly print hostnames without resolvable hostname 08042005 (v2.4.1) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_1_relnotes.txt - note: verified to work with automake versions 1.6 and 1.9; automake 1.5 and older, as well as autoconf versions older than 2.50, are no longer supported; these changes only affect users of Ecasound CVS checkouts - added: ecaplay - better error reporting, feature to reset output device audio parameters for each new input file, support for ECAPLAY_OUTPUT_DEVICE environment variable; see ecatools(1) for more info - added: playlist mode to ecaplay (new -q, and -p options; see ecaplay(1) for more info) - added: "Supported automake/autoconf features" section to the INSTALL file - added: new presets to the default effect_presets file - added: support for describing full range of preset parameter flags with -ppt (see effect_presets file and the relevant sections in User's Guide) - added: new sections on preset parameters to User's Guide - added: allow reseting ecasignalview max-peak and clipped-samples counters by sending a SIGHUP to the process - changed: moved definitions from acconfig.h to configure.in; gets rid of the AC_DEFINE warnings produced by recent versions of autoheader - changed: Ecasound Programmer's Guide converted from LaTeX to ascii/rst - changed: sed is used to generate ecasoundrc at make; allows to specify a custom pkgdatadir when running make [junichi] - changed: various small improvements to all ecatools and the related manpages - changed: updated config.guess and config.sub to more recent versions (timestamp 2005-03-24) - changed: various updates to the README file - fixed: sources for the aRts plugin were not present in the 2.4.0 release package - fixed: mp3-header parsing code has been partly rewritten; the new parser is designed to better handle garbage and unknown frame types in mp3 files [juliand,kaiv] - fixed: compile errors with egcs-2.91.66 - fixed: current position of the time crop gate (-gc) was incorrecly increased [alexey] - fixed: compilation failed if building outside srcdir - fixed: ECI C impl. did not properly release all file handles in eci_cleanup(); for example playing thousands of files with ecaplay would cause the system to run out of file descriptors (too many open files error) - fixed: bug in handling LADSPA plugins with colon chars in their port descriptions (such as the SC1-4 compressors) - fixed: do not print "Session created" even if -q option has been given (quiet output mode) 12032005 (v2.4.0) -** stable release **- - more verbose description of change available at: http://nosignal.fi/ecasound/relnotes/ecasound_v2_4_0_relnotes.txt - edi-entries: edi-40 progress - added: support for having commas in arguments by escaping them with a backslash (example: "ai-add foo\,bar.wav") - added: pretty-printing of ecasound output; wrap output so so that all lines fit into 74 columns; does not affect wellformed output mode nor stderr output (-D) - added: new section about handling commas in filenames to Ecasound User's Guide - added: eiam - new 'int-log-history' command to query recent log messages sent by libecasound; this is a very useful tool for debugging ECI scripts and apps - added: eiam - new 'int-set-log-history-length' command to set log history length; default to 5 items - added: resample-lq (low-quality) audio object to force using the internal resampler even though support for libsamplerate is enabled at build time - added: support for sum-mixmode; enabled with -z:mixmode,sum; the old average mixing is still the default; see ecasound(1) - added: ecasoundrc - 'mix-mode' setting; see ecasoundrc(5) - changed: more helpful messages to explain why a chainsetup cannot be connected to the engine - changed: EIAM - when returning a list of strings, all commas in list elements are now escaped with backslashes; this is done to avoid ambiguity in parsing - changed: new default debug level of 271 - changed: new optimized message queue implementation used in communication between the engine and the interface subsystems; solves a few remaining corner cases where ecasound could block in real-time critical code-paths - changed: better error message if unable to load LADSPA plugin with -el/-eli - changed: removed hard upper-limit for -ei scale-factor, modified both the upper and lower soft limits - changed: updated config.guess and config.sub to more recent versions - fixed: correctly interpret EIAM command arguments containing whitespace (example: "ai-add foo bar.wav") - fixed: denormal problems in filter and delay operators - fixex: setting radius params of -etc comb filter - fixed: make check target failed in readline-4.0 subdir - fixed: avoid segfault when receiving a bufsize or srate change event from JACK; ecasound still cannot change bufsize or srate on the fly, but at least it now fails gracefully - fixed: always pass filename (%f) as one parameter to the external apps; fixes bug present in 2.3.4 and 2.3.5 releases which broke handling spaces in filenames; affected all file formats handled via external tools (ogg/mp3/flac/m4a/...); also a separate bug in handling spaces in ogg output filenames was fixed - fixed: occasional bugs with rubyecasound in handling the EIAM 'quit' command; this also fixes the errors in running 'make check' in ecasound/rubyecasound - fixed: serious bugs in resampling between 96000 and 44100/48000 rates when using libsamplerate; upgraded Ecasound to use the libsamplerate 'full API' - fixed: options "-b:", "-b" and "-b:0" caused a segfault - fixed: aac/m4a encoder was not stopped properly after processing was finished 12112004 (v2.3.5) -** stable release **- - note: main website address has changed to www.eca.cx/ecasound - changed: collected all email addresses from source files to the AUTHORS file and added some antispam measures - changed: do not raise an error when opening an OSS device that does not support SNDCTL_DSP_GETBLKSIZE - changed: updated all the html-docs to match the new website style - fixed: default to native-python ECI implementation on MacOSX - fixed: link against coreaudio libs if JACK enabled on MacOSX - fixed: ecasignalview build error if compiling without ncurses [mb] - fixed: bug in ecasound/rubyecasound 'make check' target 27102004 (v2.3.4) -** stable release **- - edi-entries: edi-14 and edi-32 closed, edi-40 added - note: verified to compile ok on MacOS X 10.3.2 [smbolton] - note: verified to compile ok with gcc-3.4.1 - added: basic FLAC input/output support using flac utils; new flac specific options to ecasoundrc - added: basic AAC/M4A/MP4 input/output support faac/faad utils; new options to ecasoundrc - added: optional 3rd parameter to 'sndfile' for specifying audio file format (see ecasound(1)) [jesse] - added: documentation on adding new EIAM commands to the programmer's guide - added: eaim - new 'int-set-float-to-string-precision' command - changed: set srate for mp3 input based on mp3 header - changed: increased precision of floating point return values in the C ECI implementation - fixed: multitrack offset was calculated incorrectly for ALSA devices which limit buffer period count to 2 - fixed: bugs in .wav, .cdr, JACK code, and in internal sample conversion routines that occur on big-endian machines [smbolton] - fixed: ogg input failed if requested sample-format had non-native endianess; new default-cmd for ogg-input, see ecasoundrc(5) - fixed: build failed on MacOSX/freebsd because of undefined mlockall and related defines - fixed: errors in ecasound(1) man page and the examples.html; adding chain operators to multiple chains at once is not supported anymore - fixed: engine state not fully updated after a 'run' command has completed; caused commands such as 'cs-set-position' to fail when used after 'run' - fixed: ecasound sample formats s24_le/_be were mapped to 4-byte ALSA formats S24_LE/_BE; now mapped to the correct 3-byte S24_3LE/_3BE formats - fixed: bug in C ECI impl that caused sync-loss errors between ECI clients and the engine [jesse] - fixed: ECI session corruption after processing 'long int' return values [jesse] 05052004 (v2.3.3) -** stable release **- - note: verified to compile ok with gcc-3.4 - added: eiam - 'map-ladspa-id-list' command - added: special-case value of '-1' to 'cs-set-length' or '-t:xxx' will set the chainsetup length according to the longest input object - added: ECI guide - a new section on ecasound.el [mlang] - added: ecasoundrc - a new special-case value 'autodetect' to the 'default-output' setting; 'autodetect' is also the new default ecasoundrc value; see ecasoundrc(5) for details - changed: lots of typo fixes and other corrections to the user's guide [ericdr] - changed: minor configure.in cleanup relating to handling CFLAGS, CXXFLAGS and LDFLAGS - fixed: building against libsndfile-1.0.4 and older; if libsndfile older than 1.0.0 is detected, sndfile support is disabled altogether - fixed: bug in ECI C impl that could cause segfaults [mewe] - fixed: signal handling bugs in ecasignalview and ECI C impl [mewe] - fixed: bug in ecasound(1) caused man to not show the last three pages - fixed: bug in the daemon-mode (NetECI) protocol parser that caused parsing long (over 32 chars) commands to fail - fixed: 'libecasound-config --libs' did not list all external libraries used - fixed: assign default param-names to effect presets - fixed: preset parameters were not saved by 'cs-save' and 'cs-save-as' 06122003 (v2.3.2) -** stable release **- - edi-entries: edi-33 closed - added: support for libsndfile; enabled if libsndfile is detected succesfully by configure; can be disabled with --disable-sndfile - added: added new audio input/output types 'audiofile', 'sndfile' and 'mikmod'; see ecasound(1) for more details - added: pyecasound/test2_stresstest.py new test case - added: initial Ruby ECI impl added; see rubyecasound/README for details [janweil] - added: --enable-rubyecasound configure option; defaults to yes if ruby interpreter found on the system - added: resampling examples to Documentation/examples.html - changed: increased default buffer sizes for 'rtnull' objects to avoid too many xrun warnings; warnings are also no longer printed to stderr - instead a summary is printed at the end of the session if any xruns have occured - changed: Ecasound PDF docs (user's, programmer's and ECI guides) are now generated using AE fonts; the PDFs can now be read with readers like xpdf and probably look better in others [janweil] - fixed: pyecasound/test1_stresstest.py was not included in the dist package - fixed: libaudiofile - input file audio parameters parsed incorrectly - fixed: -x option - truncate outputs - was not working - fixed: preset.h and other related headers were not installed during install-data phase - fixed: pyecasound - the critical native python bugs found in earlier releases are now fixed - fixed: ecasoundc - serious memory leak in handling string list return types - fixed: typo in libecasoundc-config usage [koraq] - fixed: bugs with resample that caused audible artifacts with certain srcrate-dstrate combinations 19112003 (v2.3.1) -** stable release **- - added: --disable-effects configure option; build ecasound without effect and controller components - changed: libtool is setup to only create object files for static linkage; you can revert to the old behaviour with the --enable-shared configure option - changed: ecasound.el updated to 0.8.3, lots of small changes, see ecasound.el for details [mlang] - changed: pyecasound - due to bugs found in the native python impl, the C ECI impl is again set as the default; can be overridden using --enable-pyecasound=IMPL - changed: pyecasound - the native python impl (ecacontrol.py) now returns an error if communication with the ecasound process times out - changed: html versions of programmer's, user's and ECI developer's guide are generated with Hevea instead of latex2html [juekawa] - changed: updated config.guess and config.sub to more recent versions - fixed: makefile errors when building against system libreadline - fixed: processing did not start in the default transport mode with JACK versions 0.80 and older - fixed: recording failed with a WinTv 401dbx and the btaudio OSS driver - fixed: compilation against alsa-lib-1.0.x - fixed: default ratio value incorrectly set for -eca; does not affect presets using -eca [remon] 29082003 (v2.3.0) -** stable release **- - edi-entries: edi-4, edi-19 and edi-35 frozen, edi-38 added and frozen immediately, edi-39 added; frozen is a new status for items that probably won't be ever implemented - note: verified to compile ok with gcc-3.3 - note: verified to work with python-2.3 - added: eaim - command 'engine-launch' to inialize engine without starting actual processing, and 'engine-halt' for halting it without disconnecting; useful with JACK transport functions - added: separate AUTHORS file; also added to the website - added: -d, -dd and -d command-line options, see ecasound(1) - added: recording offset parameter -z:multitrack,offset option - changed: to avoid resampling faults, upper limit of 2000% set for pitchshifter's (-ei) shift-% arg; note! high values of shift-% can still cause crashes if using libsamplerate - changed: if available, use pthread API for setting scheduler params; might improve real-time reliability on rh9.0 machines and others that have NPTL - changed: pyecasound - redefined configure option --enable-pyecasound=IMPL where 'IMPL' is either 'c' or 'python'; --disable-pyecasound disables them both - changed: pyecasound - if ecasound's build prefix does not match the python prefix, /usr or /usr/local, pyecasound will be disabled; you can override this by specifying the python module directory explicitly with the --with-python-modules=DIR option - changed: JACK transport support code to the new API introduced in 0.76.1 and newer - changed: ecasound.spec; added 'AUTHORS' - changed: JACK transport modes redefined; new modes are 'notransport', 'send', 'recv' and 'sendrecv' - changed: major updates to README file - changed: improved check for aRts; now verifies that linking against libartcs actually works before enabling the arts plugin - fixed: use of the JACK transport API was never actually enabled in 2.2.3 - fixed: .aiff/.snd/.au input/output was not working at all due to a typo in source code - fixed: a chain with a short input file could cause a nasty feedback loop if processed with certain effects and mixed with audio from other chains - fixed: ewf length and offset errors with sample rates different from default (usually 44.1kHz) - fixed: chainsetup samplerate incorrectly set with some configurations; caused problems with -t:xxx and other functions related to chainsetup level position and length - fixed: serious bug in mixing down multiple chains with different number of channels to one output; audio from previous mixdown rounds leaked to unused source channels - fixed: some chainsetup parsing errors were totally ignored and not reported to the user - fixed: eiam - output of map-* commands was broken in certain locales (for example "fi_FI") - fixed: without at least one '-Md' or one '-km' option specified, MIDI-services did not work - fixed: pulse gate timing inaccuracy (-eemp); also affected the bpm pulse gate (-eemb) and thus the metronome preset (-pn:metronome) - fixed: a 'setpos' on a not yet connected chainsetup would cause seeks to the wrong position for objects with non-default samplerates - fixed: pay regard to -z:multitrack and -z:nomultitrack when saving chainsetups to .ecs files 27042003 (v2.2.3) -** stable release **- - added: support for both -0.64 and 0.65- JACK versions; transport functionality is only enabled with the newer versions - added: automatic query of child object sample rate by giving 'auto' as 2nd arg to resample object - changed: by default python version of ECI is used; the C python module for ECI, pyecasound, is only compiled if --enable-pyecasound is specified - changed: jack_auto,dstclient input/output object now automatically connects to matching ports of JACK dstclient (no longer requires dstclient to have in_X/out_X port names) - fixed: yet another fix for creating temporary files in ecanormalize and ecafixdc; now both LOGNAME and USER are checked for a valid user name - fixed: prefer usleep over nanosleep on cygwin; avoids the excessive-cpu-usage problem - fixed: work-around for a bug in the pcm plugin of ALSA 0.9.1 and earlier that caused recording/playback to stop to an audio i/o error - fixed: inconsistencies in how configure --disable/enable-feat options were handled - fixed: if pyecasound was disabled at build time, make install target failed in ecasound/pyecasound 18032003 (v2.2.2) -** stable release **- - edi-entries: edi-35 and edi-36 added - added: ecacontrol.py - a native python implementation of the ECI API [jhalttun] - added: stream ogg/mp3/mid directly from network if the filename has a url-prefix - added: author name to the description of LADSPA plugins - added: latest config.guess and config.sub added to the dist package - added: ecamonitor - a warning is printed if you try to run with python-1.x; python-2.x is required - added: new tutorials page added to documentation; see Documentation/index.html - changed: ecasound.el updated to 0.8.2, lots of small changes, see ecasound.el for details [mlang] - changed: alsa-0.9 - better support for pcm devices such as dmix which have strict period size constraints - fixed: libecasound sample conversion unit test failed when compiled with gcc-2.91.66 on certain platforms - fixed: compile failed on systems that don't have nanosleep() - fixed: subtle bug in -kl and -kl2 (and possibly others) with fade lengths under 1s - fixed: alsa-0.9 - prevent ecasound from prefilling too much data to output devices - fixed: a ':' in LADSPA plugins parameter name confused ecasound (swh's sc4 is one example) - fixed: theoretical problem with ecalength argument parsing - fixed: use LOGNAME instead of USER for creating temporary files for ecanormalize and ecafixdc - fixed: -tl has been broken since 2.2.0-pre5 - fixed: copp-list dumped core if no cop was selected 15022003 (v2.2.1) -** stable release **- - added: sane default param hints for chainops: -ec, -etd, -ete, -etf, -etl, -etm, -etp, -etr and -epp - added: if configured with JACK-support, ecasound will fetch the correct bufsize and srate parameters from the JACK server when connecting a chainsetup with JACK inputs or outputs - added: support for Erik de Castro Lopo's libsamplerate resampling library; used both by the resample audio i/o object and the pitch shifter chainop (-ei); enable with --with-libsamplerate - added: --disable-libsamplerate; don't enable libsamplerate support even if the library is found during configure - added: resample-hq audio object type; like resample, but use the highest available resampling quality; currently only has an effect if libsamplerate support is enabled - added: alternative UNIX signal handling for platforms that don't provide sigwait() (cygwin is one) - changed: ecasoundrc - ladspa-plugin-directory can contain multiple directories, separated by colons; this change was done to avoid any confusion with the LADSPA_PATH syntax and ecasoundrc - changed: rewritten much of the JACK slave-mode code; enables much faster and reliable transport-sync - fixed: compiling pyecasound failed on alpha w/ gcc-3.2 - fixed: -t:xxx option did not work if chainsetup samplerate differed from the default; for instance rate change from 44100 to 22050 doubled the run length - fixed: make uninstall in kvutils failed if non-identified files from old releases were detected - fixed: excessive dbc warnings when using the jack plugin - fixed: core dump if -eac:x,y was given an invalid channel index - fixed: compile failed if JACK support was enabled, but no explicit --with-jack option was given - fixed: rounding errors fixed in the resample object - fixed: terminal was not properly resetted after a ctrl-c in interactive mode - fixed: handle /dev/dsp drivers that don't support DSP_GETCAPS (cygwin is one) - fixed: don't link with rpath if target prefix is /usr [juekawa] - fixed: -kl2 didn't work at all in some circumstances 09012003 (v2.2.0) -** stable release **- - edi-entries: edi-1 closed - changed: ecasound.el updated to version 0.8.1 [mlang] - changed: more user-friednly errormsg when trying to open a nonexistent ogg/mid/mod file - changed: eiam - all instances of 'c-mute' in code and docs changed to 'c-muting', although now officially deprecated, 'c-mute' will continue to work as an alias to 'c-muting' - fixed: edi-1 - crackle at start of processing with -ete removed [hgfischer] - fixed: various small fixes to remove uncalled for dbc warnings - fixed: -b:0 caused a segfault - fixed: compile error with gcc-2.95.4 concerning eca-curses.cpp and the 'erase' symbol - fixed: compile error with freebsd-4.7 concerning eca-chainsetup.cpp/eca-fileio-stream.cpp and the header file 'sys/mman.h' - fixed: resample audio object set the child srate incorrectly for mp3 and headerless audio files 28112002 (v2.2.0-rc1) - edi-entries: edi-35 added - fixed: more curses fixes - fixed: ecaplay - -k and ctrl-c cleanup bugs - fixed: ecaplay - accept filenames containing whitespace - fixed: ecafixdc - don't process files that have zero dc-offset - fixed: compilation fixes for solaris+gcc combo - fixed: -y option was not working; broken since 2.2.0-pre1 - fixed: seg.faults when finishing processing a setup with -t:x defined, -z:db, no rt-inputs and one or more rt-outputs - fixed: restarting processing from a new position after processing had reached the finished state - fixed: banner was printed to stdout even in quiet mode - fixed: -etc (chorus), -etp (phaser) and -etl (flanger) broken by edi-21 work 07112002 (v2.2.0-pre5) - edi-entries: edi-29 closed - added: ecasound emacs interface, ecasound.el, is now distributed with ecasound (ecatools/ecasound.el); ecasound.el is installed to ecasound's data directory (default /usr/local/share/ecasound) - added: libkvutils_tester, unit tester for libkvutils - added: ecamonitor - 'q' to quit - added: --nodaemon and --daemon-port=XXX ecasound options - added: documentation about the daemon functionality to ecasound(1) - added: ecamonitor.1 man page - added: NetECI documentation to programmer's guide - changed: rpm spec file unified with the spec file used to build PlanetCCRMA's ecasound packages - changed: pyecasound license from GPL to LGPL - changed: the C++ ECI implementation, the ECA_CONTROL_INTERFACE class, moved from libecasound to libecasoundc; now also under LGPL - changed: asm/atomic.h kernel header no longer used - changed: ecaplay - improved ctrl-c handling - fixed: cleanup of curses/ncurses detection in configure.in; this also fixes ecasound compilation on mandrake9.x systems - fixed: controller source positions were not always updated when global chainsetup position was changed - fixed: controllers weren't properly initialized before use; this bug caused real harm only to -klg objects; only the first defined -klg worked as expected - fixed: increased the max message size in ECI-standalone; ecasetupedit-0.2.3 caused the parsing buffers to overflow 31102002 (v2.2.0-pre4) - edi-entries: edi-27, edi-28, edi-29, edi-30 - added: eiam - commands 'map-cop-list', 'map-ctrl-list', 'map-ladspa-list' and 'map-preset-list'; see ecasound-iam(1) man page for details - added: eiam - 'ao-add-default' command - added: ecicpp_tester, a unit test program for C++ ECI - changed: libecasoundc now LGPL licensed - changed: edi-30 done; ecaplay, ecaconvert, ecafixdc and ecanormalize rewritten using the new standalone ECI api - changed: reimplemented the C++ ECI interface on top of the new standalone C ECI interface - changed: implementation level improvements to db, ewf, resample, reverse and typeselect audio object types - changed: edi-28 done; ECI standalone now the only ECI implementation - changed: ecasound now uses the new JACK (0.40.0 and newer) ALSA PCM port names (alsa_pcm:capture_X and alsa_pcm:playback_X) - changed: number of channels must be given as the first parameter to -ezx; this was needed to implement true multichannel support - changed: syntax used for JACK inputs/outputs, see ecasound(1) and ecasound user's guide for details - changed: ecasound JACK transport master mode now follows the new pending-timebase model - changed: edi-27 done; the NetECI protocol replaced with the ECI standalone protocol defined in ecasound programmer's guide - changed: edi-29; major updates to ecamonitor; moved back to ecasound/ecamonitor - fixed: libecasoundc return value sync problem; return value for command wasn't returned until command n+1 was issued - fixed: -etc, -etl and -etp crashes if delay parameter was set to zero - fixed: -ezf didn't report the correct dcfic for the first channel - fixed: LADSPA param descriptions were incorrectly parsed - fixed: ecasound ended up in a cpu-intensive loop if the standard input suddenly disappeared in the -D output mode; this happened every now and then with ECI apps - fixed: eiam - missing newlines in output of 'cop-status' and 'ctrl-status' 19102002 (v2.2.0-pre3) - fixed: reverted to using old ALSA 0.9 hw-params API, ecasound agains works with old 0.9beta and 0.9rc ALSA versions 18102002 (v2.2.0-pre2) - fixed: ALSA objects weren't properly registered as audio object types - fixed: debug level was resetted to 0 after issuing 'int-output-mode-wellformed' - fixed: automake complained about multiple definition of ecasoundc_sa 17102002 (v2.2.0-pre1) - edi-entries: edi-24, edi-28, edi-29, edi-30 - note: libecasound and libkvutils interface version numbers will from now on track API changes instead of ABI changes - added: edi-24; resample audio object added - added: edi-29; initial version of ecamonitor - added: edi-28; eiam-command 'int-output-mode-wellformed' - removed: edi-30; ecasound internal plugins no longer installed separately - changed: ALSA support requires alsa-lib version 0.9rc4 or newer - changed: libecasoundc versioning back to normal libtool style; interface version reverted back to 1:0:0 - changed: edi-28; C implementation of ECI, libecasoundc, is rewritten to not depend on libecasound - changed: edi-28; pyecasound is rewritten to use the new C ECI implementation instead of direct use of libecasound - changed: edi-30; removed all shared libs and subpackages containing them from ecasound.spec.in - changed: added ecamonitor to ecasound.spec.in - changed: edi-30; libecasound and libkvutils versioning back to normal libtool style - fixed: unnecessary warnings when closing OSS audio objects - fixed: unnecessary warnings when adding audio objects to a chainsetup with no chains currently selected - fixed: resample, reverse and typeselect audio objects types were broken in 2.1dev11 - fixed: removing audio inputs and outputs didn't work as specified - fixed: bugs in multitrack-mode operation; processing would stop once all input objects were finished - fixed: pyeca.py - correct handling of 'e' and '-' return types [jhalttun] - fixed: eiam - removed the extra newline char from output of 'cop-status' and 'ctrl-status' - fixed: loglevel settings were lost when output mode was changed - fixed: ecamonitor was missing from the dist package 22082002 (v2.1dev11) - added: configure-check for socket libraries - added: -evp - volume peak watcher operator - added: initial support for LADSPA v1.1 API for plugin parameter defaults (as used in swh-0.2.8 plugin set); updated ladspa.h included in the source tree - changed: rewrite of all user-interface code that's in the ecasound-x.y.z/ecasound directory - changed: added chainop and controller parameter descriptions back to ecasound's command-line help (--help/-h) - changed: ecasignalview rewritten; segfault bugs fixed, consumes less cpu-resources, better interface - changed: ecasoundrc - default command for ogg playback to catch up with the ogg 1.0 release - changed: new sample format conversion routines along with unit tests - fixed: a long-standing bug in ecaplay that caused it to segfault with big playlists - fixed: LADSPA_PATH env.variable not parsed correctly - fixed: floating-point exceptions when run on alpha-linux - fixed: libecasound_tester failed on machines without the LADSPA SDK plugins installed - fixed: ia-mode - ctrl-d didn't exit as it should; this broke shell scripts that used pipes to communicate with ecasound 24062002 (v2.1dev10) - added: -G:mgrtype,optstring switch for setting audio object manager level options - added: -G:jack,client_name,operation_mode option; see ecasound(1) for details - added: --enable-all-static configure option - added: --disable-jack configure option; disable JACK support even if all required libs and headers are found - changed: major data structure cleanup in the JACK plugin - changed: JACK support is now enabled if 'jack/jack.h' is found; also --with-jack=PATH still works - fixed: 'unknown device state' errors with multichannel soundcards like midiman deltaXX and rme when starting processing and if -z:intbuf mode was selected - fixed: due to changes in autoconf variables, non-atomic locking was always used instead of atomic locking in 2.1dev8 and 2.1dev9 - fixed: configure failed if an old (<0.9) ALSA version was installed even if --disable-alsa was specified - fixed: loading chainsetup from interactive mode failed both with cs-load and after cs-edit - fixed: compiling against readline 4.2 with --enable-sys-readline failed - fixed: bugs in the -z:db subsystem caused segfaults - fixed: problems with -z:db and small files - fixed: eiam - 'cs-get-length' always returned 0 17052002 (v2.1dev9) - edi-entries: edi-22 - changed: optimized disk i/o subsystem (-z:db) performance - changed: edi-22 fully implemented (JACK-support) - fixed: disk i/o subsystem didn't discard all old data after a seek to a new location - fixed: installing pyeca.py failed if ecasound was built outside srcdir - fixed: timeouts when starting chainsetups with JACK input/outputs - fixed: bug in stopping JACK input/outputs; affects seeking in interactive mode 13052002 (v2.1dev8) - edi-entries: edi-13, edi-18, edi-21, edi-22 - added: reverse audio object type; see the ecasound(1) man page for better documentation - added: pyecasound - if python version is 2.2 or higher, pyeca.py sets custom dlopen flags before importing the actual pyecasound python module; this makes it possible to access ecasound's plugins (ALSA, JACK, libaudiofile) from python ECI apps - added: ecasoundrc - 'default-audio-format'; same syntax as with the -f option; defaults to s16_le,2,44100,i - added: edi-18 implemented; engine samplerate is now set automatically - if object sample rates don't match, an error is printed - added: edi-21 implemented; a much improved framework for handling audio position information is now in place; -kl, -kl2 and -klg are now position aware - changing chainsetup position also affects controller sources - added: initial implementation of edi-22 - added: support for devfs /dev/sound/dsp devices [karmak] - added: new debugging system in libecasound; semantics of -d:xxx debug levels have changed - added: 'make check' target builds and runs libecasound/libecasound_tester, which performs a set of functionality tests - removed: support for old ALSA driver versions 0.3.x, 0.4.x and 0.5.x - removed: ecasoundrc - 'default-samplerate' - removed: -sr option; not needed anymore - removed: ia-mode - 'c-rewind', 'c-forward' and 'c-setpos' - removed: ecasoundrc - default-to-interactive-mode - removed: mixmode switch (-m) - removed: ecasound/contrib directory - changed: JACK support updated to match JACK's 13/May/02 CVS-tree - changed: pyecasound - module libpyecasound.so renamed to pyecasound.so - changed: programmer's guide updated; added a new chapter about library organization - changed: minor user's guide update - changed: looping with -tl always loops from the start; -y can't be used for setting the loop start offset -> ewf-files should be used instead - changed: s24_le and s24_be sample formats are interpreted as three-byte values, not as four-byte 24-in-32bits values as before; to access unpacked 24bit data, use s32_le and s32_be formats instead - changed: configure.in cleanup - changed: the libkvutils binary API has changes so its version number was changed from 3:0:1 to 3:0:0 (libkvutils.so.3); this interface will be frozen together with libecasound.so.8 - changed: rewritten rtnull implementation; now imitates soundcard behaviour much more accurately - changed: numerous portability improvements to the autoconf scripts - changed: new rpm-spec file; libraries are now located in separate rpm-packages - changed: ecasound-config renamed to libecasoundX-config - changed: ecasoundc-config renamed to libecasoundcX-config - changed: libecasound headers are now installed to incdir/libecasound, similarly libecasoundc headers to incdir/libecasoundc - changed: plugin directory name from prefix/lib/ecasound-plugins to prefix/lib/libecasoundX-plugins, where X is the library interface number - fixed: -[io]:alsaplugin,x,y didn't work with latest ALSA 0.9betaX releases - fixed: serious bug in setting up ALSA 0.9.x buffering params - fixed: rare bug with sampling rate changes - fixed: autoconf 2.5x fixes [iondiode] - fixed: typeselect - opening and closing a typeselect device multiple times caused a seg.fault - fixed: some ECI apps dumped core when executing their first command - fixed: after mp3/ogg/mikmod/timidity objects had reached finished state, playback couldn't be started without doing a disconnect-connect - fixed: better handling of situations where JACK server is abruptly shutdown and then restarted - fixed: sometimes an incorrect length-field was written to newly created wav-files - fixed: problems with using ewf-files with doublebuffering - fixed: loop devices didn't work; resulted in 'explicit exception' errors - fixed: configure failed if neither ncurses nor termcap was installed - fixed: compile failed if ALSA was not installed (even with --disable-alsa) - fixed: if compiled with --with-largefile, when closing output wav files, riff header block was written over start of audio data - fixed: -eemb wasn't working properly, this broke the 'metronome' preset - fixed: recording offset not set when not in multitrack mode - fixed: incorrect parsing of wav headers on big-endian machines - fixed: various small fixes to make ecasound compile with Sun's Workshop6 C5.2 C++ compiler under 64bit Solaris 2.8 (sparc ultra-250) - fixed: ecasoundrc - ext-cmd-text-editor and ext-cmd-wave-editor were incorrectly parsed - fixed: cs-edit didn't preserve chainsetup position - fixed: cs-edit discarded all changes if the original chainsetup was connected but the resulting setup was not valid for reconnection - fixed: -klg didn't work as documented 16012002 (v2.1dev7) - edi-entries: edi-12 - added: a watchdog thread that handles thread cleanup; this is needed especially for audio and chainop objects which create their own threads (like jack) - changed: unification of interactive and passive modes; running ecasound without -c is now pretty close to "echo run | ecasound -c cmds" - changed: if an invalid chainsetup is given on the command line, and -c is given, ecasound will print an error but will not exit as it did before; you can continue editing in the ia-mode to check what was wrong in the setup - changed: compilation of eca-iamode-parser.cpp is now significantly faster and takes less resources; this should fix problems with compiling ecasound on machines with <256MB of memory - fixed: audio-manager.h was missing from the dist-package - fixed: critical bug that prevented writing to double-buffered non-realtime output objects - fixed: chainsetups with multiple controller objects of the same type didn't work in 2.1dev6 [jesse] - fixed: edi-12 - multichannel, noninterleaved ALSA 0.9 input and output not working properly 22122001 (v2.1dev6) - edi-entries: edi-8, edi-11, edi-17 - note: review of all samplebuffer-related code; lots of code-cleanups and minor improvements - added: edi-11; hierarchy-based config file system; default values now stored to '{prefix}/share/ecasound/ecasoundrc' while individual values can be overridden in '~/.ecasound/ecasoundrc' - added: bitrate (kbps) params to mp3 and ogg outputs - added: initial JACK support; enable by giving --with-jack=install_prefix configure option - added: edi-8; ia-mode - support for parsing args containing white-space; either by quoting with ("a token") or backslash espacing (a\ token) [junichi] - removed: ecasoundrc - 'user-resource-directory' tag removed; user-specific preset/oscillator definition directory now '~/.ecasound' - changed: ecasoundrc - to avoid versioning conflicts, all 'ext-*' tags are renamed; see ecasoundrc(5) - changed: 'make install' will now overwrite old data files ({prefix}/share/ecasound/*) - fixed: problems with automake1.5 - fixed: eiam - 'ao-get-position' returned an integer value instead of a float as it should - fixed: bugs with combining -ei and LADSPA plugins - fixed: 2.1dev5 wrote broken wav-headers - fixed: minor changes to posix signal handling - fixed: seg.faults with -ei:x where x < 50 05122001 (v2.1dev5) - added: docs - Documentation/manpages.html - added: ecalength - -su option added [smassy] - added: experimental support for largefiles (>2GB); enabled with --with-largefile configure option - changed: most preset names changed in 'effect_presets' - changed: ecasoundrc - new defaults for mp3 and ogg output - changed: unified kvutils build process; added separate libkvutils_debug target; CXXFLAGS shared with ecasound build configuration - fixed: processing didn't stop with setups that had loop- devices connected to multiple input objects - fixed: using loop devices in setups with non-default internal sample rate could cause unwanted resampling - fixed: -kog and -f were broken (since dev4) - fixed: bugs in passing audio format params to mp3 and ogg encoders; note! update your ~/.ecasoundrc to match the new defaults, see ecasoundrc(5) man page - fixed: ecasound wrote to ewf-files opened in read-only mode - fixed: work-around for environments without the C99 stdint.h header file [anarcat] - fixed: eiam - problems with 'cs-set-position-samples', 'cs-rewind' and 'cs-forward' with unconnected chainsetups 31102001 (v2.1dev4) - added: eiam - 'cs-option' commmand; although explicit use of cmd-line options as iactive-mod commands (like "-i:file.wav") is still supported, "cs-option -i:file.wav" is now the preferred syntax - removed: ecasound FAQ file - it only contains about a pageful of useful text - I moved that precious piece of content to the user's guide :) - changed: uses of '-i' an '-o' replaced with 'ai-add' and 'ao-add' in ECI documentation and code examples in 'ecasound/examples' - changed: user's and programmer's guides updated - changed: bug-alert; major rewrite of ecasound's internal object factory code - changed: eiam - output of aio-register, cop-register, ladspa-register and preset-register commands - fixed: multitrack mode was not properly detected if buffering mode was selected explicitly (-B) - fixed: eiam - minor 'cs-edit' bugs fixed - fixed: 'make install' failed if srcdir != objdir - fixed: didn't work with ALSA +0.9b8 CVS-tree - fixed: additional noises when mixing mono and stereo streams in ecasound chains - fixed: better handling of situations where ecasound can't execute ogg123 for ogg input 21102001 (v2.1dev3) - note: major changes to effect preset system which break some old preset definitions - edi-entries: edi-3 - added: ecasound-config - --ldflags and --prefix - added: engine profiling info (printed to stderr) - added: -z:multitrack, -z:nomultitrack for forced enabling and disabling of multitrack-mode - added: variable-like preset parameters; it's now possible to bind one preset parameter to multiple chainops' parameters (control multiple settings with one parameter) - added: support for describing preset parameters (edi-3) - changed: pyecasound - makefile-hack that allows pyecasound to work even though compiled against libecasound and libkvutils that are not installed to a directory listed in /etc/ld.so.conf - changed: db-subsystem - is put to sleep more aggressively, which should further decrease its cpu-load - changed: db-subsystem - runs once again under sched_fifo scheduling if -r is enabled - changed: ALSA xrun reports are now printed to stderr instead of ecasound debug-subsystem - changed: -B:rt selected as the default bmode for multitrack-setups (instead of -B:lowlatency) - changed: preset definitions in 'effect_presets' changed to take advantage of the preset system improvements - fixed: major bugs in interpreting LADSPA plugin parameter hint flags - fixed: a nasty bug in bufmode activation code prevented -kos, -kl, and others from working properly - fixed: loop devices didn't work well with -z:db; fixes ecasound testsuite case con_test1-8 - fixed: memory leak in LADSPA handling code; was triggered by recent versions of ecamegapedal - fixed: pyecasound - make target 'install-exec-hook' failed if --disable-pyecasound was given to configure 14102001 (v2.1dev2) - added: ecaplay - -k, -d and -h options, see 'man ecaplay' - added: eiam - ai-get-length-samples, ao-get-length-samples, cs-get-length-samples, cs-set-length-samples [smassy] - added: support for variable length buffer's for ALSA 0.9 output (required by -ei:xx type effects) - changed: tuned prefill-parameters for double-buffering - changed: when saving chainsetups, if no parameters are overridden, buffermode definition (-B) is saved instead of individual parameters - changed: yet more changes to the multitrack-mode - changed: eiam - output of *-status commands - fixed: -r option wasn't saved to chainsetups (used to be a session-level option) - fixed: typeselect problems when used for outputs - fixed: system lockups with -B:rtlowlatency and rt-object-only chainsetups - fixed: misplaced tab prevented eci.py from working with python 2.1 (nested scopes) - fixed: if a monitor track input ended before recording stopped in multitrack mode and -z:db was enabled, it continued producing unwanted noise to the monitor output - fixed: eiam - ladspa-register output had plugin names and descriptions mixed 09102001 (v2.1dev1) - added: chainsetup parser prints a warning if an unknown buffering mode is given to -B:mode - changed: 'rt' buffering mode is preferred over 'rtlowlatency' if no chain operators are present, and multitrack mode is not active - changed: more improvements to double-buffering - fixed: critical bug when running in -B:rtlowlatency mode (caused system-lockups with ALSA 0.9.x oss-emulation) - fixed: explicitly specifying -z:nointbuf had no effect - fixed: setting double-buffer length didn't have any effect (given either in bmode defaults or as -z:db,dbsize) 06102001 (v2.1dev0) - edi-entries: edi-2, edi-6, edi-10, edi-15 - added: more recent config.guess and config.sub to the dist package [juekawa] - added: new feedback-% param to -etd effect, doesn't affect old presets using -etd [smassy] - added: ALSA device name 'default' is used if no other name is given ('-o:alsa' is equivalent to '-o:alsa,default') - added: special case for mapping "ecasound file.ecs" to "ecasound -s:file.ecs" - added: implementation of edi-6; the -z:db is now completely transparent to other parts of ecasound - added: eiam - new commands: cs-set-position-samples, cs-get-position-samples, ai-set-position-samples, ai-get-position-samples, ao-set-position-samples, ao-get-position-samples - added: edi-15 - '-B' option for selecting default buffering mode (see ecasound man page) - added: edi-15 - ecasoundrc bmode-defaults options; obsoletes old default-buffersize, etc options - added: various improvements to multitrack sync-mechanism to make it work reliably in all buffering modes - added: ladspa.h added back to distribution; it is however not installed to incdir/ecasound/ladspa; also already installed ladspa.h is preferred over the local header file version - added: S.Massy's ecalength added to ecatools - see ecalength(1) manual page (edi-10) - added: new 'typeselect' audio object type that can be used to override the object type; see man ecasound(1) for details - changed: library version changed to 8.0.0 - changed: use of kvutils/definition_by_contract dropped; more lightweight kvutils/dbc.h will be used from now on - changed: more strict option parsing; now a warning is printed if an unknown option is seen; parser also won't accept known options with invalid or incorrect parameters - changed: use of libstdc++ namespace now explicitly marked using the 'std::' prefix [rpolton] - changed: new layout for saved ecs-files - changed: docs - converted ecasound user's and programmer's guide from yodl to latex - changed: shocking changes to startup printouts :) - fixed: gcc3.x fixes to ALSA 0.5.x plugin [juekawa] - fixed: problems with ALSA 0.9beta7 (dlopen() issue) - fixed: minor samplerated bug with LADSPA plugins - fixed: gcc3.x failed on certain glibc2.1 headers if optimization was enabled (-O2) - fixed: pyecasound linking failed in certain circumstances - fixed: ecasound.spec - dropped the hardcoded python module path that was passed to configure - fixed: seg.fault if opening wav/raw files for output failed for some reason (access denied, etc) - fixed: non-zero defaults for -r:x and -z:db,y [smassy] 16012002 (v2.0.4) -** stable release **- - edi-entries: edi-12 - added: docs - Documentation/manpages.html - fixed: ecasound.spec - dropped the hardcoded python module path that was passed to configure - fixed: seg.fault if opening wav/raw files for output failed for some reason (access denied, etc) - fixed: misplaced tab prevented eci.py from working with python 2.1 - fixed: major bugs in interpreting LADSPA plugin parameter hint flags - fixed: memory leak in LADSPA handling code; was triggered by recent versions of ecamegapedal - fixed: edi-12 - multichannel, noninterleaved ALSA 0.9 input and output not working properly 28092001 (v2.0.3) -** stable release **- - added: more recent config.guess and config.sub to the dist package [juekawa] - changed: -z:intbuf made the default once again - changed: ecasoundrc - default-to-internal-buffering renamed to default-to-max-internal-buffering to avoid conflicts with the old defaults - fixed: gcc3.x fixes to ALSA 0.5.x plugin [juekawa] - fixed: problems with ALSA 0.9beta7 (dlopen() issue) - fixed: minor samplerated bug with LADSPA plugins - fixed: gcc3.x failed on certain glibc2.1 headers if optimization was enabled (-O2) - fixed: pyecasound linking failed in certain circumstances 17082001 (v2.0.2) -** stable release **- - added: current position tracking to loop devices - added: more verbose xrun info from ALSA 0.9.x devices - added: info about the new perl bindings to ECI API docs - added: Eric Tiedemann's alternative Python ECI interface, eci.py, added to pyecasound [est] - added: support for gcc 3.0 [juekawa] - changed: improved configure checks for python include and library directories - changed: -tl now works without -t - changed: new algorithm for selecting initial param values for LADSPA plugins - changed: update ogg input and output support to work with ogg vorbis 1.0rc2 - changed: changed some of the returned error codes - fixed: selecting a non-existant chainsetup could crash ecasound - fixed: --enable-audiofile actually disabled the use of libaudiofile (!) - fixed: ecaplay - if ecaplay is unable to play a file, instead of exiting it now skips to the next file - fixed: giving a non-integer number of delays to -etd caused a seg.fault - fixed: eiam - issuing copp-select + copp-get caused a crash if no cop was selected - fixed: bugs in handling infinite length ewf sources - fixed: --disable-oss still required to sys/soundcard.h to be present [rob] - fixed: bug in sending MIDI-MMC messages [robstr] - fixed: bug in ecasoundc cleanup routines [rjpoelstra] 05062001 (v2.0.1) -** stable release **- - added: ecasoundrc - default-to-internal-buffering; select the default between -z:intbuf and -z:nointbuf - added: alternative C ECI implementation providing reentrant access to the library; the new routines have a '_r' postfix and are located in libecasoundc [ajeanneau] - changed: completely rewritten mp3 header parsing; should fix most of the compatibility problems - fixed: disk buffers weren't properly flushed in -z:db mode when changing or setting processing position - fixed: bugs in assigning LADSPA plugin audio ports to ecasound chain channels - fixed: configure script failed if arts was installed without the devel files (arts-devel) - fixed: bug in the MIDI-server code caused core dumps in certain situations - fixed: bug in querying -klg parameter status - fixed: eiam - giving certain invalid arguments to 'cop-add' and 'ctrl-add' crashed ecasound - fixed: bug in closing .raw files [smassy] - fixed: eiam - cop-inxed-select renamed to cop-index-select - fixed: bugs in loop device channel handling - fixed: changing internal sample rate caused problems to the noise gate effect (-enm) 02052001 (v2.0.0) -** stable release **- - added: -klg - a generic linear envelope; a controller source that can be used to map custom envelopes to chain operator parameters [artham] - fixed: segfaults when trying to access non-existing preset parameters - fixed: segfault if tried to copp-get without first selecting a parameter with copp-select - fixed: few bugs in ewf looping routines - fixed: 'make uninstall' forgot some files and dirs - fixed: bug in ALSA 0.9.x xrun handling 24042001 (v1.9dev6) - added: eiam - cs-setpos, cs-set-position; aliases for setpos - added: eiam - cs-getpos, cs-get-position; aliases for getpos - added: eiam - cs-rewind and cs-forward; aliases for rewind and forward - added: eiam - cs-get-length; alias for get-length - added: ecatools - repeated ctrl-c causes ecaplay to exit immediately (like mpg123) - added: MIDI options now properly saved to ecs files - added: eiam - c-index-select, c-iselect, cs-iselect, cs-list, ai-list, ao-list, ai-iselect, ao-iselect - added: eiam - cop-index-select, cop-iselect as aliases for cop-select - added: eiam - copp-index-select, copp-iselect as aliases for copp-select - added: eiam - ctrl-index-select, ctrl-iselect as aliases for ctrl-select - added: eiam - ai-get-format and ao-get-format - added: eiam - cop-selected, copp-selected and ctrl-selected - added: eiam - cop-list, copp-list, ctrl-list - removed: because of the continuing licensing problems, ladspa.h was removed; to compile ecasound with LADSPA support, the LADSPA SDK has to be installed - changed: eiam - separate commands sets for operating on audio inputs (ai-) and outputs (ao-); affects all aio-* commands except aio-register and aio-status - changed: eiam - dump-aio-* separated into dump-ai-* and dump-ao-* - changed: eiam - cs-length renamed to cs-set-length - changed: updated ecafixdc and ecanormalize to use the new temp file creation routines - changed: -z:nointbuf is now the default; use -z:intbuf to enable the old default behaviour - changed: eiam - ai-index-select and ao-index-select now take an integer parameter - changed: eiam - c-name renamed to c-rename - changed: eiam - cs-set renamed cs-set-param - changed: eiam - cs-format renamed cs-set-audio-format - changed: eiam - cs-loop renamed to cs-toggle-loop - fixed: small bug fix to ALSA 0.9.x support - fixed: eiam - ctrl-remove bug fix, take two :) 22032001 (v1.9dev5) - added: eiam - new aliases 'getpos', 'c-set-position', 'aio-set-position', 'aio-getpos' - added: eiam - 'int-cmd-list', 'int-version-string'. 'int-version-lib-current', 'int-version-lib-revision', 'int-version-lib-age' - added: eiam - added a section about 'realtime commands' to ecasound-iam(1) man page - changed: new system for creating temporary files; all temps are put into a separate directory; $TMPDIR and $TMP are used if available, otherwise defaults to /tmp - fixed: mp3 output broken - fixed: more zombie-problems with mpg123, lame, ogg123 and others - fixed: eiam - 'fw' and 'rw' commands didn't work properly if -z:db was enabled and audio object sample rate was different than internal sample rate - fixed: eiam - 'ctrl-remove' removed the selected chainop, not the controller as it should have - fixed: eiam - seg.fault when using 'cs-edit' to configure a connected chainsetup 06032001 (v1.9dev4) - added: -C - disable interactive mode; reverse op. for -c - added: -X - open outputs for updating; rev.op. for -x - added: -r:-1 to disable raised-priority mode - added: -z:nopsr, -z:noxruns and -z:intbuf ; rev.ops for existing -z options - added: 'user-resource-directory' define to ~/.ecasoundrc; see ecasoundrc(5) for details - changed: ecasoundrc - the default midi-device has to be given using the new 'type,device' syntax; defaults to 'rawmidi,/dev/midi' - changed: man pages are now distributed in nroff 'man' format - changed: audio object regexps are now case insensitive - for instance both file.mp3 and file.MP3 are now recognized as mp3 files - fixed: mpg123 instances weren't always properly cleaned - fixed: loop-device code wasn't working - fixed: more ewf-fixes - fixed: removal of static object maps might cure some C++ compatibility problems (no user-visible changes) - fixed: if connected, trying to remove the last chainsetup failed (possible core dump if debug disabled) - fixed: when used as inputs, 'null' and 'rtnull' now produce silence instead of random data (=noise) 02032001 (v1.9dev3) - added: ecaplay - ctrl-c skips to the next file - changed: -Md syntax to '-Md:rawmidi,device_name', where 'rawmidi' specifies the type while 'device_name' refers to a file/device name - fixed: MIDI-thread hang when exiting ecasound - fixed: various ewf-related fixes - fixed: eiam - rounding errors with 'rw' and 'fw' commands - fixed: ecaplay - seg.faults when playing multiple files - fixed: object cleanup was not properly done if ecasound received signals while multiple threads were running ("pure virtual method called" warnings) 14022001 (v1.9dev2) - added: -z:nointbuf - minimize the use of internal buffering done by rt-devices - added: -z:xruns - stop processing if an xrun occurs - added: '--disable-ncurses' configure switch; ncurses/termcap is still required during compiling, but with this, ncurses/termcap is ignored during linking - added: -Md:device option for specifying MIDI-devices - added: -Mms:device_id; send MMC start/stop to MIDI devices - added: -Mss; send MIDI-start/stop (note! MIDI-clock is not sent) - added: support for ALSA 0.6.x named pcm-devices; the new syntax is '-[io]:alsa,pcm_name'; alternatively, '-[io]:alsahw,card,dev,subdev' and '-[io]:alsaplugin, c,d,sd' can also be used; doesn't affect 0.5.x and older ALSA plugins - added: eiam-cmds; cs-is-valid - changed: support for -z:nointbuf to OSS-devices (/dev/dsp) and ALSA 0.5.x plugin - fixed: severe bugs with -km (midi-routines) 07022001 (v1.9dev1) - notice: new version numbering scheme - added: eiam-cmds; set-position, get-position, get-length, cs-connected, cs-selected, engine-status, aio-get-position, aio-get-length, aio-selected, ctrl-select, ctrl-remove, cop-select, copp-select, copp-set, copp-get, c-list, cs-list - added: eiam command return type documentation to ecasound-iam man page - added: ecasound detects all eiam return types and automatically prints their values after commands are issued - added: example code (under ./examples) - ecidoc_example.c, ecidoc_example.cpp, ecidoc_example.py, normalize.py - added: -kog - a new generic oscillator - added: lots of new documentation - check the examples page, user's guide and the ecasound faq - added: better handling of output error conditions (out of disk space, etc) - added: -eS - audio stamper - added: -ksv - control source that analyzes audio stamp volume statistics and creates control data from the results - added: -z:nodb - disable double-buffering - removed: eiam-cmds; u, a, cstatus, l, fstatus, estatus - changed: -kf - 'mode' parameter added - changed: format of the file 'generic_oscillators' - changed: ECI - last_list_of_strings() to last_string_list() - changed: the way gate operators work; instead of muting the chain, they now truncate the passing buffers - in future, amplify+controller (-ea + -k) combinations can be used in the same manner as the old gate operators - changed: 'ecasound-config --flags' now prints includedir instead of includedir/ecasound - changed: updated ALSA 0.6.x support to match CVS-20010122 - changed: a better implementation of MIDI i/o routines - fixed: "-x -i file.ext" style cmd-line arg sequences weren't parsed correctly [jhall] - fixed: ECI - command_float_arg() was broken (all languages) - fixed: when exiting console-mode ecasound with "quit", ecasound object weren't properly destructed causing all kinds of weird behavious (especially with wav- files) - [smassy] - fixed: more FreeBSD 4.x related fixes [beaupran] - fixed: ogg vorbis output fixes [nolan_d] - fixed: gcc 2.96 (RH7.0) related fixes [swharris] - fixed: ewf-file parsing not working [smorris] 07122000 (v1.8.5d15) - added: tremolo effect (-eemt) [rcs] - added: -z:db; i/o double buffering layer is back! - after complete rewrite, db-mode now supports all non-realtime audio objects, and works both for input and output - added: default-double-buffer-size added to ~/.ecasoundrc - added: double buffer size can be given as the 2nd argument of -z:db,dbsize - added: optional argument for -r:sched_priority; specify the static rt-priority; see ecasound(1) - added: default-schedpriority added to ~/.ecasoundrc - added: 32bit support for OSS/Linux - added: comments lines (#-prefixed lines) allowed when loading chainsetups from file - added: ecatools - ecasignalview added to the package; see ecatools(1) man page for details - added: new modules - libecasoundc and pyecasound - added: --disable-pyecasound configure switch - added: './contrib' and './examples' directories added to the distribution package - added: ecasound control interface documentation added - see 'Documentation/programmers_guide/eci_doc.html' - added: eiam - new commands; c-selected - added: extended support for parameter descriptions; all LADSPA parameter hints now supported - added: support for result paramerers, ie. values resulted from processing/analyzing - added: ECI - error() added - removed: the "LADSPA/" prefix removed from plugin labels - removed: support for underscores in EIAM-commands - changed: more intelligent handling of resource files (for instance ~/.ecasoundrc and preset files) - changed: output produced by -ev - changed: updated ALSA 0.6.x support to match pcmfinal-state - changed: minor changes to multitrack sync code; should now be even more accurate - changed: triggering of realtime outputs; now all rt-outputs are prefilled with two buffers before triggering - changed: Mandrake and PLD Linux RPM-spec files moved into the new './contrib' directory - changed: -ev and -ezf now report their results as output parameters (normal chainop params) - fixed: nasty bug in effect preset mapping - fixed: -ei:0 caused problems - fixed: cdr-file endianess (should be _always_ big endian) - fixed: yet more fixes to mono mp3 input handling - fixed: input problems (easily triggered by using -sr) with .mp3, .mid and mikmod modules - fixed: c-setpos didn't work if chainsetup wasn't connected - fixed: commas in descriptions of LADSPA plugin parameters confused ecasound, and usually ended up crashing (triggered at least by the hermes filter) 07112000 (v1.8.4d15) - added: pulse gate (-eemp); can be used to generate a metronome signal [rcs] - added: support for preset parameters - see file 'effect_presets' for examples [artham] - added: support for MIDI files using Timidity++ - added: input and output of Ogg Vorbis files (.ogg) using ogg123 and vorbize - added: version control to internal plugins; when compiling, libecasound libtool interface number is stored to the plugin object files - added: updates and additions to ecasound programmer's guide - added: support for noninterleaved streams to ALSA 0.6.x plugin - added: 4th parameter to -f, 'i' (default) indicates interleaved stream format while 'n' refers to noninterleaved - added: -D option; prints debug messages to stderr - removed: -m:mthreaded and -z:db (obsolete) - changed: tries to load all internal plugins even if some plugins were disabled during compile-time; this makes it possible to have multiple versions of same plugin tupe (for instance, plugins for different ALSA versions, etc) - changed: ecasoundrc - mikmod-path and -args combined into more general mikmod-cmd - fixed: compile time problems under Solaris 2.6 and FreeBSD 4.1 [beaupran, rcampbel] - fixed: ncurses fixes (the ever-bold bug) [artham] - fixed: cs-loop seg.faulted - fixed: stripped libtool version info from plugins [wrobell] - fixed: configure-time relocations didn't affect the default paths of effects presets and LADSPA plugins [juekawa] - fixed: invalid/non-existant files caused problems for all utils in ecatools package - fixed: sync-related ALSA 0.6.x fixes - fixed: better handling of mp3, ogg, timidity and mikmod related errors - fixed: -sr:srate didn't work (broken in 1.8.3d15) - fixed: problems with ALSA 0.6.x pcm plugins 26092000 (v1.8.3d15) - changed: code for parsing command-line arguments rewritten; now reports about invalid arguments - changed: default precision when printing time in seconds changed to 3 (msec precision) - fixed: ALSA 0.6.x updates - fixed: few bugs in aRts plugin 16092000 (v1.8.2r14) -** public release **- - added: --enable-alsa-rawmidi configure option - this is a temporary solution for supporting ALSA rawmidi until we have a proper plugin-based MIDI-subsystem - fixed: some broken mp3 headers caused ecasound to misinterpret mp3 sampling rate - fixed: problems when handling mp3 files with white-space in the filename [rsassman] - fixed: incorrect riff-wave header bug fixed [artham] - fixed: in some cases, controllers weren't parsed correctly - fixed: annoying clicks with phaser, flanger and chorus 01092000 (v1.8.1d14) - notice: all qt-related stuff put to separate packages - added: support for internal plugins; modules using external libraries (ALSA, aRts, libaudiofile, etc) are now dynamically loaded on runtime (no unnecessary dependencies); installed by default to (prefixdir)/lib/ecasound-plugins; see also ecasoundrc(5) man page for related entries - added: new ecasound-plugins rpm package - added: mp3 channel-count and sampling rate from mp3 header - added: notifies user if internal-plugin directory isn't found - removed: support for native ALSA rawmidi temporarily removed (while waiting, use ALSA's OSS-emulation) - changed: aRts support enabled by default - changed: behaviour of -ete effect's wet-% parameter - fixed: system readline related fixes (wrobell) - fixed: ewf - crashed if looping was enabled and 'start-position' > 'length' - fixed: few ewf output fixes - fixed: compile problems with ALSA 0.5.x - fixed: ecatools hang if interactive-mode enabled by default - fixed: ALSA 0.6.x support working again 25062000 (v1.8.0d14) - added: ecaconvert - a new ecatools app; converts a set of files to target file format - added: support for ALSA 0.6.x (plugin and direct) [jhall] - added: ia-mode - 'cs-list', 'c-list', 'aio-list', 'cop-list'; nothing new, but some might find these a bit more intuitive to use than various status cmds - added: more info about audio object status - added: --enable-sys-readline (compile against already installed libreadline) [wrobell] - added: rpm-spec file for PLD-Linux - ecasound.pld.spec [wrobell] - added: support for destdir env.variable [wrobell] - added: support for float samples (-f:f32_le and -f:f32_be) - added: support for IEEE754 wav files (float) - added: --enable-arts - use aRts daemon for audio input and output, see ecasound(1) man page for more info - added: limiter effect (-eal:limit-%) - changed: major changes in source tree organization - changed: mp3 input and output now possible with all decoders and encoders which support standards i/o streams; still defaults to mpg123 and lame - see ecasoundrc(5) for details - changed: qtecasound - all shortcut keys are now ctrl-some_key 23062000 (v1.7.9r13) -** public release **- - fixed: stdin, stdout and '-' were all more or less broken - fixed: loop devices weren't saved correctly 05062000 (v1.7.8r12) -** public release **- - added: files 'TODO' and 'ecasound.mdk.spec' - added: support for LADSPA_PATH env.variable - added: support for multichannel LADSPA plugins - added: -eli options, select a LADSPA plugin using its unique id-number - added: -ete - a new, more advanced reverb (thanks to Stefan M. Fendt for the algorithm!) - changed: qtecasound - major layout changes - changed: ecatools renamed to ecaplay, ecanormalize and ecafixdc - changed: updated the 'INSTALL' file - fixed: qtecasound - bugs in debug output - fixed: some minor bugs in LADSPA support - fixed: compile problems with 2.95.x - fixed: errors loading some LADSPA plugins - fixed: the ".mp3.wav" bug - fixed: config.h fixes 03052000 (v1.7.7r11) -** public release **- - added: --version and --help command-line options (for GNU compliance) - changed: documentation updates - fixed: some compile-time problems - fixed: chain-muting wasn't working properly 26042000 (v1.7.6d11) - added: new input/output device 'alsaplugin' - similar to normal ALSA pcm-devices, but uses the pcm-plugin layer (automatic sample rate and format conversions) - added: safety-checks against invalid command-line parameters and ia-mode commands (adding inputs, outputs, parameter control) - changed: much faster communication between engine and ui - changed: qtecasound - replaced some old widgets with new libqtecasound widgets - changed: ia-mode - c-clear now works on-the-fly - fixed: qtecasound - core dumps when removing audio objects - fixed: qtecasound - many minor bugs - fixed: core dumps when adding parameter controllers for non-existent chainops - fixed: include-file problems when compiling in a separate dir - fixed: problems in mixing multiple mono-inputs 12042000 (v1.7.5d11) - added: ALSA support for s32_le and s32_be sample formats - added: numerous fixes and small improvements to ALSA 0.5.x support - removed: dynamic loading of ALSA support - as ALSA is getting bigger and bigger, maintaining dynamic support has become more and more difficult - this means that ALSA support isn't anymore included in binary distribution packages - to get native ALSA support, you have to compile ecasound from sources - of course you can always use ALSA's OSS-emulation layer - changed: pitch-shifter (-ei) improvements [artham] - changed: above improvements also affect normal resampling - changed: ia-mode commands cop-add, cop-remove and ctrl-add can now be used with connected chainsetups (add effects on-the-fly, etc) - changed: updated LADSPA support to v1 24032000 (v1.7.4d11) - added: summary info to configure-script - changed: upgraded LADSPA support to API v1-rel1 - changed: default directory for LADSPA plugins is now /usr/local/lib/ladspa (see ecasoundrc(5)) - fixed: latency-problems with ALSA pcm-loopback - fixed: thread scheduling problems with '-r' - fixed: compile problems under Solaris - fixed: many .ewf bugs - fixed: compile problems with ALSA 0.4.x - fixed: few minor bugs in -ev and -ezf 21032000 (v1.7.3d11) - added: initial LADSPA support (-el), see ecasound(1) man page - added: 'ladspa-plugin-directory' entry to ~/.ecasoundrc - added: ia-mode commands 'aio-register', 'cop-register', 'ctrl-register', 'preset-register', 'ladspa-register'- these commands list all registered object types - changed: a more compact command-line help - fixed: nasty bug when adding effects on-the-fly (caused infinite recursion inside the object maps) 19032000 (v1.7.2d11) - added: support for ALSA 0.5.x pcm-loopback - added: more effect presets - added: ia-mode - 'aio-select-input' and 'aio-select-output' - added: ia-mode - dump-* commands, see ecasound-iam(5) for the details - removed: /dev/snd/pcmCxDy notation for specifying ALSA devices - changed: ia-mode - if aio-add-output is executed without arguments, the default output is used - fixed: libqtecasound was compiled even if --disable-qt was specified - fixed: qtecasound - libqtecasound header include path was wrong - fixed: ia-mode - problems with '_' -> '-' conversions - fixed: -erc, -erm and -epp didn't work as expected if both mono and stereo files were present in the active setup - fixed: minor bugs in ALSA pcm2 support - fixed: bugs in OSS capability checking (triggering and realtime caps), thanks to Rui Sousa for the fix - fixed: bugs in internal looping 26022000 (v1.7.1d11) - added: a new effect preset system, see user's guide and ecasound man page for more info - added: lots of default presets, see file 'effect_presets' - added: an allpass filter (-efa) - added: a comb filter (-efc) - added: a simple pitch shifter (-ei) - added: flanger (-etl), chorus (-etc) and phaser (-etp) - added: a new, faster multi-tap delay (-etm) - removed: old effect preset files and command line options - changed: rewrote the normal compressor (-ec), now takes the threshold argument as percents - changed: updated Stefan Fendt's rc-lowpass, now a 3rd stage, 36dB lowpass filter - changed: parsing of command line parameters - most changes don't affect the user-interface side - fixed: ecatools crashed with multiple inputs 17022000 (v1.7.0d11) - added: qtecasound - chainsetup status - added: automatic grouping of realtime and non-realtime audio objects for better performance - added: two-stage linear envelope (-kl2) - added: 'run' command to ia-mode - like 'start' but blocks until processing is finished - added: '-kx' option - this can be used for controlling controller parameters with other controllers - added: ia-mode command "ctrl-status" (controller status) - added: qtecasound - controller status pushbutton - added: qtecasound - a nicer looking debug-window - added: libqtecasound - a new subpackage containing generic GUI objects - added: support for chain-to-chain looping, see ecasound(1) manual page for more info - removed: qtecasound - waveform view - changed: ecawave is now the default ext. wave-editor - changed: all shortcuts are now alt+key combinations - changed: renamed ia-mode commands "cop-add-controller" to "ctrl-add" and "cop-remove-controller" to "ctrl-remove" - changed: qtecasound - some renamed pushbuttons and reassigned shortcut keys - changed: changes in debugging subsystem, affects '-d' behaviour, see ecasound man page - changed: rewritten .ewf support with lots of new features - see ecasound user's guide for more detailed info - fixed: qtecasound - position slider wasn't working - fixed: instead of just outputting raw ANSI-codes, standard ncurses routines are now used - fixed: recording from realtime inputs didn't work when processing length was not set - fixed: setting processing length didn't work in normal passive mixing mode (multiple chains) - fixed: overrun/underrun problems with ALSA 0.5.x 30012000 (v1.6.13d11) - changed: rtnull reports about over/underruns now level-4 debug messages - fixed: some problems in mixmode selection 29012000 (v1.6.12r10) -** public release **- - added: support for s24_le, s24_be, s32_le and s32_be sample formats - added: support for ALSA-subdevices (-o:alsa,card,dev,subdev) - added: to ia-mode - 'c-deselect', 'c-select-add' - added: improved multitrack-sync - added: 'default-double-buffer-size' added to .ecasoundrc - changed: ALSA pcm2-devices now opened in nonblock-mode - changed: ecasound can now be compiled in a separate obj dir - fixed: bugs in channel routing and output mixing - fixed: delay effects dumped core with mono inputs 14012000 (v1.6.11d10) - added: -ef4 - 2th-order, 24dB filter which simulates an analog active RC-lowpass filter - submitted by Stefan Fendt - added: support for ALSA 0.5.x (pcm2, no loopback) - removed: support for ALSA 0.3.1 and older - changed: 'cs-edit' now possible while processing - changed: raised-priority mode moved from chainsetups to session-level (isn't saved to ecs-files, etc) - fixed: removed the huge delay in (dis)connecting chainsetups - fixed: 'fw', 'rw', 'setpos' crashed if executed without parameters - fixed: under/overrun problems with ALSA drivers - fixed: stdin/stdout not working - fixed: c-add and c-select didn't accept multiple parameters - fixed: problems with -etf memory handling 03012000 (v1.6.10d10) - added: a realtime null audio device 'rtnull' - simulates soundcard behaviour (warns about over/underruns) - changed: 'make install' isn't forced anymore - changed: mono noisegate (-enm) replaced with a new multichannel noisegate - changed: behaviour of -r; now changes scheduling policy to SCHED_FIFO (realtime) - beware! this gives better performance, but might cause total lock-ups if something goes wrong - fixed: improvements to autoconf scripts; --enable-qt and --disable-qt now work as expected - thanks to Vadim Tkachenko for the patch - fixed: seg.faults with some files when using -z:db - fixed: many bug fixes to delay effects (-etf, -etr and -etd) - fixed: nasty bug in ewf-routines - fixed: double-buffered mode (-z:db) sometimes discarded the last few bytes before end-of-file 151299 (v1.6.9r9) -** public release **- - notice: changes in version numbering - added: linear envelope (-kl), useful for fade-ins/outs - changed: signal limiting code moved from chains to output mixing stage - when processing multichain setups, this is faster and gives more dynamic headroom - changed: mikmod default args now "-p 0 --noloops" - changed: many improvements to input double-buffering (-z:db) and multithreaded mixmode (-m:mthreaded) - fixed: bug in testing chainsetup validity - fixed: piping bugs that caused mpg123, lame and mikmod to hang in some situations - fixed: mono noise-gate (-enm) wasn't working - fixed: changes to -s broke -sr in 1.6.8r8 041299 (v1.6.8r8) -** public release **- - added: cs-index-select (see ecasound-iam(1)) - added: more info fiels to cs-status - added: configure check for Qt version (must be >= 2.x) - fixed: cs-status didn't show all chainsetups - fixed: problems with cs-load - fixed: processing ended prematurely when mixing multiple chains to one output - fixed: some uses of C++ namespaces caused compile errors with older gcc versions - fixed: in addition to '-s:cs_file.ecs', '-s cs_file.ecs' is now also accepted 251199 (v1.6.7r7) -** public release **- - changed: some not-so-important runtime info (opening and closing devices, etc) is now considered to be debug info and is not printed by default - changed: position is printed as a floating-point value - fixed: qtecasound - lots of bugs 221199 (v1.6.6d6) - fixed: cs-save and cs-save-as didn't work as expected - fixed: cs-load didn't work properly 221199 (v1.6.5d6) - added: safety-checks to prevent users from connecting invalid chainsetups - added: underlines are accepted in ia-mode commands - fixed: problems with -ev - fixed: minor bugs in audvvio object positioning 191199 (v1.6.4d6) - added: -erc - channel copy (one-to-one) and -erm - mix all channels (all-to-one) ; these are meant for handling multichannel files - added: -y option - set starting position for last specified input/output - added: -t option - set processing time in seconds (makes multitrack cut&paste possible when used with -y) - added: -tl option - enable looping (see -y and -t) - added: ia-mode: cs-length (like -t), cs-loop (like -tl) - added: you can now pass additional options to external programs (mpg123, lame, mikmod), specified in ~/.ecasoundrc - changed: mute + unmute -> mute (on/off toggle) - changed: bypass-enable + bypass-disable -> bypass - changed: minor changes in ~/.ecasoundrc format (see ecasoundrc(5)) - fixed: tried to reconnect invalid chainsetups - fixed: global forward and rewind weren't working - fixed: dumped core if number of delays (-etd) was changed during processing - fixed: gates are working once again - fixed: minor bugs in output mixing - fixed: -s option wasn't working properly - fixed: 8<->16bit conversion - fixed: bugs in AIFF output 161199 (v1.6.3d6) - added: new ia-mode commands: aio-forward, aio-rewind, aio-setpos, aio-index-select and aio-wave-edit (load currently selected audio object into an external wave editor) - added: support for using tracker modules as input sources - uses mikmod (mikmod 3.1.6 + libmikmod 3.1.7 or newer required) - changed: cleaned up the audio object interface - changed: -f parameter format has changed - instead of bits, sample type is now specified as a formatted string ("u8", "s16_le", "s24_le" and so on) - changed: in precise-sample-rate mode, removed all implicit sample rate conversions - instead a warning is issued 121199 (v1.6.2d6) - added: all ia-mode commands now implemented&documented - added: a little bit of artificial intelligence to command interpreting :) - as an example, if you want to start processing but no chainsetup is connected, ecasound tries to connect the currently selected setup, etc - fixed: given a certain combination of forward and rewind commands, processing wouldn't start anymore - fixed: delay surround mode now works normally - fixed: ecatools - files not in the default sample format were not handled properly - fixed: some bugs in double-buffering - removed: adding chain operators to multiple chains is no longer possile - this makes the library interface more powerful as client programs can have direct access to chainops they've added (see eca-controller.h for details) 101199 (v1.6.1d6) - added: most interactive-mode commands are now implemented - added: new ia-mode commands: c-mute, c-unmute, c-process, c-select-all, cs-save-as, - added: documentation for nearly all implemented ia-mode commands, see ecasound-aim(1) - changes: major changes in RPM-packaging - fixed: a very nasty bug in dynamic ALSA-support - fixed: some effects caused core dumps (bug in the sbuf iterator routines) - fixed: many minor bug fixes - removed: ia-mode commands: exec, end 081199 (v1.6.0d6) - added: iactive mode now uses GNU readline for user input - command-line editing, command history and command completion (use .inputrc for configuring) - added: 30-40 new interactive-mode commands - added: ecasound-iam(1) manual page - interactive mode documentation - added: ecasound user's guide and programmer's guide - added: 'default-to-precise-sample-rates' to ecasoundrc - whether to ignore sample rate differences (and possibly avoid resampling), affects OSS-devices, defaults to 'false' - added: -z:psr option (see above) - changed: reimplemented signal handling using POSIX signal handlers (ANSI interface was used before) - changed: divided all the bigger modules into smaller classes and files (these big modules were causing lots of compiler and resource problems) - changed: major internal changes (multichannel chain operators, improved mixing algorithms, etc) - changed: rewritten mp3-support (still using mpg123 and lame) - changed: lots of changes in handling external resources (wave and text editors, mpg123 and lame parameters, etc.) - see 'man ecasoundrc' - removed: looping (interactive-mode loop commands) - removed: 'sfx' command (iactive-mode) 011099 (v1.5.16d6) - added: changes and additions to libecasound interface are from now on logged to libecasound/ChangeLog - fixed: errors in -kf documentation 270999 (v1.5.15d6) - changed: optimized various engine and effect routines to improve ecasound's performance with complex setups - fixed: "-ev" max-amplitude wasn't reseted - fixed: some finetuning of ALSA buffer handling 210999 (v1.5.14d6) - notice: from now on development versions will be marked with a 'd' in the version number - added: configure check for libdl library - added: "-eac:amp-%,channel" channel amplify - changed: "-ea" to "-eaw", amplify with clipping control - changed: "-eas" to "-ea", normal amplify 180999 (v1.5.13r6) - added: -sr:srate option - set chainsetup sample rate - added: 'default-samplerate' to ~/.ecasoundrc - fixed: problems with OSS es1370 drivers (thanks to Billy Biggs for the patch) - fixed: resonant bandpass wasn't working (-ef1) 140999 (v1.5.12r6) -** public release **- - fixed: problems with libaudiofile (.aiff and .au/.snd support) - fixed: extra noise when upsampling - fixed: qtecasound - chainsetup's name was changed to tempfile name if edited with an external editor - fixed: qtecasound - conflict with Qt-libs when stopping processing (resulted in abort) 120999 (v1.5.11r5) - added: ldconfig is now always run after (un)install of binary RPM packages - added: if underruns/overruns occur when using ALSA devices, a warning message is given on exit (stderr) - changed: gcc's -fomit-frame-pointer isn't used anymore (caused lots of problems with exceptions) - fixed: ecasound tried to use ALSA headers even though --disable-alsa was given (eca-alsa-dyn.h and eca-midi.h) - fixed: audiofx_compressor.h tried to include obsolete error.h header file - fixed: pan effect (-epp) decreased overall volume level - fixed: fake-stereo effect (-etf) wasn't working properly - fixed: "make install" created (prefix)/share/ecasound with permission mode 644 (only root could access the directory) - fixed: some problems with effect option parsing - removed: simple lowpass filter (-ef2) 070999 (v1.5.10r5) - added: qtecasound - file dialogs now remember the current directory - added: a much more elegant system for dynamically loading ALSA support - added: support for ALSA MIDI devices (/dev/snd/midiCxDy) - changed: rewrote the MIDI-input sybsystem (works better with multiple controllers) - fixed: kvutils -package also needed configure script fixes to recognise FreeBSD's pthread implementation - fixed: although "make install" worked in all cases, plain "make" didn't work if installing ecasound 1.5.x for the first time - fixed: crashed if you had two chainsetups with ALSA devices and you tried to delete the other one - fixed: crashed in some conditions when closing .wav and .raw files 040999 (v1.5.9r5) - changed: qtecasound - in all windows with list widgets, if no item is selected, current item (if any) is used for all operations - changed: in most cases, '-r' option (raise priority) isn't needed anymore (see ecasound and ecasoundrc man pages for more info) - changed ecasoundrc - 'x-text-editor-use-getenv' is now 'true' by default - fixed: resonant lowpass filter was once again broken - fixed: configure should now recognise FreeBSD's pthread implementation (not tested yet) - fixed: in some rare cases, engine was started in interactive mixmode while the interface was in passive mode (-> program started but didn't do anything) 030999 (v1.5.8r5) - added: '!' shortcut to all windows (keyboard focus to control panel) - changed: some Makefile changes for excluding static ecasound libraries from the binary dist packages (managed to shrink binary-rpms by nearly a 1MB!) - fixed: qtecasound - shortcut-key fixes in chainsetup window - fixed: qtecasound - waveform view positioning is now much more precise than before - fixed: qtecasound - core dumps when exiting 020999 (v1.5.7r5) - added: qtecasound - chainsetup window now has a wave-edit button which loads the active file into a external wave editor; defaults to "snd", can be changed by changing the value of "x-wave-editor" in ~/.ecasoundrc - added: qtecasound - support for external text editors (can be launched from session window) - saves the active chainsetup to a text file, loads it to an editor and afterwards updates file's content back to ecasound - if "x-text-editor-use-getenv true" is specified in ~/.ecasoundrc, ecasound uses EDITOR environment variable if it's available, otherwise value of "x-default-text-editor" is used ... an of course, default value for this is the ultimate musicians tool: emacs! ;) - changed: qtecasound - some minor changes to session and chainsetup widgets - changed: .ews format (wave view cache files) has changed, ecasound can still read the old format - changed: qtecasound - "activate" button changed to a "change status" button which rotates through inactive->active->connected->inactive ... - fixed: qtecasound - enabling/disabling chains sometimes resulted in program crashes - fixed: all structs found in ecasound source code now use the standard type definations from sys/type.h (format "[u_]int'bits'_t") - this should solve some compatibility problems with non-x86 platforms - thanks for Guenter Geiger for notifying about these - fixed: a few fixes to the new double-buffering system - lots of buffer parameter fine-tuning 290899 (v1.5.6r5) - added: "-z:feature" command line option for enabling misc features - added: mmap-based double-buffering now disabled by default, enable it with "-z:db" or by putting "default-to-double-buffering true" to your ~/.ecasoundrc - added: when upgrading ecasound, new resource values will be automatically added to your ~/.ecasoundrc - fixed: crashes when getting error messages from alsa-lib (for instance when using invalid card and device numbers) - fixed: a few Makefile problems in 1.5.x versions (thanks for Vadim Tkachenko for reporting these) 280899 (v1.5.5r5) - added: improvements to resource file (~/.ecasoundrc) handling - resource files can now have comment lines (lines beginning with a '#'); resource files are rewritten only if resource values are changed directly from ecasound; '=' sign can be used as a name-value separator - fixed: since version 1.5.2r5, .cdr input/output hasn't worked (reversed byteorder when reading .crd files, .cdr output files weren't padded correctly) 270899 (v1.5.4r5) - added: experimental support for double-buffered mmap() file i/o (currently implemented for .wav/.raw input only) - fixed: thread-priority was always risen (once again) 210899 (v1.5.3r5) - added: a lowpass filter effect (-ef2); not as good as the other lowpass filters (-efl and -ef3), but should be a bit faster - fixed: 1.5.2r5 was really _slow_ (a file seek bug) 200899 (v1.5.2r5) - added: "-x" command line option - truncate outputs - added: sample rate conversion (resampling) - if audio object's sample rate differs from ecasound's internal rate the signal gets resampled (internal rate is currently 44100; can be changed from samplebuffer.h) - changed: gcc 2.95.1 is now used when developing ecasound; precompiled packages require libstdc++ 2.10.0 (comes with gcc 2.95.1) or newer - fixed: few minor fixes to the noisegate effect - fixed: upon creation, more precision is used to print effect parameters 190899 (v1.5.1r5) - fixed: problems with filters 180899 (v1.5.0r5) - added: ecatools package which now consists of programs ecatools_normalize, ecatools_fixdc and ecatools_play - see ecatools(1) man page - changed: ecasound and qtecasound now have their own source trees; rest of ecasound is compiled into the libecasound.so shared library - changed: to make ecasound relocatable, preset files are now installed to standard data dir (defaults to /usr/local/share/ecasound) - changed: lot of source file name changes - changed: ALSA support (libasound.so library) is now loaded dynamically at runtime - fixed: you had to have yodl installed to to install ecasound man pages 150899 (v1.4.6r5) -** public release **- - added: qtecasound - along with some other improvements, waveform widget now uses cache files to store wave statistics; for file "somefile.wav", cache file "somefile.wav.ews" is used - fixed: reading and writing aiff files works again; some aiff files created with sox still seem to cause trouble (might be a problem with libaudiofile) - fixed: qtecasound - a nasty mutex bug which caused ecasound to crash if you tried to use a chainsetup which has more inputs than chains 120899 (v1.4.5r4): - added: qtecasound - dialogs for adding, removing and attaching inputs and outputs - added: support for null inputs/outputs - added: effect status is now printed when exiting ecasound (doesn't affect interactive mode) - added: if OSS drivers for your soundcard don't support trigger functions, you can disable these with configure option "--disable-osstrigger" - added: -ev effect (analyze sample data) now also tells how much the analyzed signal can be amplified without clipping - added: debug level can now be set in iactive mode with "debug level" command - changed: qtecasound - shortcuts a, A and ctrl-a now do the same thing; applies to all shortcuts - fixed: adding a chain without a valid output resulted in hangs when using multithreaded mixmode - fixed: didn't compile with alsa-lib versions older than 0.3.1 - fixed: "ecasound -h" dumped core 010899 (v1.4.4r4) - added: qtecasound - now asks for a name when adding chainsetups - added: qtecasound - adding and deleting chains - changed: some layout changes 290799 (v1.4.3r4) - changed: if format supports it, outputs are now opened in read-write mode; currently supported by .wav, .cdr and .raw; when you use these as outputs, files aren't truncated if they exist - fixed: qtecasound - active chainsetup was always saved even if some other chainsetup was selected - fixed: qtecasound - crashed if you changed the active chainsetup and you had a waveform window open - fixed: qtecasound - crashed if tried to activate a invalid chainsetup - fixed: if you wrote to a output file, its length was not changed (from ecasound's viewpoint) 270799 (v1.4.2r4) - fixed: samplebuffer.h still tried to include , which is both not necessary and a wrong place to look for it; thanks to Torbjorn Tornkvist and Xavier Hosxe for notifying me - fixed: qtecasound - using multithreaded mixmode, changing chainsetups on the fly caused a lot of problems - fixed: qtecasound - shortcut keys didn't work with CLI 270799 (v1.4.1r4) - added: qtecasound - chain widget now monitors effect parameters - added: qtecasound - support for double clicks and return presses for various widgets - added: qtecasound - some new features to the waveform widget - changed: from now on, interactive mode isn't automatically enabled, if a realtime input is specified - changed: names of some functions (I'm trying to be careful how I use 'new' and 'add', 'load' and 'open', etc - fixed: qtecasound - waveform widget crashed qtecasound if the analyzed file had less than 76800 samples - fixed: if processing was completed and was restarted without a rewind/setpos, ecasound crashed/hang - fixed: raised-priority mode was sometimes enabled even without the -r option - fixed: qtecasound - when using multithreaded mixmode, exiting sometimes resulted in core dump or segfault 250799 (v1.4.0r4) - added: qtecasound - waveform widget; graphical representation for input/output objects - added: qtecasound - chain widget; view chain status - added: qtecasound - chainsetup widget; status of input, output and chain objects, enable/disable chains - added: qtecasound - session-setup widget; load and save chainsetups, create new ones, etc - changed: can now be started without a valid chainsetup if interactive mode is enabled - fixed: *serious bug* if end of input was reached, that input remained silent until ecasound was restarted (has been broken since 1.3.0r3) 240799 (v1.3.3r4) - added: -n option, sets chainsetup's name 230799 (v1.3.2r4) - added: a new compressor - thanks for Viktor Endersz for sending it to me and John S. Dyson for coding it; it really works like a dream! (option -eca) - fixed: some fixes to my old compressor (now that we have a better one, this should be used only if you really want brutal results :)) - fixed: due to some changes in ALSA libs, ecasound wouldn't compile with ALSA versions >0.3.2; haven't tested it, but should now work with both new and old ALSA libs 200799 (v1.3.1r4) -** public release **- - fixed: delay effect was broken; while fixing this I also added a new surround mode, 2 = stereo-spread - fixed: more bugs with ALSA and OSS input routines; did some multitrack recording with both of them and got suprisingly good results (it seems that finding the optimal buffer size is the key to success) 190799 (v1.3.0r3) - added: support for sessions and chainsetups; now you can store the whole runtime setup to an ascii file and load it back; the syntax used is exactly the same as the command line syntax so editing these saved chainsetup files is easy - added: "-s[:]filename" command line option for loading chainsetup files - added: "load filename" and "save filename" commands to the interactive-mode (for chainsetups) - added: support for libaudiofile (SGI audiofile) library; new file formats: .aiff, .au and .snd; (linking to audiofile can be prevented with --disable-audiofile option to the configure script) - added: -q option (quiet mode), disables all output - added: support for raw/headerless (.raw) input/output files - added: support for using standard system input and output streams (-i:stdin, -o:stdout) - added: finished the man pages, all important options and features should now be covered - fixed: file name ending with a upper-case extension wasn't recognised - fixed: when using multithreaded mixmode with complex setups, threads sometimes went out of sync causing strange behaviour - changed: size of sample buffer objects can now be changed on-the-fly (output files are not aligned to buffersize anymore) -> this makes ecasound more usable as a format conversion tool - changed: compressor wasn't working, decided to code a new one (still experimental but works better than the last one) 140799 (v1.2.3r3) - added: support for .mp2 files - fixed: still some bugs in selecting mixmode - fixed: automatic stereo-mono conversion wasn't working at all (as all chains are internally stereo, this occured everytime you specified a mono output, even if the input was mono, too) 130799 (v1.2.2r3) - added: ALSA devices can now also be opened by specifying the actual device name (/dev/snd/pcm...) - changed: default output is now always attached to chain 'all' - fixed: start/stop/forward/rewind with ALSA-output sometimes resulted in loud crackle - fixed: some bugs in the position slider of qtecasound - fixed: 'noise-gate-mono' effect was rewritten as it didn't seem to work very well 120799 (v1.2.1r3) -** public release **- - added: 'make install' now creates /etc/ecasound directory and copies all the configuration/preset files to this directory (existing files/dirs are skipped) - added: lots of crash-guards to command line parsing - added: frequently-asked-questions file (both txt and html) - added: new options to the configure script: --disable-alsa, --disable-oss and --disable-qt - fixed: bugs in mixmode multithreaded-iactive (crashed pretty much everytime) - fixed: estatus output was sometimes pretty messy 110799 (v1.2.0r2) - added: support for ALSA input/output - added: a lot of new documentation to the man pages - added: new configurable options to ~/.ecasoundrc (default-buffersize, default-to-interactive-mode, default-to-raisepriority) - added: finally implemented the 'help' command in the interactive-mode; also added a prompt, which should help a bit :) - added: autoconf and automake additions; now qtecasound is compiled only if qt library is found, OSS and ALSA modules are compiled if the necessary headers and libraries are available - added: support for single-chain effect presets (-ps command line option) - fixed: bugs with OSS-input (device was sometimes closed multiple times resulting in core dumps) - fixed: auto-runmode used 'simple-iactive' mixmode although iactive-mode wasn't set - fixed: looping wasn't working properly - fixed: -m option wasn't working - removed: simple filter effect (not really useful) - removed: 'Waiting for the processing thread' messagebox (qtecasound) 100799 (v1.1.8r2) - fixed: more synchronisation bugs 050799 (v1.1.6r2) - added: rewrote the man-pages using Yodl; now they're also available in HTML-format - fixed: OSS-output module used a non-standard location for soundcard.h (noticed by D.Phillips) 010799 (v1.1.5r2) -** public release **- - tested: did some real recording and mixing work with this version and after a few fixes, everything seems to work ok - added: now checks whether a chainop supports parameter controlling or not - added: a lot of new documentation (especially to 'Documentation/examples.html') - fixed: chain 'all' wasn't working properly - fixed: multitrack chain synchronization was broken; should now work even with complex setups - fixed: a serious bug in OSS-input: ecasound always threw an "read-error" exception when trying to read from OSS input - fixed: analyze effect (-ev) output didn't work 300699 (v1.1.4r1) -** public release **- - notice! first release; should be considered beta - fixed: if mp3 files had white-spaces in their filenames, filenames weren't interpreted correctly 250699 (v1.1.3r0) - more bug fixes - tested rpm-packaging and seemed to work ok 230699 (v1.1.2r0) - bug fixes 190699 (v1.1.1r0) - fixed: some bugs in exception handling - qtecasound: added a not-implemented message screen! ;) 180699 (v1.1.0r0) - all major features of ecasound v0.9.x and earlier are now implemented to the new program design - support for gates (time crop gate and threshold gate implemented) - support for ~/.ecasoundrc configuration file - support for GNU autoconf and automake - added some new command line shortcuts - qtecasound: added a position slider widget (displays and enables to change current position) - qtecasound: removed waveform and volume meter widgets; they will reappear in the "Chain Setup" window (still under work) 160699 (v1.0.8r0) - mp3 output support (using lame) 150699 (v1.0.7r0) - fixed: waveform -output now works with all inputs (for instance showing mp3 waveforms is now possible) - routines for interfacing with mpg123 recoded; a lot more stable than before - qtecasound now uses the new qt library (v2.0beta2) - support for various controllers (sine oscillator, MIDI cc-controllers, generic oscillator etc) - fixed: when ecasound was stopped with ctrl-c or kill, proper cleanup wasn't done 100699 (v1.0.6r0) - a new wave-form view 080699 (v1.0.5r0) - multitrack-mode sync-routines rewritten and tested - various mixmode bugs fixed 040699 (v1.0.4r0) - simple graphical vu-meters added to test the new io-system 030699 (v1.0.3r0): - multithread-io mode: one chain can be processed and mixed while waiting for getting data from other chains 020699 (v1.0.2r0): - a better way to deal with system endianess - new chain-operator routines; unless there are no no chainops, signal is always put through a clip control routine which ensures that all sample values fit the value range 010699 (v1.0.1r0) - fixed a _lot_ of bugs 310599 (v1.0.0r0) - changed version numbering - major changes in nearly all program modules aiming at a more modular and abstract design - fix: resonant_bandpass_filter wasn't working anymore 190599 (v0.9.10) - mp3 support using mpg123 (readonly) - X-Window GUI added (using Qt-libraries) 260499 (v0.9.x) - support for multitrack recording - independent effect chains - interactive command-line-interface (CLI) - looping (loop, loop_start, loop_end) - new debug -system - man -pages 311098 (v0.80) - support for MIDI-controllers - now uses glibc v2.0 and linuxthread libraries 041098 (v0.70) - began to upkeep this history file - fixing the gate-functions --- 1998: - changed development platform from Os/2 to Linux 1997-98: - complete rewrite in C++; name changed from "wavstat" to "ecasound" 1995-97: - started working with this project; original program was called "wavstat" and it basicly was just a very simple command line DSP util (running under Os/2) ----------------------------------------------------------------------- ecasound-2.9.3/config.guess0000755000076400007640000012637313604135372012617 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ecasound-2.9.3/libecasoundc/0000755000076400007640000000000013606336217013001 500000000000000ecasound-2.9.3/libecasoundc/eca-control-interface.h0000644000076400007640000000573611144366232017244 00000000000000#ifndef INCLUDED_ECA_CONTROL_INTERFACE_H #define INCLUDED_ECA_CONTROL_INTERFACE_H /** ------------------------------------------------------------------------ * ecasoundc.h: C++ implementation of the Ecasound Control Interface * Copyright (C) 2000-2002 Kai Vehmanen * * 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.1 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 * ------------------------------------------------------------------------- */ #include #include #include /** * C++ implementation of the Ecasound Control Interface * * @author Kai Vehmanen */ class ECA_CONTROL_INTERFACE { public: // ------------------------------------------------------------------- // State // ------------------------------------------------------------------- bool ready(void); // ------------------------------------------------------------------- // Issuing EIAM commands // ------------------------------------------------------------------- void command(const std::string& cmd); void command_float_arg(const std::string& cmd, double arg); // ------------------------------------------------------------------- // Getting return values // ------------------------------------------------------------------- const std::vector& last_string_list(void) const; const std::string& last_string(void) const; double last_float(void) const; int last_integer(void) const; bool last_bool(void) const; long int last_long_integer(void) const; const std::string& last_error(void) const; const std::string& last_type(void) const; bool error(void) const; /** * Returns last_integer() interpreted as a bool. */ bool last_boolean(void) const { return(last_integer() != 0); } // ------------------------------------------------------------------- // Events // ------------------------------------------------------------------- bool events_available(void); void next_event(void); const std::string& current_event(void); // ------------------------------------------------------------------- // Constructors and destructors // ------------------------------------------------------------------- ECA_CONTROL_INTERFACE(void); ~ECA_CONTROL_INTERFACE(void); private: eci_handle_t eci_repp; mutable std::string str_rep; mutable std::vector strlist_rep; }; #endif ecasound-2.9.3/libecasoundc/libecasoundc_tester.c0000644000076400007640000002215511740524567017117 00000000000000/* ------------------------------------------------------------------------ * libecasound_tester.c: Runs a set of ECI C unit tests. * Copyright (C) 2002,2006,2009 Kai Vehmanen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ------------------------------------------------------------------------ */ #include #include /* ANSI-C: atoi(), ... */ #include #include "ecasoundc.h" /* #include "eca-control-interface.h" */ /* FIXME: cannot be run on a clean-build as ecasound is not yet * installed */ /* --------------------------------------------------------------------- * Options */ #define VERBOSE /* --------------------------------------------------------------------- * Test util macros */ #ifdef VERBOSE #define ECA_TEST_ENTRY() do { printf("\n%s:%d - Test started\n", __FILE__, __LINE__); } while(0) #define ECA_TEST_SUCCESS() do { printf("%s:%d - Test passed\n", __FILE__, __LINE__); return 0; } while(0) #define ECA_TEST_FAIL(x,y) do { printf("\n%s:%d - Test failed: \"%s\"\n", __FILE__, __LINE__, y); return x; } while(0) #define ECA_TEST_NOTE(x) do { printf("%s:%d - %s\n", __FILE__, __LINE__, x); fflush(stdout); } while(0) #define ECA_TEST_TRACE(x) do { x; } while(0) #else #define ECA_TEST_ENTRY() ((void) 0) #define ECA_TEST_SUCCESS() return 0 #define ECA_TEST_FAIL(x,y) return x #define ECA_TEST_NOTE(x) ((void) 0) #define ECA_TEST_TRACE(x) do { ; } while(0) #endif /* --------------------------------------------------------------------- * Type definitions */ typedef int (*eci_test_t)(void); /* --------------------------------------------------------------------- * Test case declarations */ static int eci_test_1(void); static int eci_test_2(void); static int eci_test_3(void); static int eci_test_4(void); static int eci_test_5(void); static int eci_test_6(void); static int eci_test_7(void); static eci_test_t eci_funcs[] = { eci_test_1, eci_test_2, eci_test_3, eci_test_4, eci_test_5, eci_test_6, eci_test_7, NULL }; /* --------------------------------------------------------------------- * Funtion definitions */ int main(int argc, char *argv[]) { int n, failed = 0; const char *binpath = #ifdef NDEBUG "ECASOUND=" TEST_TOP_BUILDDIR "/ecasound/ecasound" #else "ECASOUND=" TEST_TOP_BUILDDIR "/ecasound/ecasound_debug" #endif ; ECA_TEST_TRACE(printf("Running %s tests with %s.\n", __FILE__, binpath)); putenv(binpath); if (argc > 1) { /* run just a single test */ size_t m = atoi(argv[1]); if (m > 0 && m <= (sizeof(eci_funcs) / sizeof(eci_test_t))) { if (eci_funcs[m - 1]() != 0) { ++failed; } } } else { /* run all tests */ for(n = 0; eci_funcs[n] != NULL; n++) { int ret = eci_funcs[n](); if (ret != 0) { ++failed; } } } return failed; } static int eci_test_1(void) { ECA_TEST_ENTRY(); eci_init(); if (eci_ready() == 0) ECA_TEST_FAIL(1, "eci_init failed (1)"); eci_cleanup(); eci_init(); if (eci_ready() == 0) ECA_TEST_FAIL(2, "eci_init failed (2)"); eci_cleanup(); ECA_TEST_SUCCESS(); } static int eci_test_2(void) { eci_handle_t handle; ECA_TEST_ENTRY(); handle = eci_init_r(); if (eci_ready_r(handle) == 0) ECA_TEST_FAIL(1, "eci_init_r failed (1)"); eci_cleanup_r(handle); handle = eci_init_r(); if (eci_ready_r(handle) == 0) ECA_TEST_FAIL(2, "eci_init_r failed (1)"); eci_cleanup_r(handle); ECA_TEST_SUCCESS(); } static int eci_test_3(void) { int count; ECA_TEST_ENTRY(); eci_init(); eci_command("cs-add default"); eci_command("cs-selected"); if (memcmp(eci_last_string(), "default", 7) != 0) { ECA_TEST_FAIL(1, "chainsetup addition or selection failed"); } eci_command("cs-set-length 5"); eci_command("c-add 1,2"); eci_command("c-select-all"); eci_command("c-selected"); count = eci_last_string_list_count(); if (count != 2) { ECA_TEST_FAIL(2, "chain count mismatch"); } eci_command("-i:null"); eci_command("-o:null"); eci_command("cs-connect"); eci_command("cs-connected"); if (memcmp(eci_last_string(), "default", 7) != 0) { ECA_TEST_FAIL(3, "can't connect chainsetup"); } eci_command("run"); eci_cleanup(); ECA_TEST_SUCCESS(); } static int eci_test_4(void) { eci_handle_t handle; ECA_TEST_ENTRY(); handle = eci_init_r(); if (handle == NULL) { ECA_TEST_FAIL(1, "init failed"); } eci_command_r(handle, "cs-add test_cs"); eci_command_r(handle, "c-add test_c"); eci_command_r(handle, "ai-add null"); eci_command_r(handle, "ao-add null"); eci_command_r(handle, "cs-connect"); if (eci_error_r(handle) != 0) { eci_cleanup_r(handle); ECA_TEST_FAIL(2, "cs-connect failed (1)"); } eci_command_r(handle, "cs-disconnect"); eci_command_r(handle, "ai-iselect 1"); eci_command_r(handle, "ai-remove"); eci_command_r(handle, "ai-add rtnull"); eci_command_r(handle, "cs-connect"); if (eci_error_r(handle) != 0) { eci_cleanup_r(handle); ECA_TEST_FAIL(3, "cs-connect failed (2)"); } eci_command_r(handle, "cs-disconnect"); eci_command_r(handle, "ai-iselect 1"); eci_command_r(handle, "ai-remove"); eci_command_r(handle, "ai-add null"); eci_command_r(handle, "ai-add null"); eci_command_r(handle, "ai-add null"); eci_command_r(handle, "c-add 1"); eci_command_r(handle, "ai-add null"); eci_command_r(handle, "cs-connect"); if (eci_error_r(handle) == 0) { eci_cleanup_r(handle); ECA_TEST_FAIL(3, "cs-connect succeeded when it should fail"); } eci_command_r(handle, "c-remove"); eci_command_r(handle, "c-select test_c"); eci_command_r(handle, "ai-iselect 4"); eci_command_r(handle, "ai-remove"); eci_command_r(handle, "ai-iselect 3"); eci_command_r(handle, "ai-remove"); eci_command_r(handle, "ai-iselect 2"); eci_command_r(handle, "ai-remove"); eci_command_r(handle, "ai-iselect 1"); eci_command_r(handle, "ai-attach"); eci_command_r(handle, "cs-connect"); if (eci_error_r(handle) != 0) { eci_cleanup_r(handle); ECA_TEST_FAIL(3, "cs-connect failed (3)"); } eci_command_r(handle, "cs-disconnect"); /* note: Test that ECI implementation survives sending * a "quit". This will cause the ecasound process * to exit, which needs special handling from * the ECI implementation. */ eci_command_r(handle, "quit"); eci_cleanup_r(handle); ECA_TEST_SUCCESS(); } static int eci_test_5(void) { eci_handle_t handle; int count; ECA_TEST_ENTRY(); handle = eci_init_r(); if (handle == NULL) { ECA_TEST_FAIL(1, "init failed"); } eci_command_r(handle, "cs-remove"); eci_command_r(handle, "cs-status"); eci_command_r(handle, "cs-list"); count = eci_last_string_list_count_r(handle); if (count != 0) { ECA_TEST_FAIL(1, "cs-list count not zero"); } eci_command_r(handle, "cs-add test_cs2"); eci_command_r(handle, "cs-list"); count = eci_last_string_list_count_r(handle); if (count != 1) { ECA_TEST_FAIL(2, "cs-list count not one"); } if (strncmp(eci_last_string_list_item_r(handle, 0), "test_cs2", 8) != 0) { ECA_TEST_FAIL(3, "cs name does not match"); } eci_cleanup_r(handle); ECA_TEST_SUCCESS(); } static int eci_test_6(void) { #if 0 ECA_CONTROL_INTERFACE handle; int count; ECA_TEST_ENTRY(); if (handle == NULL) { ECA_TEST_FAIL(1, "init failed"); } handle.command("cs-remove"); handle.command("cs-status"); handle.command( "cs-list"); count = handle.last_string_list().size(); if (count != 0) { ECA_TEST_FAIL(1, "cs-list count not zero"); } handle.command("cs-add test_cs2"); handle.command("cs-list"); count = handle.last_string_list().size; if (count != 1) { ECA_TEST_FAIL(2, "cs-list count not one"); } if (handle.last_string_list()[0] != "test_cs2") { ECA_TEST_FAIL(3, "cs name does not match"); } ECA_TEST_SUCCESS(); #else return 0; #endif } /** * Tests parsing long string lists. */ static int eci_test_7(void) { eci_handle_t handle; int count; ECA_TEST_ENTRY(); handle = eci_init_r(); if (handle == NULL) { ECA_TEST_FAIL(1, "init failed"); } eci_command_r(handle, "map-ladspa-list"); if (eci_error_r(handle) != 0) { ECA_TEST_FAIL(1, "error in parsing map-ladspa-list"); } eci_command_r(handle, "map-lv2-list"); if (eci_error_r(handle) != 0) { ECA_TEST_FAIL(1, "error in parsing map-lv2-list"); } eci_command_r(handle, "int-cmd-list"); if (eci_error_r(handle) != 0) { ECA_TEST_FAIL(2, "error in parsing int-cmd-list"); } count = eci_last_string_list_count_r(handle); if (count == 0) { ECA_TEST_FAIL(3, "no entries found"); } eci_cleanup_r(handle); ECA_TEST_SUCCESS(); } ecasound-2.9.3/libecasoundc/ChangeLog0000644000076400007640000000246611144366232014476 00000000000000----------------------------------------------------------------------- *** ecasound - changes and additions to libecasoundc interface *** ----------------------------------------------------------------------- 2009-02-08 Kai Vehmanen * ecasoundc.h (eci_ready): Added. * ecasoundc.h (eci_ready_r): Added. * eca-control-interface.cpp (ready): * library version 2:0:1 frozen 2003-01-07 Kai Vehmanen * library version 1:0:0 frozen 2002-10-05 Kai Vehmanen * library version changed back to 1:0:0 * library version number dropped from the library name 2002-04-25 Kai Vehmanen * library version changed to 2:0:0 * library version number added to library name; current name is libecasoundc2 2001-06-04 Kai Vehmanen * library version changed to 1:0:1 * added reentrant variants for all ECI routines (submitted by Aymeric Jeanneau) 2001-04-27 Kai Vehmanen * library version 0:0:0 frozen 2000-12-12 Kai Vehmanen * ecasoundc.h (eci_error): added 2000-12-06 Kai Vehmanen * development started; libtool version number 0:0:0 ----------------------------------------------------------------------- ecasound-2.9.3/libecasoundc/libecasoundc-config.in0000644000076400007640000000135210664032032017135 00000000000000#!/bin/sh usage() { echo "usage: $0 [OPTIONS]" cat << EOH options: [--libs] [--libs_debug] [--cflags] [--version] EOH exit 1; } prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ flags="" while test $# -gt 0 do case $1 in --libs) flags="$flags -L$libdir -lecasoundc" ;; --libs_debug) flags="$flags -L$libdir -lecasoundc_debug" ;; --ldflags) case "$libdir" in /usr/lib);; *) flags="$flags -Wl,--rpath -Wl,$libdir" ;; esac ;; --cflags) flags="$flags -I$includedir/libecasoundc" ;; --version) echo @VERSION@ ;; *) echo "$0: unknown option $1" echo usage ;; esac shift done if test -n "$flags" then echo $flags fi ecasound-2.9.3/libecasoundc/Makefile.am0000644000076400007640000000650012303075645014754 00000000000000# ---------------------------------------------------------------------- # File: ecasound/libecasoundc/Makefile.am # Description: Ecasound Control Interface C implementation. # License: LGPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- EXTRA_DIST = ChangeLog AUTOMAKE_OPTIONS = foreign # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- # !!! # remember to update eca-version.cpp if ECA_AM_DEBUG_MODE eca_ldflags = -version-info @LIBECASOUNDC_VERSION@:0:@LIBECASOUNDC_VERSION_AGE@ -static else eca_ldflags = -s -version-info @LIBECASOUNDC_VERSION@:0:@LIBECASOUNDC_VERSION_AGE@ -static endif AM_CPPFLAGS = -I$(srcdir) # -I$(top_srcdir)/libecasound # ---------------------------------------------------------------------- # build targets and compiler options target defines # ---------------------------------------------------------------------- if ECA_AM_DEBUG_MODE lib_LTLIBRARIES = libecasoundc_debug.la else lib_LTLIBRARIES = libecasoundc.la endif TESTS = libecasoundc_tester ecicpp_tester check_PROGRAMS = $(TESTS) # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- ecasoundc_includes = ecasoundc.h \ eca-control-interface.h noinst_HEADERS = $(ecasoundc_includes) # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- # standalone implementation (forks and execs the ecasound binary) ecasoundc_src = ecasoundc_sa.c \ eca-control-interface.cpp # ---------------------------------------------------------------------- # library definitons # ---------------------------------------------------------------------- libecasoundc_la_SOURCES = $(ecasoundc_src) libecasoundc_la_CFLAGS = -prefer-pic libecasoundc_la_CXXFLAGS = -prefer-pic libecasoundc_la_LIBADD = libecasoundc_la_LDFLAGS = -export-dynamic $(eca_ldflags) libecasoundc_debug_la_SOURCES = $(libecasoundc_la_SOURCES) libecasoundc_debug_la_CFLAGS = $(libecasoundc_la_CFLAGS) libecasoundc_debug_la_CXXFLAGS = $(libecasoundc_la_CXXFLAGS) libecasoundc_debug_la_LIBADD = $(libecasoundc_la_LIBADD) libecasoundc_debug_la_LDFLAGS = $(libecasoundc_la_LDFLAGS) libecasoundc_tester_SOURCES = libecasoundc_tester.c libecasoundc_tester_LDADD = $(lib_LTLIBRARIES) ecicpp_tester_SOURCES = ecicpp_tester.cpp ecicpp_tester_LDADD = $(lib_LTLIBRARIES) AM_CPPFLAGS += "-DTEST_TOP_BUILDDIR=\"$(top_builddir)\"" # --------------------------------------------------------------------- # Install targets install-data-local: $(INSTALL) -d $(DESTDIR)$(includedir)/libecasoundc cd $(srcdir) ; \ $(INSTALL_DATA) $(ecasoundc_includes) \ $(DESTDIR)$(includedir)/libecasoundc $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL_SCRIPT) libecasoundc-config $(DESTDIR)$(bindir)/ # --------------------------------------------------------------------- # Uninstall targets uninstall-local: cd $(DESTDIR)$(includedir)/libecasoundc && \ rm -f $(ecasoundc_includes) rmdir $(DESTDIR)$(includedir)/libecasoundc || echo "Skipping non-empty directory" rm -f $(DESTDIR)$(bindir)/libecasoundc-config rmdir $(DESTDIR)$(bindir) || echo "Skipping non-empty directory" ecasound-2.9.3/libecasoundc/eca-control-interface.cpp0000644000076400007640000000631611144366232017572 00000000000000// ------------------------------------------------------------------------ // eca-control-interface.cpp: C++ implementation of the Ecasound // Control Interface // Copyright (C) 2000,2002,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // 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.1 of the License, or (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "eca-control-interface.h" using std::string; using std::vector; /** * Class constructor. */ ECA_CONTROL_INTERFACE::ECA_CONTROL_INTERFACE (void) { eci_repp = eci_init_r(); } /** * Desctructor. */ ECA_CONTROL_INTERFACE::~ECA_CONTROL_INTERFACE (void) { eci_cleanup_r(eci_repp); } /** * Checks whether ECI is ready for use. */ bool ECA_CONTROL_INTERFACE::ready(void) { return (eci_ready_r(eci_repp) != 0); } /** * Parse string mode command and act accordingly. */ void ECA_CONTROL_INTERFACE::command(const string& cmd) { eci_command_r(eci_repp, cmd.c_str()); } void ECA_CONTROL_INTERFACE::command_float_arg(const string& cmd, double arg) { eci_command_float_arg_r(eci_repp, cmd.c_str(), arg); } const vector& ECA_CONTROL_INTERFACE::last_string_list(void) const { strlist_rep.clear(); int count = eci_last_string_list_count_r(eci_repp); for(int n = 0; n < count; n++) { const char* next = eci_last_string_list_item_r(eci_repp, n); assert(next != NULL); strlist_rep.push_back(string(next)); } return strlist_rep; } const string& ECA_CONTROL_INTERFACE::last_string(void) const { str_rep = string(eci_last_string_r(eci_repp)); return str_rep; } double ECA_CONTROL_INTERFACE::last_float(void) const { return eci_last_float_r(eci_repp); } int ECA_CONTROL_INTERFACE::last_integer(void) const { return eci_last_integer_r(eci_repp); } long int ECA_CONTROL_INTERFACE::last_long_integer(void) const { return eci_last_long_integer_r(eci_repp); } const string& ECA_CONTROL_INTERFACE::last_error(void) const { str_rep = string(eci_last_error_r(eci_repp)); return str_rep; } const string& ECA_CONTROL_INTERFACE::last_type(void) const { str_rep = string(eci_last_type_r(eci_repp)); return str_rep; } bool ECA_CONTROL_INTERFACE::error(void) const { return ((eci_error_r(eci_repp) != 0) ? true : false); } bool ECA_CONTROL_INTERFACE::events_available(void) { return false; } void ECA_CONTROL_INTERFACE::next_event(void) { } const string& ECA_CONTROL_INTERFACE::current_event(void) { str_rep = ""; return str_rep; } ecasound-2.9.3/libecasoundc/ecicpp_tester.cpp0000644000076400007640000000664111172704430016255 00000000000000// ------------------------------------------------------------------------ // eca-control-interface_tester.cpp: Runs a set of ECI C++ unit tests. // Copyright (C) 2002,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "eca-control-interface.h" /* FIXME: cannot be run on a clean-build as ecasound is not yet * installed */ /* --------------------------------------------------------------------- * Options */ #define VERBOSE /* --------------------------------------------------------------------- * Test util macros */ #ifdef VERBOSE #define ECA_TEST_ENTRY() printf("%s:%d - Test started", __FILE__, __LINE__) #define ECA_TEST_SUCCESS() printf("\n%s:%d - Test passed\n", __FILE__, __LINE__); return 0 #define ECA_TEST_FAIL(x,y) printf("\n%s:%d - Test failed: \"%s\"\n", __FILE__, __LINE__, y); return x #define ECA_TEST_CASE() printf("."); fflush(stdout) #define ECA_TEST_TRACE(x) do { x; } while(0) #else #define ECA_TEST_ENTRY() ((void) 0) #define ECA_TEST_SUCCESS() return 0 #define ECA_TEST_FAIL(x,y) return x #define ECA_TEST_CASE() ((void) 0) #define ECA_TEST_TRACE(x) do { ; } while(0) #endif /* --------------------------------------------------------------------- * Type definitions */ typedef int (*eci_test_t)(void); /* --------------------------------------------------------------------- * Test case declarations */ static int eci_test_1(void); static eci_test_t eci_funcs[] = { eci_test_1, NULL }; /* --------------------------------------------------------------------- * Funtion definitions */ int main(int argc, char *argv[]) { int n, failed = 0; #ifdef NDEBUG const char *binpath = "ECASOUND=" TEST_TOP_BUILDDIR "/ecasound/ecasound"; #else const char *binpath = "ECASOUND=" TEST_TOP_BUILDDIR "/ecasound/ecasound_debug"; #endif ECA_TEST_TRACE(printf("Running %s tests with %s.\n", __FILE__, binpath)); putenv((char *)binpath); for(n = 0; eci_funcs[n] != NULL; n++) { int ret = eci_funcs[n](); if (ret != 0) { ++failed; } } return failed; } static int eci_test_1(void) { ECA_CONTROL_INTERFACE handle; int count; ECA_TEST_ENTRY(); handle.command("cs-remove"); handle.command("cs-status"); handle.command("cs-list"); count = handle.last_string_list().size(); if (count != 0) { ECA_TEST_FAIL(1, "cs-list count not zero"); } handle.command("cs-add test_cs2"); handle.command("cs-list"); count = handle.last_string_list().size(); if (count != 1) { ECA_TEST_FAIL(2, "cs-list count not one"); } if (handle.last_string_list()[0] != "test_cs2") { ECA_TEST_FAIL(3, "cs name does not match"); } ECA_TEST_SUCCESS(); } ecasound-2.9.3/libecasoundc/Makefile.in0000644000076400007640000010065713606336177015004 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/libecasoundc/Makefile.am # Description: Ecasound Control Interface C implementation. # License: LGPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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@ check_PROGRAMS = $(am__EXEEXT_1) subdir = libecasoundc DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libecasoundc-config.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = libecasoundc-config 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 = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libecasoundc_la_DEPENDENCIES = am__objects_1 = libecasoundc_la-ecasoundc_sa.lo \ libecasoundc_la-eca-control-interface.lo am_libecasoundc_la_OBJECTS = $(am__objects_1) libecasoundc_la_OBJECTS = $(am_libecasoundc_la_OBJECTS) @ECA_AM_DEBUG_MODE_FALSE@am_libecasoundc_la_rpath = -rpath $(libdir) am__DEPENDENCIES_1 = libecasoundc_debug_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__objects_2 = libecasoundc_debug_la-ecasoundc_sa.lo \ libecasoundc_debug_la-eca-control-interface.lo am__objects_3 = $(am__objects_2) am_libecasoundc_debug_la_OBJECTS = $(am__objects_3) libecasoundc_debug_la_OBJECTS = $(am_libecasoundc_debug_la_OBJECTS) @ECA_AM_DEBUG_MODE_TRUE@am_libecasoundc_debug_la_rpath = -rpath \ @ECA_AM_DEBUG_MODE_TRUE@ $(libdir) am__EXEEXT_1 = libecasoundc_tester$(EXEEXT) ecicpp_tester$(EXEEXT) am_ecicpp_tester_OBJECTS = ecicpp_tester.$(OBJEXT) ecicpp_tester_OBJECTS = $(am_ecicpp_tester_OBJECTS) @ECA_AM_DEBUG_MODE_FALSE@am__DEPENDENCIES_2 = libecasoundc.la @ECA_AM_DEBUG_MODE_TRUE@am__DEPENDENCIES_2 = libecasoundc_debug.la ecicpp_tester_DEPENDENCIES = $(am__DEPENDENCIES_2) am_libecasoundc_tester_OBJECTS = libecasoundc_tester.$(OBJEXT) libecasoundc_tester_OBJECTS = $(am_libecasoundc_tester_OBJECTS) libecasoundc_tester_DEPENDENCIES = $(am__DEPENDENCIES_2) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libecasoundc_la_SOURCES) $(libecasoundc_debug_la_SOURCES) \ $(ecicpp_tester_SOURCES) $(libecasoundc_tester_SOURCES) DIST_SOURCES = $(libecasoundc_la_SOURCES) \ $(libecasoundc_debug_la_SOURCES) $(ecicpp_tester_SOURCES) \ $(libecasoundc_tester_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = -I$(srcdir) "-DTEST_TOP_BUILDDIR=\"$(top_builddir)\"" AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = ChangeLog AUTOMAKE_OPTIONS = foreign @ECA_AM_DEBUG_MODE_FALSE@eca_ldflags = -s -version-info @LIBECASOUNDC_VERSION@:0:@LIBECASOUNDC_VERSION_AGE@ -static # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- # !!! # remember to update eca-version.cpp @ECA_AM_DEBUG_MODE_TRUE@eca_ldflags = -version-info @LIBECASOUNDC_VERSION@:0:@LIBECASOUNDC_VERSION_AGE@ -static @ECA_AM_DEBUG_MODE_FALSE@lib_LTLIBRARIES = libecasoundc.la # -I$(top_srcdir)/libecasound # ---------------------------------------------------------------------- # build targets and compiler options target defines # ---------------------------------------------------------------------- @ECA_AM_DEBUG_MODE_TRUE@lib_LTLIBRARIES = libecasoundc_debug.la TESTS = libecasoundc_tester ecicpp_tester # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- ecasoundc_includes = ecasoundc.h \ eca-control-interface.h noinst_HEADERS = $(ecasoundc_includes) # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- # standalone implementation (forks and execs the ecasound binary) ecasoundc_src = ecasoundc_sa.c \ eca-control-interface.cpp # ---------------------------------------------------------------------- # library definitons # ---------------------------------------------------------------------- libecasoundc_la_SOURCES = $(ecasoundc_src) libecasoundc_la_CFLAGS = -prefer-pic libecasoundc_la_CXXFLAGS = -prefer-pic libecasoundc_la_LIBADD = libecasoundc_la_LDFLAGS = -export-dynamic $(eca_ldflags) libecasoundc_debug_la_SOURCES = $(libecasoundc_la_SOURCES) libecasoundc_debug_la_CFLAGS = $(libecasoundc_la_CFLAGS) libecasoundc_debug_la_CXXFLAGS = $(libecasoundc_la_CXXFLAGS) libecasoundc_debug_la_LIBADD = $(libecasoundc_la_LIBADD) libecasoundc_debug_la_LDFLAGS = $(libecasoundc_la_LDFLAGS) libecasoundc_tester_SOURCES = libecasoundc_tester.c libecasoundc_tester_LDADD = $(lib_LTLIBRARIES) ecicpp_tester_SOURCES = ecicpp_tester.cpp ecicpp_tester_LDADD = $(lib_LTLIBRARIES) all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libecasoundc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libecasoundc/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 libecasoundc-config: $(top_builddir)/config.status $(srcdir)/libecasoundc-config.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ 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 libecasoundc.la: $(libecasoundc_la_OBJECTS) $(libecasoundc_la_DEPENDENCIES) $(CXXLINK) $(am_libecasoundc_la_rpath) $(libecasoundc_la_LDFLAGS) $(libecasoundc_la_OBJECTS) $(libecasoundc_la_LIBADD) $(LIBS) libecasoundc_debug.la: $(libecasoundc_debug_la_OBJECTS) $(libecasoundc_debug_la_DEPENDENCIES) $(CXXLINK) $(am_libecasoundc_debug_la_rpath) $(libecasoundc_debug_la_LDFLAGS) $(libecasoundc_debug_la_OBJECTS) $(libecasoundc_debug_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done ecicpp_tester$(EXEEXT): $(ecicpp_tester_OBJECTS) $(ecicpp_tester_DEPENDENCIES) @rm -f ecicpp_tester$(EXEEXT) $(CXXLINK) $(ecicpp_tester_LDFLAGS) $(ecicpp_tester_OBJECTS) $(ecicpp_tester_LDADD) $(LIBS) libecasoundc_tester$(EXEEXT): $(libecasoundc_tester_OBJECTS) $(libecasoundc_tester_DEPENDENCIES) @rm -f libecasoundc_tester$(EXEEXT) $(LINK) $(libecasoundc_tester_LDFLAGS) $(libecasoundc_tester_OBJECTS) $(libecasoundc_tester_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecicpp_tester.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecasoundc_debug_la-eca-control-interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecasoundc_debug_la-ecasoundc_sa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecasoundc_la-eca-control-interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecasoundc_la-ecasoundc_sa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecasoundc_tester.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @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@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @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 $@ $< libecasoundc_la-ecasoundc_sa.lo: ecasoundc_sa.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_la_CFLAGS) $(CFLAGS) -MT libecasoundc_la-ecasoundc_sa.lo -MD -MP -MF "$(DEPDIR)/libecasoundc_la-ecasoundc_sa.Tpo" -c -o libecasoundc_la-ecasoundc_sa.lo `test -f 'ecasoundc_sa.c' || echo '$(srcdir)/'`ecasoundc_sa.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libecasoundc_la-ecasoundc_sa.Tpo" "$(DEPDIR)/libecasoundc_la-ecasoundc_sa.Plo"; else rm -f "$(DEPDIR)/libecasoundc_la-ecasoundc_sa.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ecasoundc_sa.c' object='libecasoundc_la-ecasoundc_sa.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_la_CFLAGS) $(CFLAGS) -c -o libecasoundc_la-ecasoundc_sa.lo `test -f 'ecasoundc_sa.c' || echo '$(srcdir)/'`ecasoundc_sa.c libecasoundc_debug_la-ecasoundc_sa.lo: ecasoundc_sa.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_debug_la_CFLAGS) $(CFLAGS) -MT libecasoundc_debug_la-ecasoundc_sa.lo -MD -MP -MF "$(DEPDIR)/libecasoundc_debug_la-ecasoundc_sa.Tpo" -c -o libecasoundc_debug_la-ecasoundc_sa.lo `test -f 'ecasoundc_sa.c' || echo '$(srcdir)/'`ecasoundc_sa.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libecasoundc_debug_la-ecasoundc_sa.Tpo" "$(DEPDIR)/libecasoundc_debug_la-ecasoundc_sa.Plo"; else rm -f "$(DEPDIR)/libecasoundc_debug_la-ecasoundc_sa.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ecasoundc_sa.c' object='libecasoundc_debug_la-ecasoundc_sa.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_debug_la_CFLAGS) $(CFLAGS) -c -o libecasoundc_debug_la-ecasoundc_sa.lo `test -f 'ecasoundc_sa.c' || echo '$(srcdir)/'`ecasoundc_sa.c .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< libecasoundc_la-eca-control-interface.lo: eca-control-interface.cpp @am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_la_CXXFLAGS) $(CXXFLAGS) -MT libecasoundc_la-eca-control-interface.lo -MD -MP -MF "$(DEPDIR)/libecasoundc_la-eca-control-interface.Tpo" -c -o libecasoundc_la-eca-control-interface.lo `test -f 'eca-control-interface.cpp' || echo '$(srcdir)/'`eca-control-interface.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libecasoundc_la-eca-control-interface.Tpo" "$(DEPDIR)/libecasoundc_la-eca-control-interface.Plo"; else rm -f "$(DEPDIR)/libecasoundc_la-eca-control-interface.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='eca-control-interface.cpp' object='libecasoundc_la-eca-control-interface.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_la_CXXFLAGS) $(CXXFLAGS) -c -o libecasoundc_la-eca-control-interface.lo `test -f 'eca-control-interface.cpp' || echo '$(srcdir)/'`eca-control-interface.cpp libecasoundc_debug_la-eca-control-interface.lo: eca-control-interface.cpp @am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_debug_la_CXXFLAGS) $(CXXFLAGS) -MT libecasoundc_debug_la-eca-control-interface.lo -MD -MP -MF "$(DEPDIR)/libecasoundc_debug_la-eca-control-interface.Tpo" -c -o libecasoundc_debug_la-eca-control-interface.lo `test -f 'eca-control-interface.cpp' || echo '$(srcdir)/'`eca-control-interface.cpp; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libecasoundc_debug_la-eca-control-interface.Tpo" "$(DEPDIR)/libecasoundc_debug_la-eca-control-interface.Plo"; else rm -f "$(DEPDIR)/libecasoundc_debug_la-eca-control-interface.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='eca-control-interface.cpp' object='libecasoundc_debug_la-eca-control-interface.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libecasoundc_debug_la_CXXFLAGS) $(CXXFLAGS) -c -o libecasoundc_debug_la-eca-control-interface.lo `test -f 'eca-control-interface.cpp' || echo '$(srcdir)/'`eca-control-interface.cpp mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) 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) 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-checkPROGRAMS 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-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-exec-am: install-libLTLIBRARIES install-info: install-info-am install-man: 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-info-am uninstall-libLTLIBRARIES \ uninstall-local .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS 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-data-local install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man 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-info-am \ uninstall-libLTLIBRARIES uninstall-local # --------------------------------------------------------------------- # Install targets install-data-local: $(INSTALL) -d $(DESTDIR)$(includedir)/libecasoundc cd $(srcdir) ; \ $(INSTALL_DATA) $(ecasoundc_includes) \ $(DESTDIR)$(includedir)/libecasoundc $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL_SCRIPT) libecasoundc-config $(DESTDIR)$(bindir)/ # --------------------------------------------------------------------- # Uninstall targets uninstall-local: cd $(DESTDIR)$(includedir)/libecasoundc && \ rm -f $(ecasoundc_includes) rmdir $(DESTDIR)$(includedir)/libecasoundc || echo "Skipping non-empty directory" rm -f $(DESTDIR)$(bindir)/libecasoundc-config rmdir $(DESTDIR)$(bindir) || echo "Skipping non-empty directory" # 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: ecasound-2.9.3/libecasoundc/ecasoundc.h0000644000076400007640000000606711144366232015042 00000000000000#ifndef INCLUDED_ECASOUNDC_H #define INCLUDED_ECASOUNDC_H /** ------------------------------------------------------------------------ * ecasoundc.h: Standalone C implementation of the * ecasound control interface * Copyright (C) 2000-2002 Kai Vehmanen * Copyright (C) 2001 Aymeric Jeanneau * * 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.1 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 * ------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif /* --------------------------------------------------------------------- * Reference on object */ typedef void * eci_handle_t; /* --------------------------------------------------------------------- * Constructing and destructing */ void eci_init(void); eci_handle_t eci_init_r(void); int eci_ready(void); int eci_ready_r(eci_handle_t p); void eci_cleanup(void); void eci_cleanup_r(eci_handle_t p); /* --------------------------------------------------------------------- * Issuing EIAM commands */ void eci_command(const char* cmd); void eci_command_r(eci_handle_t p, const char* cmd); void eci_command_float_arg(const char*, double arg); void eci_command_float_arg_r(eci_handle_t p, const char*, double arg); /* --------------------------------------------------------------------- * Getting return values */ int eci_last_string_list_count(void); int eci_last_string_list_count_r(eci_handle_t p); const char* eci_last_string_list_item(int n); const char* eci_last_string_list_item_r(eci_handle_t p, int n); const char* eci_last_string(void); const char* eci_last_string_r(eci_handle_t p); double eci_last_float(void); double eci_last_float_r(eci_handle_t p); int eci_last_integer(void); int eci_last_integer_r(eci_handle_t p); long int eci_last_long_integer(void); long int eci_last_long_integer_r(eci_handle_t p); const char* eci_last_error(void); const char* eci_last_error_r(eci_handle_t p); const char* eci_last_type(void); const char* eci_last_type_r(eci_handle_t p); int eci_error(void); int eci_error_r(eci_handle_t p); /* --------------------------------------------------------------------- * Events */ int eci_events_available(void); int eci_events_available_r(eci_handle_t p); void eci_next_event(void); void eci_next_event_r(eci_handle_t p); const char* eci_current_event(void); const char* eci_current_event_r(eci_handle_t p); #ifdef __cplusplus } #endif #endif ecasound-2.9.3/libecasoundc/ecasoundc_sa.c0000644000076400007640000011225412275660025015517 00000000000000/** * @file ecasoundc_sa.cpp Standalone C implementation of the * ecasound control interface */ /* FIXME: add check for big sync-error -> ecasound probably * died so better to give an error */ /* FIXME: add check for msgsize errors */ /** ------------------------------------------------------------------------ * ecasoundc.cpp: Standalone C implementation of the * ecasound control interface * Copyright (C) 2000-2006,2008,2009 Kai Vehmanen * Copyright (C) 2003 Michael Ewe * Copyright (C) 2001 Aymeric Jeanneau * * 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.1 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 * * ------------------------------------------------------------------------- * History of major changes: * * 2009-02-08 Kai Vehmanen * - Finally got rid of the fixed-size parsing buffers. * - Added handling (or proper ignoring) of SIGPIPE signals. * 2006-12-06 Kai Vehmanen * - Fixed severe string termination bug in handling lists of * strings. * - Fixed mechanism for waiting on grandchild ecasound process to exit. * 2003-12-24 Michael Ewe * - Fixed signaling issues on FreeBSD. Modified to perform a * double-fork to better decouple ECI stack and the ecasound * engine process. * 2002-10-04 Kai Vehmanen * - Rewritten as a standalone implementation. * 2001-06-04 Aymeric Jeanneau * - Added reentrant versions of all public ECI functions. * 2000-12-06 Kai Vehmanen * - Initial version. * * ------------------------------------------------------------------------- */ #include #include /* ANSI-C: printf(), ... */ #include /* ANSI-C: calloc(), free() */ #include /* ANSI-C: strlen() */ #include /* ANSI-C: errno */ #include #include /* POSIX: fcntl() */ #include /* XPG4-UNIX: poll() */ #include /* POSIX: pipe(), fork() */ #include /* POSIX: stat() */ #include /* POSIX: fork() */ #include /* POSIX: wait() */ #include /* POSIX: signal handling */ #include "ecasoundc.h" /* --------------------------------------------------------------------- * Options */ /* #define ECI_ENABLE_DEBUG */ /* --------------------------------------------------------------------- * Definitions and constants */ #define ECI_PARSER_BUF_SIZE 65536 #define ECI_MAX_DYN_ALLOC_SIZE 16777216 /* assert if reached */ #define ECI_MAX_FLOAT_BUF_SIZE 32 #define ECI_MAX_RETURN_TYPE_SIZE 4 #define ECI_INI_STRING_SIZE 64 #define ECI_MAX_RESYNC_ATTEMPTS 9 #define ECI_MAX_LAST_COMMAND_SIZE 64 #define ECI_READ_TIMEOUT_MS 15000 #define ECI_READ_RETVAL_TIMEOUT_MS 30000 #define ECI_STATE_INIT 0 #define ECI_STATE_LOGLEVEL 1 #define ECI_STATE_MSGSIZE 2 #define ECI_STATE_COMMON_CR_1 3 #define ECI_STATE_COMMON_LF_1 4 #define ECI_STATE_RET_TYPE 5 #define ECI_STATE_COMMON_CONTENT 6 #define ECI_STATE_COMMON_CR_2 7 #define ECI_STATE_COMMON_LF_2 8 #define ECI_STATE_COMMON_CR_3 9 #define ECI_STATE_COMMON_LF_3 10 #define ECI_STATE_SEEK_TO_LF 11 #define ECI_STATE_MSG_GEN 0 #define ECI_STATE_MSG_RETURN 1 #define ECI_TOKEN_PHASE_NONE 0 #define ECI_TOKEN_PHASE_READING 1 #define ECI_TOKEN_PHASE_VALIDATE 2 #define ECI_RETURN_TYPE_LOGLEVEL 256 #ifdef ECI_ENABLE_DEBUG #define ECI_DEBUG(x) fprintf(stderr,x) #define ECI_DEBUG_1(x,y) fprintf(stderr,x,y) #define ECI_DEBUG_2(x,y,z) fprintf(stderr,x,y,z) #define ECI_DEBUG_3(x,y,z,t) fprintf(stderr,x,y,z,t) #else #define ECI_DEBUG(x) ((void) 0) #define ECI_DEBUG_1(x,y) ((void) 0) #define ECI_DEBUG_2(x,y,z) ((void) 0) #define ECI_DEBUG_3(x,y,z,t) ((void) 0) #endif #define DBC_REQUIRE(expr) \ (expr) ? (void)(0) : (void)(fprintf(stderr, "Warning: DBC_REQUIRE failed - \"%s\", %s, %d.\n", #expr,__FILE__, __LINE__)) #define DBC_ENSURE(expr) \ (expr) ? (void)(0) : (void)(fprintf(stderr, "Warning: DBC_ENSURE failed - \"%s\", %s, %d.\n", #expr,__FILE__, __LINE__)) #define DBC_CHECK(expr) \ (expr) ? (void)(0) : (void)(fprintf(stderr, "Warning: DBC_CHECK failed - \"%s\", %s, %d.\n", #expr,__FILE__, __LINE__)) #define DBC_DECLARE(expr) expr /* --------------------------------------------------------------------- * Data structures */ struct eci_string_s { char *d; /* buffer to string contents */ int slen; /* string length in octets, including terminating null */ int size; /* buffer length in octets, including terminating null */ }; typedef struct eci_string_s eci_string; struct eci_los_list { struct eci_los_list* prev_repp; struct eci_los_list* next_repp; eci_string data_repp; }; struct eci_parser { int state_rep; int state_msg_rep; double last_f_rep; long int last_li_rep; int last_i_rep; int last_counter_rep; char last_type_repp[ECI_MAX_RETURN_TYPE_SIZE]; struct eci_los_list* last_los_repp; eci_string last_error_repp; eci_string last_s_repp; eci_string buffer_rep; int msgsize_rep; int loglevel_rep; int token_phase_rep; int buffer_current_rep; bool sync_lost_rep; }; struct eci_internal { int pid_of_child_rep; int pid_of_parent_rep; int cmd_read_fd_rep; int cmd_write_fd_rep; char last_command_repp[ECI_MAX_LAST_COMMAND_SIZE]; int commands_counter_rep; struct eci_parser* parser_repp; char farg_buf_repp[ECI_MAX_FLOAT_BUF_SIZE]; char raw_buffer_repp[ECI_PARSER_BUF_SIZE]; }; /* --------------------------------------------------------------------- * Global variables */ static eci_handle_t static_eci_rep = 0; /** * Message shown if ECASOUND is not defined. */ const char* eci_str_no_ecasound_env = "\n" "***********************************************************************\n" "* Message from libecasoundc:\n" "* \n" "* 'ECASOUND' environment variable not set. Using the default value \n" "* value 'ECASOUND=ecasound'.\n" "***********************************************************************\n" "\n"; const char* eci_str_null_handle = "\n" "***********************************************************************\n" "* Message from libecasoundc:\n" "* \n" "* A null client handle detected. This is usually caused by a bug \n" "* in the ECI application. Please report this bug to the author of\n" "* the program.\n" "***********************************************************************\n" "\n"; const char* eci_str_sync_lost = "\n" "***********************************************************************\n" "* Message from libecasoundc:\n" "* \n" "* Connection to the processing engine was lost. Check that ecasound \n" "* is correctly installed. Also make sure that ecasound is either \n" "* in some directory listed in PATH, or the environment variable\n" "* 'ECASOUND' contains the path to a working ecasound executable.\n" "***********************************************************************\n" "\n"; /* --------------------------------------------------------------------- * Declarations of static functions */ static void eci_impl_check_handle(struct eci_internal* eci_rep); static void eci_impl_free_parser(struct eci_internal* eci_rep); static void eci_impl_clean_last_values(struct eci_parser* parser); static void eci_impl_dump_parser_state(eci_handle_t ptr, const char* message); static ssize_t eci_impl_fd_read(int fd, void *buf, size_t count, int timeout); static const char* eci_impl_get_ecasound_path(void); static struct eci_los_list *eci_impl_los_list_add_item(struct eci_los_list* headptr, char* stmp, int len); static struct eci_los_list *eci_impl_los_list_alloc_item(void); static void eci_impl_los_list_clear(struct eci_los_list *ptr); static void eci_impl_read_return_value(struct eci_internal* eci_rep, int timeout); static void eci_impl_set_last_los_value(struct eci_parser* parser); static void eci_impl_set_last_values(struct eci_parser* parser); static void eci_impl_update_state(struct eci_parser* eci_rep, char c); /* --------------------------------------------------------------------- * Constructing and destructing */ /** * Initializes session. This call clears all status info and * prepares ecasound for processing. Can be used to "restart" * the library. */ void eci_init(void) { DBC_CHECK(static_eci_rep == NULL); static_eci_rep = eci_init_r(); } /** * Initializes session. This call creates a new ecasound * instance and prepares it for processing. * * @return NULL if initialization fails */ eci_handle_t eci_init_r(void) { struct eci_internal* eci_rep = NULL; int cmd_send_pipe[2], cmd_receive_pipe[2]; const char* ecasound_exec = eci_impl_get_ecasound_path(); /* step: launch ecasound process and setup two-way communication */ if (ecasound_exec != NULL && (pipe(cmd_receive_pipe) == 0 && pipe(cmd_send_pipe) == 0)) { int fork_pid = fork(); /* step: 1st fork */ if (fork_pid == 0) { /* first child (phase-1) */ /* -c = interactive mode, -D = direct prompts and banners to stderr */ const char* args[4] = { NULL, "-c", "-D", NULL }; int res = 0; struct sigaction sa; pid_t pid; sa.sa_handler=SIG_IGN; sigemptyset(&sa.sa_mask); sa.sa_flags=0; sigaction(SIGHUP, &sa, NULL); setsid(); /* step: 2nd fork (to detach from parent) */ if (fork() != 0) _exit(0); /* first child terminates here (phase-2) */ /* second child continues (phase-2) */ args[0] = ecasound_exec; /* close all unused descriptors and resources */ close(0); close(1); dup2(cmd_send_pipe[0], 0); dup2(cmd_receive_pipe[1], 1); close(cmd_receive_pipe[0]); close(cmd_receive_pipe[1]); close(cmd_send_pipe[0]); close(cmd_send_pipe[1]); freopen("/dev/null", "w", stderr); /* step: write second child's pid to the (grand) parent */ pid = getpid(); write(1, &pid, sizeof(pid)); /* step: notify the parent that we're up */ res = write(1, args, 1); res = execvp(args[0], (char**)args); if (res < 0) printf("(ecasoundc_sa) launching ecasound FAILED!\n"); close(0); close(1); _exit(res); ECI_DEBUG("(ecasoundc_sa) You shouldn't see this!\n"); } else { /* step: parent (phase-1) */ int res; char buf[1]; int status; int pid; /* set up signal handling */ struct sigaction ign_handler; ign_handler.sa_handler = SIG_IGN; sigemptyset(&ign_handler.sa_mask); ign_handler.sa_flags = 0; /* ignore the following signals */ sigaction(SIGPIPE, &ign_handler, 0); sigaction(SIGFPE, &ign_handler, 0); eci_rep = (struct eci_internal*)calloc(1, sizeof(struct eci_internal)); eci_rep->parser_repp = (struct eci_parser*)calloc(1, sizeof(struct eci_parser)); /* step: initialize variables */ eci_rep->pid_of_child_rep = fork_pid; eci_rep->commands_counter_rep = 0; eci_rep->parser_repp->last_counter_rep = 0; eci_rep->parser_repp->token_phase_rep = ECI_TOKEN_PHASE_NONE; eci_rep->parser_repp->buffer_current_rep = 0; eci_rep->parser_repp->sync_lost_rep = false; eci_impl_clean_last_values(eci_rep->parser_repp); /* waits for first child to prevent the zombie read grand child prozess id from pipe */ waitpid(eci_rep->pid_of_child_rep, &status, 0); res = read(cmd_receive_pipe[0], &pid, sizeof(pid)); if ( res != sizeof(pid) ) { ECI_DEBUG_1("(ecasoundc_sa) fork() of %s FAILED!\n", ecasound_exec); eci_impl_free_parser(eci_rep); free(eci_rep); eci_rep = NULL; } eci_rep->pid_of_child_rep = pid; eci_rep->pid_of_parent_rep = getpid(); eci_rep->cmd_read_fd_rep = cmd_receive_pipe[0]; close(cmd_receive_pipe[1]); eci_rep->cmd_write_fd_rep = cmd_send_pipe[1]; close(cmd_send_pipe[0]); /* step: switch to non-blocking mode for read */ fcntl(eci_rep->cmd_read_fd_rep, F_SETFL, O_NONBLOCK); fcntl(eci_rep->cmd_write_fd_rep, F_SETFL, O_NONBLOCK); /* step: check that fork succeeded() */ res = eci_impl_fd_read(eci_rep->cmd_read_fd_rep, buf, 1, ECI_READ_TIMEOUT_MS); if (res != 1) { ECI_DEBUG_1("(ecasoundc_sa) fork() of %s FAILED!\n", ecasound_exec); eci_impl_free_parser(eci_rep); free(eci_rep); eci_rep = NULL; } else { write(eci_rep->cmd_write_fd_rep, "debug 256\n", strlen("debug 256\n")); write(eci_rep->cmd_write_fd_rep, "int-set-float-to-string-precision 17\n", strlen("int-set-float-to-string-precision 17\n")); write(eci_rep->cmd_write_fd_rep, "int-output-mode-wellformed\n", strlen("int-output-mode-wellformed\n")); eci_rep->commands_counter_rep ++; /* step: check that exec() succeeded */ eci_impl_read_return_value(eci_rep, ECI_READ_TIMEOUT_MS); if (eci_rep->commands_counter_rep != eci_rep->parser_repp->last_counter_rep) { ECI_DEBUG_3("(ecasoundc_sa) exec() of %s FAILED (%d=%d)!\n", ecasound_exec, eci_rep->commands_counter_rep, eci_rep->parser_repp->last_counter_rep); eci_impl_free_parser(eci_rep); free(eci_rep); eci_rep = NULL; } } } } return (eci_handle_t)eci_rep; } /** * Checks whether ECI is ready for use. * * @return non-zero if ready, zero otherwise */ int eci_ready(void) { return eci_ready_r(static_eci_rep); } /** * Checks whether ECI is ready for use. * * @return non-zero if ready, zero otherwise */ int eci_ready_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; if (!ptr) return 0; if (eci_rep->pid_of_child_rep <= 0 || eci_rep->cmd_read_fd_rep < 0 || eci_rep->cmd_write_fd_rep < 0) return 0; return 1; } /** * Frees all resources. */ void eci_cleanup(void) { if (static_eci_rep != NULL) { eci_cleanup_r(static_eci_rep); static_eci_rep = NULL; } } /** * Frees all resources. */ void eci_cleanup_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; ssize_t resread = 1, respoll; char buf[1]; struct pollfd fds[1]; eci_impl_check_handle(eci_rep); ECI_DEBUG("\n(ecasoundc_sa) requesting to terminatte ecasound process.\n"); write(eci_rep->cmd_write_fd_rep, "quit\n", strlen("quit\n")); eci_rep->commands_counter_rep++; /* as we use double-fork, we cannot use waitpid() -- * to block until ecasound grandchild has exited, we * use a combination of poll+read(), * ref: http://www.greenend.org.uk/rjk/2001/06/poll.html */ ECI_DEBUG_1("\n(ecasoundc_sa) cleaning up. waiting for grandchild ecasound process %d.\n", eci_rep->pid_of_child_rep); while (resread > 0) { fds[0].fd = eci_rep->cmd_read_fd_rep; fds[0].events = POLLIN; fds[0].revents = 0; respoll = poll(fds, 1, ECI_READ_RETVAL_TIMEOUT_MS); if (fds[0].revents & (POLLIN | POLLHUP)) resread = read(eci_rep->cmd_read_fd_rep, buf, 1); else if (fds[0].revents & POLLERR) resread = -2; ECI_DEBUG_3("(ecasoundc_sa) waiting for ecasound, poll=%d, read=%d, revents=0x%02x)\n", respoll, resread, fds[0].revents); } ECI_DEBUG("(ecasoundc_sa) child exited\n"); if (eci_rep != 0) { /* close descriptors */ close(eci_rep->cmd_read_fd_rep); close(eci_rep->cmd_write_fd_rep); /* free lists of strings, if any */ eci_impl_clean_last_values(eci_rep->parser_repp); eci_impl_free_parser(eci_rep); free(eci_rep); } } /* --------------------------------------------------------------------- * Issuing EIAM commands */ /** * Sends a command to the ecasound engine. See ecasound-iam(5) for * more info. */ void eci_command(const char* command) { eci_command_r(static_eci_rep, command); } /** * Sends a command to the ecasound engine. See ecasound-iam(5) for * more info. */ void eci_command_r(eci_handle_t ptr, const char* command) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; int timeout = ECI_READ_RETVAL_TIMEOUT_MS; eci_impl_check_handle(eci_rep); if (eci_ready_r(ptr) == 0) { ECI_DEBUG("(ecasoundc_sa) not ready, unable to process commands\n"); return; } ECI_DEBUG_2("(ecasoundc_sa) writing command '%s' (cmd-counter=%d).\n", command, eci_rep->commands_counter_rep + 1); memcpy(eci_rep->last_command_repp, command, ECI_MAX_LAST_COMMAND_SIZE); eci_impl_clean_last_values(eci_rep->parser_repp); write(eci_rep->cmd_write_fd_rep, command, strlen(command)); write(eci_rep->cmd_write_fd_rep, "\n", 1); /* 'run' is the only blocking function */ if (strncmp(command, "run", 3) == 0) { ECI_DEBUG("(ecasoundc_sa) 'run' detected; disabling reply timeout!\n"); timeout = -1; } eci_rep->commands_counter_rep++; if (eci_rep->commands_counter_rep - 1 != eci_rep->parser_repp->last_counter_rep) { eci_impl_dump_parser_state(ptr, "sync error"); eci_rep->parser_repp->sync_lost_rep = true; } if (eci_rep->commands_counter_rep >= eci_rep->parser_repp->last_counter_rep) { eci_impl_read_return_value(eci_rep, timeout); } ECI_DEBUG_2("(ecasoundc_sa) set return value type='%s' (read-counter=%d).\n", eci_rep->parser_repp->last_type_repp, eci_rep->parser_repp->last_counter_rep); if (eci_rep->commands_counter_rep > eci_rep->parser_repp->last_counter_rep) { fprintf(stderr, "%s", eci_str_sync_lost); eci_rep->parser_repp->sync_lost_rep = true; } } /** * A specialized version of 'eci_command()' taking a double value * as the 2nd argument. */ void eci_command_float_arg(const char* command, double arg) { eci_command_float_arg_r(static_eci_rep, command, arg); } /** * A specialized version of 'eci_command()' taking a double value * as the 2nd argument. */ void eci_command_float_arg_r(eci_handle_t ptr, const char* command, double arg) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); snprintf(eci_rep->farg_buf_repp, ECI_MAX_FLOAT_BUF_SIZE-1, "%s %.32f", command, arg); eci_command_r(ptr, eci_rep->farg_buf_repp); } /* --------------------------------------------------------------------- * Getting return values */ /** * Returns the number of strings returned by the * last ECI command. */ int eci_last_string_list_count(void) { return(eci_last_string_list_count_r(static_eci_rep)); } /** * Returns the number of strings returned by the * last ECI command. */ int eci_last_string_list_count_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; struct eci_los_list* i; int count = 0; eci_impl_check_handle(eci_rep); for(i = eci_rep->parser_repp->last_los_repp; i != NULL; i = i->next_repp) { ++count; } return count; } /** * Returns the nth item of the list containing * strings returned by the last ECI command. * * require: * n >= 0 && n < eci_last_string_list_count() */ const char* eci_last_string_list_item(int n) { return(eci_last_string_list_item_r(static_eci_rep, n)); } /** * Returns the nth item of the list containing * strings returned by the last ECI command. * * require: * n >= 0 && n < eci_last_string_list_count() */ const char* eci_last_string_list_item_r(eci_handle_t ptr, int n) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; struct eci_los_list* i; int count = 0; eci_impl_check_handle(eci_rep); for(i = eci_rep->parser_repp->last_los_repp; i != NULL; i = i->next_repp) { if (count++ == n) { return i->data_repp.d; } } return NULL; } const char* eci_last_string(void) { return(eci_last_string_r(static_eci_rep)); } const char* eci_last_string_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); return eci_rep->parser_repp->last_s_repp.d; } double eci_last_float(void) { return(eci_last_float_r(static_eci_rep)); } double eci_last_float_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); return eci_rep->parser_repp->last_f_rep; } int eci_last_integer(void) { return(eci_last_integer_r(static_eci_rep)); } int eci_last_integer_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); return eci_rep->parser_repp->last_i_rep; } long int eci_last_long_integer(void) { return(eci_last_long_integer_r(static_eci_rep)); } long int eci_last_long_integer_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); return eci_rep->parser_repp->last_li_rep; } /** * Returns pointer to a null-terminated string containing * information about the last occured error. */ const char* eci_last_error(void) { return(eci_last_error_r(static_eci_rep)); } /** * Returns pointer to a null-terminated string containing * information about the last occured error. */ const char* eci_last_error_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); return eci_rep->parser_repp->last_error_repp.d; } const char* eci_last_type(void) { return(eci_last_type_r(static_eci_rep)); } const char* eci_last_type_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; eci_impl_check_handle(eci_rep); return eci_rep->parser_repp->last_type_repp; } /** * Whether an error has occured? * * @return zero if not in error state */ int eci_error(void) { return(eci_error_r(static_eci_rep)); } /** * Whether an error has occured? * * @return zero if not in error state */ int eci_error_r(eci_handle_t ptr) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; int res; eci_impl_check_handle(eci_rep); if (eci_ready_r(ptr) == 0) { ECI_DEBUG("(ecasoundc_sa) not ready, raising an error\n"); return 1; } if (eci_rep->parser_repp->sync_lost_rep == true) { ECI_DEBUG("(ecasoundc_sa) sync lost, raising an error\n"); return 1; } res = (eci_rep->parser_repp->last_type_repp[0] == 'e') ? 1 : 0; ECI_DEBUG_1("(ecasoundc_sa) checking for error, returning %d", res); return res; } /* --------------------------------------------------------------------- * Events */ int eci_events_available(void) { return(eci_events_available_r(static_eci_rep)); } int eci_events_available_r(eci_handle_t ptr) { return(0); } void eci_next_event(void) { eci_next_event_r(static_eci_rep); } void eci_next_event_r(eci_handle_t ptr) { } const char* eci_current_event(void) { return(eci_current_event_r(static_eci_rep)); } const char* eci_current_event_r(eci_handle_t ptr) { return(0); } /* --------------------------------------------------------------------- * Implementation of static functions */ static void eci_string_add(eci_string *dst, int at, char const *src, int len); /** * Clears the string contents. * * @post eci_string_len(str)==0 * @post strlen(str->d)==0 */ static void eci_string_clear(eci_string *str) { DBC_CHECK(str); str->slen = 0; if (str->size == 0) eci_string_add(str, 0, NULL, 0); else str->d[0] = 0; DBC_CHECK(str->d[0] == 0); } /** * Initializes the string object for use. * This must only be called after initial * object allocation. */ static void eci_string_init(eci_string *str) { DBC_CHECK(str); str->slen = 0; str->size = 0; str->d = 0; } static void eci_string_free(eci_string *str) { DBC_CHECK(str); free(str->d); str->size = 0; str->slen = 0; } #ifdef DOCUMENTATION_ONLY /** * Returns the string length. */ static int eci_string_len(eci_string *str) { DBC_CHECK(str); return str->slen; } #endif /** * Adds 'len' octets from buffer 'src' to the string * at position 'at' (position 0 being the first character). */ static void eci_string_add(eci_string *dst, int at, char const *src, int len) { int space_needed = at + len + 1; DBC_CHECK(dst); if (space_needed > dst->size) { int newsize = dst->size ? dst->size * 2 : ECI_INI_STRING_SIZE; char *newbuf; while (space_needed > newsize) { newsize *= 2; } assert(newsize <= ECI_MAX_DYN_ALLOC_SIZE); newbuf = realloc(dst->d, newsize); assert(newbuf); dst->size = newsize; dst->d = newbuf; } DBC_CHECK(space_needed <= dst->size); memcpy(&dst->d[at], src, len); dst->d[at + len] = 0; } static void eci_impl_check_handle(struct eci_internal* eci_rep) { if (eci_rep == NULL) { fprintf(stderr, "%s", eci_str_null_handle); DBC_CHECK(eci_rep != NULL); exit(-1); } } static void eci_impl_free_parser(struct eci_internal* eci_rep) { DBC_CHECK(eci_rep); eci_string_free(&eci_rep->parser_repp->last_error_repp); eci_string_free(&eci_rep->parser_repp->last_s_repp); eci_string_free(&eci_rep->parser_repp->buffer_rep); free(eci_rep->parser_repp); eci_rep->parser_repp = 0; } static void eci_impl_clean_last_values(struct eci_parser* parser) { DBC_CHECK(parser != 0); eci_impl_los_list_clear(parser->last_los_repp); parser->last_los_repp = NULL; parser->last_i_rep = 0; parser->last_li_rep = 0; parser->last_f_rep = 0.0f; eci_string_clear(&parser->last_error_repp); eci_string_clear(&parser->last_s_repp); } static void eci_impl_dump_parser_state(eci_handle_t ptr, const char* message) { struct eci_internal* eci_rep = (struct eci_internal*)ptr; fprintf(stderr, "\n(ecasoundc_sa) Error='%s', cmd='%s' last_error='%s' cmd_cnt=%d last_cnt=%d.\n", message, eci_rep->last_command_repp, eci_last_error_r(ptr), eci_rep->commands_counter_rep, eci_rep->parser_repp->last_counter_rep); } /** * Attempts to read up to 'count' bytes from file descriptor 'fd' * into the buffer starting at 'buf'. If no data is available * for reading, up to 'timeout' milliseconds will be waited. * A negative value means infinite timeout. */ static ssize_t eci_impl_fd_read(int fd, void *buf, size_t count, int timeout) { int nfds = 1; struct pollfd ufds; ssize_t rescount = 0; int ret; ufds.fd = fd; ufds.events = POLLIN | POLLPRI; ufds.revents = 0; ret = poll(&ufds, nfds, timeout); if (ret > 0) { if (ufds.revents & POLLIN || ufds.revents & POLLPRI) { rescount = read(fd, buf, count); } } else if (ret == 0) { /* timeout */ rescount = -1; } return rescount; } static const char* eci_impl_get_ecasound_path(void) { const char* result = getenv("ECASOUND"); if (result == NULL) { fprintf(stderr, "%s", eci_str_no_ecasound_env); result = "ecasound"; } return result; } static struct eci_los_list *eci_impl_los_list_add_item(struct eci_los_list* head, char* stmp, int len) { struct eci_los_list* i = head; struct eci_los_list* last = NULL; /* find end of list */ while(i != NULL) { last = i; i = i->next_repp; } /* add to the end, copy data */ i = eci_impl_los_list_alloc_item(); eci_string_add(&i->data_repp, 0, stmp, len); if (last != NULL) last->next_repp = i; /* ECI_DEBUG_3("(ecasoundc_sa) adding item '%s' to los list; head=%p, i=%p\n", stmp, (void*)head, (void*)i); */ /* created a new list, return the new item */ if (head == NULL) return i; /* return the old head */ return head; } struct eci_los_list *eci_impl_los_list_alloc_item(void) { struct eci_los_list *item; /* ECI_DEBUG("(ecasoundc_sa) list alloc item\n"); */ item = (struct eci_los_list*)calloc(1, sizeof(struct eci_los_list)); DBC_CHECK(item != NULL); item->next_repp = item->prev_repp = NULL; eci_string_clear(&item->data_repp); return item; } static void eci_impl_los_list_clear(struct eci_los_list *ptr) { struct eci_los_list *i = ptr; ECI_DEBUG_1("(ecasoundc_sa) clearing list, i=%p\n", (void*)i); while(i != NULL) { /* ECI_DEBUG_1("(ecasoundc_sa) freeing list item %p\n", (void*)i); */ struct eci_los_list* next = i->next_repp; eci_string_free(&i->data_repp); free(i); i = next; } } static void eci_impl_read_return_value(struct eci_internal* eci_rep, int timeout) { char* raw_buffer = eci_rep->raw_buffer_repp; int attempts = 0; DBC_CHECK(eci_rep->commands_counter_rep >= eci_rep->parser_repp->last_counter_rep); while(attempts < ECI_MAX_RESYNC_ATTEMPTS) { int res = eci_impl_fd_read(eci_rep->cmd_read_fd_rep, raw_buffer, ECI_PARSER_BUF_SIZE-1, timeout); if (res > 0) { int n; raw_buffer[res] = 0; /* ECI_DEBUG_2("\n(ecasoundc_sa) read %u bytes:\n--cut--\n%s\n--cut--\n", res, raw_buffer); */ for(n = 0; n < res; n++) { /* int old = eci_rep->parser_repp->state_rep; */ eci_impl_update_state(eci_rep->parser_repp, raw_buffer[n]); /* if (old != eci_rep->parser_repp->state_rep) ECI_DEBUG_3("state change %d-%d, c=[%02X].\n", old, eci_rep->parser_repp->state_rep, raw_buffer[n]); */ } if (eci_rep->commands_counter_rep == eci_rep->parser_repp->last_counter_rep) break; /* read return values until the correct one is found */ } else { if (res < 0) { ECI_DEBUG_1("(ecasoundc_sa) timeout when reading return values (attempts=%d)!\n", attempts); eci_rep->parser_repp->sync_lost_rep = true; break; } } ++attempts; } if (eci_rep->commands_counter_rep != eci_rep->parser_repp->last_counter_rep) { eci_impl_dump_parser_state(eci_rep, "read() error"); eci_rep->parser_repp->sync_lost_rep = true; } } /** * Sets the last 'list of strings' values. * * @pre parser != 0 * @pre parser->state_rep == ECI_STATE_COMMON_LF_3 */ static void eci_impl_set_last_los_value(struct eci_parser* parser) { struct eci_los_list* i = parser->last_los_repp; int quoteflag = 0, m = 0, n; eci_string stmp; eci_string_init(&stmp); DBC_CHECK(parser != 0); DBC_CHECK(parser->state_rep == ECI_STATE_COMMON_LF_3); ECI_DEBUG_2("(ecasoundc_sa) parsing a list '%s' (count=%d)\n", parser->buffer_rep.d, parser->buffer_current_rep); eci_impl_los_list_clear(i); parser->last_los_repp = NULL; for(n = 0; n < parser->buffer_current_rep && n < parser->msgsize_rep; n++) { char c = parser->buffer_rep.d[n]; if (c == '\"') { quoteflag = !quoteflag; } else if (c == '\\') { n++; eci_string_add(&stmp, m++, &parser->buffer_rep.d[n], 1); } else if (c != ',' || quoteflag == 1) { eci_string_add(&stmp, m++, &parser->buffer_rep.d[n], 1); } else { if (m == 0) continue; i = eci_impl_los_list_add_item(i, stmp.d, m); m = 0; } } if (m > 0) { i = eci_impl_los_list_add_item(i, stmp.d, m); } parser->last_los_repp = i; eci_string_free(&stmp); } /** * Sets the 'last value' fields in the given 'parser' * object. * * @pre parser != 0 * @pre parser->state_rep == ECI_STATE_COMMON_LF_3 */ static void eci_impl_set_last_values(struct eci_parser* parser) { DBC_CHECK(parser != 0); DBC_CHECK(parser->state_rep == ECI_STATE_COMMON_LF_3); switch(parser->last_type_repp[0]) { case 's': eci_string_add(&parser->last_s_repp, 0, parser->buffer_rep.d, parser->buffer_current_rep); break; case 'S': eci_impl_set_last_los_value(parser); break; case 'i': parser->last_i_rep = atoi(parser->buffer_rep.d); break; case 'l': parser->last_li_rep = atol(parser->buffer_rep.d); break; case 'f': parser->last_f_rep = atof(parser->buffer_rep.d); break; case 'e': eci_string_add(&parser->last_error_repp, 0, parser->buffer_rep.d, parser->buffer_current_rep); break; default: {} } } static void eci_impl_update_state(struct eci_parser* parser, char c) { switch(parser->state_rep) { case ECI_STATE_INIT: if (c >= 0x30 && c <= 0x39) { parser->token_phase_rep = ECI_TOKEN_PHASE_READING; parser->buffer_current_rep = 0; eci_string_clear(&parser->buffer_rep); parser->state_rep = ECI_STATE_LOGLEVEL; } else { parser->token_phase_rep = ECI_TOKEN_PHASE_NONE; } break; case ECI_STATE_LOGLEVEL: if (c == ' ') { parser->loglevel_rep = atoi(parser->buffer_rep.d); if (parser->loglevel_rep == ECI_RETURN_TYPE_LOGLEVEL) { /* ECI_DEBUG_3("\n(ecasoundc_sa) found rettype loglevel '%s' (i=%d,len=%d).\n", parser->buffer_repp, parser->loglevel_rep, parser->buffer_current_rep); */ parser->state_msg_rep = ECI_STATE_MSG_RETURN; } else { /* ECI_DEBUG_3("\n(ecasoundc_sa) found loglevel '%s' (i=%d,parser->buffer_current_rep=%d).\n", buf, parser->loglevel_rep, parser->buffer_current_rep); */ parser->state_msg_rep = ECI_STATE_MSG_GEN; } parser->state_rep = ECI_STATE_MSGSIZE; parser->token_phase_rep = ECI_TOKEN_PHASE_NONE; } else if (c < 0x30 && c > 0x39) { parser->state_rep = ECI_STATE_SEEK_TO_LF; } break; case ECI_STATE_MSGSIZE: if ((c == ' ' && parser->state_msg_rep == ECI_STATE_MSG_RETURN) || (c == 0x0d && parser->state_msg_rep == ECI_STATE_MSG_GEN)) { parser->msgsize_rep = atoi(parser->buffer_rep.d); /* ECI_DEBUG_3("(ecasoundc_sa) found msgsize '%s' (i=%d,len=%d).\n", parser->buffer_repp, parser->msgsize_rep, parser->buffer_current_rep); */ if (parser->state_msg_rep == ECI_STATE_MSG_GEN) { parser->state_rep = ECI_STATE_COMMON_LF_1; } else { parser->state_rep = ECI_STATE_RET_TYPE; } parser->token_phase_rep = ECI_TOKEN_PHASE_NONE; } else if (c < 0x30 && c > 0x39) { parser->state_rep = ECI_STATE_SEEK_TO_LF; } else if (parser->token_phase_rep == ECI_TOKEN_PHASE_NONE) { parser->token_phase_rep = ECI_TOKEN_PHASE_READING; parser->buffer_current_rep = 0; eci_string_clear(&parser->buffer_rep); } break; case ECI_STATE_COMMON_CR_1: if (c == 0x0d) parser->state_rep = ECI_STATE_COMMON_LF_1; else parser->state_rep = ECI_STATE_INIT; break; case ECI_STATE_COMMON_LF_1: if (c == 0x0a) { parser->state_rep = ECI_STATE_COMMON_CONTENT; } else parser->state_rep = ECI_STATE_INIT; break; case ECI_STATE_RET_TYPE: if (c == 0x0d) { /* parse return type */ /* set 'parser->last_type_repp' */ int len = (parser->buffer_current_rep < ECI_MAX_RETURN_TYPE_SIZE) ? parser->buffer_current_rep : (ECI_MAX_RETURN_TYPE_SIZE - 1); memcpy(parser->last_type_repp, parser->buffer_rep.d, len); parser->last_type_repp[len] = 0; ECI_DEBUG_2("(ecasoundc_sa) found rettype '%s' (len=%d)\n", parser->last_type_repp, parser->buffer_current_rep); parser->state_rep = ECI_STATE_COMMON_LF_1; parser->token_phase_rep = ECI_TOKEN_PHASE_NONE; } else if (parser->token_phase_rep == ECI_TOKEN_PHASE_NONE) { parser->token_phase_rep = ECI_TOKEN_PHASE_READING; parser->buffer_current_rep = 0; eci_string_clear(&parser->buffer_rep); } break; case ECI_STATE_COMMON_CONTENT: if (c == 0x0d) { /* parse return type */ /* set 'parser->last_xxx_yyy' */ /* handle empty content */ if (parser->msgsize_rep == 0) eci_string_clear(&parser->buffer_rep); ECI_DEBUG_2("(ecasoundc_sa) found content, loglevel=%d, msgsize=%d", parser->loglevel_rep, parser->msgsize_rep); if (parser->state_msg_rep == ECI_STATE_MSG_GEN) ECI_DEBUG(".\n"); else ECI_DEBUG_1(" type='%s'.\n", parser->last_type_repp); parser->state_rep = ECI_STATE_COMMON_LF_2; parser->token_phase_rep = ECI_TOKEN_PHASE_VALIDATE; } else if (parser->token_phase_rep == ECI_TOKEN_PHASE_NONE) { parser->token_phase_rep = ECI_TOKEN_PHASE_READING; parser->buffer_current_rep = 0; eci_string_clear(&parser->buffer_rep); } break; case ECI_STATE_COMMON_CR_2: if (c == 0x0d) parser->state_rep = ECI_STATE_COMMON_LF_2; else parser->state_rep = ECI_STATE_COMMON_CONTENT; break; case ECI_STATE_COMMON_LF_2: if (c == 0x0a) parser->state_rep = ECI_STATE_COMMON_CR_3; else parser->state_rep = ECI_STATE_COMMON_CONTENT; break; case ECI_STATE_COMMON_CR_3: if (c == 0x0d) parser->state_rep = ECI_STATE_COMMON_LF_3; else parser->state_rep = ECI_STATE_COMMON_CONTENT; break; case ECI_STATE_COMMON_LF_3: if (c == 0x0a) { if (parser->state_msg_rep == ECI_STATE_MSG_RETURN) { ECI_DEBUG_1("(ecasoundc_sa) rettype-content validated: <<<%s>>>\n", parser->buffer_rep.d); eci_impl_set_last_values(parser); parser->last_counter_rep++; } else { ECI_DEBUG_1("(ecasoundc_sa) gen-content validated: <<<%s>>>\n", parser->buffer_rep.d); } parser->state_rep = ECI_STATE_INIT; } else parser->state_rep = ECI_STATE_COMMON_CONTENT; break; case ECI_STATE_SEEK_TO_LF: if (c == 0x0a) { parser->token_phase_rep = ECI_TOKEN_PHASE_NONE; parser->state_rep = ECI_STATE_INIT; } break; default: {} } /* end of switch() */ if (parser->token_phase_rep == ECI_TOKEN_PHASE_READING) { eci_string_add(&parser->buffer_rep, parser->buffer_current_rep, &c, 1); ++parser->buffer_current_rep; } //ECI_DEBUG_2("(ecasoundc_sa) parser buf contents: '%s' (cur=%d)\n.", parser->buffer_rep.d, parser->buffer_current_rep); } ecasound-2.9.3/COPYING.GPL0000644000076400007640000004311010664032032011726 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. ecasound-2.9.3/ltmain.sh0000644000076400007640000117671213604135367012126 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.6 Debian-2.4.6-9" package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do if eval $_G_hook '"$@"'; then # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift _G_rc_run_hooks=: fi done $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, you may remove/edit # any options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. In this case you also must return $EXIT_SUCCESS to let the # hook's caller know that it should pay attention to # '_result'. Returning $EXIT_FAILURE signalizes that # arguments are left untouched by the hook and therefore caller will ignore the # result variable. # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). There is # # no need to do the equivalent (but slower) action: # # func_quote_for_eval ${1+"$@"} # # my_options_prep_result=$func_quote_for_eval_result # false # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@", we could need that later # # if $args_changed is true. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # if $args_changed; then # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # fi # # $args_changed # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # false # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd _G_func_options_finish_exit=false if func_run_hooks func_options ${1+"$@"}; then func_options_finish_result=$func_run_hooks_result _G_func_options_finish_exit=: fi $_G_func_options_finish_exit } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_rc_options=false for my_func in options_prep parse_options validate_options options_finish do if eval func_$my_func '${1+"$@"}'; then eval _G_res_var='$'"func_${my_func}_result" eval set dummy "$_G_res_var" ; shift _G_rc_options=: fi done # Save modified positional parameters for caller. As a top-level # options-parser function we always need to set the 'func_options_result' # variable (regardless the $_G_rc_options value). if $_G_rc_options; then func_options_result=$_G_res_var else func_quote_for_eval ${1+"$@"} func_options_result=$func_quote_for_eval_result fi $_G_rc_options } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= _G_rc_options_prep=false if func_run_hooks func_options_prep ${1+"$@"}; then _G_rc_options_prep=: # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result fi $_G_rc_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= _G_rc_parse_options=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. if func_run_hooks func_parse_options ${1+"$@"}; then eval set dummy "$func_run_hooks_result"; shift _G_rc_parse_options=: fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_rc_parse_options=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_rc_parse_options=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac $_G_match_parse_options && _G_rc_parse_options=: done if $_G_rc_parse_options; then # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result fi $_G_rc_parse_options } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd _G_rc_validate_options=false # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" if func_run_hooks func_validate_options ${1+"$@"}; then # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result _G_rc_validate_options=: fi # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE $_G_rc_validate_options } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.4.6-9 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result fi $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result fi $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: ecasound-2.9.3/depcomp0000755000076400007640000005602013604135372011643 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: ecasound-2.9.3/configure0000755000076400007640000252120613606336200012175 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for ecasound 2.9.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ecasound' PACKAGE_TARNAME='ecasound' PACKAGE_VERSION='2.9.3' PACKAGE_STRING='ecasound 2.9.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="libecasound/audiofx.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_subst_vars='LTLIBOBJS LIBOBJS ECA_AM_ALL_STATIC_FALSE ECA_AM_ALL_STATIC_TRUE ECA_S_EXTRA_LIBS ECA_S_EXTRA_CPPFLAGS LIBLO_LIBS LIBLO_CFLAGS LIBLILV_LIBS LIBLILV_CFLAGS LIBOIL_LIBS LIBOIL_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG ECA_S_READLINE_LIBS ECA_S_READLINE_INCLUDES ECA_AM_SYSTEM_READLINE_FALSE ECA_AM_SYSTEM_READLINE_TRUE ECA_AM_KVUTILS_INSTALLED_FALSE ECA_AM_KVUTILS_INSTALLED_TRUE ECA_S_JACK_INCLUDES ECA_S_JACK_LIBS ECA_AM_COMPILE_JACK_FALSE ECA_AM_COMPILE_JACK_TRUE ECA_AM_COMPILE_ALSA_FALSE ECA_AM_COMPILE_ALSA_TRUE ECA_AM_COMPILE_SNDFILE_FALSE ECA_AM_COMPILE_SNDFILE_TRUE ECA_AM_COMPILE_AUDIOFILE_FALSE ECA_AM_COMPILE_AUDIOFILE_TRUE ECA_AM_USE_TERMCAP_FALSE ECA_AM_USE_TERMCAP_TRUE ECA_AM_USE_NCURSES_FALSE ECA_AM_USE_NCURSES_TRUE LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL ECA_AM_RUBYECASOUND_INSTALL_FALSE ECA_AM_RUBYECASOUND_INSTALL_TRUE ECA_S_RUBY_SITEDIR RUBYPATH ECA_AM_PYECASOUND_INSTALL_FALSE ECA_AM_PYECASOUND_INSTALL_TRUE ECA_AM_PYECASOUND_CEXT_FALSE ECA_AM_PYECASOUND_CEXT_TRUE ECA_S_PYTHON_DLMODULES ECA_S_PYTHON_MODULES PYTHONPATH ECA_AM_COMPILE_SAMPLERATE_FALSE ECA_AM_COMPILE_SAMPLERATE_TRUE ECA_AM_COMPILE_ARTS_FALSE ECA_AM_COMPILE_ARTS_TRUE ARTSC_CONFIG ECA_AM_COMPILE_OSS_FALSE ECA_AM_COMPILE_OSS_TRUE EGREP GREP CXXCPP ECA_AM_DISABLE_EFFECTS_FALSE ECA_AM_DISABLE_EFFECTS_TRUE ECA_S_PREFIX ECA_AM_FEELING_EXPERIMENTAL_FALSE ECA_AM_FEELING_EXPERIMENTAL_TRUE ECA_AM_DEBUG_MODE_FALSE ECA_AM_DEBUG_MODE_TRUE AM_LDFLAGS AM_CPPFLAGS AM_CXXFLAGS AM_CFLAGS host_os host_vendor host_cpu host build_os build_vendor build_cpu build CPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LIBKVUTILS_VERSION_AGE LIBKVUTILS_VERSION LIBECASOUNDC_VERSION_AGE LIBECASOUNDC_VERSION LIBECASOUND_VERSION_AGE LIBECASOUND_VERSION am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_debug enable_experimental enable_dbc enable_effects with_extra_cppflags with_extra_libs with_largefile enable_largefile enable_oss enable_osstrigger enable_arts with_libsamplerate enable_libsamplerate enable_pyecasound with_python_modules enable_python_force_site_packages enable_rubyecasound enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_ncurses enable_audiofile enable_sndfile enable_alsa with_jack enable_jack enable_sys_readline enable_liboil enable_liblilv enable_liblo enable_all_static ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CXXCPP LT_SYS_LIBRARY_PATH PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBOIL_CFLAGS LIBOIL_LIBS LIBLILV_CFLAGS LIBLILV_LIBS LIBLO_CFLAGS LIBLO_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures ecasound 2.9.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/ecasound] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ecasound 2.9.3:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-debug Enable debugging (default = no) --enable-experimental Enable experimental code (default = no) --disable-dbc Don't check design-by-contract assertions (default = check) --disable-effects Disable effects (default = no) --disable-largefile omit support for large files --disable-oss Disable OSS (default = no) --disable-osstrigger Disable the use of OSS trigger functions (default = no) --disable-arts Disable aRts support (default = no) --disable-libsamplerate Disable libsamplerate support (default = no) --enable-pyecasound Enable compilation of pyecasound (default = python) --enable-python-force-site-packages force install Python modules into site-packages even when it doesn't exist default=no --enable-rubyecasound Enable rubyecasound (default = yes) --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-ncurses Disable ncurses (default = no) --disable-audiofile Disable libaudiofile (default = no) --disable-sndfile Disable libsndfile (default = no) --disable-alsa Disable ALSA (default = no) --enable-jack Enable JACK support (default=yes, if found) --enable-sys-readline Compile with system readline (default=yes) --enable-liboil Use liboil if available (default=no) --enable-liblilv Use liblilv if available (default=yes) --enable-liblo Use liblo if available (default=yes) --enable-all-static Build only static binaries (default = no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-extra-cppflags=FLAGS pass extra flags to cpp --with-extra-libs=FLAGS pass extra flags to linker --with-largefile deprecated option, now used by default --with-libsamplerate=DIR Compile against libsamplerate installed in DIR --with-python-modules=DIR install Python modules in DIR --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-jack=DIR Compile against JACK installed in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBOIL_CFLAGS C compiler flags for LIBOIL, overriding pkg-config LIBOIL_LIBS linker flags for LIBOIL, overriding pkg-config LIBLILV_CFLAGS C compiler flags for LIBLILV, overriding pkg-config LIBLILV_LIBS linker flags for LIBLILV, overriding pkg-config LIBLO_CFLAGS C compiler flags for LIBLO, overriding pkg-config LIBLO_LIBS linker flags for LIBLO, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF ecasound configure 2.9.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ecasound $as_me 2.9.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version="1.9" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='ecasound' VERSION='2.9.3' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" echo "------------------------------------------------------------------" echo "1. Section: Basic setup" echo "------------------------------------------------------------------" LIBECASOUND_VERSION=24 LIBECASOUND_VERSION_AGE=0 LIBECASOUNDC_VERSION=2 LIBECASOUNDC_VERSION_AGE=1 LIBKVUTILS_VERSION=10 LIBKVUTILS_VERSION_AGE=0 cat >>confdefs.h <<_ACEOF #define LIBECASOUND_VERSION ${LIBECASOUND_VERSION} _ACEOF cat >>confdefs.h <<_ACEOF #define LIBECASOUND_VERSION_AGE ${LIBECASOUND_VERSION_AGE} _ACEOF cat >>confdefs.h <<_ACEOF #define LIBECASOUNDC_VERSION ${LIBECASOUNDC_VERSION} _ACEOF cat >>confdefs.h <<_ACEOF #define LIBKVUTILS_VERSION ${LIBKVUTILS_VERSION} _ACEOF cat >>confdefs.h <<_ACEOF #define LIBKVUTILS_VERSION_AGE ${LIBKVUTILS_VERSION_AGE} _ACEOF ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac EXTRACPPFLAGS="-D_REENTRANT -D_XOPEN_SOURCE=600" EXTRAGCCFLAGS="-ffast-math -fstrict-aliasing" EXTRACXXFLAGS="-std=c++98" if test x${GXX} = xyes; then AM_CXXFLAGS="$AM_CXXFLAGS $EXTRAGCCFLAGS" AM_CFLAGS="$AM_CFLAGS $EXTRAGCCFLAGS" fi AM_CPPFLAGS="$AM_CPPFLAGS $EXTRACPPFLAGS" AM_CXXFLAGS="$AM_CXXFLAGS $EXTRACXXFLAGS" eca_platform_python_impl="python" eca_platform_curses_support="yes" case "$host" in *-*-openbsd*) AM_CFLAGS="$AM_CFLAGS -pthread" AM_CXXFLAGS="$AM_CXXFLAGS -pthread" echo "Setting OpenBSD compilation options for POSIX threads" ;; *-*-freebsd*) AM_CFLAGS="$AM_CFLAGS -pthread" AM_CPPFLAGS="$AM_CPPFLAGS -D_THREAD_SAFE -D_P1003_1B_VISIBLE" AM_CXXFLAGS="$AM_CXXFLAGS -pthread" echo "Setting FreeBSD compilation options for POSIX threads" ;; *-*-solaris*) AM_CPPFLAGS="$AM_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS" LIBS="$LIBS -lposix4 -lpthread" echo "Setting Solaris compilation options for POSIX threads" if test x$CXX = xCC; then LIBS="$LIBS -mt" AM_CXXFLAGS="$AM_CXXFLAGS -instances=static" echo "Sun Workshop C++ compiler detected. Enabling static template instantation." fi ;; *-*-linux-gnu) ;; alpha*-*-linux-*) AM_CFLAGS="$AM_CFLAGS -mieee" AM_CXXFLAGS="$AM_CXXFLAGS -mieee" echo "Enabling fully IEEE compliant floating-point code generation on Alpha." ;; *darwin*) if test "$GCC" = yes; then AM_CPPFLAGS="$AM_CPPFLAGS -D_P1003_1B_VISIBLE" fi ;; *) echo "Using generic settings for POSIX thread support." ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } if ${ac_cv_search_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF for ac_lib in '' pthread c_r; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_pthread_create=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_pthread_create+:} false; then : break fi done if ${ac_cv_search_pthread_create+:} false; then : else ac_cv_search_pthread_create=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 $as_echo "$ac_cv_search_pthread_create" >&6; } ac_res=$ac_cv_search_pthread_create if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "** POSIX.4 threads not installed or broken **" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } if ${ac_cv_search_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_clock_gettime+:} false; then : break fi done if ${ac_cv_search_clock_gettime+:} false; then : else ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 $as_echo "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "------------------------------------------------------------------" echo "2. Section: Options for the configure script" echo "------------------------------------------------------------------" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging" >&5 $as_echo_n "checking whether to enable debugging... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } include_debug=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } include_debug=no ;; *) as_fn_error $? "Invalid parameter value for --enable-debug: $enableval" "$LINENO" 5 ;; esac fi if test x$include_debug = xyes; then ECA_AM_DEBUG_MODE_TRUE= ECA_AM_DEBUG_MODE_FALSE='#' else ECA_AM_DEBUG_MODE_TRUE='#' ECA_AM_DEBUG_MODE_FALSE= fi if test x$include_debug = xyes; then EXTRADEBUGFLAGS="-Wall -O" $as_echo "#define ECA_DEBUG_MODE 1" >>confdefs.h else EXTRADEBUGFLAGS="-DNDEBUG" fi AM_CXXFLAGS="$AM_CXXFLAGS $EXTRADEBUGFLAGS" AM_CFLAGS="$AM_CFLAGS $EXTRADEBUGFLAGS" # Check whether --enable-experimental was given. if test "${enable_experimental+set}" = set; then : enableval=$enable_experimental; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } experimental=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } experimental=no ;; *) as_fn_error $? "Invalid parameter value for --enable-experimental: $enableval" "$LINENO" 5 ;; esac fi if test x$experimental = xyes; then $as_echo "#define ECA_FEELING_EXPERIMENTAL 1" >>confdefs.h fi if test x$experimental = xyes; then ECA_AM_FEELING_EXPERIMENTAL_TRUE= ECA_AM_FEELING_EXPERIMENTAL_FALSE='#' else ECA_AM_FEELING_EXPERIMENTAL_TRUE='#' ECA_AM_FEELING_EXPERIMENTAL_FALSE= fi if test "x${prefix}" = "xNONE"; then ecaprefix=${ac_default_prefix} else ecaprefix=${prefix} fi ECA_S_PREFIX=${ecaprefix} cat >>confdefs.h <<_ACEOF #define ECA_PREFIX "${ecaprefix}" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to check design-by-contract assertions" >&5 $as_echo_n "checking whether to check design-by-contract assertions... " >&6; } enable_dbc_d=yes # Check whether --enable-dbc was given. if test "${enable_dbc+set}" = set; then : enableval=$enable_dbc; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_dbc_d=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_dbc_d=no ;; *) as_fn_error $? "Invalid parameter value for --enable-dbc: $enableval" "$LINENO" 5 ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test x$enable_dbc_d = xyes; then AM_CXXFLAGS="$AM_CXXFLAGS -DENABLE_DBC" AM_CFLAGS="$AM_CFLAGS -DENABLE_DBC" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable effects" >&5 $as_echo_n "checking whether to enable effects... " >&6; } # Check whether --enable-effects was given. if test "${enable_effects+set}" = set; then : enableval=$enable_effects; echo "Enableval: ${enableval}." case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_effects_d=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_effects_d=no ;; *) as_fn_error $? "Invalid parameter value for --enable-effects: $enableval" "$LINENO" 5 ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_effects_d=yes fi if test x$enable_effects_d = xno; then ECA_AM_DISABLE_EFFECTS_TRUE= ECA_AM_DISABLE_EFFECTS_FALSE='#' else ECA_AM_DISABLE_EFFECTS_TRUE='#' ECA_AM_DISABLE_EFFECTS_FALSE= fi if test x$enable_effects_d = xno; then $as_echo "#define ECA_DISABLE_EFFECTS 1" >>confdefs.h fi # Check whether --with-extra-cppflags was given. if test "${with_extra_cppflags+set}" = set; then : withval=$with_extra_cppflags; ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${withval}" fi # Check whether --with-extra-libs was given. if test "${with_extra_libs+set}" = set; then : withval=$with_extra_libs; ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${withval}" fi echo "checking for largefile support (>2GB files)..." # Check whether --with-largefile was given. if test "${with_largefile+set}" = set; then : withval=$with_largefile; fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi if test x$ac_cv_sys_file_offset_bits = x64 ; then AM_CXXFLAGS="$AM_CXXFLAGS -D_FILE_OFFSET_BITS=64" AM_CFLAGS="$AM_CFLAGS -D_FILE_OFFSET_BITS=64" enable_largefile=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_cxx_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default" if test "x$ac_cv_header_sys_soundcard_h" = xyes; then : oss_support=yes else oss_support=no fi # Check whether --enable-oss was given. if test "${enable_oss+set}" = set; then : enableval=$enable_oss; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } oss_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } oss_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-oss: $enableval" "$LINENO" 5 ;; esac fi if test x$oss_support = xyes; then ECA_AM_COMPILE_OSS_TRUE= ECA_AM_COMPILE_OSS_FALSE='#' else ECA_AM_COMPILE_OSS_TRUE='#' ECA_AM_COMPILE_OSS_FALSE= fi if test x$oss_support = xyes; then $as_echo "#define ECA_COMPILE_OSS 1" >>confdefs.h fi # Check whether --enable-osstrigger was given. if test "${enable_osstrigger+set}" = set; then : enableval=$enable_osstrigger; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } osstrigger=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } osstrigger=no ;; *) as_fn_error $? "Invalid parameter value for --enable-osstrigger: $enableval" "$LINENO" 5 ;; esac fi if test x$osstrigger = xyes; then $as_echo "#define ECA_DISABLE_OSS_TRIGGER 1" >>confdefs.h fi # Extract the first word of "artsc-config", so it can be a program name with args. set dummy artsc-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ARTSC_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ARTSC_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ARTSC_CONFIG="$ARTSC_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ARTSC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ARTSC_CONFIG" && ac_cv_path_ARTSC_CONFIG="none" ;; esac fi ARTSC_CONFIG=$ac_cv_path_ARTSC_CONFIG if test -n "$ARTSC_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ARTSC_CONFIG" >&5 $as_echo "$ARTSC_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$ARTSC_CONFIG = xnone; then arts_support=no else arts_support=yes ECA_ARTSC_CFLAGS="`$ARTSC_CONFIG --cflags`" ECA_ARTSC_LIBS="`$ARTSC_CONFIG --libs`" fi if test x$arts_support = xyes; then old_LIBS=$LIBS LIBS="$LIBS $ECA_ARTSC_LIBS" old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $ECA_ARTSC_CFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { arts_init(); return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : /bin/true else arts_support=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu LIBS=${old_LIBS} CFLAGS=${old_CFLAGS} fi # Check whether --enable-arts was given. if test "${enable_arts+set}" = set; then : enableval=$enable_arts; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } arts_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } arts_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-arts: $enableval" "$LINENO" 5 ;; esac fi if test x$arts_support = xyes; then ECA_AM_COMPILE_ARTS_TRUE= ECA_AM_COMPILE_ARTS_FALSE='#' else ECA_AM_COMPILE_ARTS_TRUE='#' ECA_AM_COMPILE_ARTS_FALSE= fi if test x$arts_support = xyes; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_ARTSC_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_ARTSC_LIBS}" $as_echo "#define ECA_COMPILE_ARTS 1" >>confdefs.h fi ac_fn_cxx_check_header_mongrel "$LINENO" "samplerate.h" "ac_cv_header_samplerate_h" "$ac_includes_default" if test "x$ac_cv_header_samplerate_h" = xyes; then : samplerate_support=yes else samplerate_support=no fi # Check whether --with-libsamplerate was given. if test "${with_libsamplerate+set}" = set; then : withval=$with_libsamplerate; ECA_SAMPLERATE_LIBS="-L${withval}/lib" ECA_SAMPLERATE_INCLUDES="-I${withval}/include" samplerate_support=yes fi # Check whether --enable-libsamplerate was given. if test "${enable_libsamplerate+set}" = set; then : enableval=$enable_libsamplerate; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } samplerate_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } samplerate_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-samplerate: $enableval" "$LINENO" 5 ;; esac fi if test x$samplerate_support = xyes; then ECA_AM_COMPILE_SAMPLERATE_TRUE= ECA_AM_COMPILE_SAMPLERATE_FALSE='#' else ECA_AM_COMPILE_SAMPLERATE_TRUE='#' ECA_AM_COMPILE_SAMPLERATE_FALSE= fi if test x$samplerate_support = xyes; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_SAMPLERATE_INCLUDES}" ECA_SAMPLERATE_LIBS="${ECA_SAMPLERATE_LIBS} -lsamplerate" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_SAMPLERATE_LIBS}" $as_echo "#define ECA_COMPILE_SAMPLERATE 1" >>confdefs.h fi pyecasound_support=${eca_platform_python_impl} # Check whether --enable-pyecasound was given. if test "${enable_pyecasound+set}" = set; then : enableval=$enable_pyecasound; case "$enableval" in y | yes) pyecasound_support=python ;; n | no | none) pyecasound_support=none ;; python) pyecasound_support=python ;; *) pyecasound_support=python ;; esac fi # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PYTHONPATH+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHONPATH in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHONPATH="$PYTHONPATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHONPATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PYTHONPATH" && ac_cv_path_PYTHONPATH="none" ;; esac fi PYTHONPATH=$ac_cv_path_PYTHONPATH if test -n "$PYTHONPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHONPATH" >&5 $as_echo "$PYTHONPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$PYTHONPATH = xnone; then pyecasound_support=none python_install_prefix="" else python_install_prefix=`python -c "import sys; print (sys.prefix)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python libraries" >&5 $as_echo_n "checking for Python libraries... " >&6; } # Check whether --with-python-modules was given. if test "${with_python_modules+set}" = set; then : withval=$with_python_modules; fi if test "X$with_python_modules" = "X" then if test x${python_install_prefix} != x${ecaprefix} -a \ x${ecaprefix} != x/usr -a \ x${ecaprefix} != x/usr/local ; then pyecasound_support=none { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } if test x$PYTHONPATH != xnone; then python_prefix_tmp=`python -c "import sys; print (sys.prefix + '/lib/python' + sys.version[:3])"` else python_prefix_tmp="DIR" fi { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** *** Python modules won't be installed as the module install prefix does *** not match ecasound's build prefix! To override, set python *** module directory explicitly (for example *** \"--with-python-modules=${python_prefix_tmp}\"). *** " >&5 $as_echo "$as_me: WARNING: *** *** Python modules won't be installed as the module install prefix does *** not match ecasound's build prefix! To override, set python *** module directory explicitly (for example *** \"--with-python-modules=${python_prefix_tmp}\"). *** " >&2;} else pymoddirs="/usr/local/lib /usr/lib" pymoddirsmore=`python -c "import sys; print (sys.prefix + '/lib/python' + sys.version[:3])"` pymoddirs="$pymoddirs $pymoddirsmore" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pymoddirs" >&5 $as_echo "$pymoddirs" >&6; } fi else pymoddirs=$with_python_modules { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pymoddirs" >&5 $as_echo "$pymoddirs" >&6; } fi # Check whether --enable-python-force-site-packages was given. if test "${enable_python_force_site_packages+set}" = set; then : enableval=$enable_python_force_site_packages; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } python_force_site_packages=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } python_force_site_packages=no ;; *) as_fn_error $? "Invalid parameter value for --enable-python-force-site-packages: $enableval" "$LINENO" 5 ;; esac fi ECA_S_PYTHON_MODULES=NO for i in $pymoddirs; do for j in lib-dynload; do if test -r "$i/$j"; then ECA_S_PYTHON_MODULES=$i break 2 fi done done if test -d $ECA_S_PYTHON_MODULES/site-packages -o "X$python_force_site_packages" = "Xyes" then ECA_S_PYTHON_MODULES=$ECA_S_PYTHON_MODULES/site-packages ECA_S_PYTHON_DLMODULES=$ECA_S_PYTHON_MODULES else ECA_S_PYTHON_DLMODULES=$ECA_S_PYTHON_MODULES/lib-dynload fi if test x$pyecasound_support = xc; then ECA_AM_PYECASOUND_CEXT_TRUE= ECA_AM_PYECASOUND_CEXT_FALSE='#' else ECA_AM_PYECASOUND_CEXT_TRUE='#' ECA_AM_PYECASOUND_CEXT_FALSE= fi if test x$pyecasound_support != xnone; then ECA_AM_PYECASOUND_INSTALL_TRUE= ECA_AM_PYECASOUND_INSTALL_FALSE='#' else ECA_AM_PYECASOUND_INSTALL_TRUE='#' ECA_AM_PYECASOUND_INSTALL_FALSE= fi rubyecasound_support=yes # Check whether --enable-rubyecasound was given. if test "${enable_rubyecasound+set}" = set; then : enableval=$enable_rubyecasound; case "$enableval" in y | yes) rubyecasound_support=yes ;; n | no | none) rubyecasound_support=no ;; *) rubyecasound_support=no ;; esac fi # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_RUBYPATH+:} false; then : $as_echo_n "(cached) " >&6 else case $RUBYPATH in [\\/]* | ?:[\\/]*) ac_cv_path_RUBYPATH="$RUBYPATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RUBYPATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RUBYPATH" && ac_cv_path_RUBYPATH="none" ;; esac fi RUBYPATH=$ac_cv_path_RUBYPATH if test -n "$RUBYPATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBYPATH" >&5 $as_echo "$RUBYPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x$RUBYPATH = xnone; then rubyecasound_support=no ECA_S_RUBY_SITEDIR="" else ECA_S_RUBY_SITEDIR="`ruby -e 'require "rbconfig"; include RbConfig; print CONFIG["sitedir"] + "/" + CONFIG["MAJOR"] + "." + CONFIG["MINOR"]'`" fi if test x$rubyecasound_support = xyes; then ECA_AM_RUBYECASOUND_INSTALL_TRUE= ECA_AM_RUBYECASOUND_INSTALL_FALSE='#' else ECA_AM_RUBYECASOUND_INSTALL_TRUE='#' ECA_AM_RUBYECASOUND_INSTALL_FALSE= fi echo "------------------------------------------------------------------" echo "3. Section: Programs " echo "------------------------------------------------------------------" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C++ compiler supports namespaces" >&5 $as_echo_n "checking if C++ compiler supports namespaces... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu old_cxx_flags=$CXXFLAGS CXXFLAGS="-fno-exceptions $CXXFLAGS" # hack around gcc3.x feature if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no." >&5 $as_echo "no." >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include using std::string; int main(void) { string s ("foo"); std::vector v; return(0); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes." >&5 $as_echo "yes." >&6; } $as_echo "#define ECA_USE_CXX_STD_NAMESPACE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no." >&5 $as_echo "no." >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C++ compiler has problems with namespaces. Build process can fail because of this." >&5 $as_echo "$as_me: WARNING: C++ compiler has problems with namespaces. Build process can fail because of this." >&2;} fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CXXFLAGS=$old_cxx_flags ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "------------------------------------------------------------------" echo "4. Section: Libraries" echo "------------------------------------------------------------------" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntoa" >&5 $as_echo_n "checking for library containing inet_ntoa... " >&6; } if ${ac_cv_search_inet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_ntoa (); int main () { return inet_ntoa (); ; return 0; } _ACEOF for ac_lib in '' socket nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_ntoa=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_ntoa+:} false; then : break fi done if ${ac_cv_search_inet_ntoa+:} false; then : else ac_cv_search_inet_ntoa=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntoa" >&5 $as_echo "$ac_cv_search_inet_ntoa" >&6; } ac_res=$ac_cv_search_inet_ntoa if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "*** required inet_ntoa() function not found! ***" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 $as_echo_n "checking for library containing nanosleep... " >&6; } if ${ac_cv_search_nanosleep+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char nanosleep (); int main () { return nanosleep (); ; return 0; } _ACEOF for ac_lib in '' rt posix4; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_nanosleep=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_nanosleep+:} false; then : break fi done if ${ac_cv_search_nanosleep+:} false; then : else ac_cv_search_nanosleep=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 $as_echo "$ac_cv_search_nanosleep" >&6; } ac_res=$ac_cv_search_nanosleep if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sched_setscheduler" >&5 $as_echo_n "checking for library containing sched_setscheduler... " >&6; } if ${ac_cv_search_sched_setscheduler+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sched_setscheduler (); int main () { return sched_setscheduler (); ; return 0; } _ACEOF for ac_lib in '' rt posix4; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_sched_setscheduler=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sched_setscheduler+:} false; then : break fi done if ${ac_cv_search_sched_setscheduler+:} false; then : else ac_cv_search_sched_setscheduler=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sched_setscheduler" >&5 $as_echo "$ac_cv_search_sched_setscheduler" >&6; } ac_res=$ac_cv_search_sched_setscheduler if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 $as_echo_n "checking for library containing socket... " >&6; } if ${ac_cv_search_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF for ac_lib in '' socket nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_socket=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_socket+:} false; then : break fi done if ${ac_cv_search_socket+:} false; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 $as_echo "$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "*** required socket() function not found! ***" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sin" >&5 $as_echo_n "checking for library containing sin... " >&6; } if ${ac_cv_search_sin+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sin (); int main () { return sin (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_sin=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sin+:} false; then : break fi done if ${ac_cv_search_sin+:} false; then : else ac_cv_search_sin=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sin" >&5 $as_echo "$ac_cv_search_sin" >&6; } ac_res=$ac_cv_search_sin if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "*** required sin() function not found! ***" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "*** required dlopen() function not found! ***" "$LINENO" 5 fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lncurses" >&5 $as_echo_n "checking for main in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_main=yes else ac_cv_lib_ncurses_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_main" >&5 $as_echo "$ac_cv_lib_ncurses_main" >&6; } if test "x$ac_cv_lib_ncurses_main" = xyes; then : termcap_library=ncurses else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ltermcap" >&5 $as_echo_n "checking for main in -ltermcap... " >&6; } if ${ac_cv_lib_termcap_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltermcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_termcap_main=yes else ac_cv_lib_termcap_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_main" >&5 $as_echo "$ac_cv_lib_termcap_main" >&6; } if test "x$ac_cv_lib_termcap_main" = xyes; then : termcap_library=termcap else termcap_library=none fi fi # Check whether --enable-ncurses was given. if test "${enable_ncurses+set}" = set; then : enableval=$enable_ncurses; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } termcap_library=ncurses ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } termcap_library=none ;; *) as_fn_error $? "Invalid parameter value for --enable-ncurses: $enableval" "$LINENO" 5 ;; esac fi if test $termcap_library = ncurses; then ECA_AM_USE_NCURSES_TRUE= ECA_AM_USE_NCURSES_FALSE='#' else ECA_AM_USE_NCURSES_TRUE='#' ECA_AM_USE_NCURSES_FALSE= fi if test $termcap_library = termcap; then ECA_AM_USE_TERMCAP_TRUE= ECA_AM_USE_TERMCAP_FALSE='#' else ECA_AM_USE_TERMCAP_TRUE='#' ECA_AM_USE_TERMCAP_FALSE= fi if test x$termcap_library = xtermcap; then ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" if test "x$ac_cv_header_curses_h" = xyes; then : $as_echo "#define ECA_USE_CURSES_H 1" >>confdefs.h else as_fn_error $? "*** curses.h not found! Try with \"./configure --disable-ncurses\". ***" "$LINENO" 5 fi fi if test x$termcap_library = xncurses; then ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : $as_echo "#define ECA_USE_NCURSES_NCURSES_H 1" >>confdefs.h else ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" if test "x$ac_cv_header_ncurses_h" = xyes; then : $as_echo "#define ECA_USE_NCURSES_H 1" >>confdefs.h else as_fn_error $? "*** Neither ncurses.h or ncurses/ncurses.h found! Try with \"./configure --disable-ncurses\". ***" "$LINENO" 5 fi fi fi if test $termcap_library = xnone ; then eca_platform_curses_support=no fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -laudiofile" >&5 $as_echo_n "checking for main in -laudiofile... " >&6; } if ${ac_cv_lib_audiofile_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-laudiofile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_audiofile_main=yes else ac_cv_lib_audiofile_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_audiofile_main" >&5 $as_echo "$ac_cv_lib_audiofile_main" >&6; } if test "x$ac_cv_lib_audiofile_main" = xyes; then : af_support=yes else af_support=no fi # Check whether --enable-audiofile was given. if test "${enable_audiofile+set}" = set; then : enableval=$enable_audiofile; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } af_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } af_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-audiofile: $enableval" "$LINENO" 5 ;; esac fi if test x$af_support = xyes; then ECA_AM_COMPILE_AUDIOFILE_TRUE= ECA_AM_COMPILE_AUDIOFILE_FALSE='#' else ECA_AM_COMPILE_AUDIOFILE_TRUE='#' ECA_AM_COMPILE_AUDIOFILE_FALSE= fi if test x$af_support = xyes; then ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -laudiofile" $as_echo "#define ECA_COMPILE_AUDIOFILE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsndfile" >&5 $as_echo_n "checking for main in -lsndfile... " >&6; } if ${ac_cv_lib_sndfile_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsndfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_sndfile_main=yes else ac_cv_lib_sndfile_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndfile_main" >&5 $as_echo "$ac_cv_lib_sndfile_main" >&6; } if test "x$ac_cv_lib_sndfile_main" = xyes; then : sndfile_support=yes else sndfile_support=no fi # Check whether --enable-sndfile was given. if test "${enable_sndfile+set}" = set; then : enableval=$enable_sndfile; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } sndfile_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } sndfile_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-sndfile: $enableval" "$LINENO" 5 ;; esac fi if test x$sndfile_support = xyes; then ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { SF_INFO sfinfo; sfinfo.frames = 0; return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : /bin/true else sndfile_support=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found an old version of libsndfile. Libsndfile 1.0.0 or newer is required." >&5 $as_echo "$as_me: WARNING: Found an old version of libsndfile. Libsndfile 1.0.0 or newer is required." >&2;} fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test x$sndfile_support = xyes; then ECA_AM_COMPILE_SNDFILE_TRUE= ECA_AM_COMPILE_SNDFILE_FALSE='#' else ECA_AM_COMPILE_SNDFILE_TRUE='#' ECA_AM_COMPILE_SNDFILE_FALSE= fi if test x$sndfile_support = xyes; then ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -lsndfile" $as_echo "#define ECA_COMPILE_SNDFILE 1" >>confdefs.h fi # Check whether --enable-alsa was given. if test "${enable_alsa+set}" = set; then : enableval=$enable_alsa; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } alsa_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } alsa_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-alsa: $enableval" "$LINENO" 5 ;; esac fi if test x$alsa_support = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_delay in -lasound" >&5 $as_echo_n "checking for snd_pcm_delay in -lasound... " >&6; } if ${ac_cv_lib_asound_snd_pcm_delay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lasound $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char snd_pcm_delay (); int main () { return snd_pcm_delay (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_asound_snd_pcm_delay=yes else ac_cv_lib_asound_snd_pcm_delay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_delay" >&5 $as_echo "$ac_cv_lib_asound_snd_pcm_delay" >&6; } if test "x$ac_cv_lib_asound_snd_pcm_delay" = xyes; then : alsa_support=yes else alsa_support=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ALSA version older than 0.9.0 not supported - update to a newer version or compile with --disable-alsa" >&5 $as_echo "$as_me: WARNING: ALSA version older than 0.9.0 not supported - update to a newer version or compile with --disable-alsa" >&2;} fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing snd_pcm_open" >&5 $as_echo_n "checking for library containing snd_pcm_open... " >&6; } if ${ac_cv_search_snd_pcm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char snd_pcm_open (); int main () { return snd_pcm_open (); ; return 0; } _ACEOF for ac_lib in '' asound; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_snd_pcm_open=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_snd_pcm_open+:} false; then : break fi done if ${ac_cv_search_snd_pcm_open+:} false; then : else ac_cv_search_snd_pcm_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_snd_pcm_open" >&5 $as_echo "$ac_cv_search_snd_pcm_open" >&6; } ac_res=$ac_cv_search_snd_pcm_open if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in snd_pcm_sw_params_set_tstamp_type do : ac_fn_c_check_func "$LINENO" "snd_pcm_sw_params_set_tstamp_type" "ac_cv_func_snd_pcm_sw_params_set_tstamp_type" if test "x$ac_cv_func_snd_pcm_sw_params_set_tstamp_type" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SND_PCM_SW_PARAMS_SET_TSTAMP_TYPE 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test x$alsa_support = xyes; then ECA_AM_COMPILE_ALSA_TRUE= ECA_AM_COMPILE_ALSA_FALSE='#' else ECA_AM_COMPILE_ALSA_TRUE='#' ECA_AM_COMPILE_ALSA_FALSE= fi if test x$alsa_support = xyes; then ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} -lasound" $as_echo "#define ECA_COMPILE_ALSA 1" >>confdefs.h fi ac_fn_cxx_check_header_mongrel "$LINENO" "jack/jack.h" "ac_cv_header_jack_jack_h" "$ac_includes_default" if test "x$ac_cv_header_jack_jack_h" = xyes; then : jack_support=yes else jack_support=no fi # Check whether --with-jack was given. if test "${with_jack+set}" = set; then : withval=$with_jack; ECA_S_JACK_LIBS="-L${withval}/lib" ECA_S_JACK_INCLUDES="-I${withval}/include" jack_support=yes fi # Check whether --enable-jack was given. if test "${enable_jack+set}" = set; then : enableval=$enable_jack; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } jack_support=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } jack_support=no ;; *) as_fn_error $? "Invalid parameter value for --enable-jack: $enableval" "$LINENO" 5 ;; esac fi if test x$jack_support = xyes; then ECA_AM_COMPILE_JACK_TRUE= ECA_AM_COMPILE_JACK_FALSE='#' else ECA_AM_COMPILE_JACK_TRUE='#' ECA_AM_COMPILE_JACK_FALSE= fi if test x$jack_support = xyes; then $as_echo "#define ECA_COMPILE_JACK 1" >>confdefs.h ECA_S_JACK_LIBS="${ECA_S_JACK_LIBS} -ljack" case "$host" in *darwin*) AM_LDFLAGS="$AM_LDFLAGS -framework CoreAudio" ;; esac fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu old_cppflags=$CPPFLAGS old_ldflags=$LDFLAGS old_INCLUDES=$INCLUDES CPPFLAGS="$CPPFLAGS $ECA_S_JACK_INCLUDES" LDFLAGS="$LDFLAGS $ECA_S_JACK_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { jack_position_t t; int *a = (void*)&jack_transport_query; int *b = (void*)&jack_transport_start; int *c = (void*)&jack_transport_stop; int *d = (void*)&jack_transport_locate; t.frame = 0; t.valid = 0; return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ECA_JACK_TRANSPORT_API="3" else ECA_JACK_TRANSPORT_API="0" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # note: check for the new latency API added to JACK 0.120.1 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { jack_latency_range_t t; t.min = 0; t.max = 0; return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ECA_JACK_FEATSET="1" else ECA_JACK_FEATSET="0" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$old_cppflags" LDFLAGS="$old_ldflags" INCLUDES="$old_INCLUDES" echo "Using JACK transport API version:" ${ECA_JACK_TRANSPORT_API} cat >>confdefs.h <<_ACEOF #define ECA_JACK_TRANSPORT_API ${ECA_JACK_TRANSPORT_API} _ACEOF echo "Using JACK feature set (ecasound specific):" ${ECA_JACK_FEATSET} cat >>confdefs.h <<_ACEOF #define ECA_JACK_FEATSET ${ECA_JACK_FEATSET} _ACEOF ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${ECA_S_JACK_INCLUDES}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${ECA_S_JACK_LIBS}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkvutils" >&5 $as_echo_n "checking for main in -lkvutils... " >&6; } if ${ac_cv_lib_kvutils_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvutils $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kvutils_main=yes else ac_cv_lib_kvutils_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvutils_main" >&5 $as_echo "$ac_cv_lib_kvutils_main" >&6; } if test "x$ac_cv_lib_kvutils_main" = xyes; then : kvutils_installed=yes else kvutils_installed=no fi if test x$kvutils_installed = xyes; then ECA_AM_KVUTILS_INSTALLED_TRUE= ECA_AM_KVUTILS_INSTALLED_FALSE='#' else ECA_AM_KVUTILS_INSTALLED_TRUE='#' ECA_AM_KVUTILS_INSTALLED_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with system readline" >&5 $as_echo_n "checking whether to build with system readline... " >&6; } # Check whether --enable-sys_readline was given. if test "${enable_sys_readline+set}" = set; then : enableval=$enable_sys_readline; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_sysreadline=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_sysreadline=no ;; *) as_fn_error $? "Invalid parameter value for --enable-sys-readline: $enableval" "$LINENO" 5 ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_sysreadline=yes fi if test x$enable_sysreadline = xyes; then ac_fn_c_check_header_mongrel "$LINENO" "readline.h" "ac_cv_header_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_h" = xyes; then : ECA_S_READLINE_INCLUDES=/usr/include else ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" if test "x$ac_cv_header_readline_readline_h" = xyes; then : ECA_S_READLINE_INCLUDES=/usr/include/readline else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** readline headers not installed ***" >&5 $as_echo "$as_me: WARNING: *** readline headers not installed ***" >&2;} enable_sysreadline=no fi fi ac_fn_c_check_header_mongrel "$LINENO" "history.h" "ac_cv_header_history_h" "$ac_includes_default" if test "x$ac_cv_header_history_h" = xyes; then : else ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" if test "x$ac_cv_header_readline_history_h" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** readline history headers not installed ***" >&5 $as_echo "$as_me: WARNING: *** readline history headers not installed ***" >&2;} enable_sysreadline=no fi fi if test x${termcap_library} = xnone; then readline_extra_libs=""; else readline_extra_libs="-l${termcap_library}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lreadline" >&5 $as_echo_n "checking for main in -lreadline... " >&6; } if ${ac_cv_lib_readline_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline ${readline_extra_libs} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_main=yes else ac_cv_lib_readline_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_main" >&5 $as_echo "$ac_cv_lib_readline_main" >&6; } if test "x$ac_cv_lib_readline_main" = xyes; then : ECA_S_READLINE_LIBS="-lreadline" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** readline support not installed ***" >&5 $as_echo "$as_me: WARNING: *** readline support not installed ***" >&2;} enable_sysreadline=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhistory" >&5 $as_echo_n "checking for main in -lhistory... " >&6; } if ${ac_cv_lib_history_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhistory ${readline_extra_libs} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_history_main=yes else ac_cv_lib_history_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_main" >&5 $as_echo "$ac_cv_lib_history_main" >&6; } if test "x$ac_cv_lib_history_main" = xyes; then : ECA_S_READLINE_LIBS="${ECA_S_READLINE_LIBS} -lhistory" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** readline support not installed ***" >&5 $as_echo "$as_me: WARNING: *** readline support not installed ***" >&2;} enable_sysreadline=no fi else ECA_S_READLINE_INCLUDES="" ECA_S_READLINE_LIBS="" fi # if no readline library is found, disable platform-curses toggle if test $enable_sysreadline = no ; then eca_platform_curses_support=no fi if test x$enable_sysreadline = xyes; then ECA_AM_SYSTEM_READLINE_TRUE= ECA_AM_SYSTEM_READLINE_FALSE='#' else ECA_AM_SYSTEM_READLINE_TRUE='#' ECA_AM_SYSTEM_READLINE_FALSE= fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBOIL" >&5 $as_echo_n "checking for LIBOIL... " >&6; } if test -n "$LIBOIL_CFLAGS"; then pkg_cv_LIBOIL_CFLAGS="$LIBOIL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liboil-0.3\""; } >&5 ($PKG_CONFIG --exists --print-errors "liboil-0.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBOIL_CFLAGS=`$PKG_CONFIG --cflags "liboil-0.3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBOIL_LIBS"; then pkg_cv_LIBOIL_LIBS="$LIBOIL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liboil-0.3\""; } >&5 ($PKG_CONFIG --exists --print-errors "liboil-0.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBOIL_LIBS=`$PKG_CONFIG --libs "liboil-0.3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBOIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liboil-0.3" 2>&1` else LIBOIL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liboil-0.3" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBOIL_PKG_ERRORS" >&5 HAVE_LIBOIL=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBOIL=no else LIBOIL_CFLAGS=$pkg_cv_LIBOIL_CFLAGS LIBOIL_LIBS=$pkg_cv_LIBOIL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBOIL=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use liboil" >&5 $as_echo_n "checking whether to use liboil... " >&6; } # Check whether --enable-liboil was given. if test "${enable_liboil+set}" = set; then : enableval=$enable_liboil; case "$enableval" in y | yes) if test "x${HAVE_LIBOIL}" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_liboil=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-liboil given but liboil library not available" >&5 $as_echo "$as_me: WARNING: --enable-liboil given but liboil library not available" >&2;} fi ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_liboil=no ;; *) as_fn_error $? "Invalid parameter value for --enable-liboil: $enableval" "$LINENO" 5 ;; esac else if test "x${HAVE_LIBOIL}" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_liboil=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling liboil as library devel files are not available" >&5 $as_echo "$as_me: WARNING: disabling liboil as library devel files are not available" >&2;} fi fi if test "x${enable_liboil}" = "xyes" ; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBOIL_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBOIL_LIBS}" $as_echo "#define ECA_USE_LIBOIL 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use liblilv for LV2 support" >&5 $as_echo_n "checking whether to use liblilv for LV2 support... " >&6; } # Check whether --enable-liblilv was given. if test "${enable_liblilv+set}" = set; then : enableval=$enable_liblilv; case "$enableval" in y | yes) pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLILV" >&5 $as_echo_n "checking for LIBLILV... " >&6; } if test -n "$LIBLILV_CFLAGS"; then pkg_cv_LIBLILV_CFLAGS="$LIBLILV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lv2 lilv-0\""; } >&5 ($PKG_CONFIG --exists --print-errors "lv2 lilv-0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLILV_CFLAGS=`$PKG_CONFIG --cflags "lv2 lilv-0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBLILV_LIBS"; then pkg_cv_LIBLILV_LIBS="$LIBLILV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lv2 lilv-0\""; } >&5 ($PKG_CONFIG --exists --print-errors "lv2 lilv-0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLILV_LIBS=`$PKG_CONFIG --libs "lv2 lilv-0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBLILV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lv2 lilv-0" 2>&1` else LIBLILV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lv2 lilv-0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBLILV_PKG_ERRORS" >&5 HAVE_LIBLILV=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBLILV=no else LIBLILV_CFLAGS=$pkg_cv_LIBLILV_CFLAGS LIBLILV_LIBS=$pkg_cv_LIBLILV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBLILV=yes fi if test "x${HAVE_LIBLILV}" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_liblilv=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-liblilv given but liblilv library not available" >&5 $as_echo "$as_me: WARNING: --enable-liblilv given but liblilv library not available" >&2;} fi ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_liblilv=no ;; *) as_fn_error $? "Invalid parameter value for --enable-liblilv: $enableval" "$LINENO" 5 ;; esac else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLILV" >&5 $as_echo_n "checking for LIBLILV... " >&6; } if test -n "$LIBLILV_CFLAGS"; then pkg_cv_LIBLILV_CFLAGS="$LIBLILV_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lv2core lilv-0 > 0.5.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors "lv2core lilv-0 > 0.5.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLILV_CFLAGS=`$PKG_CONFIG --cflags "lv2core lilv-0 > 0.5.0 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBLILV_LIBS"; then pkg_cv_LIBLILV_LIBS="$LIBLILV_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lv2core lilv-0 > 0.5.0 \""; } >&5 ($PKG_CONFIG --exists --print-errors "lv2core lilv-0 > 0.5.0 ") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLILV_LIBS=`$PKG_CONFIG --libs "lv2core lilv-0 > 0.5.0 " 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBLILV_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lv2core lilv-0 > 0.5.0 " 2>&1` else LIBLILV_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lv2core lilv-0 > 0.5.0 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBLILV_PKG_ERRORS" >&5 HAVE_LIBLILV=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBLILV=no else LIBLILV_CFLAGS=$pkg_cv_LIBLILV_CFLAGS LIBLILV_LIBS=$pkg_cv_LIBLILV_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBLILV=yes fi enable_liblilv=${HAVE_LIBLILV} { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_liblilv}" >&5 $as_echo "${enable_liblilv}" >&6; } fi if test "x${enable_liblilv}" = "xyes" ; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBLILV_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBLILV_LIBS}" $as_echo "#define ECA_USE_LIBLILV 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBLO" >&5 $as_echo_n "checking for LIBLO... " >&6; } if test -n "$LIBLO_CFLAGS"; then pkg_cv_LIBLO_CFLAGS="$LIBLO_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblo\""; } >&5 ($PKG_CONFIG --exists --print-errors "liblo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLO_CFLAGS=`$PKG_CONFIG --cflags "liblo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBLO_LIBS"; then pkg_cv_LIBLO_LIBS="$LIBLO_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblo\""; } >&5 ($PKG_CONFIG --exists --print-errors "liblo") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBLO_LIBS=`$PKG_CONFIG --libs "liblo" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBLO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblo" 2>&1` else LIBLO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblo" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBLO_PKG_ERRORS" >&5 HAVE_LIBLO=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_LIBLO=no else LIBLO_CFLAGS=$pkg_cv_LIBLO_CFLAGS LIBLO_LIBS=$pkg_cv_LIBLO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_LIBLO=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use liblo for OSC support" >&5 $as_echo_n "checking whether to use liblo for OSC support... " >&6; } # Check whether --enable-liblo was given. if test "${enable_liblo+set}" = set; then : enableval=$enable_liblo; case "$enableval" in y | yes) if test "x${HAVE_LIBLO}" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_liblo=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-liblo given but liblo library not available" >&5 $as_echo "$as_me: WARNING: --enable-liblo given but liblo library not available" >&2;} fi ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_liblo=no ;; *) as_fn_error $? "Invalid parameter value for --enable-liblo: $enableval" "$LINENO" 5 ;; esac else enable_liblo=${HAVE_LIBLO} { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_liblo}" >&5 $as_echo "${enable_liblo}" >&6; } fi if test "x${enable_liblo}" = "xyes" ; then ECA_S_EXTRA_CPPFLAGS="${ECA_S_EXTRA_CPPFLAGS} ${LIBLO_CFLAGS}" ECA_S_EXTRA_LIBS="${ECA_S_EXTRA_LIBS} ${LIBLO_LIBS}" $as_echo "#define ECA_USE_LIBLO 1" >>confdefs.h fi echo "------------------------------------------------------------------" echo "5. Section: Headers" echo "------------------------------------------------------------------" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in dlfcn.h errno.h fcntl.h regex.h signal.h unistd.h sys/poll.h sys/stat.h sys/socket.h sys/time.h sys/types.h sys/wait.h sys/select.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else as_fn_error $? "*** not all required header files were found ***" "$LINENO" 5 fi done for ac_header in execinfo.h features.h inttypes.h locale.h ladspa.h sched.h stdint.h sys/mman.h termios.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_header_mongrel "$LINENO" "map" "ac_cv_header_map" "$ac_includes_default" if test "x$ac_cv_header_map" = xyes; then : nostlmap=0 else nostlmap=1 fi if test "x$nostlmap" = "x1" ; then as_fn_error $? "C++ header files not found! Searched for '' (STL)." "$LINENO" 5 fi echo "------------------------------------------------------------------" echo "6. Section: Typedefs and structures" echo "------------------------------------------------------------------" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "------------------------------------------------------------------" echo "7. Section: Functions" echo "------------------------------------------------------------------" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if ${ac_cv_func_mmap_fixed_mapped+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_mmap_fixed_mapped=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; const char *cdata2; int i, pagesize; int fd, fd2; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 2; if (write (fd, data, pagesize) != pagesize) return 3; close (fd); /* Next, check that the tail of a page is zero-filled. File must have non-zero length, otherwise we risk SIGBUS for entire page. */ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; cdata2 = ""; if (write (fd2, cdata2, 1) != 1) return 5; data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) if (*(data2 + i)) return 7; close (fd2); if (munmap (data2, pagesize)) return 8; /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 9; if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 10; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 11; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 12; if (read (fd, data3, pagesize) != pagesize) return 13; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 14; close (fd); free (data); free (data3); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_mmap_fixed_mapped=yes else ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then $as_echo "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt for ac_func in execvp gettimeofday pthread_mutexattr_init do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else as_fn_error $? "*** not all required library functions were found ***" "$LINENO" 5 fi done for ac_func in clock_gettime do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" if test "x$ac_cv_func_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CLOCK_GETTIME 1 _ACEOF fi done for ac_func in mlockall do : ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall" if test "x$ac_cv_func_mlockall" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MLOCKALL 1 _ACEOF fi done for ac_func in munlockall do : ac_fn_c_check_func "$LINENO" "munlockall" "ac_cv_func_munlockall" if test "x$ac_cv_func_munlockall" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MUNLOCKALL 1 _ACEOF fi done for ac_func in nanosleep do : ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NANOSLEEP 1 _ACEOF fi done for ac_func in pause do : ac_fn_c_check_func "$LINENO" "pause" "ac_cv_func_pause" if test "x$ac_cv_func_pause" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PAUSE 1 _ACEOF fi done for ac_func in posix_memalign do : ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" if test "x$ac_cv_func_posix_memalign" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_POSIX_MEMALIGN 1 _ACEOF fi done for ac_func in pthread_self do : ac_fn_c_check_func "$LINENO" "pthread_self" "ac_cv_func_pthread_self" if test "x$ac_cv_func_pthread_self" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_SELF 1 _ACEOF fi done for ac_func in pthread_getschedparam do : ac_fn_c_check_func "$LINENO" "pthread_getschedparam" "ac_cv_func_pthread_getschedparam" if test "x$ac_cv_func_pthread_getschedparam" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_GETSCHEDPARAM 1 _ACEOF fi done for ac_func in pthread_setschedparam do : ac_fn_c_check_func "$LINENO" "pthread_setschedparam" "ac_cv_func_pthread_setschedparam" if test "x$ac_cv_func_pthread_setschedparam" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_SETSCHEDPARAM 1 _ACEOF fi done for ac_func in pthread_sigmask do : ac_fn_c_check_func "$LINENO" "pthread_sigmask" "ac_cv_func_pthread_sigmask" if test "x$ac_cv_func_pthread_sigmask" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_SIGMASK 1 _ACEOF fi done for ac_func in pthread_kill do : ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" if test "x$ac_cv_func_pthread_kill" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_KILL 1 _ACEOF fi done for ac_func in sched_get_priority_max do : ac_fn_c_check_func "$LINENO" "sched_get_priority_max" "ac_cv_func_sched_get_priority_max" if test "x$ac_cv_func_sched_get_priority_max" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SCHED_GET_PRIORITY_MAX 1 _ACEOF fi done for ac_func in sched_getparam do : ac_fn_c_check_func "$LINENO" "sched_getparam" "ac_cv_func_sched_getparam" if test "x$ac_cv_func_sched_getparam" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SCHED_GETPARAM 1 _ACEOF fi done for ac_func in sched_getscheduler do : ac_fn_c_check_func "$LINENO" "sched_getscheduler" "ac_cv_func_sched_getscheduler" if test "x$ac_cv_func_sched_getscheduler" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SCHED_GETSCHEDULER 1 _ACEOF fi done for ac_func in sched_setscheduler do : ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" if test "x$ac_cv_func_sched_setscheduler" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SCHED_SETSCHEDULER 1 _ACEOF fi done for ac_func in setlocale do : ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" if test "x$ac_cv_func_setlocale" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SETLOCALE 1 _ACEOF fi done for ac_func in sigprocmask do : ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" if test "x$ac_cv_func_sigprocmask" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGPROCMASK 1 _ACEOF fi done for ac_func in sigwait do : ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait" if test "x$ac_cv_func_sigwait" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGWAIT 1 _ACEOF fi done for ac_func in usleep do : ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_USLEEP 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Check whether --enable-all-static was given. if test "${enable_all_static+set}" = set; then : enableval=$enable_all_static; case "$enableval" in y | yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_all_static=yes ;; n | no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_all_static=no ;; *) as_fn_error $? "Invalid parameter value for --enable-all-static: $enableval" "$LINENO" 5 ;; esac fi if test x$enable_all_static = xyes; then $as_echo "#define ECA_ALL_STATIC 1" >>confdefs.h AM_CXXFLAGS="$AM_CXXFLAGS -static" AM_CFLAGS="$AM_CFLAGS -static" AM_LDFLAGS="$AM_LDFLAGS -Bstatic -all-static" fi if test x$enable_all_static = xyes; then ECA_AM_ALL_STATIC_TRUE= ECA_AM_ALL_STATIC_FALSE='#' else ECA_AM_ALL_STATIC_TRUE='#' ECA_AM_ALL_STATIC_FALSE= fi if test $eca_platform_curses_support == yes ; then $as_echo "#define ECA_PLATFORM_CURSES 1" >>confdefs.h fi echo "------------------------------------------------------------------" echo "8. Section: Output" echo "------------------------------------------------------------------" ac_config_files="$ac_config_files Makefile libecasound/Makefile libecasound/libecasound-config libecasound/plugins/Makefile libecasoundc/Makefile libecasoundc/libecasoundc-config pyecasound/Makefile rubyecasound/Makefile ecasound/Makefile ecatools/Makefile kvutils/Makefile Documentation/Makefile Documentation/users_guide/Makefile Documentation/programmers_guide/Makefile examples/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_DEBUG_MODE_TRUE}" && test -z "${ECA_AM_DEBUG_MODE_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_DEBUG_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_FEELING_EXPERIMENTAL_TRUE}" && test -z "${ECA_AM_FEELING_EXPERIMENTAL_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_FEELING_EXPERIMENTAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_DISABLE_EFFECTS_TRUE}" && test -z "${ECA_AM_DISABLE_EFFECTS_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_DISABLE_EFFECTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_OSS_TRUE}" && test -z "${ECA_AM_COMPILE_OSS_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_OSS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_ARTS_TRUE}" && test -z "${ECA_AM_COMPILE_ARTS_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_ARTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_SAMPLERATE_TRUE}" && test -z "${ECA_AM_COMPILE_SAMPLERATE_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_SAMPLERATE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_PYECASOUND_CEXT_TRUE}" && test -z "${ECA_AM_PYECASOUND_CEXT_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_PYECASOUND_CEXT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_PYECASOUND_INSTALL_TRUE}" && test -z "${ECA_AM_PYECASOUND_INSTALL_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_PYECASOUND_INSTALL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_RUBYECASOUND_INSTALL_TRUE}" && test -z "${ECA_AM_RUBYECASOUND_INSTALL_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_RUBYECASOUND_INSTALL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_USE_NCURSES_TRUE}" && test -z "${ECA_AM_USE_NCURSES_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_USE_NCURSES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_USE_TERMCAP_TRUE}" && test -z "${ECA_AM_USE_TERMCAP_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_USE_TERMCAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_AUDIOFILE_TRUE}" && test -z "${ECA_AM_COMPILE_AUDIOFILE_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_AUDIOFILE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_SNDFILE_TRUE}" && test -z "${ECA_AM_COMPILE_SNDFILE_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_SNDFILE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_ALSA_TRUE}" && test -z "${ECA_AM_COMPILE_ALSA_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_ALSA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_COMPILE_JACK_TRUE}" && test -z "${ECA_AM_COMPILE_JACK_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_COMPILE_JACK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_KVUTILS_INSTALLED_TRUE}" && test -z "${ECA_AM_KVUTILS_INSTALLED_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_KVUTILS_INSTALLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_SYSTEM_READLINE_TRUE}" && test -z "${ECA_AM_SYSTEM_READLINE_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_SYSTEM_READLINE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ECA_AM_ALL_STATIC_TRUE}" && test -z "${ECA_AM_ALL_STATIC_FALSE}"; then as_fn_error $? "conditional \"ECA_AM_ALL_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by ecasound $as_me 2.9.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ ecasound config.status 2.9.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libecasound/Makefile") CONFIG_FILES="$CONFIG_FILES libecasound/Makefile" ;; "libecasound/libecasound-config") CONFIG_FILES="$CONFIG_FILES libecasound/libecasound-config" ;; "libecasound/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES libecasound/plugins/Makefile" ;; "libecasoundc/Makefile") CONFIG_FILES="$CONFIG_FILES libecasoundc/Makefile" ;; "libecasoundc/libecasoundc-config") CONFIG_FILES="$CONFIG_FILES libecasoundc/libecasoundc-config" ;; "pyecasound/Makefile") CONFIG_FILES="$CONFIG_FILES pyecasound/Makefile" ;; "rubyecasound/Makefile") CONFIG_FILES="$CONFIG_FILES rubyecasound/Makefile" ;; "ecasound/Makefile") CONFIG_FILES="$CONFIG_FILES ecasound/Makefile" ;; "ecatools/Makefile") CONFIG_FILES="$CONFIG_FILES ecatools/Makefile" ;; "kvutils/Makefile") CONFIG_FILES="$CONFIG_FILES kvutils/Makefile" ;; "Documentation/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/Makefile" ;; "Documentation/users_guide/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/users_guide/Makefile" ;; "Documentation/programmers_guide/Makefile") CONFIG_FILES="$CONFIG_FILES Documentation/programmers_guide/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in "$ac_file" | "$ac_file":* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for "$ac_file"" >`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "-----------------------------------------------------------------" echo "Following packages are now configured:" echo "ecasound: yes (ecasound,libecasound,libecasoundc)" echo "ecatools: yes" if test x$pyecasound_support != xnone ; then if test x$pyecasound_support = xc ; then echo "pyecasound: yes (as Python C extension module)" else echo "pyecasound: yes (as native Python module)" fi else echo "pyecasound: no" fi if test x$rubyecasound_support = xyes ; then echo "rubyecasound: yes" else echo "rubyecasound: no" fi echo "libkvutils: yes" echo "-----------------------------------------------------------------" echo "Compiler options:" echo "CFLAGS: $AM_CFLAGS $CFLAGS" echo "CXXFLAGS: $AM_CXXFLAGS $CXXFLAGS" echo "CPPFLAGS: $AM_CPPFLAGS $CPPFLAGS" echo "LDFLAGS: $AM_LDFLAGS $LDFLAGS" echo "-----------------------------------------------------------------" echo "Following features were selected:" if test x$include_debug = xyes ; then echo "Debugging info: yes" else echo "Debugging info: no" fi if test x$enable_effects_d = xyes ; then echo "Effects enabled: yes" else echo "Effects enabled: no" fi if test x$termcap_library = xtermcap ; then echo "Termcap: termcap" fi if test x$termcap_library = xncurses; then echo "Termcap: ncurses" fi if test x$termcap_library = xnone; then echo "Termcap: none" fi if test x$enable_sysreadline = xyes ; then echo "Use system readline: yes" else echo "Use system readline: no" fi echo "Use curses interface: $eca_platform_curses_support" if test x$af_support = xyes ; then echo "Libaudiofile: yes" else echo "Libaudiofile: no" fi if test x$sndfile_support = xyes ; then echo "Libsndfile: yes" else echo "Libsndfile: no" fi if test x$alsa_support = xyes ; then echo "ALSA support: yes" else echo "ALSA support: no" fi if test x$oss_support = xyes ; then echo "OSS support: yes" else echo "OSS support: no" fi if test x$arts_support = xyes ; then echo "aRts support: yes" else echo "aRts support: no" fi if test x$jack_support = xyes ; then echo "JACK support: yes" else echo "JACK support: no" fi if test x$samplerate_support = xyes ; then echo "Libsamplerate support yes" else echo "Libsamplerate support no" fi if test x$enable_liblilv = xyes ; then echo "LV2 (liblilv) support: yes" else echo "LV2 (liblilv) support: no" fi if test x$enable_liboil = xyes ; then echo "Liboil support: yes" else echo "Liboil support: no" fi if test x$enable_liblo = xyes ; then echo "Liblo (OSC) support: yes" else echo "Liblo (OSC) support: no" fi echo "-----------------------------------------------------------------" echo "Following directories are used:" echo "Directory prefix: "$ECA_S_PREFIX if test x$pyecasound_support = xc ; then echo "Python include dir: "$ECA_S_PYTHON_INCLUDES fi if test x$pyecasound_support != xnone ; then echo "Python module dir: "$ECA_S_PYTHON_MODULES fi if test x$rubyecasound_support != xnone ; then echo "Ruby module dir: "$ECA_S_RUBY_SITEDIR fi if test "x$ECA_S_EXTRA_CPPFLAGS" != "x" ; then echo "Extra headers: "$ECA_S_EXTRA_CPPFLAGS fi if test "x$ECA_S_EXTRA_LIBS" != "x" ; then echo "Extra libs: "$ECA_S_EXTRA_LIBS fi echo "-------------------------------------------------------------------" echo "Type 'make' to compile the package and 'make install' to install." echo "Remember to use GNU Make, often installed as 'gmake'." echo "-------------------------------------------------------------------" ecasound-2.9.3/libecasound/0000755000076400007640000000000013606336216012635 500000000000000ecasound-2.9.3/libecasound/eca-chainsetup-position.cpp0000644000076400007640000000506112201477764020022 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup-position.cpp: Global chainsetup position // Copyright (C) 1999-2003 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* ceil() */ #include "eca-chainsetup-position.h" ECA_CHAINSETUP_POSITION::ECA_CHAINSETUP_POSITION(void) { looping_rep = false; max_length_set_rep = false; } ECA_CHAINSETUP_POSITION::~ECA_CHAINSETUP_POSITION(void) { } SAMPLE_SPECS::sample_pos_t ECA_CHAINSETUP_POSITION::max_length_in_samples(void) const { return(max_length_in_samples_rep); } double ECA_CHAINSETUP_POSITION::max_length_in_seconds_exact(void) const { return((double)max_length_in_samples_rep / (double)samples_per_second()); } /** * Explicitly sets the chainsetup length (in seconds). * * A special-case value of '-1 * srate' can be used to override * a previously set chainsetup length. * * @post ((pos == -1 * samples_per_second()) && (max_length_set() != true)) || * (max_length_set() == true) */ void ECA_CHAINSETUP_POSITION::set_max_length_in_samples(SAMPLE_SPECS::sample_pos_t pos) { max_length_in_samples_rep = pos; if (pos != -1 * samples_per_second()) { max_length_set_rep = true; } else { max_length_set_rep = false; } } void ECA_CHAINSETUP_POSITION::set_max_length_in_seconds(double pos_in_seconds) { set_max_length_in_samples(static_cast(pos_in_seconds * samples_per_second())); } void ECA_CHAINSETUP_POSITION::set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value) { if (max_length_set() == true) { double ratio (new_value); ratio /= samples_per_second(); set_max_length_in_samples(static_cast(max_length_in_samples() * ratio)); } ECA_AUDIO_POSITION::set_samples_per_second(new_value); } ecasound-2.9.3/libecasound/global-preset.cpp0000644000076400007640000000467310664032032016021 00000000000000// ------------------------------------------------------------------------ // global_preset.cpp: Global effect preset // Copyright (C) 2000 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "resource-file.h" #include "eca-resources.h" #include "eca-logger.h" #include "eca-error.h" #include "global-preset.h" GLOBAL_PRESET::GLOBAL_PRESET(const std::string& preset_name) : preset_name_rep(preset_name) { ECA_RESOURCES ecarc; ECA_LOG_MSG(ECA_LOGGER::system_objects,"(global-preset) Opening sc-preset file."); /* FIXME: is this correct; user resources should be nowadays handled in eca-resources.cpp */ std::string user_filename = ecarc.resource("user-resource-directory") + "/" + ecarc.resource("resource-file-effect-presets"); RESOURCE_FILE rc; rc.resource_file(user_filename); rc.load(); std::string raw = rc.resource(preset_name); if (raw == "") { std::string global_filename = ecarc.resource("resource-directory") + "/" + ecarc.resource("resource-file-effect-presets"); rc.resource_file(global_filename); rc.load(); raw = rc.resource(preset_name); } if (raw != "") { parse(raw); set_name(preset_name); } else { set_name("empty"); throw(ECA_ERROR("GLOBAL_PRESET", "requested preset \"" + preset_name + "\" was not found.")); } } GLOBAL_PRESET* GLOBAL_PRESET::clone(void) const { std::vector param_values; for(int n = 0; n < number_of_params(); n++) { param_values.push_back(get_parameter(n + 1)); } GLOBAL_PRESET* preset = new GLOBAL_PRESET(preset_name_rep); for(int n = 0; n < preset->number_of_params(); n++) { preset->set_parameter(n + 1, param_values[n]); } return(preset); } ecasound-2.9.3/libecasound/audiofx.cpp0000644000076400007640000000474311053067202014716 00000000000000// ------------------------------------------------------------------------ // audiofx.cpp: General effect processing routines. // Copyright (C) 1999-2002,2004,2006,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "sample-specs.h" #include "samplebuffer.h" #include "audiofx.h" #include "eca-logger.h" EFFECT_BASE::EFFECT_BASE(void) : channels_rep(0) { } EFFECT_BASE::~EFFECT_BASE(void) { } void EFFECT_BASE::init(SAMPLE_BUFFER* sbuf) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Init w/ samplerate " + kvu_numtostr(samples_per_second()) + " for object " + name() + "."); set_channels(sbuf->number_of_channels()); DBC_CHECK(channels() > 0); DBC_CHECK(samples_per_second() > 0); } int EFFECT_BASE::channels(void) const { return channels_rep; } void EFFECT_BASE::set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_rate) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Setting samplerate to " + kvu_numtostr(new_rate) + " for object " + name() + ". Old value " + kvu_numtostr(samples_per_second()) + "."); /* note: changing the sample rate might change values of * of parameters, so we want to preserve the values */ if (samples_per_second() != new_rate) { std::vector old_values (number_of_params()); for(int n = 0; n < number_of_params(); n++) { old_values[n] = get_parameter(n + 1); } ECA_SAMPLERATE_AWARE::set_samples_per_second(new_rate); for(int n = 0; n < number_of_params(); n++) { set_parameter(n + 1, old_values[n]); } } } void EFFECT_BASE::set_channels(int v) { channels_rep = v; } ecasound-2.9.3/libecasound/eca-chainsetup-parser_test.h0000644000076400007640000000757511166145417020166 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup-parser_test.h: Unit test for ECA_CHAINSETUP_PARSER // Copyright (C) 2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "eca-chainsetup.h" #include "kvu_numtostr.h" #include "eca-logger.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_CHAINSETUP. * * FIXME: implementation not ready */ class ECA_CHAINSETUP_PARSER_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("ECA_CHAINSETUP_PARSER_TEST"); } virtual void do_run(void); public: virtual ~ECA_CHAINSETUP_PARSER_TEST(void) { } private: void do_run_format_options(void); }; void ECA_CHAINSETUP_PARSER_TEST::do_run(void) { do_run_format_options(); } void ECA_CHAINSETUP_PARSER_TEST::do_run_format_options(void) { ECA_CHAINSETUP csetup; ECA_CHAINSETUP_PARSER p(&csetup); p.interpret_option("-f:foo,bar"); if (p.interpret_result() != false) { ECA_TEST_FAILURE("invalid sample_format accepted"); } ECA_AUDIO_FORMAT afmt (4, 96000, ECA_AUDIO_FORMAT::sfmt_f64_be, false); csetup.set_default_audio_format(afmt); if (csetup.default_audio_format().sample_format() != ECA_AUDIO_FORMAT::sfmt_f64_be) ECA_TEST_FAILURE("failed to set initial audio fmt (1)"); if (csetup.default_audio_format().channels() != 4 || csetup.default_audio_format().samples_per_second() != 96000 || csetup.default_audio_format().sample_format() != ECA_AUDIO_FORMAT::sfmt_f64_be || csetup.default_audio_format().interleaved_channels() != false) ECA_TEST_FAILURE("failed to set initial audio fmt"); /* note: Setting one audio format component should not affect other * audio format components. The following section has * multiple test cases related to this. */ p.interpret_option("-f:s32_be"); if (csetup.default_audio_format().sample_format() != ECA_AUDIO_FORMAT::sfmt_s32_be) ECA_TEST_FAILURE("unable to set sample format"); if (csetup.default_audio_format().channels() != 4) ECA_TEST_FAILURE("setting sample format affected channels"); ECA_LOG_MSG(ECA_LOGGER::info, afmt.format_string()); ECA_LOG_MSG(ECA_LOGGER::info, csetup.default_audio_format().format_string()); p.interpret_option("-f:,6,"); if (csetup.default_audio_format().channels() != 6) ECA_TEST_FAILURE("unable to channels"); if (csetup.default_audio_format().sample_format() != ECA_AUDIO_FORMAT::sfmt_s32_be) ECA_TEST_FAILURE("setting channels affected sample format"); p.interpret_option("-f:,6,"); if (csetup.default_audio_format().channels() != 6) ECA_TEST_FAILURE("unable to channels"); /* note: Test setting all parameters */ p.interpret_option("-f:u8,1,22050,i"); if (csetup.default_audio_format().channels() != 1 || csetup.default_audio_format().samples_per_second() != 22050 || csetup.default_audio_format().sample_format() != ECA_AUDIO_FORMAT::sfmt_u8 || csetup.default_audio_format().interleaved_channels() != true) ECA_TEST_FAILURE("failed to set all audio fmt components"); } ecasound-2.9.3/libecasound/preset.cpp0000644000076400007640000004152711740524567014601 00000000000000// ------------------------------------------------------------------------ // preset.cpp: Class for representing effect presets // Copyright (C) 2000-2002,2004-2007,2009 Kai Vehmanen // Copyright (C) 2001 Arto Hamara // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include "eca-chain.h" #include "eca-chainop.h" #include "generic-controller.h" #include "eca-object-factory.h" #include "samplebuffer.h" #include "eca-logger.h" #include "eca-error.h" #include "preset.h" #include "preset_impl.h" using std::string; using std::vector; using std::cerr; using std::endl; PRESET::PRESET(void) { impl_repp = new PRESET_impl(); impl_repp->parsed_rep = false; } PRESET::PRESET(const string& formatted_string) { impl_repp = new PRESET_impl(); parse(formatted_string); } PRESET::~PRESET(void) { vector::iterator q = chains.begin(); while(q != chains.end()) { delete *q; ++q; } vector::iterator p = buffers.begin(); while(p != buffers.end()) { if (p != buffers.begin()) delete *p; // first buffer points to an // outside buffer -> not // deleted here ++p; } for(size_t n = 0; n < impl_repp->pardesclist_rep.size(); n++) { delete impl_repp->pardesclist_rep[n]; impl_repp->pardesclist_rep[n] = 0; } // NOTE: chainops and controllers are deleted in CHAIN::~CHAIN() delete impl_repp; impl_repp = 0; } PRESET* PRESET::clone(void) const { vector param_values; for(int n = 0; n < number_of_params(); n++) { param_values.push_back(get_parameter(n + 1)); } PRESET* preset = new PRESET(impl_repp->parse_string_rep); for(int n = 0; n < preset->number_of_params(); n++) { preset->set_parameter(n + 1, param_values[n]); } return preset; } PRESET* PRESET::new_expr(void) const { return new PRESET(impl_repp->parse_string_rep); } void PRESET::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { for(size_t q = 0; q < chains.size(); q++) { chains[q]->set_samples_per_second(v); } ECA_SAMPLERATE_AWARE::set_samples_per_second(v); } string PRESET::name(void) const { return impl_repp->name_rep; } string PRESET::description(void) const { return impl_repp->description_rep; } void PRESET::set_name(const string& v) { impl_repp->name_rep = v; } /** * Whether preset data has been parsed */ bool PRESET::is_parsed(void) const { return impl_repp->parsed_rep; } void PRESET::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { if (param > 0 && param <= static_cast(impl_repp->pardesclist_rep.size())) *pd = *impl_repp->pardesclist_rep[param - 1]; } /** * Parse preset data from the formatted string given * as argument. * * require: * formatted_string.empty() == false * ensure: * is_parsed() == true */ void PRESET::parse(const string& formatted_string) { // -------- DBC_REQUIRE(formatted_string.empty() == false); // -------- impl_repp->parse_string_rep = formatted_string; chains.clear(); chains.push_back(new CHAIN()); chains.back()->set_samples_per_second(samples_per_second()); // FIXME: add support for quotes (ie. "one token with space" style) vector tokens = kvu_string_to_words(formatted_string); vector::const_iterator p = tokens.begin(); while(p != tokens.end()) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Parsing: " + *p + "."); /* case 1: new chain */ if (*p == "|") { add_chain(); } /* case 2: preset specific option */ else if (is_preset_option(*p) == true) { parse_preset_option(*p); } /* case 3: ecasound cop option */ else { parse_operator_option(*p); } ++p; } impl_repp->parsed_rep = true; // -------- DBC_ENSURE(is_parsed() == true); // -------- } bool PRESET::is_preset_option(const string& arg) const { if (arg.size() < 2 || arg[0] != '-') return false; switch(arg[1]) { case 'p': { if (arg.size() < 3) return false; switch(arg[2]) { case 'd': case 'p': return true; default: { } } } default: { } } return false; } void PRESET::parse_preset_option(const string& arg) { if (arg.size() < 2) return; if (arg[0] != '-') return; switch(arg[1]) { case 'p': { if (arg.size() < 3) return; switch(arg[2]) { case 'd': { /* -pd:preset_description */ impl_repp->description_rep = kvu_get_argument_number(1, arg); break; } case 'p': { if (arg.size() < 4) return; switch(arg[3]) { case 'd': { /* -ppd:x,y,z (param default values) */ set_preset_defaults(kvu_get_arguments(arg)); break; } case 'n': { /* -ppn:x,y,z (param names) */ set_preset_param_names(kvu_get_arguments(arg)); break; } case 'l': { /* -ppl:x,y,z (param lower bounds) */ set_preset_lower_bounds(kvu_get_arguments(arg)); break; } case 'u': { /* -ppu:x,y,z (param upper bounds) */ set_preset_upper_bounds(kvu_get_arguments(arg)); break; } case 't': { /* -ppt:x,y,z (param toggle) */ set_preset_toggles(kvu_get_arguments(arg)); break; } default: { ECA_LOG_MSG(ECA_LOGGER::info, "Unknown preset option (1) " + arg + "."); break; } } break; /* -pp */ } default: { ECA_LOG_MSG(ECA_LOGGER::info, "Unknown preset option (2) " + arg + "."); break; } } break; /* -p */ } default: { ECA_LOG_MSG(ECA_LOGGER::info, "Unknown preset option (3) " + arg + "."); break; } } } void PRESET::extend_pardesc_vector(int number) { while (static_cast(impl_repp->pardesclist_rep.size()) < number) { DBC_DECLARE(size_t oldsize = impl_repp->pardesclist_rep.size()); impl_repp->pardesclist_rep.push_back(new OPERATOR::PARAM_DESCRIPTION()); // cerr << "(preset) adding pardesclist_rep item." << endl; DBC_CHECK(impl_repp->pardesclist_rep.size() == oldsize + 1); } } void PRESET::set_preset_defaults(const vector& args) { extend_pardesc_vector(args.size()); for(size_t n = 0; n < args.size(); n++) { if (args[n].size() > 0 && args[n][0] == '-') continue; impl_repp->pardesclist_rep[n]->default_value = atof(args[n].c_str()); set_parameter(n + 1, impl_repp->pardesclist_rep[n]->default_value); // cerr << "(preset) setting default for " << n << " to " << impl_repp->pardesclist_rep[n]->default_value << "." << endl; } } void PRESET::set_preset_param_names(const vector& args) { impl_repp->preset_param_names_rep.resize(args.size()); for(size_t n = 0; n < args.size(); n++) { impl_repp->preset_param_names_rep[n] = args[n]; // cerr << "(preset) setting param name for " << n << " to " << impl_repp->preset_param_names_rep[n] << "." << endl; } } void PRESET::set_preset_lower_bounds(const vector& args) { extend_pardesc_vector(args.size()); for(size_t n = 0; n < args.size(); n++) { if (args[n].size() > 0 && args[n][0] == '-') { impl_repp->pardesclist_rep[n]->bounded_below = false; } else { impl_repp->pardesclist_rep[n]->bounded_below = true; impl_repp->pardesclist_rep[n]->lower_bound = atof(args[n].c_str()); // cerr << "(preset) setting lowbound for " << n << " to " << impl_repp->pardesclist_rep[n]->lower_bound << "." << endl; } } } void PRESET::set_preset_upper_bounds(const vector& args) { extend_pardesc_vector(args.size()); for(size_t n = 0; n < args.size(); n++) { if (args[n].size() > 0 && args[n][0] == '-') { impl_repp->pardesclist_rep[n]->bounded_above = false; } else { impl_repp->pardesclist_rep[n]->bounded_above = true; impl_repp->pardesclist_rep[n]->upper_bound = atof(args[n].c_str()); // cerr << "(preset) setting upperbound for " << n << " to " << impl_repp->pardesclist_rep[n]->upper_bound << "." << endl; } } } void PRESET::set_preset_toggles(const vector& args) { extend_pardesc_vector(args.size()); for(size_t n = 0; n < args.size(); n++) { impl_repp->pardesclist_rep[n]->integer = false; impl_repp->pardesclist_rep[n]->logarithmic = false; impl_repp->pardesclist_rep[n]->output = false; impl_repp->pardesclist_rep[n]->toggled = false; if (args[n].find("i") != string::npos) impl_repp->pardesclist_rep[n]->integer = true; if (args[n].find("l") != string::npos) impl_repp->pardesclist_rep[n]->logarithmic = true; if (args[n].find("o") != string::npos) impl_repp->pardesclist_rep[n]->output = true; if (args[n].find("t") != string::npos) impl_repp->pardesclist_rep[n]->toggled = true; ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Setting preset toggles: integer=") + kvu_numtostr(impl_repp->pardesclist_rep[n]->integer) + ", log=" + kvu_numtostr(impl_repp->pardesclist_rep[n]->logarithmic) + ", output=" + kvu_numtostr(impl_repp->pardesclist_rep[n]->output) + ", toggle=" + kvu_numtostr(impl_repp->pardesclist_rep[n]->toggled) + "."); } } void PRESET::parse_operator_option(const string& arg) { CHAIN_OPERATOR *cop; GENERIC_CONTROLLER* gctrl; /* phase 1: parse for cop definitions -eabc:1.0,%param1,2.0 */ vector arg_indices; vector arg_slave_indices; vector ps_parts(kvu_get_number_of_arguments(arg)); for(int i = 0; i < kvu_get_number_of_arguments(arg); i++) { string onearg = kvu_get_argument_number(i + 1, arg); if(onearg.size() > 0 && onearg[0] == '%') { // FIXME: what if %xxx options are given in the "wrong" order? size_t preset_index = atoi(kvu_get_argument_number(i + 1, arg).substr(1).c_str()); if (preset_index <= arg_indices.size()) { preset_index = arg_indices.size() + 1; } arg_indices.push_back(preset_index); arg_slave_indices.push_back(i + 1); ps_parts[i] = "0.0"; // make sure param is mentioned in param_names list if (impl_repp->preset_param_names_rep.size() < preset_index) { impl_repp->preset_param_names_rep.resize(preset_index); impl_repp->preset_param_names_rep[preset_index - 1] = string("arg-") + kvu_numtostr(preset_index); } } else { ps_parts[i] = onearg; } } DBC_CHECK(arg_indices.size() == arg_slave_indices.size()); /* phase 2: 'ps' is set to -eabc:1.0,2.0,2.0 (no %-params) */ string ps = "-" + kvu_get_argument_prefix(arg) + ":" + kvu_vector_to_string(ps_parts, ","); // cerr << "Creating object from '" << ps << "'." << endl; /* phase 3: create an object using 'ps' */ DYNAMIC_OBJECT* object = 0; cop = 0; cop = ECA_OBJECT_FACTORY::create_chain_operator(ps); if (cop == 0) cop = ECA_OBJECT_FACTORY::create_ladspa_plugin(ps); if(cop == 0) cop=ECA_OBJECT_FACTORY::create_lv2_plugin(ps); if (cop != 0) { chains.back()->add_chain_operator(cop); chains.back()->selected_chain_operator_as_target(); object = cop; } else { if (kvu_get_argument_prefix(ps) == "kx") chains.back()->selected_controller_as_target(); else { gctrl = ECA_OBJECT_FACTORY::create_controller(ps); if (gctrl != 0) { impl_repp->gctrls_rep.push_back(gctrl); chains.back()->add_controller(gctrl); } object = gctrl; } } /* phase 4: create an object using 'ps' */ if (object != 0) { for(int i = 0; i < static_cast(arg_indices.size()); i++) { // NOTE: there's a one-to-many connection between // presets' parameters and 'object-param' pairs // (ie. one preset-parameter can control // multiple object params (param_objects and // param_indices) size_t preset_index = arg_indices[i]; // NOTE: for instance for LADSPA plugins -el:label,par1,par2 // number_of_args is 3, but number_of_params is 2! int slave_index = arg_slave_indices[i]; slave_index -= kvu_get_number_of_arguments(arg) - object->number_of_params(); if (preset_index > impl_repp->slave_param_objects_rep.size()) { impl_repp->slave_param_objects_rep.resize(preset_index); impl_repp->slave_param_indices_rep.resize(preset_index); } impl_repp->slave_param_objects_rep[preset_index - 1].push_back(object); impl_repp->slave_param_indices_rep[preset_index - 1].push_back(slave_index); // cerr << "Linking preset parameter " << preset_index << " to object '" << impl_repp->slave_param_objects_rep[preset_index - 1].back()->name() << "', and its parameter '" << impl_repp->slave_param_objects_rep[preset_index - 1].back()->get_parameter_name(impl_repp->slave_param_indices_rep[preset_index - 1].back()) << "'." << endl; DBC_CHECK(impl_repp->slave_param_objects_rep.size() == impl_repp->slave_param_indices_rep.size()); } } } void PRESET::add_chain(void) { chains.push_back(new CHAIN()); buffers.push_back(new SAMPLE_BUFFER()); } string PRESET::parameter_names(void) const { return kvu_vector_to_string(impl_repp->preset_param_names_rep, ","); } void PRESET::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { if (param > 0 && param <= static_cast(impl_repp->slave_param_objects_rep.size())) { for(size_t n = 0; n < impl_repp->slave_param_objects_rep[param - 1].size(); n++) { DBC_CHECK(static_cast(impl_repp->slave_param_indices_rep.size()) > param - 1); DBC_CHECK(impl_repp->slave_param_indices_rep[param - 1].size() > n); int index = impl_repp->slave_param_indices_rep[param - 1][n]; // cerr << "Setting preset " << name() << " param " << param << " (" << impl_repp->slave_param_objects_rep[param-1][n]->get_parameter_name(param) << "), of object " << impl_repp->slave_param_objects_rep[param-1][n]->name() << ", with index number " << index << ", to value " << value << "." << endl; impl_repp->slave_param_objects_rep[param-1][n]->set_parameter(index, value); } } } CHAIN_OPERATOR::parameter_t PRESET::get_parameter(int param) const { if (param > 0 && param <= static_cast(impl_repp->slave_param_objects_rep.size())) { DBC_CHECK(static_cast(impl_repp->slave_param_indices_rep.size()) > param - 1); if (impl_repp->slave_param_indices_rep[param - 1].size() > 0) { int index = impl_repp->slave_param_indices_rep[param - 1][0]; DBC_CHECK(index > 0); // cerr << "Getting preset " << name() << " param " << param << ", index number " << index cerr << " with value " << impl_repp->slave_param_objects_rep[param-1][0]->get_parameter(index) << "." << endl; return impl_repp->slave_param_objects_rep[param-1][0]->get_parameter(index); } } return 0.0f; } void PRESET::init(SAMPLE_BUFFER *insample) { DBC_CHECK(samples_per_second() > 0); first_buffer = insample; chains[0]->set_samples_per_second(samples_per_second()); chains[0]->init(first_buffer, first_buffer->number_of_channels(), first_buffer->number_of_channels()); for(size_t q = 1; q < chains.size(); q++) { DBC_CHECK(q - 1 < buffers.size()); buffers[q - 1]->length_in_samples(first_buffer->length_in_samples()); buffers[q - 1]->number_of_channels(first_buffer->number_of_channels()); chains[q]->set_samples_per_second(samples_per_second()); chains[q]->init(buffers[q - 1], first_buffer->number_of_channels(), first_buffer->number_of_channels()); } for(size_t n = 0; n < impl_repp->gctrls_rep.size(); n++) { impl_repp->gctrls_rep[n]->init(); } } void PRESET::release(void) { /* reimplemented from CHAIN_OPERATOR base class; * see init() */ vector::iterator q = chains.begin(); while(q != chains.end()) { (*q)->release(); ++q; } first_buffer = 0; } void PRESET::process(void) { vector::iterator p = buffers.begin(); while(p != buffers.end()) { (*p)->copy_all_content(*first_buffer); ++p; } vector::iterator q = chains.begin(); while(q != chains.end()) { (*q)->process(); ++q; } if (chains.size() > 1) { first_buffer->divide_by(chains.size()); p = buffers.begin(); while(p != buffers.end()) { first_buffer->add_with_weight(**p, static_cast(chains.size())); ++p; } } } ecasound-2.9.3/libecasound/audioio-db-client.cpp0000644000076400007640000002353311755263413016560 00000000000000// ------------------------------------------------------------------------ // audioio-db-client.cpp: Client class for double-buffering providing // additional layer of buffering for objects // derived from AUDIO_IO. // Copyright (C) 2000-2005,2009,2011,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include /* open(), close() */ #include #include #include "samplebuffer.h" #include "eca-logger.h" #include "audioio-db-client.h" /** * Constructor. The given client object is registered to * the given db server as a client object. * * Ownership of 'aobject' is transfered to this db client * object if 'transfer_ownership' is true. */ AUDIO_IO_DB_CLIENT::AUDIO_IO_DB_CLIENT (AUDIO_IO_DB_SERVER *pserver, AUDIO_IO* aobject, bool transfer_ownership) : pserver_repp(pserver), free_child_rep(transfer_ownership) { set_child(aobject); pbuffer_repp = 0; xruns_rep = 0; finished_rep = false; recursing_rep = false; ECA_LOG_MSG(ECA_LOGGER::user_objects, std::string("DB-client created for ") + child()->label() + "."); // just in case the child object has already been configured fetch_initial_child_data(); } /** * Copy attributes from the proxied (child) object. */ void AUDIO_IO_DB_CLIENT::fetch_initial_child_data(void) { // note! the child object is one that is configured // at this point set_audio_format(child()->audio_format()); set_position_in_samples(child()->position_in_samples()); set_length_in_samples(child()->length_in_samples()); set_buffersize(child()->buffersize()); set_io_mode(child()->io_mode()); set_label(child()->label()); toggle_nonblocking_mode(child()->nonblocking_mode()); } /** * Desctructor. Unregisters the client from the db * server. */ AUDIO_IO_DB_CLIENT::~AUDIO_IO_DB_CLIENT(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "destructor " + label() + "."); if (is_open() == true) { close(); } if (pserver_repp != 0) { bool was_running = false; if (pserver_repp->is_running() == true) { was_running = true; pserver_repp->stop(); pserver_repp->wait_for_stop(); DBC_CHECK(pserver_repp->is_running() != true); } pserver_repp->unregister_client(child()); pbuffer_repp = 0; if (was_running == true) { pserver_repp->start(); } } if (free_child_rep != true) { /* to avoid deleting the original registered child */ release_child_no_delete(); } if (xruns_rep > 0) std::cerr << "(audioio-db-client) There were total " << xruns_rep << " xruns." << std::endl; } /** * Whether all data has been processed? If opened in mode 'io_read', * this means that end of stream has been reached. If opened in * 'io_write' or 'io_readwrite' modes, finished status usually * means that an error has occured (no space left, etc). After * finished() has returned 'true', further calls to read_buffer() * and/or write_buffer() won't process any data. */ bool AUDIO_IO_DB_CLIENT::finished(void) const { return finished_rep; } /** * Reads samples to buffer pointed by 'sbuf'. If necessary, the target * buffer will be resized. */ void AUDIO_IO_DB_CLIENT::read_buffer(SAMPLE_BUFFER* sbuf) { DBC_CHECK(pbuffer_repp != 0); if (pbuffer_repp->read_space() > 0) { SAMPLE_BUFFER* source = pbuffer_repp->sbufs_rep[pbuffer_repp->readptr_rep.get()]; sbuf->copy_all_content(*source); pbuffer_repp->advance_read_pointer(); pserver_repp->signal_client_activity(); change_position_in_samples(sbuf->length_in_samples()); } else { sbuf->number_of_channels(channels()); if (pbuffer_repp->finished_rep.get() == 1) { finished_rep = true; sbuf->length_in_samples(0); } else { xruns_rep++; sbuf->length_in_samples(0); std::cerr << "(audioio-db-client) WARNING: Underrun in reading from \"" << child()->label() << "\". Trying to recover." << std::endl; } } // -------- DBC_ENSURE(sbuf->number_of_channels() == channels()); // -------- } /** * Writes all data from sample buffer pointed by 'sbuf'. Notes * concerning read_buffer() also apply to this routine. */ void AUDIO_IO_DB_CLIENT::write_buffer(SAMPLE_BUFFER* sbuf) { DBC_CHECK(pbuffer_repp != 0); if (pbuffer_repp->write_space() > 0) { SAMPLE_BUFFER* target = pbuffer_repp->sbufs_rep[pbuffer_repp->writeptr_rep.get()]; target->copy_all_content(*sbuf); target->number_of_channels(channels()); pbuffer_repp->advance_write_pointer(); pserver_repp->signal_client_activity(); change_position_in_samples(sbuf->length_in_samples()); extend_position(); } else { if (pbuffer_repp->finished_rep.get() == 1) finished_rep = true; else { /* NOTE: not always rt-safe, but it's better to break rt-safety than * to lose recorded data */ std::cerr << "(audioio-db-client) WARNING: Overrun in writing to \"" << child()->label() << "\". Trying to recover." << std::endl; xruns_rep++; pserver_repp->wait_for_full(); if (recursing_rep != true && pbuffer_repp->write_space() > 0) { recursing_rep = true; this->write_buffer(sbuf); recursing_rep = false; } else { seek_position(position_in_samples()); // hack to force a restart of the db server std::cerr << "(audioio-db-client) Serious trouble with the disk-io subsystem! (output)" << std::endl; } } } } /** * Stops the DB server in case it's running. * Returns true if server was running. The return * value should be passed to restore_db_server_state() * function. */ bool AUDIO_IO_DB_CLIENT::pause_db_server_if_running(void) { bool was_running = false; if (pserver_repp->is_running() == true) { was_running = true; pserver_repp->stop(); pserver_repp->wait_for_stop(); DBC_CHECK(pserver_repp->is_running() != true); } return was_running; } void AUDIO_IO_DB_CLIENT::restore_db_server_state(bool was_running) { if (was_running == true) { pserver_repp->start(); pserver_repp->wait_for_full(); DBC_CHECK(pserver_repp->is_running() == true); } } /** * Seeks to the current position. * * Note! Seeking involves stopping the whole db * server, so it's a costly operation. */ SAMPLE_SPECS::sample_pos_t AUDIO_IO_DB_CLIENT::seek_position(SAMPLE_SPECS::sample_pos_t pos) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "seek " + label() + " to pos " + kvu_numtostr(pos) + "."); SAMPLE_SPECS::sample_pos_t res = child()->position_in_samples(); if (child()->supports_seeking() == true) { bool was_running = pause_db_server_if_running(); child()->seek_position_in_samples(pos); res = child()->position_in_samples(); if (pbuffer_repp != 0) { pbuffer_repp->reset(); } finished_rep = false; restore_db_server_state(was_running); } /* note: important that we override the AUDIO_IO_PROXY * default implementation as it does the wrong thing */ return AUDIO_IO::seek_position(res); } /** * Opens the child audio object (possibly in exclusive mode). * This routine is meant for opening files and devices, * loading libraries, etc. */ void AUDIO_IO_DB_CLIENT::open(void) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "open " + label() + "."); if (child()->is_open() != true) { child()->open(); } set_audio_format(child()->audio_format()); set_length_in_samples(child()->length_in_samples()); if (pbuffer_repp == 0) { pserver_repp->register_client(child()); pbuffer_repp = pserver_repp->get_client_buffer(child()); for(unsigned int n = 0; n < pbuffer_repp->sbufs_rep.size(); n++) { pbuffer_repp->sbufs_rep[n]->number_of_channels(channels()); pbuffer_repp->sbufs_rep[n]->length_in_samples(buffersize()); } if (io_mode() == AUDIO_IO::io_read) pbuffer_repp->io_mode_rep = AUDIO_IO::io_read; else pbuffer_repp->io_mode_rep = AUDIO_IO::io_write; } AUDIO_IO::open(); } /** * Closes the child audio object. After calling this routine, * all resources (ie. soundcard) must be freed * (they can be used by other processes). */ void AUDIO_IO_DB_CLIENT::close(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "close " + label() + "."); if (child()->is_open() == true) child()->close(); AUDIO_IO::close(); } void AUDIO_IO_DB_CLIENT::start_io(void) { AUDIO_IO_PROXY::start_io(); /* note: In case child object does not support seeking, and * position is not zero, it is undefined what the child * object position will be after start_io(). Try to * handle this case gracefully. */ if (child()->supports_seeking() != true && position_in_samples() != 0) { bool was_running = pause_db_server_if_running(); // note: this is not fully accurate, but the best // information we have available at this point set_position_in_samples(child()->position_in_samples()); /* as position might have changed, flush the buffers */ if (pbuffer_repp != 0) { pbuffer_repp->reset(); } restore_db_server_state(was_running); } } void AUDIO_IO_DB_CLIENT::stop_io(void) { AUDIO_IO_PROXY::stop_io(); } ecasound-2.9.3/libecasound/eca-logger-default.h0000644000076400007640000000134311261610475016353 00000000000000#ifndef INCLUDE_ECA_LOGGER_DEFAULT_H #define INCLUDE_ECA_LOGGER_DEFAULT_H #include #include #include "eca-logger-interface.h" /** * Default logging subsystem implementation. * * Outputs traces to an ostream object (by default to * std::cerr). * * @author Kai Vehmanen */ class ECA_LOGGER_DEFAULT : public ECA_LOGGER_INTERFACE { public: virtual void do_msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message); virtual void do_flush(void); virtual void do_log_level_changed(void); virtual ~ECA_LOGGER_DEFAULT(void); ECA_LOGGER_DEFAULT(std::ostream& output = std::cerr); private: std::ostream& output_rep; }; #endif /* INCLUDE_ECA_LOGGER_DEFAULT_H */ ecasound-2.9.3/libecasound/eca-control-main.cpp0000644000076400007640000000603511172651507016414 00000000000000// ------------------------------------------------------------------------ // eca-control-main.h: ECA_CONTROL_MAIN // Copyright (C) 2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #include #include #include "kvu_dbc.h" #include "kvu_numtostr.h" #include "kvu_utils.h" #include "eca-control-main.h" #include "eca-logger.h" ECA_CONTROL_MAIN::~ECA_CONTROL_MAIN (void) { } std::string ECA_CONTROL_MAIN::return_value_to_string(const struct eci_return_value *retval, int float_precision) { std::string result; if (retval->type == eci_return_value::retval_none) { ; /* nop */ } else if (retval->type == eci_return_value::retval_error) { result = retval->string_val; } else if (retval->type == eci_return_value::retval_string) { result = retval->string_val; } else if (retval->type == eci_return_value::retval_string_list) { result = kvu_vector_to_string(kvu_vector_search_and_replace(retval->string_list_val, ",", "\\,"), ","); } else if (retval->type == eci_return_value::retval_integer) { result = kvu_numtostr(retval->m.int_val); } else if (retval->type == eci_return_value::retval_long_integer) { result = kvu_numtostr(retval->m.long_int_val); } else if (retval->type == eci_return_value::retval_float) { result = kvu_numtostr(retval->m.float_val, float_precision); } else { DBC_NEVER_REACHED(); } return result; } const char* ECA_CONTROL_MAIN::return_value_type_to_string(const struct eci_return_value *retval) { if (retval->type == eci_return_value::retval_none) return "-"; else if (retval->type == eci_return_value::retval_error) return "e"; else if (retval->type == eci_return_value::retval_string) return "s"; else if (retval->type == eci_return_value::retval_string_list) return "S"; else if (retval->type == eci_return_value::retval_integer) return "i"; else if (retval->type == eci_return_value::retval_long_integer) return "li"; else if (retval->type == eci_return_value::retval_float) return "f"; else DBC_NEVER_REACHED(); return NULL; } void ECA_CONTROL_MAIN::clear_return_value(struct eci_return_value *retval) { if (retval == 0) return; retval->type = eci_return_value::retval_none; retval->string_list_val.resize(0); retval->string_val.resize(0); retval->m.long_int_val = 0; } ecasound-2.9.3/libecasound/audioio-db-server.h0000644000076400007640000000427010664032032016237 00000000000000#ifndef INCLUDED_AUDIOIO_DB_SERVER_H #define INCLUDED_AUDIOIO_DB_SERVER_H #include #include "audioio.h" #include "audioio-db-buffer.h" class AUDIO_IO_DB_SERVER_impl; /** * Audio i/o engine. Meant for serving all double-buffered client * audio objects (AUDIO_IO_DB_CLIENT). * * @author Kai Vehmanen */ class AUDIO_IO_DB_SERVER { friend void* start_db_server_io_thread(void *ptr); public: /** @name Constructors and dtors */ /*@{*/ AUDIO_IO_DB_SERVER (void); ~AUDIO_IO_DB_SERVER(void); /*@}*/ /** @name Public functions for acquiring status information */ /*@{*/ bool is_running(void) const; bool is_full(void) const; /*@}*/ /** @name Public functions for transport control */ /*@{*/ void start(void); void stop(void); void flush(void); /*@}*/ /** @name Public functions for reporting client activity */ /*@{*/ void signal_client_activity(void); /*@}*/ /** @name Public functions for waiting on server conditions */ /*@{*/ void wait_for_full(void); void wait_for_stop(void); void wait_for_flush(void); /*@}*/ /** @name Public functions for configuration */ /*@{*/ void set_buffer_defaults(int buffers, long int buffersize); void register_client(AUDIO_IO* abject); void unregister_client(AUDIO_IO* abject); AUDIO_IO_DB_BUFFER* get_client_buffer(AUDIO_IO* abject); /*@}*/ private: static const int buffercount_default; static const long int buffersize_default; std::vector buffers_rep; std::vector clients_rep; std::map client_map_rep; AUDIO_IO_DB_SERVER_impl* impl_repp; bool thread_running_rep; ATOMIC_INTEGER exit_ok_rep; ATOMIC_INTEGER exit_request_rep; ATOMIC_INTEGER stop_request_rep; ATOMIC_INTEGER running_rep; ATOMIC_INTEGER full_rep; int buffercount_rep; long int buffersize_rep; int schedpriority_rep; AUDIO_IO_DB_SERVER& operator=(const AUDIO_IO_DB_SERVER& x) { return *this; } AUDIO_IO_DB_SERVER (const AUDIO_IO_DB_SERVER& x) { } void io_thread(void); void wait_for_client_activity(void); void signal_full(void); void signal_stop(void); void signal_flush(void); void dump_profile_counters(void); }; #endif ecasound-2.9.3/libecasound/eca-iamode-parser_impl.h0000644000076400007640000000743411742360471017234 00000000000000#ifndef INCLUDED_ECA_IAMODE_PARSER_IMPL_H #define INCLUDED_ECA_IAMODE_PARSER_IMPL_H class ECA_IAMODE_PARSER_COMMANDS { protected: enum Commands { ec_unknown, // -- ec_help, ec_exit, ec_start, ec_stop, ec_stop_sync, ec_run, ec_debug, ec_resource_file, // -- ec_engine_status, ec_engine_launch, ec_engine_halt, // -- ec_cs_add, ec_cs_remove, ec_cs_list, ec_cs_select, ec_cs_selected, ec_cs_index_select, ec_cs_load, ec_cs_save, ec_cs_save_as, ec_cs_edit, ec_cs_is_valid, ec_cs_connect, ec_cs_connected, ec_cs_disconnect, ec_cs_set_param, ec_cs_set_audio_format, ec_cs_status, ec_cs_rewind, ec_cs_forward, ec_cs_set_position, ec_cs_set_position_samples, ec_cs_get_position, ec_cs_get_position_samples, ec_cs_get_length, ec_cs_get_length_samples, ec_cs_set_length, ec_cs_set_length_samples, ec_cs_toggle_loop, ec_cs_option, // -- ec_c_add, ec_c_remove, ec_c_list, ec_c_select, ec_c_selected, ec_c_select_all, ec_c_select_add, ec_c_index_select, ec_c_deselect, ec_c_clear, ec_c_rename, ec_c_muting, ec_c_bypass, ec_c_status, ec_c_is_bypassed, ec_c_is_muted, // -- ec_aio_register, ec_aio_status, // -- ec_ai_add, ec_ai_describe, ec_ai_remove, ec_ai_list, ec_ai_select, ec_ai_selected, ec_ai_index_select, ec_ai_attach, ec_ai_status, ec_ai_forward, ec_ai_rewind, ec_ai_set_position, ec_ai_set_position_samples, ec_ai_get_position, ec_ai_get_position_samples, ec_ai_get_length, ec_ai_get_length_samples, ec_ai_get_format, ec_ai_wave_edit, // -- ec_ao_add, ec_ao_add_default, ec_ao_describe, ec_ao_remove, ec_ao_list, ec_ao_select, ec_ao_selected, ec_ao_index_select, ec_ao_attach, ec_ao_status, ec_ao_forward, ec_ao_rewind, ec_ao_set_position, ec_ao_set_position_samples, ec_ao_get_position, ec_ao_get_position_samples, ec_ao_get_length, ec_ao_get_length_samples, ec_ao_get_format, ec_ao_wave_edit, // -- ec_cop_add, ec_cop_bypass, ec_cop_describe, ec_cop_is_bypassed, ec_cop_remove, ec_cop_list, ec_cop_select, ec_cop_selected, ec_cop_set, ec_cop_get, ec_cop_status, ec_cop_register, ec_copp_list, ec_copp_select, ec_copp_selected, ec_copp_set, ec_copp_get, // -- ec_ladspa_register, ec_preset_register, ec_lv2_register, // -- ec_ctrl_add, ec_ctrl_describe, ec_ctrl_remove, ec_ctrl_list, ec_ctrl_select, ec_ctrl_selected, ec_ctrl_status, ec_ctrl_register, ec_ctrlp_list, ec_ctrlp_select, ec_ctrlp_selected, ec_ctrlp_set, ec_ctrlp_get, ec_ctrl_get_target, // [spa] added new command // -- ec_int_cmd_list, ec_int_log_history, ec_int_output_mode_wellformed, ec_int_set_float_to_string_precision, ec_int_set_log_history_length, ec_int_version_string, ec_int_version_lib_current, ec_int_version_lib_revision, ec_int_version_lib_age, // -- ec_map_cop_list, ec_map_preset_list, ec_map_ladspa_list, ec_map_ladspa_id_list, ec_map_lv2_list, ec_map_ctrl_list, // -- ec_dump_target, ec_dump_status, ec_dump_position, ec_dump_length, ec_dump_cs_status, ec_dump_c_selected, ec_dump_ai_selected, ec_dump_ai_position, ec_dump_ai_length, ec_dump_ai_open_state, ec_dump_ao_selected, ec_dump_ao_position, ec_dump_ao_length, ec_dump_ao_open_state, ec_dump_cop_value, // -- ec_jack_connect, ec_jack_disconnect, ec_jack_list_connections, // -- ec_invalid }; }; #endif ecasound-2.9.3/libecasound/eca-chainsetup.cpp0000644000076400007640000021702413502010362016142 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup.cpp: Class representing an ecasound chainsetup object. // Copyright (C) 1999-2006,2008,2009,2011-2013,2019 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* find() */ #include #include #include #include #include /* POSIX: getpid() */ #include /* POSIX: getpid() */ #ifdef HAVE_SYS_MMAN_H #include /* POSIX: for mlockall() */ #endif #ifdef ECA_COMPILE_JACK #include #endif #include #include #include #include #include #include "eca-resources.h" #include "eca-session.h" #include "generic-controller.h" #include "eca-chainop.h" #include "eca-chain.h" #include "audioio.h" #include "audioio-manager.h" #include "audioio-device.h" #include "audioio-buffered.h" #include "audioio-loop.h" #include "audioio-null.h" #include "audioio-resample.h" #include "eca-engine-driver.h" #include "eca-object-factory.h" #include "eca-object-map.h" #include "midiio.h" #include "midi-client.h" #include "eca-object-factory.h" #include "eca-chainsetup-position.h" #include "sample-specs.h" #include "eca-error.h" #include "eca-logger.h" #include "eca-chainsetup.h" #include "eca-chainsetup_impl.h" using std::cerr; using std::endl; using namespace ECA; const string ECA_CHAINSETUP::default_audio_format_const = "s16_le,2,44100,i"; const string ECA_CHAINSETUP::default_bmode_nonrt_const = "1024,false,50,false,100000,true"; const string ECA_CHAINSETUP::default_bmode_rt_const = "1024,true,50,true,100000,true"; const string ECA_CHAINSETUP::default_bmode_rtlowlatency_const = "256,true,50,true,100000,false"; static void priv_erase_object(std::vector* vec, const AUDIO_IO* obj); /** * Construct from a vector of options. * * If any invalid options are passed us argument, * interpret_result() will be 'false', and * interpret_result_verbose() contains more detailed * error description. */ ECA_CHAINSETUP::ECA_CHAINSETUP(const vector& opts) : cparser_rep(this), is_enabled_rep(false) { impl_repp = new ECA_CHAINSETUP_impl; // FIXME: set default audio format here! setup_name_rep = "untitled-chainsetup"; setup_filename_rep = ""; set_defaults(); vector options (opts); cparser_rep.preprocess_options(options); interpret_options(options); if (interpret_result() == true) { /* do not add default if there were parsing errors as * it might hide real problems */ add_default_output(); add_default_midi_device(); } ECA_LOG_MSG(ECA_LOGGER::info, "Chainsetup \"" + setup_name_rep + "\""); } /** * Constructs an empty chainsetup. * * @post buffersize != 0 */ ECA_CHAINSETUP::ECA_CHAINSETUP(void) : cparser_rep(this), is_enabled_rep(false) { impl_repp = new ECA_CHAINSETUP_impl; setup_name_rep = ""; set_defaults(); ECA_LOG_MSG(ECA_LOGGER::info, "Chainsetup created (empty)"); } /** * Construct from a chainsetup file. * * If any invalid options are passed us argument, * interpret_result() will be 'false', and * interpret_result_verbose() contains more detailed * error description. * * @post buffersize != 0 */ ECA_CHAINSETUP::ECA_CHAINSETUP(const string& setup_file) : cparser_rep(this), is_enabled_rep(false) { impl_repp = new ECA_CHAINSETUP_impl; setup_name_rep = ""; set_defaults(); vector options; load_from_file(setup_file, options); set_filename(setup_file); if (name() == "") set_name(setup_file); cparser_rep.preprocess_options(options); interpret_options(options); if (interpret_result() == true) { /* do not add default if there were parsing errors as * it might hide real problems */ add_default_output(); } ECA_LOG_MSG(ECA_LOGGER::info, "Chainsetup \"" + name() + "\" created (file: " + setup_file + ")"); } /** * Destructor */ ECA_CHAINSETUP::~ECA_CHAINSETUP(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects,"ECA_CHAINSETUP destructor-in"); DBC_CHECK(is_locked() != true); if (is_enabled() == true) { disable(); } DBC_CHECK(is_enabled() != true); /* delete chain objects */ for(vector::iterator q = chains.begin(); q != chains.end(); q++) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting chain \"" + (*q)->name() + "\"."); delete *q; *q = 0; } /* delete input db objects; reset all pointers to null */ for(vector::iterator q = inputs.begin(); q != inputs.end(); q++) { if (dynamic_cast(*q) != 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting audio db-client \"" + (*q)->label() + "\"."); delete *q; } *q = 0; } /* delete all actual audio input objects except loop devices; reset all pointers to null */ for(vector::iterator q = inputs_direct_rep.begin(); q != inputs_direct_rep.end(); q++) { if (dynamic_cast(*q) == 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting audio object \"" + (*q)->label() + "\"."); delete *q; } *q = 0; } /* delete output db objects; reset all pointers to null */ for(vector::iterator q = outputs.begin(); q != outputs.end(); q++) { if (dynamic_cast(*q) != 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting audio db-client \"" + (*q)->label() + "\"."); delete *q; } *q = 0; } /* delete all actual audio output objects except loop devices; reset all pointers to null */ for(vector::iterator q = outputs_direct_rep.begin(); q != outputs_direct_rep.end(); q++) { // trouble with dynamic_cast with libecasoundc apps like ecalength? if (dynamic_cast(*q) == 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting audio object \"" + (*q)->label() + "\"."); delete *q; *q = 0; } } /* delete loop objects */ for(map::iterator q = loop_map.begin(); q != loop_map.end(); q++) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting loop device \"" + q->second->label() + "\"."); delete q->second; q->second = 0; } /* delete aio manager objects */ for(vector::iterator q = aio_managers_rep.begin(); q != aio_managers_rep.end(); q++) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Deleting audio manager \"" + (*q)->name() + "\"."); delete *q; *q = 0; } delete impl_repp; ECA_LOG_MSG(ECA_LOGGER::system_objects,"ECA_CHAINSETUP destructor-out"); } /** * Sets default values. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::set_defaults(void) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- /* note: defaults are set as specified in ecasoundrc(5) */ precise_sample_rates_rep = false; ignore_xruns_rep = true; pserver_repp = &impl_repp->pserver_rep; midi_server_repp = &impl_repp->midi_server_rep; engine_driver_repp = 0; if (kvu_check_for_sched_fifo() == true) { rtcaps_rep = true; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Rtcaps detected."); } else rtcaps_rep = false; db_clients_rep = 0; multitrack_mode_rep = false; multitrack_mode_override_rep = false; memory_locked_rep = false; midi_server_needed_rep = false; is_locked_rep = false; selected_chain_index_rep = 0; selected_ctrl_index_rep = 0; selected_ctrl_param_index_rep = 0; multitrack_mode_offset_rep = -1; buffering_mode_rep = cs_bmode_auto; active_buffering_mode_rep = cs_bmode_none; set_output_openmode(AUDIO_IO::io_readwrite); ECA_RESOURCES ecaresources; if (ecaresources.has_any() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Unable to read global resources. May result in incorrect behaviour."); } set_default_midi_device(ecaresources.resource("midi-device")); string rc_temp = set_resource_helper(ecaresources, "default-audio-format", ECA_CHAINSETUP::default_audio_format_const); cparser_rep.interpret_object_option("-f:" + rc_temp); set_samples_per_second(default_audio_format().samples_per_second()); toggle_precise_sample_rates(ecaresources.boolean_resource("default-to-precise-sample-rates")); rc_temp = set_resource_helper(ecaresources, "default-mix-mode", "avg"); cparser_rep.interpret_object_option("-z:mixmode," + rc_temp); impl_repp->bmode_nonrt_rep.set_all(set_resource_helper(ecaresources, "bmode-defaults-nonrt", ECA_CHAINSETUP::default_bmode_nonrt_const)); impl_repp->bmode_rt_rep.set_all(set_resource_helper(ecaresources, "bmode-defaults-rt", ECA_CHAINSETUP::default_bmode_rt_const)); impl_repp->bmode_rtlowlatency_rep.set_all(set_resource_helper(ecaresources, "bmode-defaults-rtlowlatency", ECA_CHAINSETUP::default_bmode_rtlowlatency_const)); impl_repp->bmode_active_rep = impl_repp->bmode_nonrt_rep; } /** * Sets a resource value. * * Only used by ECA_CHAINSETUP::set_defaults. */ string ECA_CHAINSETUP::set_resource_helper(const ECA_RESOURCES& ecaresources, const string& tag, const string& alternative) { if (ecaresources.has(tag) == true) { return ecaresources.resource(tag); } else { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Using hardcoded defaults for \"" + tag + "\"."); return alternative; } } /** * Tests whether chainsetup is in a valid state. */ bool ECA_CHAINSETUP::is_valid(void) const { return is_valid_for_connection(false); } /** * Checks whether chainsetup is valid for enabling/connecting. * If chainsetup is not valid and 'verbose' is true, detected * errors are reported via the logging subsystem. */ bool ECA_CHAINSETUP::is_valid_for_connection(bool verbose) const { bool result = true; if (inputs.size() == 0) { if (verbose) ECA_LOG_MSG(ECA_LOGGER::info, "Unable to connect: No inputs in the current chainsetup. (1.1-NO-INPUTS)"); result = false; } else if (outputs.size() == 0) { if (verbose) ECA_LOG_MSG(ECA_LOGGER::info, "Unable to connect: No outputs in the current chainsetup. (1.2-NO-OUTPUTS)"); result = false; } else if (chains.size() == 0) { if (verbose) ECA_LOG_MSG(ECA_LOGGER::info, "Unable to connect: No chains in the current chainsetup. (1.3-NO-CHAINS)"); result = false; } else { list conn_inputs, conn_outputs; for(vector::const_iterator q = chains.begin(); q != chains.end(); q++) { /* log messages printed in CHAIN::is_valid() */ int id = (*q)->connected_input(); if (id > -1) conn_inputs.push_back(id); if ((*q)->is_valid() == false) { result = false; if (verbose) ECA_LOG_MSG(ECA_LOGGER::info, "Unable to connect: Chain \"" + (*q)->name() + "\" is not valid. Following errors were detected:"); if (verbose && id == -1) { ECA_LOG_MSG(ECA_LOGGER::info, "Chain \"" + (*q)->name() + "\" is not connected to any input. " "All chains must have exactly one valid input. (2.1-NO-CHAIN-INPUT)"); } } id = (*q)->connected_output(); if (id > -1) conn_outputs.push_back(id); if (verbose && (*q)->is_valid() == false) { if (id == -1) { ECA_LOG_MSG(ECA_LOGGER::info, "Chain \"" + (*q)->name() + "\" is not connected to any output. " "All chains must have exactly one valid output. (2.2-NO-CHAIN-OUTPUT)"); } } } // FIXME: doesn't work yet if (verbose) { for(int n = 0; n < static_cast(inputs.size()); n++) { if (std::find(conn_inputs.begin(), conn_inputs.end(), n) == conn_inputs.end()) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Input \"" + inputs[n]->label() + "\" is not connected to any chain. (3.1-DISCON-INPUT)"); } } for(int n = 0; n < static_cast(outputs.size()); n++) { if (std::find(conn_outputs.begin(), conn_outputs.end(), n) == conn_outputs.end()) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Output \"" + outputs[n]->label() + "\" is not connected to any chain. (3.2-DISCON-OUTPUT)"); } } } } /* (verbose == true) */ return result; } void ECA_CHAINSETUP::set_buffering_mode(Buffering_mode_t value) { if (value == ECA_CHAINSETUP::cs_bmode_none) buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_auto; else buffering_mode_rep = value; } /** * Sets audio i/o manager option for manager * object type 'mgrname' to be 'optionstr'. * Previously set option string is overwritten. */ void ECA_CHAINSETUP::set_audio_io_manager_option(const string& mgrname, const string& optionstr) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Set manager \"" + mgrname + "\" option string to \"" + optionstr + "\"."); aio_manager_option_map_rep[mgrname] = optionstr; propagate_audio_io_manager_options(); } /** * Determinates the active buffering parameters based on * defaults, user overrides and analyzing the current * chainsetup configuration. If the resulting parameters * are different from current ones, a state change is * performed. */ void ECA_CHAINSETUP::select_active_buffering_mode(void) { if (buffering_mode() == ECA_CHAINSETUP::cs_bmode_none) { active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_auto; } if (!(multitrack_mode_override_rep == true && multitrack_mode_rep != true) && ((multitrack_mode_override_rep == true && multitrack_mode_rep == true) || (number_of_realtime_inputs() > 0 && number_of_realtime_outputs() > 0 && number_of_non_realtime_inputs() > 0 && number_of_non_realtime_outputs() > 0 && chains.size() > 1))) { ECA_LOG_MSG(ECA_LOGGER::info, "Multitrack-mode enabled."); multitrack_mode_rep = true; } else multitrack_mode_rep = false; if (buffering_mode() == ECA_CHAINSETUP::cs_bmode_auto) { /* initialize to 'nonrt', mt-disabled */ active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_nonrt; if (has_realtime_objects() == true) { /* case 1: a multitrack setup */ if (multitrack_mode_rep == true) { active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_rt; ECA_LOG_MSG(ECA_LOGGER::system_objects, "bmode-selection case-1"); } /* case 2: rt-objects without priviledges for rt-scheduling */ else if (rtcaps_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "NOTE: Real-time configuration, but insufficient privileges to utilize real-time scheduling (SCHED_FIFO). With small buffersizes, this may cause audible glitches during processing."); toggle_raised_priority(false); active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_rt; ECA_LOG_MSG(ECA_LOGGER::system_objects, "bmode-selection case-2"); } /* case 3: no chain operators and "one-way rt-operation" */ else if (number_of_chain_operators() == 0 && (number_of_realtime_inputs() == 0 || number_of_realtime_outputs() == 0)) { active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_rt; ECA_LOG_MSG(ECA_LOGGER::system_objects, "bmode-selection case-3"); } /* case 4: default for rt-setups */ else { active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_rtlowlatency; ECA_LOG_MSG(ECA_LOGGER::system_objects, "bmode-selection case-4"); } } else { /* case 5: no rt-objects */ active_buffering_mode_rep = ECA_CHAINSETUP::cs_bmode_nonrt; ECA_LOG_MSG(ECA_LOGGER::system_objects, "bmode-selection case-5"); } } else { /* user has explicitly selected the buffering mode */ active_buffering_mode_rep = buffering_mode(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "bmode-selection explicit"); } switch(active_buffering_mode_rep) { case ECA_CHAINSETUP::cs_bmode_nonrt: { impl_repp->bmode_active_rep = impl_repp->bmode_nonrt_rep; ECA_LOG_MSG(ECA_LOGGER::info, "\"nonrt\" buffering mode selected."); break; } case ECA_CHAINSETUP::cs_bmode_rt: { impl_repp->bmode_active_rep = impl_repp->bmode_rt_rep; ECA_LOG_MSG(ECA_LOGGER::info, "\"rt\" buffering mode selected."); break; } case ECA_CHAINSETUP::cs_bmode_rtlowlatency: { impl_repp->bmode_active_rep = impl_repp->bmode_rtlowlatency_rep; ECA_LOG_MSG(ECA_LOGGER::info, "\"rtlowlatency\" buffering mode selected."); break; } default: { /* error! */ } } ECA_LOG_MSG(ECA_LOGGER::system_objects, "Set buffering parameters to: \n--cut--" + impl_repp->bmode_active_rep.to_string() +"\n--cut--"); } /** * Enable chosen active buffering mode. * * Called only from enable(). */ void ECA_CHAINSETUP::enable_active_buffering_mode(void) { /* 1. if requested, lock all memory */ if (raised_priority() == true) { lock_all_memory(); } else { unlock_all_memory(); } /* 2. if necessary, switch between different db and direct modes */ if (double_buffering() == true) { if (has_realtime_objects() != true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "No realtime objects; switching to direct mode."); switch_to_direct_mode(); impl_repp->bmode_active_rep.toggle_double_buffering(false); } else if (has_nonrealtime_objects() != true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Only realtime objects; switching to direct mode."); switch_to_direct_mode(); impl_repp->bmode_active_rep.toggle_double_buffering(false); } else if (db_clients_rep == 0) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Switching to db mode."); switch_to_db_mode(); } if (buffersize() != 0) { impl_repp->pserver_rep.set_buffer_defaults(double_buffer_size() / buffersize(), buffersize()); } else { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Buffersize set to 0."); impl_repp->pserver_rep.set_buffer_defaults(0, 0); } } else { /* double_buffering() != true */ if (db_clients_rep > 0) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Switching to direct mode."); switch_to_direct_mode(); } } /* 3. propagate buffersize value to all dependent objects */ /* FIXME: create a system for tracking buffesize aware objs */ } void ECA_CHAINSETUP::switch_to_direct_mode(void) { switch_to_direct_mode_helper(&inputs, inputs_direct_rep); switch_to_direct_mode_helper(&outputs, outputs_direct_rep); // -- DBC_ENSURE(db_clients_rep == 0); // -- } void ECA_CHAINSETUP::switch_to_direct_mode_helper(vector* objs, const vector& directobjs) { // -- DBC_CHECK(objs->size() == directobjs.size()); // -- for(size_t n = 0; n < objs->size(); n++) { AUDIO_IO_DB_CLIENT* pobj = dynamic_cast((*objs)[n]); if (pobj != 0) { delete (*objs)[n]; (*objs)[n] = directobjs[n]; --db_clients_rep; } } } void ECA_CHAINSETUP::switch_to_db_mode(void) { switch_to_db_mode_helper(&inputs, inputs_direct_rep); switch_to_db_mode_helper(&outputs, outputs_direct_rep); } void ECA_CHAINSETUP::switch_to_db_mode_helper(vector* objs, const vector& directobjs) { // -- DBC_REQUIRE(db_clients_rep == 0); DBC_CHECK(objs->size() == directobjs.size()); // -- for(size_t n = 0; n < directobjs.size(); n++) { (*objs)[n] = add_audio_object_helper(directobjs[n]); } } /** * Locks all memory with mlockall(). */ void ECA_CHAINSETUP::lock_all_memory(void) { #ifdef HAVE_MLOCKALL if (::mlockall (MCL_CURRENT|MCL_FUTURE)) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Couldn't lock all memory!"); } else { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Memory locked!"); memory_locked_rep = true; } #else ECA_LOG_MSG(ECA_LOGGER::info, "Memory locking not available."); #endif } /** * Unlocks all memory with munlockall(). */ void ECA_CHAINSETUP::unlock_all_memory(void) { #ifdef HAVE_MUNLOCKALL if (memory_locked_rep == true) { if (::munlockall()) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "WARNING: Couldn't unlock all memory!"); } else ECA_LOG_MSG(ECA_LOGGER::system_objects, "Memory unlocked!"); memory_locked_rep = false; } #else memory_locked_rep = false; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Memory unlocking not available."); #endif } /** * Adds a "default" chain to this chainsetup. * * @pre buffersize >= 0 && chains.size() == 0 * @pre is_locked() != true * * @post chains.back()->name() == "default" && * @post active_chainids.back() == "default" */ void ECA_CHAINSETUP::add_default_chain(void) { // -------- DBC_REQUIRE(buffersize() >= 0); DBC_REQUIRE(chains.size() == 0); DBC_REQUIRE(is_locked() != true); // -------- add_chain_helper("default"); selected_chainids.push_back("default"); // -------- DBC_ENSURE(chains.back()->name() == "default"); DBC_ENSURE(selected_chainids.back() == "default"); // -------- } /** * Adds new chains to this chainsetup. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::add_new_chains(const vector& newchains) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- for(vector::const_iterator p = newchains.begin(); p != newchains.end(); p++) { bool exists = false; for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*p == (*q)->name()) exists = true; } if (exists == false) { add_chain_helper(*p); } } } void ECA_CHAINSETUP::add_chain_helper(const string& name) { chains.push_back(new CHAIN()); chains.back()->name(name); chains.back()->set_samples_per_second(samples_per_second()); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Chain \"" + name + "\" created."); } /** * Removes all selected chains from this chainsetup. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::remove_chains(void) { // -------- DBC_REQUIRE(is_enabled() != true); DBC_DECLARE(size_t old_chains_size = chains.size()); DBC_DECLARE(size_t sel_chains_size = selected_chainids.size()); // -------- for(vector::const_iterator a = selected_chainids.begin(); a != selected_chainids.end(); a++) { vector::iterator q = chains.begin(); while(q != chains.end()) { if (*a == (*q)->name()) { delete *q; chains.erase(q); break; } ++q; } } selected_chainids.resize(0); // -- DBC_ENSURE(chains.size() == old_chains_size - sel_chains_size); // -- } /** * Clears all selected chains. Removes all chain operators * and controllers. * * @pre is_locked() != true */ void ECA_CHAINSETUP::clear_chains(void) { // -------- DBC_REQUIRE(is_locked() != true); // -------- for(vector::const_iterator a = selected_chainids.begin(); a != selected_chainids.end(); a++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*a == (*q)->name()) { (*q)->clear(); } } } } /** * Renames the first selected chain. */ void ECA_CHAINSETUP::rename_chain(const string& name) { for(vector::const_iterator a = selected_chainids.begin(); a != selected_chainids.end(); a++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*a == (*q)->name()) { (*q)->name(name); return; } } } } /** * Selects all chains present in this chainsetup. */ void ECA_CHAINSETUP::select_all_chains(void) { vector::const_iterator p = chains.begin(); selected_chainids.resize(0); while(p != chains.end()) { selected_chainids.push_back((*p)->name()); ++p; } } /** * Returns the index number of first selected chains. If no chains * are selected, returns 'last_index + 1' (==chains.size()). */ unsigned int ECA_CHAINSETUP::first_selected_chain(void) const { const vector& schains = selected_chains(); vector::const_iterator o = schains.begin(); unsigned int p = chains.size(); while(o != schains.end()) { for(p = 0; p != chains.size(); p++) { if (chains[p]->name() == *o) return p; } ++o; } return p; } /** * Toggles chain muting of all selected chains. * * @pre is_locked() != true */ void ECA_CHAINSETUP::toggle_chain_muting(void) { // --- DBC_REQUIRE(is_locked() != true); // --- for(vector::const_iterator a = selected_chainids.begin(); a != selected_chainids.end(); a++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*a == (*q)->name()) { (*q)->set_mute(-1); } } } } /** * Toggles chain bypass of all selected chains. * * @pre is_locked() != true */ void ECA_CHAINSETUP::toggle_chain_bypass(void) { // --- DBC_REQUIRE(is_locked() != true); // --- for(vector::const_iterator a = selected_chainids.begin(); a != selected_chainids.end(); a++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*a == (*q)->name()) { (*q)->set_bypass(-1); } } } } const ECA_CHAINSETUP_BUFPARAMS& ECA_CHAINSETUP::active_buffering_parameters(void) const { return impl_repp->bmode_active_rep; } const ECA_CHAINSETUP_BUFPARAMS& ECA_CHAINSETUP::override_buffering_parameters(void) const { return impl_repp->bmode_override_rep; } vector ECA_CHAINSETUP::chain_names(void) const { vector result; vector::const_iterator p = chains.begin(); while(p != chains.end()) { result.push_back((*p)->name()); ++p; } return result; } vector ECA_CHAINSETUP::audio_input_names(void) const { vector result; vector::const_iterator p = inputs.begin(); while(p != inputs.end()) { result.push_back((*p)->label()); ++p; } return result; } vector ECA_CHAINSETUP::audio_output_names(void) const { vector result; vector::const_iterator p = outputs.begin(); while(p != outputs.end()) { result.push_back((*p)->label()); ++p; } return result; } vector ECA_CHAINSETUP::get_attached_chains_to_input(AUDIO_IO* aiod) const { vector res; vector::const_iterator q = chains.begin(); while(q != chains.end()) { if (aiod == inputs[(*q)->connected_input()]) { res.push_back((*q)->name()); } ++q; } return res; } vector ECA_CHAINSETUP::get_attached_chains_to_output(AUDIO_IO* aiod) const { vector res; vector::const_iterator q = chains.begin(); while(q != chains.end()) { if (aiod == outputs[(*q)->connected_output()]) { res.push_back((*q)->name()); } ++q; } return(res); } int ECA_CHAINSETUP::number_of_attached_chains_to_input(AUDIO_IO* aiod) const { int count = 0; vector::const_iterator q = chains.begin(); while(q != chains.end()) { if (aiod == inputs[(*q)->connected_input()]) { ++count; } ++q; } return count; } int ECA_CHAINSETUP::number_of_attached_chains_to_output(AUDIO_IO* aiod) const { int count = 0; vector::const_iterator q = chains.begin(); while(q != chains.end()) { if (aiod == outputs[(*q)->connected_output()]) { ++count; } ++q; } return count; } /** * Output object is realtime target if it is not * connected to any chains with non-realtime inputs. * In other words all data coming to a rt target * output comes from realtime devices. */ bool ECA_CHAINSETUP::is_realtime_target_output(int output_id) const { bool result = true; bool output_found = false; vector::const_iterator q = chains.begin(); while(q != chains.end()) { if ((*q)->connected_output() == output_id) { output_found = true; AUDIO_IO_DEVICE* p = dynamic_cast(inputs[(*q)->connected_input()]); if (p == 0) { result = false; } } ++q; } if (output_found == true && result == true) ECA_LOG_MSG(ECA_LOGGER::system_objects,"slave output detected: " + outputs[output_id]->label()); else result = false; return result; } vector ECA_CHAINSETUP::get_attached_chains_to_iodev(const string& filename) const { vector::size_type p; p = 0; while (p < inputs.size()) { if (inputs[p]->label() == filename) return get_attached_chains_to_input(inputs[p]); ++p; } p = 0; while (p < outputs.size()) { if (outputs[p]->label() == filename) return get_attached_chains_to_output(outputs[p]); ++p; } return vector (0); } /** * Returns number of realtime audio input objects. */ int ECA_CHAINSETUP::number_of_chain_operators(void) const { int cops = 0; vector::const_iterator q = chains.begin(); while(q != chains.end()) { cops += (*q)->number_of_chain_operators(); ++q; } return cops; } /** * Returns true if the connected chainsetup contains at least * one realtime audio input or output. */ bool ECA_CHAINSETUP::has_realtime_objects(void) const { if (number_of_realtime_inputs() > 0 || number_of_realtime_outputs() > 0) return true; return false; } /** * Returns true if the connected chainsetup contains at least * one nonrealtime audio input or output. */ bool ECA_CHAINSETUP::has_nonrealtime_objects(void) const { if (static_cast(inputs_direct_rep.size() + outputs_direct_rep.size()) > number_of_realtime_inputs() + number_of_realtime_outputs()) return true; return false; } /** * Returns a string containing currently active chainsetup * options and settings. Syntax is the same as used for * saved chainsetup files. */ string ECA_CHAINSETUP::options_to_string(void) const { return cparser_rep.general_options_to_string(); } /** * Returns number of realtime audio input objects. */ int ECA_CHAINSETUP::number_of_realtime_inputs(void) const { int res = 0; for(size_t n = 0; n < inputs_direct_rep.size(); n++) { AUDIO_IO_DEVICE* p = dynamic_cast(inputs_direct_rep[n]); if (p != 0) res++; } return res; } /** * Returns number of realtime audio output objects. */ int ECA_CHAINSETUP::number_of_realtime_outputs(void) const { int res = 0; for(size_t n = 0; n < outputs_direct_rep.size(); n++) { AUDIO_IO_DEVICE* p = dynamic_cast(outputs_direct_rep[n]); if (p != 0) res++; } return res; } /** * Returns number of non-realtime audio input objects. */ int ECA_CHAINSETUP::number_of_non_realtime_inputs(void) const { return inputs.size() - number_of_realtime_inputs(); } /** * Returns number of non-realtime audio input objects. */ int ECA_CHAINSETUP::number_of_non_realtime_outputs(void) const { return outputs.size() - number_of_realtime_outputs(); } /** * Returns a pointer to the manager handling audio object 'aobj'. * * @return 0 if 'aobj' is not handled by any manager */ AUDIO_IO_MANAGER* ECA_CHAINSETUP::get_audio_object_manager(AUDIO_IO* aio) const { for(vector::const_iterator q = aio_managers_rep.begin(); q != aio_managers_rep.end(); q++) { if ((*q)->is_managed_type(aio) && (*q)->get_object_id(aio) != -1) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Found object manager \"" + (*q)->name() + "\" for aio \"" + aio->label() + "\"."); return *q; } } return 0; } /** * Returns a pointer to the manager handling audio * objects of type 'aobj'. * * @return 0 if 'aobj' type is not handled by any manager */ AUDIO_IO_MANAGER* ECA_CHAINSETUP::get_audio_object_type_manager(AUDIO_IO* aio) const { for(vector::const_iterator q = aio_managers_rep.begin(); q != aio_managers_rep.end(); q++) { if ((*q)->is_managed_type(aio) == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Found object manager \"" + (*q)->name() + "\" for aio type \"" + aio->name() + "\"."); return *q; } } return 0; } /** * If 'amgr' implements the ECA_ENGINE_DRIVER interface, * it is registered as the active driver. */ void ECA_CHAINSETUP::register_engine_driver(AUDIO_IO_MANAGER* amgr) { ECA_ENGINE_DRIVER* driver = dynamic_cast(amgr); if (driver != 0) { engine_driver_repp = driver; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Registered audio i/o manager \"" + amgr->name() + "\" as the current engine driver."); } } /** * Registers audio object to a manager. If no managers are * available for object's type, and it can create one, * a new manager is created. */ void ECA_CHAINSETUP::register_audio_object_to_manager(AUDIO_IO* aio) { AUDIO_IO_MANAGER* mgr = get_audio_object_type_manager(aio); if (mgr == 0) { mgr = aio->create_object_manager(); if (mgr != 0) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Creating object manager \"" + mgr->name() + "\" for aio \"" + aio->name() + "\"."); aio_managers_rep.push_back(mgr); propagate_audio_io_manager_options(); mgr->register_object(aio); /* in case manager is also a driver */ register_engine_driver(mgr); } } else { mgr->register_object(aio); } } /** * Unregisters audio object from manager. */ void ECA_CHAINSETUP::unregister_audio_object_from_manager(AUDIO_IO* aio) { AUDIO_IO_MANAGER* mgr = get_audio_object_manager(aio); if (mgr != 0) { int id = mgr->get_object_id(aio); if (id != -1) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Unregistering object \"" + aio->name() + "\" from manager \"" + mgr->name() + "\"."); mgr->unregister_object(id); } } } /** * Propagates to set manager options to all existing * audio i/o manager objects. */ void ECA_CHAINSETUP::propagate_audio_io_manager_options(void) { for(vector::const_iterator q = aio_managers_rep.begin(); q != aio_managers_rep.end(); q++) { if (aio_manager_option_map_rep.find((*q)->name()) != aio_manager_option_map_rep.end()) { const string& optstring = aio_manager_option_map_rep[(*q)->name()]; int numparams = (*q)->number_of_params(); for(int n = 0; n < numparams; n++) { (*q)->set_parameter(n + 1, kvu_get_argument_number(n + 1, optstring)); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Manager \"" + (*q)->name() + "\", " + kvu_numtostr(n + 1) + ". parameter set to \"" + (*q)->get_parameter(n + 1) + "\"."); } } } } /** * Helper function used by add_input() and add_output(). * * All audio object creates go through this function, * so this is good place to do global operations that * apply to both inputs and outputs. */ AUDIO_IO* ECA_CHAINSETUP::add_audio_object_helper(AUDIO_IO* aio) { AUDIO_IO* retobj = aio; AUDIO_IO_DEVICE* p = dynamic_cast(aio); LOOP_DEVICE* q = dynamic_cast(aio); if (p == 0 && q == 0) { /* not a realtime or loop device */ retobj = new AUDIO_IO_DB_CLIENT(&impl_repp->pserver_rep, aio, false); ++db_clients_rep; } return retobj; } /** * Helper function used by remove_audio_object(). */ void ECA_CHAINSETUP::remove_audio_object_proxy(AUDIO_IO* aio) { AUDIO_IO_DB_CLIENT* p = dynamic_cast(aio); if (p != 0) { /* a proxied object */ ECA_LOG_MSG(ECA_LOGGER::user_objects, "Delete proxy object " + aio->label() + "."); delete aio; --db_clients_rep; } } /** * Helper function used bu remove_audio_object() to remove input * and output loop devices. */ void ECA_CHAINSETUP::remove_audio_object_loop(const AUDIO_IO* aobj, AUDIO_IO* loop_aio, int dir) { int rdir = (dir == cs_dir_input ? cs_dir_output : cs_dir_input); /* loop devices are registered simultaneously to both input * and output object vectors, so they have to be removed * from both, but deleted only once */ remove_audio_object_impl(aobj, rdir, false); /* we also need to remove the loop device from * the loop_map table */ map::iterator iter = loop_map.begin(); while(iter != loop_map.end()) { if (iter->second == loop_aio) { loop_map.erase(iter); break; } ++iter; } } /** * Adds a new input object and attaches it to selected chains. * * If double-buffering is enabled (double_buffering() == true), * and the object in question is not a realtime object, it * is wrapped in a AUDIO_IO_DB_CLIENT object before * inserted to the chainsetup. Otherwise object is added * as is. * * Ownership of the insert object is transfered to * ECA_CHAINSETUP. * * @pre aiod != 0 * @pre is_enabled() != true * @post inputs.size() == old(inputs.size() + 1 */ void ECA_CHAINSETUP::add_input(AUDIO_IO* aio) { // -------- DBC_REQUIRE(aio != 0); DBC_REQUIRE(is_enabled() != true); DBC_DECLARE(size_t old_inputs_size = inputs.size()); // -------- aio->set_io_mode(AUDIO_IO::io_read); aio->set_audio_format(default_audio_format()); aio->set_buffersize(buffersize()); register_audio_object_to_manager(aio); AUDIO_IO* layerobj = add_audio_object_helper(aio); inputs.push_back(layerobj); inputs_direct_rep.push_back(aio); input_start_pos.push_back(0); attach_input_to_selected_chains(layerobj); // -------- DBC_ENSURE(inputs.size() == old_inputs_size + 1); DBC_ENSURE(inputs.size() == inputs_direct_rep.size()); // -------- } /** * Add a new output object and attach it to selected chains. * * If double-buffering is enabled (double_buffering() == true), * and the object in question is not a realtime object, it * is wrapped in a AUDIO_IO_DB_CLIENT object before * inserted to the chainsetup. Otherwise object is added * as is. * * Ownership of the insert object is transfered to * ECA_CHAINSETUP. * * @pre aiod != 0 * @pre is_enabled() != true * @post outputs.size() == outputs_direct_rep.size() */ void ECA_CHAINSETUP::add_output(AUDIO_IO* aio, bool truncate) { // -------- DBC_REQUIRE(aio != 0); DBC_REQUIRE(is_enabled() != true); DBC_DECLARE(size_t old_outputs_size = outputs.size()); // -------- aio->set_audio_format(default_audio_format()); aio->set_buffersize(buffersize()); if (truncate == true) aio->set_io_mode(AUDIO_IO::io_write); else aio->set_io_mode(AUDIO_IO::io_readwrite); register_audio_object_to_manager(aio); AUDIO_IO* layerobj = add_audio_object_helper(aio); outputs.push_back(layerobj); outputs_direct_rep.push_back(aio); output_start_pos.push_back(0); attach_output_to_selected_chains(layerobj); // --- DBC_ENSURE(outputs.size() == old_outputs_size + 1); DBC_ENSURE(outputs.size() == outputs_direct_rep.size()); // --- } /** * Erases an element matching 'obj' from 'vec'. At most one element * is removed. The function does not delete the referred object, just * removes it from the vector. */ static void priv_erase_object(std::vector* vec, const AUDIO_IO* obj) { vector::iterator p = vec->begin(); while(p != vec->end()) { if (*p == obj) { vec->erase(p); break; } ++p; } } /** * Removes the labeled audio object from this chainsetup. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::remove_audio_object_impl(const AUDIO_IO* aobj, int dir, bool destroy) { // --- DBC_REQUIRE(is_enabled() != true); // --- vector *objs = (dir == cs_dir_input ? &inputs : &outputs); vector *objs_dir = (dir == cs_dir_input ? &inputs_direct_rep : &outputs_direct_rep); DBC_DECLARE(size_t oldsize = objs->size()); AUDIO_IO *obj_to_remove = 0, *obj_dir_to_remove = NULL; int remove_index = -1; /* Notes * - objs and objs_dir vectors are always of the same size * - for non-proxied objects 'objs[n] == objs_dir[n]' for all n */ for(size_t n = 0; n < objs->size(); n++) { if ((*objs)[n] == aobj) { obj_to_remove = (*objs)[n]; obj_dir_to_remove = (*objs_dir)[n]; remove_index = static_cast(n); } } if (obj_to_remove) { DBC_CHECK(remove_index >= 0); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Removing object " + obj_to_remove->label() + "."); /* disconnect object from chains and update * references to modified input/output tables */ vector::iterator q = chains.begin(); while(q != chains.end()) { if (dir == cs_dir_input) { (*q)->input_removed(remove_index); } else { (*q)->output_removed(remove_index); } ++q; } /* unregister from manager (always the objs_dir object) */ unregister_audio_object_from_manager((*objs_dir)[remove_index]); /* delete proxy object if any */ if (obj_to_remove != obj_dir_to_remove) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Audio object proxied: " + obj_to_remove->label()); remove_audio_object_proxy(obj_to_remove); } priv_erase_object(objs, obj_to_remove); priv_erase_object(objs_dir, obj_dir_to_remove); LOOP_DEVICE* loop_dev = dynamic_cast(obj_dir_to_remove); if (loop_dev != 0 && destroy == true) { /* note: destroy must be true to limit recursion */ remove_audio_object_loop(aobj, obj_dir_to_remove, dir); } /* finally actually delete the object */ if (destroy == true) delete obj_dir_to_remove; } // --- DBC_ENSURE(objs->size() == objs_dir->size()); DBC_ENSURE(oldsize == objs->size() + 1); // --- } /** * Removes the labeled audio input from this chainsetup. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::remove_audio_input(const AUDIO_IO* aobj) { // --- DBC_REQUIRE(is_enabled() != true); DBC_DECLARE(size_t oldsize = inputs.size()); // --- remove_audio_object_impl(aobj, cs_dir_input, true); // --- DBC_ENSURE(inputs.size() == inputs_direct_rep.size()); DBC_ENSURE(oldsize == inputs.size() + 1); // --- } /** * Removes the labeled audio output from this chainsetup. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::remove_audio_output(const AUDIO_IO* aobj) { // -------- DBC_REQUIRE(is_enabled() != true); DBC_DECLARE(size_t oldsize = outputs.size()); // -------- remove_audio_object_impl(aobj, cs_dir_output, true); // --- DBC_ENSURE(outputs.size() == outputs_direct_rep.size()); DBC_ENSURE(oldsize == outputs.size() + 1); // --- } /** * Print trace messages when opening audio file 'aio'. * * @pre aio != 0 */ void ECA_CHAINSETUP::audio_object_open_info(const AUDIO_IO* aio) { // -------- DBC_REQUIRE(aio != 0); // -------- string temp = "Opened "; temp += (aio->io_mode() == AUDIO_IO::io_read) ? "input" : "output"; temp += " \"" + aio->label(); temp += "\", mode \""; if (aio->io_mode() == AUDIO_IO::io_read) temp += "read"; if (aio->io_mode() == AUDIO_IO::io_write) temp += "write"; if (aio->io_mode() == AUDIO_IO::io_readwrite) temp += "read/write (update)"; temp += "\". "; temp += aio->format_info(); ECA_LOG_MSG(ECA_LOGGER::info, temp); } /** * Adds a new MIDI-device object. * * @pre mididev != 0 * @pre is_enabled() != true * @post midi_devices.size() > 0 */ void ECA_CHAINSETUP::add_midi_device(MIDI_IO* mididev) { // -------- DBC_REQUIRE(mididev != 0); DBC_REQUIRE(is_enabled() != true); // -------- midi_devices.push_back(mididev); impl_repp->midi_server_rep.register_client(mididev); // -------- DBC_ENSURE(midi_devices.size() > 0); // -------- } /** * Remove an MIDI-device by the name 'mdev_name'. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::remove_midi_device(const string& mdev_name) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- for(vector::iterator q = midi_devices.begin(); q != midi_devices.end(); q++) { if (mdev_name == (*q)->label()) { delete *q; midi_devices.erase(q); break; } } } const CHAIN* ECA_CHAINSETUP::get_chain_with_name(const string& name) const { vector::const_iterator p = chains.begin(); while(p != chains.end()) { if ((*p)->name() == name) return(*p); ++p; } return 0; } /** * Returns a non-zero index for chain 'name'. If the chain * does not exist, -1 is returned. * * The chain index can be used with ECA::chainsetup_edit_t * items passed to ECA_CHAINSETUP::execute_edit(). * * Note: Mapping of chain names to indices can change if any * chains are either added or removed. If that happens, * the indices need to be recalculated. */ int ECA_CHAINSETUP::get_chain_index(const string& name) const { int retval = -1; vector::const_iterator p = chains.begin(); for(int n = 1; p != chains.end(); n++) { if ((*p)->name() == name) { retval = n; break; } ++p; } return retval; } /** * Attaches input 'obj' to all selected chains. * * @pre is_locked() != true */ void ECA_CHAINSETUP::attach_input_to_selected_chains(const AUDIO_IO* obj) { // -------- DBC_REQUIRE(obj != 0); DBC_REQUIRE(is_locked() != true); // -------- string temp; vector::size_type c = 0; while (c < inputs.size()) { if (inputs[c] == obj) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if ((*q)->connected_input() == static_cast(c)) { (*q)->disconnect_input(); } } temp += "Assigning file to chains:"; for(vector::const_iterator p = selected_chainids.begin(); p!= selected_chainids.end(); p++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*p == (*q)->name()) { (*q)->connect_input(c); temp += " " + *p; } } } } ++c; } ECA_LOG_MSG(ECA_LOGGER::system_objects, temp); } /** * Attaches output 'obj' to all selected chains. * * @pre is_locked() != true */ void ECA_CHAINSETUP::attach_output_to_selected_chains(const AUDIO_IO* obj) { // -------- DBC_REQUIRE(obj != 0); DBC_REQUIRE(is_locked() != true); // -------- string temp; vector::size_type c = 0; while (c < outputs.size()) { if (outputs[c] == obj) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if ((*q)->connected_output() == static_cast(c)) { (*q)->disconnect_output(); } } temp += "Assigning file to chains:"; for(vector::const_iterator p = selected_chainids.begin(); p!= selected_chainids.end(); p++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*p == (*q)->name()) { (*q)->connect_output(static_cast(c)); temp += " " + *p; } } } } ++c; } ECA_LOG_MSG(ECA_LOGGER::system_objects, temp); } /** * Returns true if 'aobj' is a pointer to some input * or output object. */ bool ECA_CHAINSETUP::ok_audio_object(const AUDIO_IO* aobj) const { if (ok_audio_object_helper(aobj, inputs) == true || ok_audio_object_helper(aobj, outputs) == true ) return(true); return false; } bool ECA_CHAINSETUP::ok_audio_object_helper(const AUDIO_IO* aobj, const vector& aobjs) { for(size_t n = 0; n < aobjs.size(); n++) { if (aobjs[n] == aobj) return(true); } return false; } void ECA_CHAINSETUP::check_object_samplerate(const AUDIO_IO* obj, SAMPLE_SPECS::sample_rate_t srate) throw(ECA_ERROR&) { if (obj->samples_per_second() != srate) { throw(ECA_ERROR("ECA-CHAINSETUP", string("All audio objects must have a common") + " sampling rate; sampling rate of audio object \"" + obj->label() + "\" differs from engine rate (" + kvu_numtostr(obj->samples_per_second()) + " <-> " + kvu_numtostr(srate) + "); unable to continue.")); } } void ECA_CHAINSETUP::enable_audio_object_helper(AUDIO_IO* aobj) const { aobj->set_buffersize(buffersize()); AUDIO_IO_DEVICE* dev = dynamic_cast(aobj); if (dev != 0) { dev->toggle_max_buffers(max_buffers()); dev->toggle_ignore_xruns(ignore_xruns()); } if (aobj->is_open() == false) { const std::string req_format = ECA_OBJECT_FACTORY::audio_object_format_to_eos(aobj); aobj->open(); const std::string act_format = ECA_OBJECT_FACTORY::audio_object_format_to_eos(aobj); if (act_format != req_format) { ECA_LOG_MSG(ECA_LOGGER::info, "NOTE: audio parameters modified at open to " + act_format + " for object '" + aobj->label() + "' (requested " + req_format + ")."); } } if (aobj->is_open() == true) { aobj->seek_position_in_samples(aobj->position_in_samples()); audio_object_open_info(aobj); } } /** * Enable chainsetup. Opens all devices and reinitializes all * chain operators if necessary. * * This action is performed before connecting the chainsetup * to a engine object (for instance ECA_ENGINE). * * @pre is_locked() != true * @post is_enabled() == true */ void ECA_CHAINSETUP::enable(void) throw(ECA_ERROR&) { // -------- DBC_REQUIRE(is_locked() != true); // -------- try { if (is_enabled_rep != true) { /* 1. check that current buffersize is supported by all devices */ long int locked_bsize = check_for_locked_buffersize(); if (locked_bsize != -1) { set_buffersize(locked_bsize); } /* 2. select and enable buffering parameters */ select_active_buffering_mode(); enable_active_buffering_mode(); /* 3.1 open input devices */ for(vector::iterator q = inputs.begin(); q != inputs.end(); q++) { enable_audio_object_helper(*q); if ((*q)->is_open() != true) { throw(ECA_ERROR("ECA-CHAINSETUP", "Open failed without explicit exception!")); } } /* 3.2. make sure that all input devices have a common * sampling rate */ SAMPLE_SPECS::sample_rate_t first_locked_srate = 0; for(vector::iterator q = inputs.begin(); q != inputs.end(); q++) { if (first_locked_srate == 0) { if ((*q)->locked_audio_format() == true) { first_locked_srate = (*q)->samples_per_second(); /* set chainsetup sampling rate to 'first_srate'. */ set_samples_per_second(first_locked_srate); } } else { check_object_samplerate(*q, first_locked_srate); } } /* 4. open output devices */ for(vector::iterator q = outputs.begin(); q != outputs.end(); q++) { enable_audio_object_helper(*q); if ((*q)->is_open() != true) { throw(ECA_ERROR("ECA-CHAINSETUP", "Open failed without explicit exception!")); } if (first_locked_srate == 0) { if ((*q)->locked_audio_format() == true) { first_locked_srate = (*q)->samples_per_second(); /* set chainsetup sampling rate to 'first_srate'. */ set_samples_per_second(first_locked_srate); } } else { check_object_samplerate(*q, first_locked_srate); } } /* 5. in case there were no objects with locked srates */ if (first_locked_srate == 0) { if (inputs.size() > 0) { /* set chainsetup srate to that of the first input */ set_samples_per_second(inputs[0]->samples_per_second()); } } /* 6. enable the MIDI server */ if (impl_repp->midi_server_rep.is_enabled() != true && midi_devices.size() > 0) { impl_repp->midi_server_rep.set_schedrealtime(raised_priority()); impl_repp->midi_server_rep.set_schedpriority(get_sched_priority()); impl_repp->midi_server_rep.enable(); } /* 7. enable all MIDI-devices */ for(vector::iterator q = midi_devices.begin(); q != midi_devices.end(); q++) { (*q)->toggle_nonblocking_mode(true); if ((*q)->is_open() != true) { (*q)->open(); if ((*q)->is_open() != true) { throw(ECA_ERROR("ECA-CHAINSETUP", string("Unable to open MIDI-device: ") + (*q)->label() + ".")); } } } /* 8. calculate chainsetup length */ calculate_processing_length(); } is_enabled_rep = true; } catch(AUDIO_IO::SETUP_ERROR& e) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Connecting chainsetup failed, throwing an SETUP_ERROR exception."); throw(ECA_ERROR("ECA-CHAINSETUP", string("Enabling chainsetup: ") + e.message())); } catch(...) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Connecting chainsetup failed, throwing a generic exception."); throw; } // -------- DBC_ENSURE(is_enabled() == true); // -------- } /** * Disable chainsetup. Closes all devices. * * This action is performed before disconnecting the * chainsetup from a engine object (for instance * ECA_ENGINE). * * @pre is_locked() != true * @post is_enabled() != true */ void ECA_CHAINSETUP::disable(void) { // -------- DBC_REQUIRE(is_locked() != true); // -------- /* calculate chainsetup length in case it has changed during processing */ calculate_processing_length(); if (is_enabled_rep == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Closing chainsetup \"" + name() + "\""); for(vector::iterator q = inputs.begin(); q != inputs.end(); q++) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Closing audio device/file \"" + (*q)->label() + "\"."); if ((*q)->is_open() == true) (*q)->close(); } for(vector::iterator q = outputs.begin(); q != outputs.end(); q++) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Closing audio device/file \"" + (*q)->label() + "\"."); if ((*q)->is_open() == true) (*q)->close(); } if (impl_repp->midi_server_rep.is_enabled() == true) impl_repp->midi_server_rep.disable(); for(vector::iterator q = midi_devices.begin(); q != midi_devices.end(); q++) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Closing midi device \"" + (*q)->label() + "\"."); if ((*q)->is_open() == true) (*q)->close(); } is_enabled_rep = false; } // -------- DBC_ENSURE(is_enabled() != true); // -------- } /** * Executes chainsetup edit 'edit'. * * @return true if succesful, false if edit cannot * be performed */ bool ECA_CHAINSETUP::execute_edit(const chainsetup_edit_t& edit) { bool retval = true; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Executing edit type of " + kvu_numtostr(static_cast(edit.type))); if (edit.cs_ptr != this) { ECA_LOG_MSG(ECA_LOGGER::errors, "ERROR: chainsetup edit executed on wrong object"); return false; } switch(edit.type) { case edit_c_bypass: { if (edit.m.c_bypass.chain < 1 || edit.m.c_bypass.chain > static_cast(chains.size())) { retval = false; break; } CHAIN *ch = chains[edit.m.c_bypass.chain - 1]; ch->set_bypass(edit.m.c_bypass.val); break; } case edit_c_muting: { if (edit.m.c_muting.chain < 1 || edit.m.c_muting.chain > static_cast(chains.size())) { retval = false; break; } CHAIN *ch = chains[edit.m.c_muting.chain - 1]; ch->set_mute(edit.m.c_muting.val); break; } #if NOT_YET_IMPLEMENTED case edit_cop_remove: case edit_ctrl_remove: // pass through on purpose #endif case edit_cop_add: case edit_ctrl_add: { if ((edit.m.c_generic_param.chain < 1) || (edit.m.c_generic_param.chain > static_cast(chains.size()))) { retval = false; break; } bool locked = is_locked_rep; is_locked_rep = false; const string& params = edit.param; if (params.size() > 0 && params[0] == '-') cparser_rep.interpret_object_option(params); else cparser_rep.interpret_object_option(string("-") + edit.param); if (interpret_result() != true) { ECA_LOG_MSG(ECA_LOGGER::errors, "cop-add error " + interpret_result_verbose()); retval = false; } is_locked_rep = locked; break; } case edit_cop_set_param: { if (edit.m.cop_set_param.chain < 1 || edit.m.cop_set_param.chain > static_cast(chains.size())) { retval = false; break; } CHAIN *ch = chains[edit.m.cop_set_param.chain - 1]; ch->set_parameter(edit.m.cop_set_param.op, edit.m.cop_set_param.param, edit.m.cop_set_param.value); break; } case edit_cop_bypass: { if (edit.m.cop_bypass.chain < 1 || edit.m.cop_bypass.chain > static_cast(chains.size())) { retval = false; break; } CHAIN *ch = chains[edit.m.cop_bypass.chain - 1]; ch->bypass_operator(edit.m.cop_bypass.op, edit.m.cop_bypass.bypass); break; } case edit_ctrl_set_param: { if (edit.m.ctrl_set_param.chain < 1 || edit.m.ctrl_set_param.chain > static_cast(chains.size())) { retval = false; break; } CHAIN *ch = chains[edit.m.ctrl_set_param.chain - 1]; ch->set_controller_parameter(edit.m.ctrl_set_param.op, edit.m.ctrl_set_param.param, edit.m.ctrl_set_param.value); break; } default: { DBC_NEVER_REACHED(); retval = false; ECA_LOG_MSG(ECA_LOGGER::info, "Unknown edit of type " + kvu_numtostr(static_cast(edit.type))); break; } } return retval; } /** * Updates the chainsetup processing length based on * 1) requested length, 2) lengths of individual * input objects, and 3) looping settings. */ void ECA_CHAINSETUP::calculate_processing_length(void) { long int max_input_length = 0; for(unsigned int n = 0; n < inputs.size(); n++) { if (inputs[n]->length_in_samples() > max_input_length) max_input_length = inputs[n]->length_in_samples(); } /* note! here we set the _actual_ length of the * chainsetup */ set_length_in_samples(max_input_length); if (looping_enabled() == true) { if (max_length_set() != true && max_input_length > 0) { /* looping but length not set */ ECA_LOG_MSG(ECA_LOGGER::info, "Setting loop point to " + kvu_numtostr(length_in_seconds_exact()) + "."); set_max_length_in_samples(max_input_length); } } } /** * Check whether the buffersize is locked to some * specific value. * * @return -1 if not locked, otherwise the locked * value */ long int ECA_CHAINSETUP::check_for_locked_buffersize(void) const { long int result = -1; #ifdef ECA_COMPILE_JACK int pid = getpid(); string cname = "ecasound-ctrl-" + kvu_numtostr(pid); int jackobjs = 0; for(size_t n = 0; n < inputs_direct_rep.size(); n++) { if (inputs_direct_rep[n]->name() == "JACK interface") ++jackobjs; } for(size_t n = 0; n < outputs_direct_rep.size(); n++) { if (outputs_direct_rep[n]->name() == "JACK interface") ++jackobjs; } /* contact jackd only if there is at least one jack audio object * present */ if (jackobjs > 0) { jack_client_t *client = jack_client_open(cname.c_str(), JackNullOption, NULL); if (client != 0) { // xxx = static_cast(jack_get_sample_rate(client); result = static_cast(jack_get_buffer_size(client)); ECA_LOG_MSG(ECA_LOGGER::user_objects, "jackd buffersize check returned " + kvu_numtostr(result) + "."); jack_client_close(client); client = 0; } else { ECA_LOG_MSG(ECA_LOGGER::user_objects, "unable to perform jackd buffersize check."); } DBC_CHECK(client == 0); } #endif return result; } /** * Reimplemented from ECA_CHAINSETUP_POSITION. */ void ECA_CHAINSETUP::set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value) { /* not necessarily a problem */ DBC_CHECK(is_locked() != true); ECA_LOG_MSG(ECA_LOGGER::user_objects, "sample rate change, chainsetup " + name() + " to rate " + kvu_numtostr(new_value) + "."); for(vector::iterator q = inputs.begin(); q != inputs.end(); q++) { (*q)->set_samples_per_second(new_value); } for(vector::iterator q = outputs.begin(); q != outputs.end(); q++) { (*q)->set_samples_per_second(new_value); } for(vector::iterator q = chains.begin(); q != chains.end(); q++) { (*q)->set_samples_per_second(new_value); } ECA_CHAINSETUP_POSITION::set_samples_per_second(new_value); } static void priv_seek_position_helper(std::vector* objs, SAMPLE_SPECS::sample_pos_t pos, const std::string& tag) { for(vector::iterator q = objs->begin(); q != objs->end(); q++) { /* note: don't try to seek real-time devices (only * allowed exception, try seeking all other * objects */ if (dynamic_cast(*q) == 0) { (*q)->seek_position_in_samples(pos); /* note: report if object claims it supports seeking, but * in fact the seek failed */ if ((*q)->supports_seeking() == true) { if (pos <= (*q)->length_in_samples() && (*q)->position_in_samples() != pos) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: sample accurate seek failed with " + tag + " \"" + (*q)->name() + "\""); } } } } /** * Reimplemented from ECA_AUDIO_POSITION. */ SAMPLE_SPECS::sample_pos_t ECA_CHAINSETUP::seek_position(SAMPLE_SPECS::sample_pos_t pos) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "seek position, chainsetup \"" + name() + "\" to pos in samples " + kvu_numtostr(pos) + "."); if (is_enabled() == true) { if (double_buffering() == true) pserver_repp->flush(); } priv_seek_position_helper(&inputs, pos, "input"); priv_seek_position_helper(&outputs, pos, "output"); for(vector::iterator q = chains.begin(); q != chains.end(); q++) { (*q)->seek_position_in_samples(pos); if ((*q)->position_in_samples() != pos) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: sample accurate seek failed with chainop \"" + (*q)->name() + "\""); } return pos; } /** * Interprets one option. This is the most generic variant of * the interpretation routines; both global and object specific * options are handled. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre is_enabled() != true * * @post (option successfully interpreted && interpret_result() == true) || * (unknown or invalid option && interpret_result() != true) */ void ECA_CHAINSETUP::interpret_option (const string& arg) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- cparser_rep.interpret_option(arg); } /** * Interprets one option. All non-global options are ignored. Global * options can be interpreted multiple times and in any order. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre is_enabled() != true * @post (option successfully interpreted && interpretation_result() == true) || * (unknown or invalid option && interpretation_result() == false) */ void ECA_CHAINSETUP::interpret_global_option (const string& arg) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- cparser_rep.interpret_global_option(arg); } /** * Interprets one option. All options not directly related to * ecasound objects are ignored. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre is_enabled() != true * * @post (option successfully interpreted && interpretation_result() == true) || * (unknown or invalid option && interpretation_result() == false) */ void ECA_CHAINSETUP::interpret_object_option (const string& arg) { // -------- // FIXME: this requirement is broken by eca-control.h (for // adding effects on-the-fly, just stopping the engine) // DBC_REQUIRE(is_enabled() != true); // -------- cparser_rep.interpret_object_option(arg); } /** * Interpret a vector of options. * * If any invalid options are passed us argument, * interpret_result() will be 'false', and * interpret_result_verbose() contains more detailed * error description. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::interpret_options(const vector& opts) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- cparser_rep.interpret_options(opts); } void ECA_CHAINSETUP::set_buffersize(long int value) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "overriding buffersize."); impl_repp->bmode_override_rep.set_buffersize(value); } void ECA_CHAINSETUP::toggle_raised_priority(bool value) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "overriding raised priority."); impl_repp->bmode_override_rep.toggle_raised_priority(value); } void ECA_CHAINSETUP::set_sched_priority(int value) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "sched_priority."); impl_repp->bmode_override_rep.set_sched_priority(value); } void ECA_CHAINSETUP::toggle_double_buffering(bool value) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "overriding doublebuffering."); impl_repp->bmode_override_rep.toggle_double_buffering(value); } void ECA_CHAINSETUP::set_double_buffer_size(long int v) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "overriding db-size."); impl_repp->bmode_override_rep.set_double_buffer_size(v); } void ECA_CHAINSETUP::toggle_max_buffers(bool v) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "overriding max_buffers."); impl_repp->bmode_override_rep.toggle_max_buffers(v); } long int ECA_CHAINSETUP::buffersize(void) const { if (impl_repp->bmode_override_rep.is_set_buffersize() == true) return impl_repp->bmode_override_rep.buffersize(); return impl_repp->bmode_active_rep.buffersize(); } bool ECA_CHAINSETUP::raised_priority(void) const { if (impl_repp->bmode_override_rep.is_set_raised_priority() == true) return impl_repp->bmode_override_rep.raised_priority(); return impl_repp->bmode_active_rep.raised_priority(); } int ECA_CHAINSETUP::get_sched_priority(void) const { if (impl_repp->bmode_override_rep.is_set_sched_priority() == true) return impl_repp->bmode_override_rep.get_sched_priority(); return impl_repp->bmode_active_rep.get_sched_priority(); } bool ECA_CHAINSETUP::double_buffering(void) const { if (impl_repp->bmode_override_rep.is_set_double_buffering() == true) return impl_repp->bmode_override_rep.double_buffering(); return impl_repp->bmode_active_rep.double_buffering(); } long int ECA_CHAINSETUP::double_buffer_size(void) const { if (impl_repp->bmode_override_rep.is_set_double_buffer_size() == true) return impl_repp->bmode_override_rep.double_buffer_size(); return impl_repp->bmode_active_rep.double_buffer_size(); } bool ECA_CHAINSETUP::max_buffers(void) const { if (impl_repp->bmode_override_rep.is_set_max_buffers() == true) return impl_repp->bmode_override_rep.max_buffers(); return impl_repp->bmode_active_rep.max_buffers(); } void ECA_CHAINSETUP::set_default_audio_format(ECA_AUDIO_FORMAT& value) { impl_repp->default_audio_format_rep = value; } const ECA_AUDIO_FORMAT& ECA_CHAINSETUP::default_audio_format(void) const { return impl_repp->default_audio_format_rep; } /** * Select controllers as targets for parameter control */ void ECA_CHAINSETUP::set_target_to_controller(void) { vector schains = selected_chains(); for(vector::const_iterator a = schains.begin(); a != schains.end(); a++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*a == (*q)->name()) { (*q)->selected_controller_as_target(); return; } } } } /** * Add general controller to selected chainop. * * @pre csrc != 0 * @pre is_locked() != true * @pre selected_chains().size() == 1 */ void ECA_CHAINSETUP::add_controller(GENERIC_CONTROLLER* csrc) { // -------- DBC_REQUIRE(csrc != 0); DBC_REQUIRE(is_locked() != true); DBC_REQUIRE(selected_chains().size() == 1); // -------- #ifndef ECA_DISABLE_EFFECTS AUDIO_STAMP_CLIENT* p = dynamic_cast(csrc->source_pointer()); if (p != 0) { p->register_server(&impl_repp->stamp_server_rep); } #endif DBC_CHECK(buffersize() != 0); DBC_CHECK(samples_per_second() != 0); vector schains = selected_chains(); for(vector::const_iterator a = schains.begin(); a != schains.end(); a++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*a == (*q)->name()) { if ((*q)->selected_target() == 0) return; (*q)->add_controller(csrc); return; } } } } /** * Add chain operator to selected chain. * * @pre cotmp != 0 * @pre is_locked() != true * @pre selected_chains().size() == 1 */ void ECA_CHAINSETUP::add_chain_operator(CHAIN_OPERATOR* cotmp) { // -------- DBC_REQUIRE(cotmp != 0); DBC_REQUIRE(is_locked() != true); DBC_REQUIRE(selected_chains().size() == 1); // -------- #ifndef ECA_DISABLE_EFFECTS AUDIO_STAMP* p = dynamic_cast(cotmp); if (p != 0) { impl_repp->stamp_server_rep.register_stamp(p); } #endif vector schains = selected_chains(); for(vector::const_iterator p = schains.begin(); p != schains.end(); p++) { for(vector::iterator q = chains.begin(); q != chains.end(); q++) { if (*p == (*q)->name()) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Adding chainop to chain " + (*q)->name() + "."); (*q)->add_chain_operator(cotmp); (*q)->selected_chain_operator_as_target(); return; } } } } /** * If chainsetup has inputs, but no outputs, a default output is * added. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::add_default_output(void) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- if (inputs.size() > 0 && outputs.size() == 0) { // No -o[:] options specified; let's use the default output select_all_chains(); interpret_object_option(string("-o:") + ECA_OBJECT_FACTORY::probe_default_output_device()); } } /** * If chainsetup has objects that need MIDI services, * but no MIDI-devices defined, a default MIDI-device is * added. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::add_default_midi_device(void) { if (midi_server_needed_rep == true && midi_devices.size() == 0) { cparser_rep.interpret_object_option("-Md:" + default_midi_device()); } } /** * Loads chainsetup options from file. * * @pre is_enabled() != true */ void ECA_CHAINSETUP::load_from_file(const string& filename, vector& opts) const throw(ECA_ERROR&) { // -------- DBC_REQUIRE(is_enabled() != true); // -------- std::ifstream fin (filename.c_str()); if (!fin) throw(ECA_ERROR("ECA_CHAINSETUP", "Couldn't open setup read file: \"" + filename + "\".", ECA_ERROR::retry)); vector options; string temp; while(getline(fin,temp)) { if (temp.size() > 0 && temp[0] == '#') { continue; } // FIXME: we should add quoting when saving the chainsetup or // give on quoting altogether... vector words = kvu_string_to_tokens_quoted(temp); for(unsigned int n = 0; n < words.size(); n++) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Adding \"" + words[n] + "\" to options (loaded from \"" + filename + "\"."); options.push_back(words[n]); } } fin.close(); opts = COMMAND_LINE::combine(options); } void ECA_CHAINSETUP::save(void) throw(ECA_ERROR&) { if (setup_filename_rep.empty() == true) setup_filename_rep = setup_name_rep + ".ecs"; save_to_file(setup_filename_rep); } void ECA_CHAINSETUP::save_to_file(const string& filename) throw(ECA_ERROR&) { // make sure that all overrides are processed select_active_buffering_mode(); std::ofstream fout (filename.c_str()); if (!fout) { cerr << "Going to throw an exception...\n"; throw(ECA_ERROR("ECA_CHAINSETUP", "Couldn't open setup save file: \"" + filename + "\".", ECA_ERROR::retry)); } else { fout << "# ecasound chainsetup file" << endl; fout << endl; fout << "# general " << endl; fout << cparser_rep.general_options_to_string() << endl; fout << endl; string tmpstr = cparser_rep.midi_to_string(); if (tmpstr.size() > 0) { fout << "# MIDI " << endl; fout << tmpstr << endl; fout << endl; } fout << "# audio inputs " << endl; fout << cparser_rep.inputs_to_string() << endl; fout << endl; fout << "# audio outputs " << endl; fout << cparser_rep.outputs_to_string() << endl; fout << endl; tmpstr = cparser_rep.chains_to_string(); if (tmpstr.size() > 0) { fout << "# chain operators and controllers " << endl; fout << tmpstr << endl; fout << endl; } fout.close(); set_filename(filename); } } ecasound-2.9.3/libecasound/audiofx_envelope_modulation.cpp0000644000076400007640000001423210664032032021040 00000000000000// ------------------------------------------------------------------------ // audiofx_envelope-modulation.cpp: Effects which modify/modulate signal // envelope // Copyright (C) 2000 Rob Coker // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // ------------------------------------------------------------------------ // // History: // // 2003-08-21 Kai Vehmanen // - Fixed a timing resolution bug in the envelope modulation code. // This involved changing from float to fixed point presentation for // the position counters to avoid loss of precision (led to unexpected // drift in pulse timing). // 2000-11-01 Rob Coker // - Initial version. // // ------------------------------------------------------------------------ #include #include #include "samplebuffer_iterators.h" #include "audiofx_envelope_modulation.h" #include "eca-logger.h" #include "eca-error.h" EFFECT_ENV_MOD::~EFFECT_ENV_MOD(void) { } EFFECT_PULSE_GATE::EFFECT_PULSE_GATE (parameter_t freq_Hz, parameter_t onTime_percent) { set_parameter(1, freq_Hz); set_parameter(2, onTime_percent); freq_rep = 1.0; on_time_rep = 0; current_rep = 0; period_rep = 0; on_from_rep = 0; } EFFECT_PULSE_GATE::~EFFECT_PULSE_GATE(void) { } void EFFECT_PULSE_GATE::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { /* NOP, see audiofx.cpp:set_samples_per_second(); */ EFFECT_ENV_MOD::set_samples_per_second(v); } void EFFECT_PULSE_GATE::set_parameter(int param, parameter_t value) { switch (param) { case 1: if (value > 0) { freq_rep = value; period_rep = static_cast(1.0f / freq_rep * samples_per_second() + 0.5f); // samples } else { MESSAGE_ITEM otemp; otemp << "(audiofx_envelope_modulation) WARNING! Frequency must be greater than 0! "; ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } break; case 2: if ((value > 0) && (value < 100)) { on_time_rep = value; on_from_rep = static_cast((on_time_rep / 100.0) * period_rep + 0.5f); } else { MESSAGE_ITEM otemp; otemp << "(audiofx_envelope_modulation) WARNING! on time must be between 0 and 100 inclusive! "; ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } break; } } CHAIN_OPERATOR::parameter_t EFFECT_PULSE_GATE::get_parameter(int param) const { switch (param) { case 1: return(freq_rep); case 2: return (on_time_rep); } return(0.0); } void EFFECT_PULSE_GATE::init(SAMPLE_BUFFER* sbuf) { i.init(sbuf); set_channels(sbuf->number_of_channels()); EFFECT_ENV_MOD::init(sbuf); } void EFFECT_PULSE_GATE::process(void) { i.begin(); // iterate through all samples, one sample-frame at a // time (interleaved) while(!i.end()) { ++current_rep; if (current_rep >= period_rep) { current_rep = 0; } if (current_rep > on_from_rep) { for(int n = 0; n < channels(); n++) { *i.current(n) = 0.0; } } i.next(); } } EFFECT_PULSE_GATE_BPM::EFFECT_PULSE_GATE_BPM (parameter_t bpm, parameter_t ontime_percent) { set_parameter(1, bpm); set_parameter(2, ontime_percent); } EFFECT_PULSE_GATE_BPM::~EFFECT_PULSE_GATE_BPM(void) { } void EFFECT_PULSE_GATE_BPM::set_parameter(int param, parameter_t value) { switch (param) { case 1: pulsegate_rep.set_parameter(1, value / 60.0f); break; case 2: pulsegate_rep.set_parameter(2, value); break; } } CHAIN_OPERATOR::parameter_t EFFECT_PULSE_GATE_BPM::get_parameter(int param) const { switch (param) { case 1: return (pulsegate_rep.get_parameter(1) * 60.0f); break; case 2: return (pulsegate_rep.get_parameter(2)); break; } return(0.0); } void EFFECT_PULSE_GATE_BPM::init(SAMPLE_BUFFER* sbuf) { pulsegate_rep.init(sbuf); EFFECT_ENV_MOD::init(sbuf); } void EFFECT_PULSE_GATE_BPM::process(void) { pulsegate_rep.process(); } void EFFECT_PULSE_GATE_BPM::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { pulsegate_rep.set_samples_per_second(v); EFFECT_ENV_MOD::set_samples_per_second(v); } EFFECT_TREMOLO::EFFECT_TREMOLO (parameter_t freq_bpm, parameter_t depth_percent) { set_parameter(1, freq_bpm); set_parameter(2, depth_percent); currentTime = 0.0; } EFFECT_TREMOLO::~EFFECT_TREMOLO(void) { } void EFFECT_TREMOLO::set_parameter(int param, parameter_t value) { switch (param) { case 1: if (value > 0) { freq = value/(2*60); // convert from bpm to Hz } else { MESSAGE_ITEM otemp; otemp << "(audiofx_envelope_modulation) WARNING! bpm must be greater than 0! "; ECA_LOG_MSG(ECA_LOGGER::info, otemp.to_string()); } break; case 2: depth = (value/100.0); // from percent to fraction break; } } CHAIN_OPERATOR::parameter_t EFFECT_TREMOLO::get_parameter(int param) const { switch (param) { case 1: return freq*120; break; case 2: return depth*100.0; break; } return(0.0); } void EFFECT_TREMOLO::init(SAMPLE_BUFFER* sbuf) { i.init(sbuf); set_channels(sbuf->number_of_channels()); incrTime = 1.0/samples_per_second(); EFFECT_ENV_MOD::init(sbuf); } void EFFECT_TREMOLO::process(void) { i.begin(); // iterate through all samples, one sample-frame at a // time (interleaved) while(!i.end()) { currentTime += incrTime; double envelope = (1-depth)+depth*fabs(sin(2*3.1416*currentTime*freq)); if (envelope < 0) { envelope = 0; } for(int n = 0; n < channels(); n++) { *i.current(n) *= envelope; } i.next(); } } ecasound-2.9.3/libecasound/dynamic-parameters.h0000644000076400007640000000332610765532076016524 00000000000000#ifndef INCLUDED_DYNAMIC_PARAMETERS_H #define INCLUDED_DYNAMIC_PARAMETERS_H #include #include /** * Virtual template class that provides a system for dynamically * controlling a set of parameters. Supports getting and setting * parameter values, verbose parameter names, etc. * * @author Kai Vehmanen */ template class DYNAMIC_PARAMETERS { public: typedef T parameter_t; public: virtual ~DYNAMIC_PARAMETERS (void) {} /** * Gets the total number of of parameters. */ int number_of_params(void) const { return kvu_get_number_of_arguments(parameter_names()); } /** * Whether parameters (and number_of_params()) may be added * during object life-cycle. */ virtual bool variable_params(void) const { return false; } /** * Gets name of parameter with index 'id'. * @param id parameter id number * */ std::string get_parameter_name(int id) const { return(kvu_get_argument_number(id, parameter_names())); } /** * A comma-separated list of parameters names. Derived classes * must implement this. */ virtual std::string parameter_names(void) const = 0; /** * Sets the parameter value. Implementations should be able to * handle arbitrary values of 'value'. Argument validity * can be tested by a combination of set_parameter() and * get_parameter() calls. Parameter value is valid, if * get_parameter() returns it without changes. * * @param param parameter id, require: param > 0 * @param value new value */ virtual void set_parameter(int param, T value) = 0; /** * Get parameter value * * @param param parameter id, require: param > 0 */ virtual T get_parameter(int param) const = 0; }; #endif ecasound-2.9.3/libecasound/stamp-ctrl.h0000644000076400007640000000231011034531771015004 00000000000000#ifndef INCLUDE_STAMP_CTRL_H #define INCLUDE_STAMP_CTRL_H #include #include "ctrl-source.h" #include "audio-stamp.h" #include "samplebuffer.h" /** * Controller sources that analyze audio stamps * and produce control data. * @author Kai Vehmanen */ class AUDIO_STAMP_CONTROLLER : public CONTROLLER_SOURCE, public AUDIO_STAMP_CLIENT { public: }; /** * Controller that analyzes stamp volume level, and creates * control data based on the results. */ class VOLUME_ANALYZE_CONTROLLER : public AUDIO_STAMP_CONTROLLER { public: virtual std::string name(void) const { return("Volume analyze controller"); } virtual void init(void); virtual parameter_t value(double pos_secs); virtual void set_initial_value(parameter_t arg) {} virtual std::string parameter_names(void) const { return("stamp-id,rms-toggle"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; VOLUME_ANALYZE_CONTROLLER(void); VOLUME_ANALYZE_CONTROLLER* clone(void) const { return 0; } VOLUME_ANALYZE_CONTROLLER* new_expr(void) const { return new VOLUME_ANALYZE_CONTROLLER(); } private: int rms_mode_rep; SAMPLE_BUFFER sbuf_rep; }; #endif ecasound-2.9.3/libecasound/global-preset.h0000644000076400007640000000101010664032032015444 00000000000000#ifndef INCLUDED_GLOBAL_PRESET_H #define INCLUDED_GLOBAL_PRESET_H #include "preset.h" /** * Effect preset that is read from a global * preset database. * * @author Kai Vehmanen */ class GLOBAL_PRESET : public PRESET { private: std::string preset_name_rep; public: virtual GLOBAL_PRESET* clone(void) const; virtual GLOBAL_PRESET* new_expr(void) const { return(new GLOBAL_PRESET(preset_name_rep)); } virtual ~GLOBAL_PRESET (void) { } GLOBAL_PRESET(const std::string& preset_name = ""); }; #endif ecasound-2.9.3/libecasound/samplebuffer_impl.h0000644000076400007640000000126511161457254016426 00000000000000#ifndef INCLUDED_SAMPLEBUFFER_IMPL_H #define INCLUDED_SAMPLEBUFFER_IMPL_H #include #include "samplebuffer.h" #ifdef HAVE_CONFIG_H #include #endif #ifdef ECA_COMPILE_SAMPLERATE #include #endif class SAMPLE_BUFFER_impl { public: friend class SAMPLE_BUFFER; private: /** @name Misc member variables */ /*@{*/ bool rt_lock_rep; int lockref_rep; int quality_rep; int event_tags_rep; SAMPLE_BUFFER::sample_t* old_buffer_repp; // for resampling std::vector resample_memory_rep; #ifdef ECA_COMPILE_SAMPLERATE int src_state_channels_rep; std::vector src_state_rep; #endif /*@}*/ }; #endif ecasound-2.9.3/libecasound/eca-static-object-maps.cpp0000644000076400007640000005556011740524567017520 00000000000000// ------------------------------------------------------------------------ // eca-static-object-maps.h: Static object map instances // Copyright (C) 2000-2004,2006,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "eca-version.h" #include "eca-chainop.h" #include "audiofx.h" #include "audiofx_misc.h" #include "audiofx_amplitude.h" #include "audiofx_analysis.h" #include "audiofx_envelope_modulation.h" #include "audiofx_filter.h" #include "audiofx_rcfilter.h" #include "audiofx_reverb.h" #include "audiofx_mixing.h" #include "audiofx_timebased.h" #include "audiogate.h" #include "audiofx_lv2.h" #include "audiofx_lv2_world.h" #include "audiofx_ladspa.h" #include "generic-controller.h" #include "ctrl-source.h" #include "midi-cc.h" #include "osc-gen.h" #include "osc-gen-file.h" #include "osc-sine.h" #include "linear-envelope.h" #include "two-stage-linear-envelope.h" #include "stamp-ctrl.h" #include "generic-linear-envelope.h" #include "audioio-plugin.h" #include "audioio-cdr.h" #include "audioio-wave.h" #ifdef ECA_COMPILE_OSS #include "audioio-oss.h" #endif #include "audioio-ewf.h" #include "audioio-mp3.h" #include "audioio-ogg.h" #include "audioio-mikmod.h" #include "audioio-timidity.h" #include "audioio-flac.h" #include "audioio-aac.h" #include "audioio-raw.h" #include "audioio-null.h" #include "audioio-rtnull.h" #include "audioio-typeselect.h" #include "audioio-resample.h" #include "audioio-reverse.h" #include "audioio-tone.h" #include "audioio-acseq.h" #ifndef ECA_ENABLE_AUDIOIO_PLUGINS #ifdef ECA_COMPILE_AUDIOFILE #include "plugins/audioio_af.h" #endif #ifdef ECA_COMPILE_SNDFILE #include "plugins/audioio_sndfile.h" #endif #ifdef ECA_COMPILE_ALSA #include "plugins/audioio_alsa.h" #include "plugins/audioio_alsa_named.h" #endif #ifdef ECA_COMPILE_ARTS #include "plugins/audioio_arts.h" #endif #ifdef ECA_COMPILE_JACK #include "plugins/audioio_jack.h" #endif #endif /* ECA_ENABLE_AUDIOIO_PLUGINS */ #include "midiio-raw.h" #ifdef ECA_COMPILE_ALSA #include "midiio-aseq.h" #endif #include "eca-object-map.h" #include "eca-preset-map.h" #include "eca-static-object-maps.h" #include "eca-resources.h" #include "eca-logger.h" #include "eca-error.h" using std::cerr; using std::endl; using std::find; using std::string; using std::list; using std::vector; /** * Declarations for static private helper functions */ static vector eca_create_ladspa_plugins(const string& fname); static void eca_import_lv2_plugins(ECA_OBJECT_MAP* objmap); static void eca_import_ladspa_plugins(ECA_OBJECT_MAP* objmap, bool reg_with_id); #ifdef ECA_ENABLE_AUDIOIO_PLUGINS static void eca_import_internal_audioio_plugin(ECA_OBJECT_MAP* objmap, const string& filename); #endif /** * Definitions of static member functions */ void ECA_STATIC_OBJECT_MAPS::register_audio_io_rt_objects(ECA_OBJECT_MAP* objmap) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_audio_io_rt_objects()"); AUDIO_IO* device = 0; #ifdef ECA_COMPILE_OSS device = new OSSDEVICE(); objmap->register_object("/dev/dsp", "/dev/dsp[0-9]*", device); objmap->register_object("/dev/sound/dsp", "/dev/sound/dsp[0-9]*", device); #endif device = new REALTIME_NULL(); objmap->register_object("rtnull", "^rtnull$", device); #ifdef ECA_ENABLE_AUDIOIO_PLUGINS eca_import_internal_audioio_plugin(objmap, "libaudioio_alsa.so"); eca_import_internal_audioio_plugin(objmap, "libaudioio_alsa_named.so"); eca_import_internal_audioio_plugin(objmap, "libaudioio_arts.so"); eca_import_internal_audioio_plugin(objmap, "libaudioio_jack.so"); #else /* ECA_ENABLE_AUDIOIO_PLUGINS */ #ifdef ECA_COMPILE_ALSA device = new AUDIO_IO_ALSA_PCM(); objmap->register_object("alsahw_09", "(^alsahw_09$)|(^alsaplugin_09$)", device); device = new AUDIO_IO_ALSA_PCM_NAMED(); objmap->register_object("alsa_09", "^alsa_09$", device); #endif #ifdef ECA_COMPILE_ARTS device = new ARTS_INTERFACE(); objmap->register_object("arts", "^arts$", device); #endif #ifdef ECA_COMPILE_JACK device = new AUDIO_IO_JACK(); objmap->register_object("jack", "(^jack$)|(^jack_multi$)|(^jack_alsa$)|(^jack_auto$)|(^jack_generic$)", device); #endif #endif /* ECA_ENABLE_AUDIOIO_PLUGINS */ const ECA_OBJECT* aobj = 0; aobj = objmap->object("alsahw_09"); if (aobj != 0) { objmap->register_object("alsahw", "^alsahw$", const_cast(aobj)); objmap->register_object("alsaplugin", "^alsaplugin$", const_cast(aobj)); } aobj = objmap->object("alsa_09"); if (aobj != 0) { objmap->register_object("alsa", "^alsa$", const_cast(aobj)); } } void ECA_STATIC_OBJECT_MAPS::register_audio_io_nonrt_objects(ECA_OBJECT_MAP* objmap) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_audio_io_nonrt_objects()"); bool native_flac = false; objmap->register_object("wav", "wav$", new WAVEFILE()); objmap->register_object("ewf", "ewf$", new EWFFILE()); objmap->register_object("cdr", "cdr$", new CDRFILE()); AUDIO_IO* raw = new RAWFILE(); objmap->register_object("raw", "raw$", raw); AUDIO_IO* mp3 = new MP3FILE(); objmap->register_object("mp3", "mp3$", mp3); objmap->register_object("mp2", "mp2$", mp3); AUDIO_IO* ogg = new OGG_VORBIS_INTERFACE(); objmap->register_object("ogg", "ogg$", ogg); AUDIO_IO* mikmod = new MIKMOD_INTERFACE(); objmap->register_object("mikmod", "(^mikmod$)|(xm$)|(669$)|(amf$)|(dsm$)|(far$)|(gdm$)|(imf$)|" "(it$)|(m15$)|(ed$)|(mod$)|(mtm$)|(s3m$)|" "(stm$)|(stx$)|(ult$)|(uni$)", mikmod); AUDIO_IO* timidity = new TIMIDITY_INTERFACE(); objmap->register_object("mid", "(mid$)|(midi$)", timidity); AUDIO_IO* forkedaac = new AAC_FORKED_INTERFACE(); objmap->register_object("aac", "aac$", forkedaac); objmap->register_object("mp4", "mp4$", forkedaac); objmap->register_object("m4a", "m4a$", forkedaac); #ifdef ECA_ENABLE_AUDIOIO_PLUGINS eca_import_internal_audioio_plugin(objmap, "libaudioio_af.so"); eca_import_internal_audioio_plugin(objmap, "libaudioio_sndfile.so"); #else /* !ECA_ENABLE_AUDIOIO_PLUGINS */ /* ---------------------------------------------------------*/ /* register file types to plugins handling audio file types */ #if defined(ECA_COMPILE_SNDFILE) || defined(ECA_COMPILE_AUDIOFILE) string common_types ("(aif*$)|(au$)|(snd$)"); #endif #ifdef ECA_COMPILE_SNDFILE SNDFILE_INTERFACE* sndfile = new SNDFILE_INTERFACE(); /* 1. register types supported by libsndfile */ string sf_types ("(^sndfile$)"); list el = sndfile->supported_extensions(); list::const_iterator i = el.begin(); string sf_all_types; while(i != el.end()) { sf_all_types += *i + ","; ++i; } ECA_LOG_MSG(ECA_LOGGER::user_objects, "All libsndfile supported extensions: " + sf_all_types); if (find(el.begin(), el.end(), "flac") != el.end()) { sf_types += "|(flac$)"; native_flac = true; } if (find(el.begin(), el.end(), "avr") != el.end()) sf_types += "|(avr$)"; if (find(el.begin(), el.end(), "caf") != el.end()) sf_types += "|(caf$)"; if (find(el.begin(), el.end(), "htk") != el.end()) sf_types += "|(htk$)"; if (find(el.begin(), el.end(), "iff") != el.end()) sf_types += "|(iff$)"; if (find(el.begin(), el.end(), "mat") != el.end()) sf_types += "|(mat$)"; if (find(el.begin(), el.end(), "paf") != el.end()) sf_types += "|(paf$)"; if (find(el.begin(), el.end(), "pvf") != el.end()) sf_types += "|(pvf$)"; if (find(el.begin(), el.end(), "nist") != el.end()) sf_types += "|(nist$)"; if (find(el.begin(), el.end(), "sf") != el.end()) sf_types += "|(sf$)"; if (find(el.begin(), el.end(), "sd2") != el.end()) sf_types += "|(sd2$)"; if (find(el.begin(), el.end(), "sds") != el.end()) sf_types += "|(sds$)"; if (find(el.begin(), el.end(), "voc") != el.end()) sf_types += "|(voc$)"; if (find(el.begin(), el.end(), "w64") != el.end()) sf_types += "|(w64$)"; if (find(el.begin(), el.end(), "xi") != el.end()) sf_types += "|(xi$)"; /* add formats supported by both libaudiofile and libsndfile */ sf_types += string("|") + common_types; common_types.clear(); objmap->register_object("sndfile", sf_types.c_str(), dynamic_cast(sndfile)); #endif #ifdef ECA_COMPILE_AUDIOFILE /* 2. register types for libaudiofile */ string af_types ("(^audiofile$)"); /* note, if sndfile not available, common_types are registered * to libaudiofile */ if (common_types.size() > 0) af_types += string("|") + common_types; AUDIO_IO* af = new AUDIOFILE_INTERFACE(); objmap->register_object("audiofile", af_types.c_str(), af); #endif /* ---------------------------------------------------------*/ #endif /* ECA_ENABLE_AUDIOIO_PLUGINS */ objmap->register_object("-", "^-$", raw); objmap->register_object("stdin", "^stdin$", raw); objmap->register_object("stdout", "^stdout$", raw); objmap->register_object("null", "^null$", new NULLFILE()); objmap->register_object("typeselect", "^typeselect$", new AUDIO_IO_TYPESELECT()); objmap->register_object("resample", "^resample$", new AUDIO_IO_RESAMPLE()); objmap->register_object("resample-hq", "^resample-hq$", new AUDIO_IO_RESAMPLE()); objmap->register_object("resample-lq", "^resample-lq$", new AUDIO_IO_RESAMPLE()); objmap->register_object("reverse", "^reverse$", new AUDIO_IO_REVERSE()); objmap->register_object("tone", "^tone$", new AUDIO_IO_TONE()); objmap->register_object("audioloop", "^(audioloop|select|playat)$", new AUDIO_CLIP_SEQUENCER()); if (native_flac != true) { AUDIO_IO* forkedflac = new FLAC_FORKED_INTERFACE(); objmap->register_object("flac", "flac$", forkedflac); } } void ECA_STATIC_OBJECT_MAPS::register_chain_operator_objects(ECA_OBJECT_MAP* objmap) { #ifndef ECA_DISABLE_EFFECTS ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_chain_operator_objects()"); objmap->register_object("eS", "^eS$", new EFFECT_AUDIO_STAMP()); objmap->register_object("ea", "^ea$", new EFFECT_AMPLIFY()); objmap->register_object("eadb", "^eadb$", new EFFECT_AMPLIFY_DB()); objmap->register_object("eac", "^eac$", new EFFECT_AMPLIFY_CHANNEL()); objmap->register_object("eal", "^eal$", new EFFECT_LIMITER()); objmap->register_object("eaw", "^eaw$", new EFFECT_AMPLIFY_CLIPCOUNT()); objmap->register_object("ec", "^ec$", new EFFECT_COMPRESS()); objmap->register_object("eca", "^eca$", new ADVANCED_COMPRESSOR()); objmap->register_object("eemb", "^eemb$", new EFFECT_PULSE_GATE_BPM()); objmap->register_object("eemp", "^eemp$", new EFFECT_PULSE_GATE()); objmap->register_object("eemt", "^eemt$", new EFFECT_TREMOLO()); objmap->register_object("ef1", "^ef1$", new EFFECT_RESONANT_BANDPASS()); objmap->register_object("ef3", "^ef3$", new EFFECT_RESONANT_LOWPASS()); objmap->register_object("ef4", "^ef4$", new EFFECT_RC_LOWPASS_FILTER()); objmap->register_object("efa", "^efa$", new EFFECT_ALLPASS_FILTER()); objmap->register_object("efb", "^efb$", new EFFECT_BANDPASS()); objmap->register_object("efc", "^efc$", new EFFECT_COMB_FILTER()); objmap->register_object("efh", "^efh$", new EFFECT_HIGHPASS()); objmap->register_object("efi", "^efi$", new EFFECT_INVERSE_COMB_FILTER()); objmap->register_object("efl", "^efl$", new EFFECT_LOWPASS()); objmap->register_object("efr", "^efr$", new EFFECT_BANDREJECT()); objmap->register_object("efs", "^efs$", new EFFECT_RESONATOR()); objmap->register_object("ei", "^ei$", new EFFECT_PITCH_SHIFT()); objmap->register_object("enm", "^enm$", new EFFECT_NOISEGATE()); objmap->register_object("epp", "^epp$", new EFFECT_NORMAL_PAN()); objmap->register_object("chorder", "^chorder$", new EFFECT_CHANNEL_ORDER()); EFFECT_CHANNEL_COPY *op_cp = new EFFECT_CHANNEL_COPY(); objmap->register_object("chcopy", "^chcopy$", op_cp); objmap->register_object("erc", "^erc$", op_cp); objmap->register_object("chmove", "^chmove$", new EFFECT_CHANNEL_MOVE()); objmap->register_object("chmute", "^chmute$", new EFFECT_CHANNEL_MUTE()); EFFECT_MIX_TO_CHANNEL *op_mix = new EFFECT_MIX_TO_CHANNEL(); objmap->register_object("erm", "^erm$", op_mix); objmap->register_object("chmix", "^chmix$", op_mix); objmap->register_object("etc", "^etc$", new EFFECT_CHORUS()); objmap->register_object("etd", "^etd$", new EFFECT_DELAY()); objmap->register_object("ete", "^ete$", new ADVANCED_REVERB()); objmap->register_object("etf", "^etf$", new EFFECT_FAKE_STEREO()); objmap->register_object("etl", "^etl$", new EFFECT_FLANGER()); objmap->register_object("etm", "^etm$", new EFFECT_MULTITAP_DELAY()); objmap->register_object("etp", "^etp$", new EFFECT_PHASER()); objmap->register_object("etr", "^etr$", new EFFECT_REVERB()); objmap->register_object("ev", "^ev$", new EFFECT_VOLUME_BUCKETS()); objmap->register_object("evp", "^evp$", new EFFECT_VOLUME_PEAK()); objmap->register_object("ezf", "^ezf$", new EFFECT_DCFIND()); objmap->register_object("ezx", "^ezx$", new EFFECT_DCFIX()); objmap->register_object("gc", "^gc$", new TIME_CROP_GATE()); objmap->register_object("ge", "^ge$", new THRESHOLD_GATE()); objmap->register_object("gm", "^gm$", new MANUAL_GATE()); #endif } void ECA_STATIC_OBJECT_MAPS::register_lv2_plugin_objects(ECA_OBJECT_MAP* objmap) { #ifndef ECA_DISABLE_EFFECTS ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_lv2_plugin_objects()"); eca_import_lv2_plugins(objmap); #endif } void ECA_STATIC_OBJECT_MAPS::register_ladspa_plugin_objects(ECA_OBJECT_MAP* objmap) { #ifndef ECA_DISABLE_EFFECTS ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_ladspa_plugin_objects()"); eca_import_ladspa_plugins(objmap, false); #endif } void ECA_STATIC_OBJECT_MAPS::register_ladspa_plugin_id_objects(ECA_OBJECT_MAP* objmap) { #ifndef ECA_DISABLE_EFFECTS ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_ladspa_plugin_id_objects()"); eca_import_ladspa_plugins(objmap, true); #endif } void ECA_STATIC_OBJECT_MAPS::register_preset_objects(ECA_PRESET_MAP* objmap) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_preset_objects()"); /* @see ECA_PRESET_MAP */ } void ECA_STATIC_OBJECT_MAPS::register_controller_objects(ECA_OBJECT_MAP* objmap) { #ifndef ECA_DISABLE_EFFECTS ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_controller_objects()"); objmap->register_object("kf", "^kf$", new GENERIC_CONTROLLER(new GENERIC_OSCILLATOR_FILE())); objmap->register_object("kog", "^kog$", new GENERIC_CONTROLLER(new GENERIC_OSCILLATOR())); objmap->register_object("kl", "^kl$", new GENERIC_CONTROLLER(new LINEAR_ENVELOPE())); objmap->register_object("kl2", "^kl2$", new GENERIC_CONTROLLER(new TWO_STAGE_LINEAR_ENVELOPE())); objmap->register_object("klg", "^klg$", new GENERIC_CONTROLLER(new GENERIC_LINEAR_ENVELOPE())); objmap->register_object("km", "^km$", new GENERIC_CONTROLLER(new MIDI_CONTROLLER())); objmap->register_object("kos", "^kos$", new GENERIC_CONTROLLER(new SINE_OSCILLATOR())); objmap->register_object("ksv", "^ksv$", new GENERIC_CONTROLLER(new VOLUME_ANALYZE_CONTROLLER())); #endif } void ECA_STATIC_OBJECT_MAPS::register_midi_device_objects(ECA_OBJECT_MAP* objmap) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "register_midi_device_objects()"); objmap->register_object("rawmidi", "^rawmidi$", new MIDI_IO_RAW()); #ifdef ECA_COMPILE_ALSA objmap->register_object("alsaseq", "^alsaseq$", new MIDI_IO_ASEQ()); #endif } /** * Definitions for static private helper functions */ #ifdef ECA_ENABLE_AUDIOIO_PLUGINS /** * Load ecasound's internal plugins. Not used since 2.2.0. */ static void eca_import_internal_audioio_plugin(ECA_OBJECT_MAP* objmap, const string& filename) { ECA_RESOURCES ecarc; string libdir = ecarc.resource("internal-plugin-directory"); struct stat fbuf; if (stat(libdir.c_str(), &fbuf) < 0) { ECA_LOG_MSG(ECA_LOGGER::info, "Internal-plugin directory not found. Check your ~/.ecasoundrc!"); return; } string file = libdir + string("/") + filename; audio_io_descriptor desc_func = 0; audio_io_interface_version plugin_version = 0; audio_io_keyword plugin_keyword = 0; audio_io_keyword_regex plugin_keyword_regex = 0; void *plugin_handle = dlopen(file.c_str(), RTLD_NOW | RTLD_GLOBAL); /* RTLD_LAZY */ if (plugin_handle != 0) { plugin_version = (audio_io_interface_version)dlsym(plugin_handle, "audio_io_interface_version"); if (plugin_version != 0) { int version = plugin_version(); if (version < ecasound_library_version_current - ecasound_library_version_age || version > ecasound_library_version_current) { ECA_LOG_MSG(ECA_LOGGER::info, "Opening internal plugin file \"" + file + "\" failed. Plugin version " + kvu_numtostr(version) + " doesn't match libecasound version " + kvu_numtostr(ecasound_library_version_current) + "." + kvu_numtostr(ecasound_library_version_revision) + "." + kvu_numtostr(ecasound_library_version_age) + "."); } else { desc_func = (audio_io_descriptor)dlsym(plugin_handle, "audio_io_descriptor"); plugin_keyword = (audio_io_keyword)dlsym(plugin_handle, "audio_io_keyword"); plugin_keyword_regex = (audio_io_keyword_regex)dlsym(plugin_handle, "audio_io_keyword_regex"); if (desc_func != 0) { AUDIO_IO* aobj = desc_func(); if (plugin_keyword != 0 && plugin_keyword_regex != 0) { objmap->register_object(plugin_keyword(), plugin_keyword_regex(), aobj); // std::cerr << "Registering audio io type: " << aobj->name() << "\nType keyword " << plugin_keyword() << ", regex " << plugin_keyword_regex() << "." << std::endl; } } } } else { std::cerr << "(eca-static-object-maps) dlsym() failed; " << file; std::cerr << ": \"" << dlerror() << "\"." << std::endl; } } else { ECA_LOG_MSG(ECA_LOGGER::user_objects, "dlopen() failed; " + file + + ": \"" + string(dlerror()) + "\"."); } if (plugin_handle == 0 || plugin_version == 0 || plugin_keyword == 0 || plugin_keyword_regex == 0 || desc_func == 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Opening internal plugin file \"" + file + "\" failed."); } } #endif static void eca_import_ladspa_plugins(ECA_OBJECT_MAP* objmap, bool reg_with_id) { DIR *dp; vector dir_names; char* env = std::getenv("LADSPA_PATH"); if (env != 0) { dir_names = kvu_string_to_vector(string(env), ':'); } /* add directories mentioned in 'ladspa-plugin-directory' * to the directory search list and remove duplicates */ ECA_RESOURCES ecarc; string add_file = ecarc.resource("ladspa-plugin-directory"); vector more_dir_names = kvu_string_to_vector(add_file, ':'); vector::const_iterator di = more_dir_names.begin(); while(di != more_dir_names.end()) { if (find(dir_names.begin(), dir_names.end(), *di) == dir_names.end()) { dir_names.push_back(*di); } ++di; } /* go through all directories in the list and * try to open all encountered files as LADSPA plugins */ struct stat statbuf; vector::const_iterator p = dir_names.begin(); while (p != dir_names.end()) { dp = opendir(p->c_str()); if (dp != 0) { struct dirent *entry = readdir(dp); for(; entry != 0; entry = readdir(dp)) { string full_path_str = string(*p + "/" + entry->d_name); int err = lstat(full_path_str.c_str(), &statbuf); if (err) { ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Invalid LADSPA plugin file \"") + entry->d_name + "\" (" + strerror(errno) + ")."); continue; } if (S_ISDIR(statbuf.st_mode)) { ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Skipping directory \"") + entry->d_name + "\" while loading LADSPA plugins."); continue; } if (S_ISCHR(statbuf.st_mode) || S_ISBLK(statbuf.st_mode)) { ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Skipping device \"") + entry->d_name + "\" while loading LADSPA plugins."); continue; } if (S_ISFIFO(statbuf.st_mode) || S_ISSOCK(statbuf.st_mode)) { ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Skipping pipe/socket \"") + entry->d_name + "\" while loading LADSPA plugins."); continue; } vector ladspa_plugins; try { if (entry->d_name[0] != '.') ladspa_plugins = eca_create_ladspa_plugins(full_path_str.c_str()); } catch(ECA_ERROR& e) { } for(unsigned int n = 0; n < ladspa_plugins.size(); n++) { if (reg_with_id == true) { objmap->register_object(kvu_numtostr(ladspa_plugins[n]->unique_number()), "^" + kvu_numtostr(ladspa_plugins[n]->unique_number()) + "$", ladspa_plugins[n]); } else { objmap->register_object(ladspa_plugins[n]->unique(), "^" + kvu_string_regex_meta_escape(ladspa_plugins[n]->unique()) + "$", ladspa_plugins[n]); } } } } ++p; } } static vector eca_create_ladspa_plugins(const string& fname) { vector plugins; #ifndef ECA_DISABLE_EFFECTS void *plugin_handle = dlopen(fname.c_str(), RTLD_NOW); if (plugin_handle != 0) { LADSPA_Descriptor_Function desc_func; desc_func = (LADSPA_Descriptor_Function)dlsym(plugin_handle, "ladspa_descriptor"); if (desc_func != 0) { const LADSPA_Descriptor *plugin_desc = 0; for (int i = 0;; i++) { plugin_desc = desc_func(i); if (plugin_desc == 0) break; try { plugins.push_back(new EFFECT_LADSPA(plugin_desc)); } catch (ECA_ERROR&) { } plugin_desc = 0; } } else { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Unable find plugin LADSPA-descriptor."); } } else { ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Unable to open plugin file \"") + fname + "\"."); } #endif return plugins; } static void eca_import_lv2_plugins(ECA_OBJECT_MAP* objmap) { #if !defined(ECA_DISABLE_EFFECTS) && defined(ECA_USE_LIBLILV) LilvWorld* world=ECA_LV2_WORLD::World(); lilv_world_load_all(world); const LilvPlugins* plugins=lilv_world_get_all_plugins(world); LILV_FOREACH(plugins,i,plugins) { const LilvPlugin* p=lilv_plugins_get(plugins,i); try { EFFECT_LV2* eff=new EFFECT_LV2(p); objmap->register_object(eff->unique(), "^" + kvu_string_regex_meta_escape(eff->unique()) + "$", eff); } catch (ECA_ERROR&) { } } #endif } ecasound-2.9.3/libecasound/audiofx_misc.h0000644000076400007640000000641110765534164015407 00000000000000#ifndef INCLUDED_AUDIOFX_MISC_H #define INCLUDED_AUDIOFX_MISC_H #include #include "sample-specs.h" #include "samplebuffer_iterators.h" #include "audio-stamp.h" #include "audiofx.h" /** * Adjusts DC-offset. * @author Kai Vehmanen */ class EFFECT_DCFIX : public EFFECT_BASE { private: std::vector deltafixes_rep; SAMPLE_ITERATOR_CHANNEL i_rep; public: virtual std::string name(void) const { return("DC-Fix"); } virtual std::string description(void) const { return("Adjusts DC-offset."); } virtual bool variable_params(void) const { return true; } virtual std::string parameter_names(void) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_DCFIX* clone(void) const { return new EFFECT_DCFIX(*this); } EFFECT_DCFIX* new_expr(void) const { return new EFFECT_DCFIX(); } EFFECT_DCFIX (const EFFECT_DCFIX& x); EFFECT_DCFIX (void); }; /** * Modify audio pitch by altering its length * @author Kai Vehmanen */ class EFFECT_PITCH_SHIFT : public EFFECT_BASE { private: parameter_t pmod_rep; long int target_rate_rep; SAMPLE_BUFFER* sbuf_repp; public: static const int resample_low_limit; virtual std::string name(void) const { return("Pitch shifter"); } virtual std::string description(void) const { return("Modify audio pitch by altering its length."); } virtual std::string parameter_names(void) const { return("change-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); virtual long int max_output_samples(long int i_samples) const; EFFECT_PITCH_SHIFT(void) : pmod_rep(100.0), target_rate_rep(0), sbuf_repp(0) { } EFFECT_PITCH_SHIFT (const EFFECT_PITCH_SHIFT& x); EFFECT_PITCH_SHIFT* clone(void) const { return new EFFECT_PITCH_SHIFT(*this); } EFFECT_PITCH_SHIFT* new_expr(void) const { return new EFFECT_PITCH_SHIFT(); } }; /** * Store an audio stamp object. Otherwise just let's the audio go through. * @author Kai Vehmanen */ class EFFECT_AUDIO_STAMP : public EFFECT_BASE, public AUDIO_STAMP { SAMPLE_BUFFER* sbuf_repp; public: virtual std::string name(void) const { return("Audio stamp"); } virtual std::string description(void) const { return("Takes a snapshot of passing audio buffers."); } virtual std::string parameter_names(void) const { return("stamp-id"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); EFFECT_AUDIO_STAMP(void); EFFECT_AUDIO_STAMP(const EFFECT_AUDIO_STAMP& arg); EFFECT_AUDIO_STAMP* clone(void) const { return new EFFECT_AUDIO_STAMP(*this); } EFFECT_AUDIO_STAMP* new_expr(void) const { return new EFFECT_AUDIO_STAMP(); } }; #endif ecasound-2.9.3/libecasound/eca-object-map.cpp0000644000076400007640000001410411141424206016015 00000000000000// ------------------------------------------------------------------------ // eca-object-map: A virtual base for dynamic object maps // Copyright (C) 2000-2004,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include "eca-object-map.h" #include "eca-logger.h" using std::find; using std::map; using std::string; using std::list; ECA_OBJECT_MAP::ECA_OBJECT_MAP(void) : expr_case_sensitive_rep(false) { } ECA_OBJECT_MAP::~ECA_OBJECT_MAP(void) { map::iterator p = object_map.begin(); while(p != object_map.end()) { if (p->second != 0) { ECA_OBJECT* next_obj = p->second; // std::cerr << "Deleting " << next_obj->name() << "." << std::endl; map::iterator q = p; ++q; while(q != object_map.end()) { if (q->second != 0 && q->second == p->second) { // std::cerr << "Deleting sub-object with keyword " << q->first << "." << std::endl; q->second = 0; } ++q; } p->second = 0; delete next_obj; } ++p; } } void ECA_OBJECT_MAP::toggle_case_sensitive_expressions(bool v) { expr_case_sensitive_rep = v; } bool ECA_OBJECT_MAP::case_sensitive_expressions(void) const { return expr_case_sensitive_rep; } /** * Registers a new object to the object map. Map object will take care * of deleting the registered objects. Notice that it's possible * to register the same physical object with different keywords. * Object map will take care that objects with multiple registered * keywords are destructed properly. * * @arg keyword tag string that identifies the registered object * @arg expr regex that is used to map strings to objects * (note! 'keyword' should match 'expr') */ void ECA_OBJECT_MAP::register_object(const string& keyword, const string& expr, ECA_OBJECT* object) { object_keywords_rep.push_back(keyword); object_map[keyword] = object; object_expr_map[keyword] = expr; if (expr_to_keyword(keyword) != keyword && object != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Registered keyword " + keyword + " doesn't match the associated regex " + expr + ", for object '" + object->name() + "' (" + expr_to_keyword(expr) + ")."); } } /** * Unregisters object with keyword 'keyword'. Does not physically * delete the assigned object, because one object can be * registered with multiple keywords. */ void ECA_OBJECT_MAP::unregister_object(const string& keyword) { object_keywords_rep.remove(keyword); object_map[keyword] = 0; object_expr_map[keyword] = ""; } /** * Returns a list of registered objects. */ const list& ECA_OBJECT_MAP::registered_objects(void) const { return object_keywords_rep; } bool ECA_OBJECT_MAP::has_keyword(const std::string& keyword) const { if (find(object_keywords_rep.begin(), object_keywords_rep.end(), keyword) == object_keywords_rep.end()) return false; return true; } bool ECA_OBJECT_MAP::has_object(const ECA_OBJECT* obj) const { map::const_iterator p = object_map.begin(); while(p != object_map.end()) { if (obj->name() == p->second->name()) { return true; } ++p; } return false; } /** * Returns the object identified by 'keyword'. If no keyword * matches, 0 is returned. * * As a const object pointer is returned, clone() and new_expr() * methods should be used to create new non-const objects of * the returned type. */ const ECA_OBJECT* ECA_OBJECT_MAP::object(const string& keyword) const { const ECA_OBJECT* object = 0; if (object_map.find(keyword) != object_map.end()) { object = object_map[keyword]; } return object; } /** * A convenience function which directly returns an object matching * search string 'input'. */ const ECA_OBJECT* ECA_OBJECT_MAP::object_expr(const string& input) const { return object(expr_to_keyword(input)); } /** * Returns the identifying keyword for input string 'input'. * * If 'case_sensitive_expressions() != true', the pattern * matching will be case insensitive. */ string ECA_OBJECT_MAP::expr_to_keyword(const string& input) const { map::const_iterator p = object_expr_map.begin(); regex_t preg; string result; while(p != object_expr_map.end()) { int cflags = REG_EXTENDED | REG_NOSUB; if (case_sensitive_expressions() != true) cflags |= REG_ICASE; regcomp(&preg, p->second.c_str(), cflags); if (regexec(&preg, input.c_str(), 0, 0, 0) == 0) { ECA_LOG_MSG(ECA_LOGGER::functions, "match (1): " + input + " to regexp " + p->second); result = p->first; regfree(&preg); break; } regfree(&preg); ++p; } return result; } /** * Returns the identifying keyword that matches the expression 'expr'. */ string ECA_OBJECT_MAP::keyword_to_expr(const string& keyword) const { if (object_expr_map.find(keyword) != object_expr_map.end()) return object_expr_map[keyword]; return ""; } /** * Returns the matching identifying keyword for 'object'. */ string ECA_OBJECT_MAP::object_identifier(const ECA_OBJECT* object) const { map::const_iterator p = object_map.begin(); while(p != object_map.end()) { if (object->name() == p->second->name()) { return p->first; } ++p; } return ""; } ecasound-2.9.3/libecasound/resource-file.h0000644000076400007640000000320310664032032015456 00000000000000#ifndef INCLUDED_RESOURCE_FILE_H #define INCLUDED_RESOURCE_FILE_H #include #include #include /** * Generic resource file class */ class RESOURCE_FILE { std::string resfile_rep; mutable std::map resmap_rep; std::vector lines_rep; bool modified_rep; public: /** * Returns a vector of registered presets */ std::vector keywords(void) const; /** * Returns current resource file name. */ const std::string& resource_file(void) const { return resfile_rep; } /** * Set resource file name. */ void resource_file(const std::string& v) { resfile_rep = v; } /** * Returns value of resource 'tag'. */ std::string resource(const std::string& tag) const; /** * Set resource 'tag' value to 'value'. If value wasn't * previously defined, it's added. */ void resource(const std::string& tag, const std::string& value); /** * Returns true if resource 'tag' is 'true', otherwise false */ bool boolean_resource(const std::string& tag) const; /** * Whether resource 'tag' is specified in the resource file */ bool has(const std::string& tag) const; /** * Has any resource value been added, removed or modified? */ bool is_modified(void) const { return modified_rep; } /** * Load/restore resources from file */ void load(void); /** * Save/store resources to file saving */ void save(void); /** * Constructor. Resource values are read, if * filename argument is given. */ RESOURCE_FILE(const std::string& resource_file = ""); virtual ~RESOURCE_FILE(void); }; #endif ecasound-2.9.3/libecasound/eca-session.h0000644000076400007640000000757710664032032015145 00000000000000#ifndef INCLUDED_ECA_SESSION_H #define INCLUDED_ECA_SESSION_H #include #include #include #include "eca-error.h" class AUDIO_IO; class ECA_CHAIN; class ECA_CHAINSETUP; /** * Class representing a set of chainsetups. Provided * functionality includes creating, removing, * selecting and connecting of chainsetups. * * Notes: Friendship access to data members is * allowed for ECA_CONTROL objects. */ class ECA_SESSION { public: // -- // type definitions and constants friend class ECA_CONTROL_BASE; friend class ECA_CONTROL_OBJECTS; friend class ECA_CONTROL; public: // -- // Public/const routines // -- const std::vector& get_chainsetups(void) const { return chainsetups_rep; } const ECA_CHAINSETUP* get_selected_chainsetup(void) const { return selected_chainsetup_repp; } const ECA_CHAINSETUP* get_connected_chainsetup(void) const { return connected_chainsetup_repp; } const ECA_CHAINSETUP* get_chainsetup_with_name(const std::string& name) const; bool is_selected_chainsetup_connected(void) const { return(selected_chainsetup_repp == connected_chainsetup_repp); } // -- // Constructors and destructors // -- ECA_SESSION(void); ECA_SESSION(COMMAND_LINE& cline) throw(ECA_ERROR&); ~ECA_SESSION(void); private: // --- // Status data // --- std::vector chainsetups_rep; ECA_CHAINSETUP* connected_chainsetup_repp; ECA_CHAINSETUP* selected_chainsetup_repp; bool cs_defaults_set_rep; // --- // Setup interpretation // --- void set_cs_param_defaults(void); void preprocess_options(std::vector* opts); void create_chainsetup_options(COMMAND_LINE& cline, std::vector* options); int interpret_general_options(const std::vector& inopts, std::vector* outopts); int interpret_general_option(const std::string& opts); int interpret_chainsetup_option(const std::string& argu); int interpret_general_option(COMMAND_LINE& cline, std::vector* options); bool is_session_option(const std::string& arg) const; // --- // Function for handling chainsetups // --- void add_chainsetup(const std::string& name); void add_chainsetup(ECA_CHAINSETUP* comline_setup); void remove_chainsetup(void); /** * Select chainsetup with name 'name' * * require: * name.empty() != true && * * ensure: * (selected_chainsetup->name() == name) || * (selected_chainsetup == 0) */ void select_chainsetup(const std::string& name); /** * Save selected chainsetup * * require: * selected_chainsetup != 0 */ void save_chainsetup(void) throw(ECA_ERROR&); /** * Save selected chainsetup to file 'filename' * * require: * selected_chainsetup != 0 && * filename.empty() != true */ void save_chainsetup(const std::string& filename) throw(ECA_ERROR&); /** * Load chainsetup from file "filename" * * require: * filename.empty() != true * * ensure: * selected_chainsetup->filename() == filename */ void load_chainsetup(const std::string& filename); /** * Connect selected chainsetup * * require: * selected_chainsetup != 0 && * selected_chainsetup->is_valid() * * ensure: * selected_chainsetup == connected_chainsetup */ void connect_chainsetup(void) throw(ECA_ERROR&); /** * Disconnect connected chainsetup * * require: * connected_chainsetup != 0 * * ensure: * connected_chainsetup == 0 */ void disconnect_chainsetup(void); /** * Gets a vector of all chainsetup names. */ std::vector chainsetup_names(void) const; void update_controller_sources(void); // -- // Make sure that objects of this class aren't copy constucted/assigned // -- ECA_SESSION (const ECA_SESSION& x) { } ECA_SESSION& operator=(const ECA_SESSION& x) { return *this; } }; #endif ecasound-2.9.3/libecasound/audioio-cdr_impl.h0000644000076400007640000000031110664032032016127 00000000000000#ifndef _AUDIOIO_CDR_IMPL_H #define _AUDIOIO_CDR_IMPL_H #define BYTE 1 #define WORD 2 #define LONG 4 #define FLOAT 5 #define DOUBLE 6 // #define SECTORSIZE (2352 / 2) #define SECTORSIZE 2352 #endif ecasound-2.9.3/libecasound/audiofx_filter.cpp0000644000076400007640000005427711755703025016303 00000000000000// ------------------------------------------------------------------------ // audiofx_filter.cpp: Routines for filter effects. // Copyright (C) 1999,2004,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "samplebuffer_iterators.h" #include "sample-ops_impl.h" #include "eca-logger.h" #include "audiofx_filter.h" static void priv_resize_buffer(std::vector *buffer, int count) { buffer->resize(count); for(int i = 0; i < count; i++) (*buffer)[i] = 0.0; } EFFECT_FILTER::~EFFECT_FILTER(void) { } EFFECT_BANDPASS::EFFECT_BANDPASS (CHAIN_OPERATOR::parameter_t centerf, CHAIN_OPERATOR::parameter_t w) { /* to avoid accessing uninitialized data */ width = 1; center = 1; C = 1; set_parameter(1, centerf); set_parameter(2, w); } void EFFECT_BANDPASS::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: center = value; D = 2 * cos(2 * M_PI * center / (CHAIN_OPERATOR::parameter_t)samples_per_second()); b[0] = -C * D * a[0]; break; case 2: if (value != 0) width = value; else width = center / 2; C = 1.0 / tan(M_PI * width / (CHAIN_OPERATOR::parameter_t)samples_per_second()); D = 2 * cos(2 * M_PI * center / (CHAIN_OPERATOR::parameter_t)samples_per_second()); a[0] = 1.0 / (1.0 + C); a[1] = 0.0; a[2] = -a[0]; b[0] = -C * D * a[0]; b[1] = (C - 1.0) * a[0]; break; } } CHAIN_OPERATOR::parameter_t EFFECT_BANDPASS::get_parameter(int param) const { switch (param) { case 1: return center; case 2: return width; } return 0.0; } EFFECT_BANDREJECT::EFFECT_BANDREJECT (CHAIN_OPERATOR::parameter_t centerf, CHAIN_OPERATOR::parameter_t w) { set_parameter(1, centerf); set_parameter(2, w); } void EFFECT_BANDREJECT::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: center = value; D = 2 * cos(2 * M_PI * center / (CHAIN_OPERATOR::parameter_t)samples_per_second()); a[1] = -D * a[0]; b[0] = a[1]; break; case 2: if (value != 0) width = value; else width = center / 2; C = tan(M_PI * width / (CHAIN_OPERATOR::parameter_t)samples_per_second()); a[0] = 1.0 / (1.0 + C); a[1] = -D * a[0]; a[2] = a[0]; b[0] = a[1]; b[1] = (1.0 - C) * a[0]; break; } } CHAIN_OPERATOR::parameter_t EFFECT_BANDREJECT::get_parameter(int param) const { switch (param) { case 1: return center; case 2: return width; } return 0.0; } void EFFECT_BW_FILTER::init(SAMPLE_BUFFER *insample) { i.init(insample); set_channels(insample->number_of_channels()); const size_t buflen = 2; sin.resize(insample->number_of_channels(), std::vector (buflen)); sout.resize(insample->number_of_channels(), std::vector (buflen)); for(int i = 0; i < insample->number_of_channels(); i++) { for(size_t j = 0; j < buflen; j++) { sin[i][j] = 0.0f; sout[i][j] = 0.0f; } } } void EFFECT_BW_FILTER::process(void) { i.begin(); while(!i.end()) { outputSample = ecaops_flush_to_zero(a[0] * (*i.current()) + a[1] * sin[i.channel()][0] + a[2] * sin[i.channel()][1] - b[0] * sout[i.channel()][0] - b[1] * sout[i.channel()][1]); sin[i.channel()][1] = sin[i.channel()][0]; sin[i.channel()][0] = *i.current(); sout[i.channel()][1] = sout[i.channel()][0]; sout[i.channel()][0] = outputSample; *i.current() = outputSample; i.next(); } } void EFFECT_BW_FILTER::process_notused(SAMPLE_BUFFER* sbuf) { // sbuf->first(); // while(sbuf->is_readable()) { // outputSample = *sbuf->current_sample() * a[0] // + sin[0] * a[1] // + sin[1] * a[2] // - sout[0] * b[0] // - sout[1] * b[1]; // sin[1] = sin[0]; // sin[0] = *(sbuf->current_sample()); // sout[1] = sout[0]; // sout[0] = outputSample; // sbuf->current_sample()->operator=(outputSample); // sbuf->next(); // } } void EFFECT_BW_FILTER::init_values(void) { // for(int j = 0; j < 2;j++) { // sin[j].sample[SAMPLE_BUFFER::ch_left] = 0.0; // sin[j].sample[SAMPLE_BUFFER::ch_right] = 0.0; // sout[j].sample[SAMPLE_BUFFER::ch_left] = 0.0; // sout[j].sample[SAMPLE_BUFFER::ch_right] = 0.0; // } } EFFECT_HIGHPASS::EFFECT_HIGHPASS (CHAIN_OPERATOR::parameter_t cutoff) { set_parameter(1, cutoff); } void EFFECT_HIGHPASS::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: cutOffFreq = value; C = tan(M_PI * cutOffFreq / (CHAIN_OPERATOR::parameter_t)samples_per_second()); a[0] = 1.0 / (1.0 + sqrt(2.0) * C + C * C); a[1] = -2.0 * a[0]; a[2] = a[0]; b[0] = 2 * (C * C - 1.0) * a[0]; b[1] = (1.0 - sqrt(2.0) * C + C * C) * a[0]; break; } } CHAIN_OPERATOR::parameter_t EFFECT_HIGHPASS::get_parameter(int param) const { switch (param) { case 1: return cutOffFreq; } return 0.0; } EFFECT_ALLPASS_FILTER::EFFECT_ALLPASS_FILTER (void) : feedback_gain(0.0), D(0.0) { } void EFFECT_ALLPASS_FILTER::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: D = value; // assert(inbuf.size() == outbuf.size()); for(int n = 0; n < static_cast(inbuf.size()); n++) { if (inbuf[n].size() > D) inbuf[n].resize(static_cast(D)); // if (outbuf[n].size() > D) inbuf[n].resize(D); } break; case 2: feedback_gain = value / 100.0; break; } } CHAIN_OPERATOR::parameter_t EFFECT_ALLPASS_FILTER::get_parameter(int param) const { switch (param) { case 1: return D; case 2: return feedback_gain * 100.0; } return 0.0; } void EFFECT_ALLPASS_FILTER::init(SAMPLE_BUFFER* insample) { i.init(insample); set_channels(insample->number_of_channels()); inbuf.resize(insample->number_of_channels()); for(size_t i = 0; i < inbuf.size(); i++) inbuf[i].clear(); } void EFFECT_ALLPASS_FILTER::process(void) { i.begin(); while(!i.end()) { if (inbuf[i.channel()].size() >= D) { inbuf[i.channel()].push_back(*i.current()); // *i.current() = -feedback_gain * (*i.current()) + // inbuf[i.channel()].front() + // feedback_gain * outbuf[i.channel()].front(); *i.current() = ecaops_flush_to_zero(-feedback_gain * (*i.current()) + (feedback_gain * inbuf[i.channel()].front() + *i.current()) * (1.0 - feedback_gain * feedback_gain)); // feedback_gain * outbuf[i.channel()].front(); // outbuf[i.channel()].push_back(*i.current()); inbuf[i.channel()].pop_front(); // outbuf[i.channel()].pop_front(); } else { inbuf[i.channel()].push_back(*i.current()); *i.current() = ecaops_flush_to_zero(*i.current() * (1.0 - feedback_gain)); // outbuf[i.channel()].push_back(*i.current()); } i.next(); } } EFFECT_COMB_FILTER::EFFECT_COMB_FILTER (int delay_in_samples, CHAIN_OPERATOR::parameter_t radius) { set_parameter(1, (CHAIN_OPERATOR::parameter_t)delay_in_samples); set_parameter(2, radius); } void EFFECT_COMB_FILTER::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: { C = value; std::vector >::iterator p = buffer.begin(); while(p != buffer.end()) { if (p->size() > C) { p->resize(static_cast(C)); } ++p; } break; } case 2: D = value; break; } } CHAIN_OPERATOR::parameter_t EFFECT_COMB_FILTER::get_parameter(int param) const { switch (param) { case 1: return C; case 2: return D; } return 0.0; } void EFFECT_COMB_FILTER::init(SAMPLE_BUFFER* insample) { i.init(insample); set_channels(insample->number_of_channels()); buffer.resize(insample->number_of_channels()); for(size_t i = 0; i < buffer.size(); i++) buffer[i].clear(); } void EFFECT_COMB_FILTER::process(void) { i.begin(); while(!i.end()) { if (buffer[i.channel()].size() >= C) { *i.current() = (*i.current()) + (pow(D, C) * buffer[i.channel()].front()); buffer[i.channel()].push_back(*i.current()); buffer[i.channel()].pop_front(); } else { buffer[i.channel()].push_back(*i.current()); } i.next(); } } EFFECT_INVERSE_COMB_FILTER::EFFECT_INVERSE_COMB_FILTER (int delay_in_samples, CHAIN_OPERATOR::parameter_t radius) { // // delay in number of samples // circle radius // set_parameter(1, (CHAIN_OPERATOR::parameter_t)delay_in_samples); set_parameter(2, radius); } void EFFECT_INVERSE_COMB_FILTER::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: C = value; break; case 2: D = value; break; } } CHAIN_OPERATOR::parameter_t EFFECT_INVERSE_COMB_FILTER::get_parameter(int param) const { switch (param) { case 1: return C; case 2: return D; } return 0.0; } void EFFECT_INVERSE_COMB_FILTER::init(SAMPLE_BUFFER* insample) { i.init(insample); set_channels(insample->number_of_channels()); buffer.resize(insample->number_of_channels()); for(size_t i = 0; i < buffer.size(); i++) buffer[i].clear(); priv_resize_buffer(&laskuri, insample->number_of_channels()); } void EFFECT_INVERSE_COMB_FILTER::process(void) { i.begin(); while(!i.end()) { buffer[i.channel()].push_back(*i.current()); if (laskuri[i.channel()] >= C) { *i.current() = (*i.current()) - (pow(D, C) * buffer[i.channel()].front()); buffer[i.channel()].pop_front(); } else { laskuri[i.channel()]++; } i.next(); } } EFFECT_LOWPASS::EFFECT_LOWPASS (CHAIN_OPERATOR::parameter_t cutoff) { set_parameter(1, cutoff); } void EFFECT_LOWPASS::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: set_cutoff(value, samples_per_second()); break; } } CHAIN_OPERATOR::parameter_t EFFECT_LOWPASS::get_parameter(int param) const { switch (param) { case 1: return cutOffFreq; } return 0.0; } void EFFECT_LOWPASS::set_cutoff(CHAIN_OPERATOR::parameter_t value, long int srate) { cutOffFreq = value; C = 1.0 / tan(M_PI * cutOffFreq / (CHAIN_OPERATOR::parameter_t)srate); a[0] = 1.0 / (1.0 + sqrt(2.0) * C + C * C); a[1] = 2.0 * a[0]; a[2] = a[0]; b[0] = 2 * (1.0 - C * C) * a[0]; b[1] = (1.0 - sqrt(2.0) * C + C * C) * a[0]; } EFFECT_LOWPASS_SIMPLE::EFFECT_LOWPASS_SIMPLE (CHAIN_OPERATOR::parameter_t cutoff) { set_parameter(1, cutoff); } void EFFECT_LOWPASS_SIMPLE::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: cutOffFreq = value; A = 2.0 * M_PI * cutOffFreq / samples_per_second(); B = exp(-A / samples_per_second()); break; } } CHAIN_OPERATOR::parameter_t EFFECT_LOWPASS_SIMPLE::get_parameter(int param) const { switch (param) { case 1: return cutOffFreq; } return 0.0; } void EFFECT_LOWPASS_SIMPLE::init(SAMPLE_BUFFER *insample) { i.init(insample); set_channels(insample->number_of_channels()); priv_resize_buffer(&outhist, insample->number_of_channels()); priv_resize_buffer(&tempin, insample->number_of_channels()); priv_resize_buffer(&temphist, insample->number_of_channels()); } void EFFECT_LOWPASS_SIMPLE::process(void) { i.begin(); while(!i.end()) { tempin[i.channel()] = *i.current(); temphist[i.channel()] = outhist[i.channel()]; outhist[i.channel()] = tempin[i.channel()]; tempin[i.channel()] *= A * 0.5; temphist[i.channel()] *= B * 0.5; *i.current() = ecaops_flush_to_zero(tempin[i.channel()] + temphist[i.channel()]); i.next(); } } EFFECT_RESONANT_BANDPASS::EFFECT_RESONANT_BANDPASS (CHAIN_OPERATOR::parameter_t centerf, CHAIN_OPERATOR::parameter_t w) { /* to avoid accessing uninitialized data */ width = 1; center = 1; set_parameter(1, centerf); set_parameter(2, w); } void EFFECT_RESONANT_BANDPASS::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: center = value; break; case 2: if (value != 0) width = value; else width = center / 2.0; break; } // R = 1.0 - M_PI * width / (CHAIN_OPERATOR::parameter_t)samples_per_second(); // R = 1.0 - ((width / (CHAIN_OPERATOR::parameter_t)samples_per_second()) / 2.0); R = 1.0 - M_PI * (width / (CHAIN_OPERATOR::parameter_t)samples_per_second()); c = R * R; pole_angle = (((2.0 * R) / (1.0 + c)) * cos((center / (CHAIN_OPERATOR::parameter_t)samples_per_second() * 2.0 * M_PI))); pole_angle = acos(pole_angle); a = (1.0 - c) * sin(pole_angle); b = 2.0 * R * cos(pole_angle); } CHAIN_OPERATOR::parameter_t EFFECT_RESONANT_BANDPASS::get_parameter(int param) const { switch (param) { case 1: return center; case 2: return width; } return 0.0; } void EFFECT_RESONANT_BANDPASS::init(SAMPLE_BUFFER* insample) { i.init(insample); set_channels(insample->number_of_channels()); priv_resize_buffer(&outhist1, insample->number_of_channels()); priv_resize_buffer(&outhist2, insample->number_of_channels()); } void EFFECT_RESONANT_BANDPASS::process(void) { i.begin(); while(!i.end()) { *i.current() = ecaops_flush_to_zero(a * (*i.current()) + b * outhist1[i.channel()] - c * outhist2[i.channel()]); outhist2[i.channel()] = outhist1[i.channel()]; outhist1[i.channel()] = *i.current(); i.next(); } } EFFECT_RESONANT_LOWPASS::EFFECT_RESONANT_LOWPASS (CHAIN_OPERATOR::parameter_t co, CHAIN_OPERATOR::parameter_t res, CHAIN_OPERATOR::parameter_t g) : ProtoCoef(2), Coef(2) { cutoff = co; Q = res; gain_orig = gain = g; laskuri = 0.0; pi = 4.0 * atan(1.0); // --- // Setup filter s-domain coefficients // --- ProtoCoef[0].a0 = 1.0; ProtoCoef[0].a1 = 0; ProtoCoef[0].a2 = 0; ProtoCoef[0].b0 = 1.0; ProtoCoef[0].b1 = 0.765367 / Q; // Divide by resonance or Q ProtoCoef[0].b2 = 1.0; ProtoCoef[1].a0 = 1.0; ProtoCoef[1].a1 = 0; ProtoCoef[1].a2 = 0; ProtoCoef[1].b0 = 1.0; ProtoCoef[1].b1 = 1.847759 / Q; // Divide by resonance or Q ProtoCoef[1].b2 = 1.0; szxform(0); szxform(1); } void EFFECT_RESONANT_LOWPASS::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: cutoff = value; break; case 2: Q = value; break; case 3: gain_orig = value; break; } refresh_values(); } CHAIN_OPERATOR::parameter_t EFFECT_RESONANT_LOWPASS::get_parameter(int param) const { switch (param) { case 1: return cutoff; case 2: return Q; case 3: return gain_orig; } return 0.0; } void EFFECT_RESONANT_LOWPASS::refresh_values(void) { if (cutoff == 0.0) cutoff = 0.1; gain = gain_orig; // ProtoCoef[0].a0 = 1.0; ProtoCoef[0].a1 = 0; ProtoCoef[0].a2 = 0; // ProtoCoef[0].b0 = 1.0; ProtoCoef[0].b1 = 0.765367 / Q; // Divide by resonance or Q ProtoCoef[0].b2 = 1.0; // ProtoCoef[1].a0 = 1.0; ProtoCoef[1].a1 = 0; ProtoCoef[1].a2 = 0; // ProtoCoef[1].b0 = 1.0; ProtoCoef[1].b1 = 1.847759 / Q; // Divide by resonance or Q ProtoCoef[1].b2 = 1.0; szxform(0); szxform(1); } void EFFECT_RESONANT_LOWPASS::szxform(int section) { wp = 2.0 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * tan(pi * cutoff / (CHAIN_OPERATOR::parameter_t)samples_per_second()); // --- // a0 and b0 are presumed to be 1, so... ProtoCoef[section].a2 = ProtoCoef[section].a2 / (wp * wp); ProtoCoef[section].a1 = ProtoCoef[section].a1 / wp; ProtoCoef[section].b2 = ProtoCoef[section].b2 / (wp * wp); ProtoCoef[section].b1 = ProtoCoef[section].b1 / wp; // --- // alpha (Numerator in s-domain) ad = 4.0 * ProtoCoef[section].a2 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * (CHAIN_OPERATOR::parameter_t)samples_per_second() + 2.0 * ProtoCoef[section].a1 * (CHAIN_OPERATOR::parameter_t)samples_per_second() + ProtoCoef[section].a0; // --- // beta (Denominator in s-domain) bd = 4.0 * ProtoCoef[section].b2 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * (CHAIN_OPERATOR::parameter_t)samples_per_second() + 2.0 * ProtoCoef[section].b1 * (CHAIN_OPERATOR::parameter_t)samples_per_second() + ProtoCoef[section].b0; // --- /* update gain constant for this section */ gain *= ad/bd; // --- // Denominator Coef[section].A = (2.0 * ProtoCoef[section].b0 - 8.0 * ProtoCoef[section].b2 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * (CHAIN_OPERATOR::parameter_t)samples_per_second()) / bd; // --- // beta1 Coef[section].B = (4.0 * ProtoCoef[section].b2 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * (CHAIN_OPERATOR::parameter_t)samples_per_second() - 2.0 * ProtoCoef[section].b1 * (CHAIN_OPERATOR::parameter_t)samples_per_second() + ProtoCoef[section].b0) / bd; // --- // beta2 // --- // Nominator Coef[section].C = (2.0 * ProtoCoef[section].a0 - 8.0 * ProtoCoef[section].a2 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * (CHAIN_OPERATOR::parameter_t)samples_per_second()) / ad; // --- // alpha1 Coef[section].D = (4.0 * ProtoCoef[section].a2 * (CHAIN_OPERATOR::parameter_t)samples_per_second() * (CHAIN_OPERATOR::parameter_t)samples_per_second() - 2.0 * ProtoCoef[section].a1 * (CHAIN_OPERATOR::parameter_t)samples_per_second() + ProtoCoef[section].a0) / ad; // --- // alpha2 } void EFFECT_RESONANT_LOWPASS::init(SAMPLE_BUFFER* insample) { i.init(insample); set_channels(insample->number_of_channels()); priv_resize_buffer(&outhist0, insample->number_of_channels()); priv_resize_buffer(&outhist1, insample->number_of_channels()); priv_resize_buffer(&outhist2, insample->number_of_channels()); priv_resize_buffer(&outhist3, insample->number_of_channels()); priv_resize_buffer(&newhist0, insample->number_of_channels()); priv_resize_buffer(&newhist1, insample->number_of_channels()); } void EFFECT_RESONANT_LOWPASS::process(void) { i.begin(); while(!i.end()) { *i.current() = (*i.current()) * gain; // first section: // -------------- // poles: *i.current() = (*i.current()) - outhist0[i.channel()] * Coef[0].A; newhist0[i.channel()] = ecaops_flush_to_zero((*i.current()) - outhist1[i.channel()] * Coef[0].B); // zeros: *i.current() = newhist0[i.channel()] + outhist0[i.channel()] * Coef[0].C; *i.current() = (*i.current()) + outhist1[i.channel()] * Coef[0].D; outhist1[i.channel()] = outhist0[i.channel()]; outhist0[i.channel()] = newhist0[i.channel()]; // second section: // -------------- // poles: *i.current() = (*i.current()) - outhist2[i.channel()] * Coef[1].A; newhist1[i.channel()] = ecaops_flush_to_zero((*i.current()) - outhist3[i.channel()] * Coef[1].B); // zeros: *i.current() = newhist1[i.channel()] + outhist2[i.channel()] * Coef[1].C; *i.current() = (*i.current()) + outhist3[i.channel()] * Coef[1].D; outhist3[i.channel()] = outhist2[i.channel()]; outhist2[i.channel()] = newhist1[i.channel()]; i.next(); } } // EFFECT_RESONANT_LOWPASS::EFFECT_RESONANT_LOWPASS (const // EFFECT_RESONANT_LOWPASS& x) // : outhist(4), newhist(2), ProtoCoef(2), Coef(2) // { // outhist = x.outhist; // newhist = x.newhist; // for(vector::size_type p = 0; p != x.ProtoCoef.size(); p++) { // ProtoCoef[p].a0 = x.ProtoCoef[p].a0; // ProtoCoef[p].a1 = x.ProtoCoef[p].a1; // ProtoCoef[p].a2 = x.ProtoCoef[p].a2; // ProtoCoef[p].b0 = x.ProtoCoef[p].b0; // ProtoCoef[p].b1 = x.ProtoCoef[p].b1; // ProtoCoef[p].b2 = x.ProtoCoef[p].b2; // ++p; // } // for(vector::size_type p = 0; p != x.Coef.size(); p++) { // Coef[p].A = x.Coef[p].A; // Coef[p].B = x.Coef[p].B; // Coef[p].C = x.Coef[p].C; // Coef[p].D = x.Coef[p].D; // ++p; // } // cutoff = x.cutoff; // Q = x.Q; // gain = x.gain; // gain_orig = x.gain_orig; // pi = x.pi; // laskuri = x.laskuri; // ad = x.ad; // bd = x.bd; // wp = x.wp; // } EFFECT_RESONATOR::EFFECT_RESONATOR (CHAIN_OPERATOR::parameter_t centerf, CHAIN_OPERATOR::parameter_t w) : cona(1), conb(2) { /* to avoid accessing uninitialized data */ width = 1; center = 1; set_parameter(1, centerf); set_parameter(2, w); } void EFFECT_RESONATOR::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: center = value; break; case 2: if (value != 0) width = value; else width = center / 2; break; } conb[1] = exp(-(2 * M_PI) * (width / (CHAIN_OPERATOR::parameter_t)samples_per_second())); conb[0] = (-4.0 * conb[1]) / (1.0 + conb[1]) * cos(2 * M_PI * (center / (CHAIN_OPERATOR::parameter_t)samples_per_second())); cona[0] = (1.0 - conb[1]) * sqrt(1.0 - (conb[0] * conb[0]) / (4.0 * conb[1])); } CHAIN_OPERATOR::parameter_t EFFECT_RESONATOR::get_parameter(int param) const { switch (param) { case 1: return center; case 2: return width; } return 0.0; } void EFFECT_RESONATOR::init(SAMPLE_BUFFER* insample) { i.init(insample); set_channels(insample->number_of_channels()); priv_resize_buffer(&saout0, insample->number_of_channels()); priv_resize_buffer(&saout1, insample->number_of_channels()); } void EFFECT_RESONATOR::process(void) { i.begin(); while(!i.end()) { *i.current() = cona[0] * (*i.current()) - conb[0] * saout0[i.channel()] - conb[1] * saout1[i.channel()]; saout1[i.channel()] = saout0[i.channel()]; saout0[i.channel()] = ecaops_flush_to_zero(*i.current()); i.next(); } } ecasound-2.9.3/libecasound/audioio-resample.h0000644000076400007640000000521511161517321016160 00000000000000#ifndef INCLUDED_AUDIOIO_RESAMPLE_H #define INCLUDED_AUDIOIO_RESAMPLE_H #include #include #include #include "samplebuffer.h" #include "audioio-proxy.h" /** * A proxy class that resamples the the child * object's data. * * Related design patterns: * - Proxy (GoF207 * * @author Kai Vehmanen */ class AUDIO_IO_RESAMPLE : public AUDIO_IO_PROXY { public: /** @name Public functions */ /*@{*/ AUDIO_IO_RESAMPLE (void); virtual ~AUDIO_IO_RESAMPLE(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return(string("Resample => ") + child()->name()); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual bool variable_params(void) const { return true; } virtual std::string parameter_names(void) const; virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_IO_RESAMPLE* clone(void) const; virtual AUDIO_IO_RESAMPLE* new_expr(void) const { return(new AUDIO_IO_RESAMPLE()); } /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return(io_read); } virtual bool supports_seeking(void) const { return(true); } virtual bool finite_length_stream(void) const { return(true); } virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual void set_buffersize(long int samples); virtual long int buffersize(void) const; /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_FORMAT */ /*@{*/ virtual void set_audio_format(const ECA_AUDIO_FORMAT& f_str); /*@}*/ /** @name Reimplemented functions from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ private: void recalculate_psfactor(void); mutable std::vector params_rep; bool init_rep; SAMPLE_SPECS::sample_rate_t child_srate_conf_rep; float psfactor_rep; int quality_rep; SAMPLE_BUFFER sbuf_rep; SAMPLE_BUFFER leftoverbuf_rep; static const int child_parameter_offset = 2; AUDIO_IO_RESAMPLE& operator=(const AUDIO_IO_RESAMPLE& x) { return *this; } AUDIO_IO_RESAMPLE (const AUDIO_IO_RESAMPLE& x) { } }; #endif ecasound-2.9.3/libecasound/audioio-mikmod.h0000644000076400007640000000433511141362360015631 00000000000000#ifndef INCLUDED_AUDIOIO_MIKMOD_H #define INCLUDED_AUDIOIO_MIKMOD_H #include #include #include "audioio-buffered.h" #include "audioio-forked-stream.h" /** * Interface to module players such as MikMod that support * UNIX pipe i/o. * * @author Kai Vehmanen */ class MIKMOD_INTERFACE : public AUDIO_IO_BUFFERED, public AUDIO_IO_FORKED_STREAM { private: static std::string default_mikmod_cmd; public: static void set_mikmod_cmd(const std::string& value); public: MIKMOD_INTERFACE (const std::string& name = ""); virtual ~MIKMOD_INTERFACE(void); virtual MIKMOD_INTERFACE* clone(void) const { return new MIKMOD_INTERFACE(*this); } virtual MIKMOD_INTERFACE* new_expr(void) const { return new MIKMOD_INTERFACE(); } virtual std::string name(void) const { return("MikMod tracker module"); } virtual std::string description(void) const { return("Interface to module players that support UNIX pipe i/o."); } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; virtual int supported_io_modes(void) const { return(io_read); } virtual string parameter_names(void) const { return("filename,opt_filename"); } virtual bool supports_seeking(void) const { return(false); } virtual void open(void) throw (AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples) { } virtual bool finished(void) const { return(finished_rep); } virtual void start_io(void); virtual void stop_io(void); protected: /* functions called by AUDIO_IO_FORKED_STREAM that require * the use of AUDIO_IO methods */ virtual bool do_supports_seeking(void) const { return supports_seeking(); } virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { set_position_in_samples(pos); } private: std::string opt_filename_rep; bool triggered_rep; bool finished_rep; long int bytes_read_rep; int filedes_rep; FILE* f1_rep; void seek_position_in_samples(long pos); MIKMOD_INTERFACE& operator=(const MIKMOD_INTERFACE& x) { return *this; } void fork_mikmod(void); void kill_mikmod(void); }; #endif ecasound-2.9.3/libecasound/eca-resources.cpp0000644000076400007640000001156611173134055016024 00000000000000// ------------------------------------------------------------------------ // eca_resources.cpp: User settings (ecasoundrc) // Copyright (C) 1999-2002,2004,2005,2007 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include /* getenv */ #include "kvu_dbc.h" #include "eca-logger.h" #include "eca-resources.h" #include "eca-version.h" #include "resource-file.h" using std::string; std::string ECA_RESOURCES::rc_override_file; ECA_RESOURCES::ECA_RESOURCES(void) : resources_found_rep(true) { if (ECA_RESOURCES::rc_override_file.size() == 0) { /* case: load global and user resource files normally */ string ecasound_resource_path (ECA_PKGDATADIR); globalrc_repp = new RESOURCE_FILE(ecasound_resource_path + "/ecasoundrc"); if (globalrc_repp->keywords().size() == 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "WARNING: Global resource file \"" + ecasound_resource_path + "/ecasoundrc" + "\" not available! Ecasound may not function properly!"); resources_found_rep = false; } char* home_dir = getenv("HOME"); if (home_dir != NULL) { string user_ecasoundrc_path = string(home_dir) + "/.ecasound"; user_resource_directory_rep = user_ecasoundrc_path; userrc_repp = new RESOURCE_FILE(user_ecasoundrc_path + "/ecasoundrc"); if (userrc_repp && userrc_repp->has("user-resource-directory") == true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Old resource data found in \"" + user_ecasoundrc_path + "\". You can reset configuration parameters by removing the old rc-file."); } } else userrc_repp = 0; overriderc_repp = 0; } else { /* case: override, do not use global/user resource files */ globalrc_repp = userrc_repp = 0; overriderc_repp = new RESOURCE_FILE(ECA_RESOURCES::rc_override_file); if (overriderc_repp->keywords().size() == 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "WARNING: Override resource file \"" + ECA_RESOURCES::rc_override_file + "\" not available! Ecasound may not function properly!"); resources_found_rep = false; } } } ECA_RESOURCES::~ECA_RESOURCES(void) { if (userrc_repp && userrc_repp->is_modified() == true) { userrc_repp->resource("ecasound-version", ecasound_library_version); userrc_repp->save(); } if (globalrc_repp != 0) delete globalrc_repp; if (userrc_repp != 0) delete userrc_repp; if (overriderc_repp != 0) delete overriderc_repp; } /** * Set resource 'tag' value to 'value'. If value wasn't * previously defined, it's added. */ void ECA_RESOURCES::resource(const string& tag, const string& value) { if (userrc_repp) userrc_repp->resource(tag, value); } /** * Returns value of resource 'tag'. Priority is given * to user-specified resources over global resources. */ string ECA_RESOURCES::resource(const string& tag) const { if (tag == "user-resource-directory") return user_resource_directory_rep; if (userrc_repp && userrc_repp->has(tag)) return userrc_repp->resource(tag); if (globalrc_repp && globalrc_repp->has(tag)) return globalrc_repp->resource(tag); if (overriderc_repp && overriderc_repp->has(tag)) return overriderc_repp->resource(tag); return string(); } /** * Returns true if resource 'tag' is 'true', otherwise false */ bool ECA_RESOURCES::boolean_resource(const string& tag) const { if (userrc_repp && userrc_repp->has(tag)) return userrc_repp->boolean_resource(tag); if (globalrc_repp && globalrc_repp->has(tag)) return globalrc_repp->boolean_resource(tag); if (overriderc_repp && overriderc_repp->has(tag)) return overriderc_repp->boolean_resource(tag); return false; } /** * Whether resource 'tag' is specified in the resource file */ bool ECA_RESOURCES::has(const string& tag) const { if ((globalrc_repp && globalrc_repp->has(tag)) || (userrc_repp && userrc_repp->has(tag)) || (overriderc_repp && overriderc_repp->has(tag))) return true; return false; } /** * Are any resource values available? */ bool ECA_RESOURCES::has_any(void) const { return resources_found_rep; } ecasound-2.9.3/libecasound/eca-error.h0000644000076400007640000000220410664032032014571 00000000000000#ifndef INCLUDED_ECA_ERROR_H #define INCLUDED_ECA_ERROR_H #include using std::string; /** * A general exception class for error reporting. */ class ECA_ERROR { public: // ------------------------------ // error type / suggested action: // ------------------------------ // stop = a critical error (can't allocate memory, etc), program // should exit at once // retry = action failed (badly formatted data, invalid user input, // etc), no need to stop the whole program // notice = action succeeded but something unusual occured enum Action { stop, retry, notice }; private: std::string esection_rep; std::string eerrormsg_rep; Action eaction_rep; public: const std::string& error_section(void) const { return(esection_rep); } const std::string& error_message(void) const { return(eerrormsg_rep); } const Action& error_action(void) const { return(eaction_rep); } ECA_ERROR(const std::string& section, const std::string& errormsg, const Action action = ECA_ERROR::retry) { esection_rep = section; eerrormsg_rep = errormsg; eaction_rep = action; } }; #endif ecasound-2.9.3/libecasound/midiio-raw.cpp0000644000076400007640000000550110664032032015311 00000000000000// ------------------------------------------------------------------------ // midiio-raw.cpp: Input and output of raw MIDI streams using standard // UNIX file operations. // Copyright (C) 2000,2005 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "midiio-raw.h" #include "eca-logger.h" MIDI_IO_RAW::MIDI_IO_RAW(const std::string& name) { label("rawmidi"); device_name_rep = name; } MIDI_IO_RAW::~MIDI_IO_RAW(void) { if (is_open()) close(); } void MIDI_IO_RAW::open(void) { int flags = 0; switch(io_mode()) { case io_read: { flags = O_RDONLY; break; } case io_write: { flags = O_WRONLY; break; } case io_readwrite: { flags = O_RDWR; break; } } if (nonblocking_mode() == true) flags |= O_NONBLOCK; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Opening midi device \"" + device_name_rep + "\"."); fd_rep = ::open(device_name_rep.c_str(), flags); if (fd_rep < 0) { toggle_open_state(false); } else { toggle_open_state(true); } finished_rep = false; } void MIDI_IO_RAW::close(void) { ::close(fd_rep); toggle_open_state(false); } bool MIDI_IO_RAW::finished(void) const { return finished_rep; } long int MIDI_IO_RAW::read_bytes(void* target_buffer, long int bytes) { /* note: ignore bytes, already read one byte at a time */ long int res = ::read(fd_rep, target_buffer, 1); if (res >= 0) return res; finished_rep = true; return 0; } long int MIDI_IO_RAW::write_bytes(void* target_buffer, long int bytes) { long int res = ::write(fd_rep, target_buffer, bytes); if (res >= 0) return res; finished_rep = true; return 0; } void MIDI_IO_RAW::set_parameter(int param, std::string value) { switch (param) { case 1: label(value); break; case 2: device_name_rep = value; break; } } std::string MIDI_IO_RAW::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return device_name_rep; } return ""; } ecasound-2.9.3/libecasound/audiofx.h0000644000076400007640000000203210664032032014350 00000000000000#ifndef INCLUDED_AUDIOFX_H #define INCLUDED_AUDIOFX_H #include "eca-chainop.h" #include "eca-samplerate-aware.h" /** * Virtual base for all audio effect classes. * * @author Kai Vehmanen */ class EFFECT_BASE : public CHAIN_OPERATOR, public ECA_SAMPLERATE_AWARE { public: /** @name Constructors and destructors */ /*@{*/ EFFECT_BASE(void); virtual ~EFFECT_BASE(void); /*@}*/ protected: /** @name Protected functions for storing channel count */ /*@{*/ void set_channels(int v); /*@}*/ public: /** @name Public virtual functions to notify about changes * (Reimplemented from ECA_SAMPLERATE_AWARE) */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ /** @name Public virtual functions for initialization * (Reimplemented from CHAIN_OPERATOR) */ /*@{*/ virtual void init(SAMPLE_BUFFER* sbuf); /*@}*/ /** @name Public non-virtual functions */ /*@{*/ int channels(void) const; /*@}*/ private: int channels_rep; }; #endif ecasound-2.9.3/libecasound/preset_impl.h0000644000076400007640000000202711166150245015245 00000000000000#ifndef INCLUDED_PRESET_IMPL_H #define INCLUDED_PRESET_IMPL_H #include #include #include "eca-chainop.h" #include "sample-specs.h" using std::string; using std::vector; class AUDIO_IO; class GENERIC_CONTROLLER; class OPERATOR; class PRESET_impl { public: friend class PRESET; private: vector preset_param_names_rep; /** * maps preset's public params 1...N (parent) to params * of slave objects (one-to-many mapping as multiple * slave params can be associated with the same preset * param */ vector > slave_param_indices_rep; /** * maps preset's public params 1...N (parent) to slave * objects (see slave_param_indices_rep) */ vector* > > slave_param_objects_rep; vector gctrls_rep; vector pardesclist_rep; bool parsed_rep; std::string parse_string_rep; std::string name_rep; std::string description_rep; }; #endif /* INCLUDED_PRESET_IMPL_H */ ecasound-2.9.3/libecasound/eca-fileio-mmap.h0000644000076400007640000000324510664032032015645 00000000000000#ifndef INCLUDED_FILEIO_MMAP_H #define INCLUDED_FILEIO_MMAP_H #include #include "eca-fileio.h" #ifndef MAP_FAILED #define MAP_FAILED ((__ptr_t) -1) #endif #if !defined _CADDR_T && !defined __USE_BSD #define _CADDR_T typedef char* caddr_t; #endif /** * File-io and buffering using mmap for data transfers. */ class ECA_FILE_IO_MMAP : public ECA_FILE_IO { public: ECA_FILE_IO_MMAP(void); virtual ~ECA_FILE_IO_MMAP(void); // -- // Open/close routines // --- virtual void open_file(const std::string& fname, const std::string& fmode); virtual void open_stdin(void) { } virtual void open_stdout(void) { } virtual void open_stderr(void) { } virtual void close_file(void); // -- // Normal file operations // --- virtual void read_to_buffer(void* obuf, off_t bytes); virtual void write_from_buffer(void* obuf, off_t bytes); virtual void set_file_position(off_t newpos) { set_file_position(newpos,true); } virtual void set_file_position(off_t newpos, bool seek); virtual void set_file_position_advance(off_t fw); virtual void set_file_position_end(void); virtual off_t get_file_position(void) const; virtual off_t get_file_length(void) const; // -- // Status // --- virtual bool is_file_ready(void) const; virtual bool is_file_error(void) const; virtual bool is_file_ended(void) const; virtual off_t file_bytes_processed(void) const; virtual const std::string& file_mode(void) const { return(mode_rep); } private: int fd_rep; caddr_t buffer_repp; off_t bytes_rep; off_t fposition_rep; off_t flength_rep; bool file_ready_rep; bool file_ended_rep; std::string mode_rep; std::string fname_rep; }; #endif ecasound-2.9.3/libecasound/resource-file.cpp0000644000076400007640000001121710664032032016015 00000000000000// ------------------------------------------------------------------------ // resource-file.cpp: Generic resource file class // Copyright (C) 1999-2004,2007 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include "resource-file.h" #include "eca-logger.h" RESOURCE_FILE::RESOURCE_FILE(const std::string& resource_file) : resfile_rep(resource_file) { if (resfile_rep.size() > 0) load(); } RESOURCE_FILE::~RESOURCE_FILE(void) { } void RESOURCE_FILE::load(void) { ECA_LOG_MSG(ECA_LOGGER::functions, "Loading file " + resfile_rep + "."); lines_rep.resize(0); std::ifstream fin (resfile_rep.c_str()); if (fin) { std::string line; std::string first, second; while(getline(fin,line)) { if (line.size() > 0 && line[0] == '#') { lines_rep.push_back(line); continue; } std::string::size_type n = line.find_first_of("="); if (n == std::string::npos) n = line.find_first_of(" "); if (n == std::string::npos) { continue; } first = std::string(line, 0, n); second = std::string(line, n + 1, std::string::npos); /* step: combine multi-line values ending with '\' into * a single value for 'first' */ first = kvu_remove_surrounding_spaces(first); second = kvu_remove_surrounding_spaces(second); std::string::iterator p = second.end(); --p; while (second.begin() != second.end() && *p == '\\') { second.erase(p); lines_rep.push_back(line); if (getline(fin, line)) { line = kvu_remove_surrounding_spaces(line); second += line; p = second.end(); --p; } else break; } // std::cerr << "found key-value pair: " + // first + " = \"" + second + "\"." << std::endl; resmap_rep[first] = second; lines_rep.push_back(line); } } fin.close(); modified_rep = false; } void RESOURCE_FILE::save(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Saving file " + resfile_rep + "."); std::ofstream fout (resfile_rep.c_str(), std::ios::out | std::ios::trunc); if (fout) { std::vector::const_iterator p = lines_rep.begin(); while(p != lines_rep.end()) { if (p->size() > 0) { // cerr << "Writing line: " << *p << "." << endl; fout << *p << "\n"; } ++p; } } fout.close(); modified_rep = false; } std::vector RESOURCE_FILE::keywords(void) const { std::vector keys; std::map::const_iterator p; p = resmap_rep.begin(); while(p != resmap_rep.end()) { // cerr << "Adding keyword: " << p->first << "." << endl; keys.push_back(p->first); ++p; } return keys; } bool RESOURCE_FILE::boolean_resource(const std::string& tag) const { if (resource(tag) == "true") return true; return false; } bool RESOURCE_FILE::has(const std::string& tag) const { if (resmap_rep.find(tag) == resmap_rep.end()) return false; return true; } std::string RESOURCE_FILE::resource(const std::string& tag) const { if (has(tag) != true) return ""; // cerr << "Returning resource: " << resmap_rep[tag] << "." << endl; return resmap_rep[tag]; } void RESOURCE_FILE::resource(const std::string& tag, const std::string& value) { resmap_rep[tag] = value; bool found = false; std::vector::iterator p; p = lines_rep.begin(); while(p != lines_rep.end()) { std::string line = *p; if (line.size() > 0 && line[0] != '#') { std::string::size_type n = line.find_first_of("="); if (n == std::string::npos) n = line.find_first_of(" "); if (n != std::string::npos) { std::string first = kvu_remove_surrounding_spaces(std::string(line, 0, n)); if (first == tag) { *p = first + " = " + value; found = true; } } } ++p; } if (found != true) { lines_rep.push_back(tag + " = " + value); } modified_rep = true; } ecasound-2.9.3/libecasound/midi-cc.cpp0000644000076400007640000000715411034532045014564 00000000000000// ------------------------------------------------------------------------ // midi-cc.cpp: Interface to MIDI continuous controllers // Copyright (C) 1999,2001-2002,2005,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include // #include "eca-midi.h" #include "midi-client.h" #include "midi-server.h" #include "midi-cc.h" #include "eca-logger.h" CONTROLLER_SOURCE::parameter_t MIDI_CONTROLLER::value(double pos) { DBC_CHECK(server() != 0); parameter_t value_rep = init_value_rep; if (server() != 0) { if (trace_request_rep == true) { server()->add_controller_trace(channel_rep, controller_rep, static_cast(value_rep * 127.0)); trace_request_rep = false; } value_rep = static_cast(server()->last_controller_value(channel_rep, controller_rep)); value_rep /= 127.0; } return value_rep; } void MIDI_CONTROLLER::set_initial_value(parameter_t arg) { init_value_rep = arg; if (server() != 0) { server()->add_controller_trace(channel_rep, controller_rep, static_cast(init_value_rep * 127.0)); } else { /* add controller trace when server is available */ trace_request_rep = true; } } MIDI_CONTROLLER::MIDI_CONTROLLER(int controller_number, int midi_channel) : controller_rep(controller_number), channel_rep(midi_channel), init_value_rep(0.0), trace_request_rep(false) { } void MIDI_CONTROLLER::init(void) { MESSAGE_ITEM otemp; otemp << "MIDI-controller initialized using controller "; otemp.setprecision(0); otemp << controller_rep << " and channel " << channel_rep << "."; ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } void MIDI_CONTROLLER::set_parameter(int param, CONTROLLER_SOURCE::parameter_t value) { /* FIXME: we should really remove unused ctrl+channel traces */ switch (param) { case 1: controller_rep = static_cast(value); if (controller_rep < 0 || controller_rep > 127) { controller_rep = 1; ECA_LOG_MSG(ECA_LOGGER::info, "(midi-cc) Controller number must be a number between 0 and 127. Defaulting to controller 0"); } break; case 2: channel_rep = static_cast(value); if (channel_rep < 1 || channel_rep > 16) { channel_rep = 1; ECA_LOG_MSG(ECA_LOGGER::info, "(midi-cc) MIDI-channel must be a number between 1 and 16. Defaulting to channel 1."); } --channel_rep; /* map from 1...16 -> 0...15 */ break; } trace_request_rep = true; } CONTROLLER_SOURCE::parameter_t MIDI_CONTROLLER::get_parameter(int param) const { switch (param) { case 1: return static_cast(controller_rep); case 2: /* map from 0...15 -> 1...16 */ return static_cast(channel_rep + 1); } return 0.0; } ecasound-2.9.3/libecasound/audioio-wave.h0000644000076400007640000000672111166131303015312 00000000000000#ifndef INCLUDED_AUDIOIO_WAVE_H #define INCLUDED_AUDIOIO_WAVE_H #include #include #include #include "audioio-buffered.h" #include "samplebuffer.h" #include "eca-fileio.h" /** * Represents a RIFF WAVE -file (wav). * * This class currently supports only a limited set of features: * * Format 1 sample data: Pulse Code Modulation (PCM) Format * * Format 3 sample data: IEEE754 floats, range [-1, +1) * * - multiple channels are interleaved * * - 8, 16, 24 and 32 bit data supported * * - if more than 8 bits, least significant byte first as specified * in the stantard */ class WAVEFILE : public AUDIO_IO_BUFFERED { public: typedef struct { uint16_t format; uint16_t channels; uint32_t srate; uint32_t byte_second; uint16_t align; uint16_t bits; } RF; typedef struct { uint8_t sig[4]; uint32_t bsize; } RB; typedef struct { uint8_t id[4]; uint32_t size; uint8_t wname[4]; } RH; private: ECA_FILE_IO* fio_repp; RH riff_header_rep; RF riff_format_rep; long int data_start_position_rep; std::string mmaptoggle_rep; /** * Do a info query prior to actually opening the device. * * require: * !is_open() * * ensure: * !is_open() * fio == 0 */ void format_query(void) throw(AUDIO_IO::SETUP_ERROR&); enum Format_tags { unknown = (0x0000), pcm = (0x0001), adpcm = (0x0002), ieee_float = (0x0003), alaw = (0x0006), mulaw = (0x0007), oki_adpcm = (0x0010), ima_adpcm = (0x0011), digistd = (0x0015), digifix = (0x0016), dolby_ac2 = (0x0030), gsm610 = (0x0031), rockwell_adpcm = (0x003b), rockwell_digitalk = (0x003c), g721_adpcm = (0x0040), g728_celp = (0x0041), mpeg = (0x0050), mpeglayer3 = (0x0055), g726_adpcm = (0x0064), g722_adpcm = (0x0065) }; public: WAVEFILE (const std::string& name = ""); virtual ~WAVEFILE(void); virtual WAVEFILE* clone(void) const; virtual WAVEFILE* new_expr(void) const { return new WAVEFILE(); } virtual std::string name(void) const { return("RIFF wave file"); } virtual bool locked_audio_format(void) const { return(true); } virtual std::string parameter_names(void) const { return("filename,toggle_mmap"); } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const; virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; private: WAVEFILE(const WAVEFILE& x) { DBC_NEVER_REACHED(); } WAVEFILE& operator=(const WAVEFILE& x) { return(*this); } void update(void); void set_length_in_bytes(void); void read_riff_header (void) throw(AUDIO_IO::SETUP_ERROR&); bool next_riff_block(RB *t, off_t *offtmp); void read_riff_fmt(void) throw(AUDIO_IO::SETUP_ERROR&); void write_riff_header (void) throw(AUDIO_IO::SETUP_ERROR&); void write_riff_fmt(void); void write_riff_datablock(void); void update_riff_datablock(void); void find_riff_datablock (void) throw(AUDIO_IO::SETUP_ERROR&); bool find_block(const char* fblock, uint32_t *blksize); }; #endif ecasound-2.9.3/libecasound/audioio-db-buffer.h0000644000076400007640000000124211162535466016213 00000000000000#ifndef INCLUDED_AUDIOIO_DB_BUFFER_H #define INCLUDED_AUDIOIO_DB_BUFFER_H #include #include "audioio.h" class SAMPLE_BUFFER; /** * Buffer used between db server and client */ class AUDIO_IO_DB_BUFFER { public: ATOMIC_INTEGER readptr_rep; ATOMIC_INTEGER writeptr_rep; ATOMIC_INTEGER finished_rep; std::vector sbufs_rep; AUDIO_IO::Io_mode io_mode_rep; void reset(void); int read_space(void); int write_space(void); void advance_read_pointer(void); void advance_write_pointer(void); AUDIO_IO_DB_BUFFER(int number_of_buffers, long int buffersize, int channels); ~AUDIO_IO_DB_BUFFER(void); }; #endif ecasound-2.9.3/libecasound/audiofx_lv2.cpp0000644000076400007640000002500612331255134015477 00000000000000// ------------------------------------------------------------------------ // audiofx_lv2.cpp: Wrapper class for LV2 plugins // Copyright (C) 2011 Jeremy Salwen // Copyright (C) 2000-2004, 2011,2014 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #if ECA_USE_LIBLILV #include #include #include #include #include "samplebuffer.h" #include "audiofx_lv2.h" #include "audiofx_lv2_world.h" #include "eca-error.h" #include "eca-logger.h" EFFECT_LV2::EFFECT_LV2 (Lilv::Plugin pdesc) throw(ECA_ERROR&) :plugin_desc(pdesc) { bool inplacebroken=plugin_desc.has_feature(ECA_LV2_WORLD::InPlaceBrokenNode()); if (inplacebroken) { throw(ECA_ERROR("AUDIOFX_LV2", "Inplace-broken plugins not supported.")); } /* FIXME: strip linefeeds and other forbidden characters; write down to * to ECA_OBJECT docs what chars are allowed and what are not... */ Lilv::Node name(plugin_desc.get_name()); name_rep = string(name.as_string()); unique_rep = string(plugin_desc.get_uri().as_string()); Lilv::Node author(plugin_desc.get_author_name()); if(author) { maker_rep = string(author.as_string()); } else { maker_rep = string(); } buffer_repp = 0; init_ports(); } EFFECT_LV2::~EFFECT_LV2 (void) { release(); if (plugin_desc != 0) { for(unsigned int n = 0; n < plugins_rep.size(); n++) { lilv_instance_deactivate(plugins_rep[n]->me); lilv_instance_free(plugins_rep[n]->me); delete plugins_rep[n]; } } } std::string EFFECT_LV2::description(void) const { return name_rep + " - Author: '" + maker_rep + "'"; } void EFFECT_LV2::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { DBC_CHECK(param >= 0); DBC_CHECK(param <= static_cast(param_descs_rep.size())); *pd = param_descs_rep[param - 1]; } EFFECT_LV2* EFFECT_LV2::clone(void) const { EFFECT_LV2* result = new EFFECT_LV2(plugin_desc); for(int n = 0; n < number_of_params(); n++) { result->set_parameter(n + 1, get_parameter(n + 1)); } return result; } void EFFECT_LV2::init_ports(void) throw(ECA_ERROR&) { // note: run from plugin constructor port_count_rep = plugin_desc.get_num_ports(); in_audio_ports = 0; out_audio_ports = 0; for(unsigned long m = 0; m < port_count_rep; m++) { Lilv::Port port=plugin_desc.get_port_by_index(m); if(port.is_a(ECA_LV2_WORLD::AudioClassNode())) { if(port.is_a(ECA_LV2_WORLD::InputClassNode())) { ++in_audio_ports; } else if (port.is_a(ECA_LV2_WORLD::OutputClassNode())) { ++out_audio_ports; } } else if (port.is_a(ECA_LV2_WORLD::ControlClassNode())) { struct PARAM_DESCRIPTION pd; parse_parameter_hint_information(plugin_desc,port, &pd); params.push_back(pd.default_value); param_descs_rep.push_back(pd); if (params.size() > 1) param_names_rep += ","; string tmp (kvu_string_search_and_replace(string(pd.description), ",", "\\,")); param_names_rep += kvu_string_search_and_replace(tmp, ":", "\\:"); } else if(!port.has_property(ECA_LV2_WORLD::PortConnectionOptionalNode())){ throw(ECA_ERROR("AUDIOFX_LV2", "Plugin has required ports which are not audio or control ports.")); } } } void EFFECT_LV2::parse_parameter_hint_information(Lilv::Plugin plugin, Lilv::Port p, struct PARAM_DESCRIPTION *pd) { /* if srate not set, use 44.1kHz (used only for calculating * param hint values */ SAMPLE_SPECS::sample_rate_t srate = samples_per_second(); /* FIXME: this is just ugly! */ if (srate <= 0) { srate = 44100; } Lilv::Node name=p.get_name(); /* parameter name */ pd->description =name.as_string(); Lilv::Node deflt(NULL); Lilv::Node min(NULL); Lilv::Node max(NULL); lilv_port_get_range(plugin.me,p.me,&deflt.me,&min.me,&max.me); bool isSRRelative=p.has_property(ECA_LV2_WORLD::PortSamplerateDependentNode()); /* upper and lower bounds */ if (min) { pd->bounded_below = true; pd->lower_bound=min.as_float(); if (isSRRelative) { pd->lower_bound *= srate; } } else { pd->bounded_below = false; } if (max) { pd->bounded_above = true; pd->upper_bound=max.as_float(); if (isSRRelative) { pd->upper_bound *= srate; } } else { pd->bounded_above = false; } /* defaults - case 1 */ if (deflt) { pd->default_value=deflt.as_float(); } /* defaults - case 2 */ else if (min && !max) { if (pd->lower_bound < 0) pd->default_value = 0.0f; else pd->default_value = pd->lower_bound; } /* defaults - case 3 */ else if (!min && max) { if (pd->upper_bound > 0) pd->default_value = 0.0f; else pd->default_value = pd->upper_bound; } /* defaults - case 4 */ else if (max && min) { if (pd->lower_bound < 0 && pd->upper_bound > 0) pd->default_value = 0.0f; else if (pd->lower_bound < 0 && pd->upper_bound < 0) pd->default_value = pd->upper_bound; else pd->default_value = pd->lower_bound; } /* defaults - case 5 */ else { DBC_CHECK(!min && !max); if (isSRRelative) pd->default_value = srate; else pd->default_value = 1.0f; } if (p.has_property(ECA_LV2_WORLD::PortToggledNode())) pd->toggled = true; else pd->toggled = false; if (p.has_property(ECA_LV2_WORLD::PortIntegerNode())) pd->integer = true; else pd->integer = false; if (p.has_property(ECA_LV2_WORLD::PortLogarithmicNode())) pd->logarithmic = true; else pd->logarithmic = false; if (p.is_a(ECA_LV2_WORLD::OutputClassNode())) pd->output = true; else pd->output = false; } void EFFECT_LV2::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { if (param > 0 && (param - 1 < static_cast(params.size()))) { // cerr << "lv2: setting param " << param << " to " << value << "." << endl; params[param - 1] = value; } } CHAIN_OPERATOR::parameter_t EFFECT_LV2::get_parameter(int param) const { if (param > 0 && (param - 1 < static_cast(params.size()))) { // cerr << "lv2: getting param " << param << " with value " << params[param - 1] << "." << endl; return(params[param - 1]); } return(0.0); } int EFFECT_LV2::output_channels(int i_channels) const { // note: We have two separate cases: either one plugin // is instantiated for each channel, or one plugin // per chain. See EFFECT_LV2::init(). if (in_audio_ports > 1 || out_audio_ports > 1) { return out_audio_ports; } return i_channels; } void EFFECT_LV2::init(SAMPLE_BUFFER *insample) { EFFECT_BASE::init(insample); DBC_CHECK(samples_per_second() > 0); if (buffer_repp != insample) { release(); buffer_repp = insample; buffer_repp->get_pointer_reflock(); } if (plugin_desc != 0) { for(unsigned int n = 0; n < plugins_rep.size(); n++) { lilv_instance_deactivate(plugins_rep[n]->me); lilv_instance_free(plugins_rep[n]->me); delete plugins_rep[n]; } plugins_rep.clear(); } DBC_CHECK(plugins_rep.size() == 0); if (in_audio_ports > 1 || out_audio_ports > 1) { //Just insert into the first location plugins_rep.push_back(Lilv::Instance::create(plugin_desc,samples_per_second(),NULL)); int inport = 0; int outport = 0; for(unsigned long m = 0; m < port_count_rep; m++) { Lilv::Port p= plugin_desc.get_port_by_index(m); if (p.is_a(ECA_LV2_WORLD::AudioClassNode())) { if (p.is_a(ECA_LV2_WORLD::InputClassNode())) { if (inport < channels()) { plugins_rep[0]->connect_port(m, buffer_repp->buffer[inport]); } ++inport; } else if(p.is_a(ECA_LV2_WORLD::OutputClassNode())) { if (outport < channels()) { plugins_rep[0]->connect_port(m, buffer_repp->buffer[outport]); } ++outport; } } } if (inport > channels()) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: chain has less channels than plugin has input ports (" + name() + ")."); if (outport > channels()) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: chain has less channels than plugin has output ports (" + name() + ")."); } else { for(int n = 0; n < channels(); n++) { plugins_rep.push_back(Lilv::Instance::create(plugin_desc,samples_per_second(),NULL)); for(unsigned long m = 0; m < port_count_rep; m++) { Lilv::Port p= plugin_desc.get_port_by_index(m); if (p.is_a(ECA_LV2_WORLD::AudioClassNode())) { plugins_rep[n]->connect_port(m,buffer_repp->buffer[n]); } } } } ECA_LOG_MSG(ECA_LOGGER::system_objects, "Instantiated " + kvu_numtostr(plugins_rep.size()) + " LV2 plugin(s), each with " + kvu_numtostr(in_audio_ports) + " audio input port(s) and " + kvu_numtostr(out_audio_ports) + " output port(s), to chain with " + kvu_numtostr(channels()) + " channel(s) and srate of " + kvu_numtostr(samples_per_second()) + "."); int data_index = 0; for(unsigned long m = 0; m < port_count_rep; m++) { Lilv::Port p=plugin_desc.get_port_by_index(m); if (p.is_a(ECA_LV2_WORLD::ControlClassNode())) { for(unsigned int n = 0; n < plugins_rep.size(); n++) { plugins_rep[n]->connect_port(m,&(params[data_index])); } ++data_index; } } for(unsigned long m = 0; m < plugins_rep.size(); m++) plugins_rep[m]->activate(); } void EFFECT_LV2::release(void) { if (buffer_repp != 0) { buffer_repp->release_pointer_reflock(); } buffer_repp = 0; } void EFFECT_LV2::process(void) { for(unsigned long m = 0; m < plugins_rep.size(); m++) lilv_instance_run(plugins_rep[m]->me, buffer_repp->length_in_samples()); } #endif /* ECA_USE_LIBLILV */ ecasound-2.9.3/libecasound/two-stage-linear-envelope.h0000644000076400007640000000165511034531732017723 00000000000000#ifndef INCLUDED_TWO_STAGE_LINEAR_ENVELOPE_H #define INCLUDED_TWO_STAGE_LINEAR_ENVELOPE_H #include #include "ctrl-source.h" /** * Two-stage linear envelope */ class TWO_STAGE_LINEAR_ENVELOPE : public CONTROLLER_SOURCE { public: std::string name(void) const { return("Two-stage linear envelope"); } virtual parameter_t value(double pos_secs); virtual void set_initial_value(parameter_t arg) {} virtual void init(void); std::string parameter_names(void) const { return("1st-stage-sec,2nd-stage-sec"); } void set_parameter(int param, parameter_t value); parameter_t get_parameter(int param) const; TWO_STAGE_LINEAR_ENVELOPE(void); TWO_STAGE_LINEAR_ENVELOPE* clone(void) const { return new TWO_STAGE_LINEAR_ENVELOPE(*this); } TWO_STAGE_LINEAR_ENVELOPE* new_expr(void) const { return new TWO_STAGE_LINEAR_ENVELOPE(); } private: parameter_t first_stage_length_rep, second_stage_length_rep; }; #endif ecasound-2.9.3/libecasound/audiofx_rcfilter.cpp0000644000076400007640000001012211755701413016604 00000000000000// ------------------------------------------------------------------------ // audiofx_rcfilter.cpp: Simulation of an 3rd-order 36dB active RC-lowpass // Copyright (C) 2000 Stefan Fendt, Kai Vehmanen (C++ version) // Copyright (C) 2012 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "samplebuffer_iterators.h" #include "eca-logger.h" #include "audiofx_rcfilter.h" EFFECT_RC_LOWPASS_FILTER::EFFECT_RC_LOWPASS_FILTER (CHAIN_OPERATOR::parameter_t cutoff, CHAIN_OPERATOR::parameter_t resonance) { set_parameter(1, cutoff); set_parameter(2, resonance); } void EFFECT_RC_LOWPASS_FILTER::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: cutoff_rep = value; break; case 2: resonance_rep = value; break; } } CHAIN_OPERATOR::parameter_t EFFECT_RC_LOWPASS_FILTER::get_parameter(int param) const { switch (param) { case 1: return(cutoff_rep); case 2: return(resonance_rep); } return(0.0); } static void priv_resize_buffer(std::vector *buffer, int count, SAMPLE_SPECS::sample_t value) { buffer->resize(count); for(int i = 0; i < count; i++) (*buffer)[i] = value; } void EFFECT_RC_LOWPASS_FILTER::init(SAMPLE_BUFFER *insample) { i.init(insample); priv_resize_buffer(&lp1_old, insample->number_of_channels(), 0.0015); priv_resize_buffer(&lp2_old, insample->number_of_channels(), -0.00067); priv_resize_buffer(&lp3_old, insample->number_of_channels(), 0.0); priv_resize_buffer(&hp1_old, insample->number_of_channels(), 0.0); priv_resize_buffer(&feedback, insample->number_of_channels(), 0.0); } void EFFECT_RC_LOWPASS_FILTER::process(void) { i.begin(); while(!i.end()) { output_temp = *i.current(); output_temp += (feedback[i.channel()] * resonance_rep); // -- // The two lines above prevent the filter from clipping if it is // self-oscillating. This is necessary for a good simulation because // real analouge RC-filters can't clip when oscillating, too. Clipping // used to simulate saturation of an amp (as many TB-303-emulators do) // is dissatisfying ! We should use an Amp-simulation instead to avoid // digital clipping ... if (output_temp > SAMPLE_SPECS::impl_max_value) output_temp = SAMPLE_SPECS::impl_max_value; else if (output_temp < SAMPLE_SPECS::impl_min_value) output_temp = SAMPLE_SPECS::impl_min_value; // -- // Ok, this is the first step of the filter. We simulate an simple // non-active RC-lowpass ... lp1_old[i.channel()] = output_temp * cutoff_rep + lp1_old[i.channel()] * (1.0 - cutoff_rep); lp2_old[i.channel()] = lp1_old[i.channel()] * cutoff_rep + lp2_old[i.channel()] * (1.0 - cutoff_rep); lp3_old[i.channel()] = lp2_old[i.channel()] * cutoff_rep + lp3_old[i.channel()] * (1.0 - cutoff_rep); // -- // A simple non-active highpass hp1_old[i.channel()] = output_temp - lp3_old[i.channel()]; // -- // Now we add a feedback of this bandpass-filtered signal to the // input of the filter again. (Look some lines above for that!) feedback[i.channel()] = hp1_old[i.channel()]; // -- // We catch the out-value of the filter after the second lp-filter // this provides 24-db filtering even with moderate resonance. *i.current() = lp3_old[i.channel()]; i.next(); } } ecasound-2.9.3/libecasound/eca-chainsetup.h0000644000076400007640000003533112260762753015630 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup.h: Class representing an ecasound chainsetup object. // Copyright (C) 1999-2004,2006,2013 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_CHAINSETUP_H #define INCLUDED_ECA_CHAINSETUP_H #include #include #include #include #include "eca-chainsetup-position.h" #include "eca-chainsetup-parser.h" #include "eca-chainsetup-edit.h" #include "eca-error.h" class AUDIO_IO; class AUDIO_IO_MANAGER; class AUDIO_IO_DB_SERVER; class CHAIN; class CHAIN_OPERATOR; class CONTROLLER_SOURCE; class ECA_AUDIO_FORMAT; class ECA_CHAINSETUP_BUFPARAMS; class ECA_CHAINSETUP_impl; class ECA_ENGINE_DRIVER; class ECA_RESOURCES; class GENERIC_CONTROLLER; class LOOP_DEVICE; class MIDI_IO; class MIDI_SERVER; using std::map; using std::list; using std::string; using std::vector; /** * Class representing an ecasound chainsetup object. * * Chainsetup is the central data object. It contains * audio inputs, outputs, chains, operators and also * information about how they are connected. * * Notes: ECA_CHAINSETUP is closely coupled to the * ECA_CHAINSETUP_PARSER and ECA_ENGINE. * In addition, to ease implementation, * also ECA_CONTROL classes have direct access * to ECA_CHAINSETUP's implementation. * * @author Kai Vehmanen */ class ECA_CHAINSETUP : public ECA_CHAINSETUP_POSITION { public: friend class ECA_ENGINE; friend class ECA_CONTROL; friend class ECA_CONTROL_BASE; friend class ECA_CONTROL_OBJECTS; friend class ECA_CHAINSETUP_PARSER; // ------------------------------------------------------------------- /** @name Public type definitions and constants */ /*@{*/ enum Buffering_mode { cs_bmode_auto, cs_bmode_nonrt, cs_bmode_rt, cs_bmode_rtlowlatency, cs_bmode_none }; enum Mix_mode { cs_mmode_avg, cs_mmode_sum }; enum Audio_dir { cs_dir_input, cs_dir_output }; typedef enum Buffering_mode Buffering_mode_t; typedef enum Mix_mode Mix_mode_t; static const string default_audio_format_const; static const string default_bmode_nonrt_const; static const string default_bmode_rt_const; static const string default_bmode_rtlowlatency_const; /*@}*/ // ------------------------------------------------------------------- /** @name Functions for init and cleanup */ /*@{*/ ECA_CHAINSETUP(void); ECA_CHAINSETUP(const vector& options); ECA_CHAINSETUP(const string& setup_file); virtual ~ECA_CHAINSETUP(void); /*@}*/ // ------------------------------------------------------------------- /** @name Functions for handling audio objects */ /*@{*/ void add_input(AUDIO_IO* aiod); void add_output(AUDIO_IO* aiod, bool truncate); void add_default_output(void); void remove_audio_input(const AUDIO_IO* aobj); void remove_audio_output(const AUDIO_IO* aobj); void attach_input_to_selected_chains(const AUDIO_IO* obj); void attach_output_to_selected_chains(const AUDIO_IO* obj); bool ok_audio_object(const AUDIO_IO* aobj) const; bool is_realtime_target_output(int output_id) const; vector audio_input_names(void) const; vector audio_output_names(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Functions for handling chains */ /*@{*/ void add_default_chain(void); void add_new_chains(const vector& newchains); void remove_chains(void); void select_chains(const vector& chainsarg) { selected_chainids = chainsarg; } void select_all_chains(void); void clear_chains(void); void rename_chain(const string& name); void toggle_chain_muting(void); void toggle_chain_bypass(void); const vector& selected_chains(void) const { return selected_chainids; } unsigned int first_selected_chain(void) const; vector chain_names(void) const; vector get_attached_chains_to_iodev(const string& filename) const; const CHAIN* get_chain_with_name(const string& name) const; int get_chain_index(const string& name) const; /*@}*/ // ------------------------------------------------------------------- /** @name Functions for handling MIDI-objects */ /*@{*/ void add_midi_device(MIDI_IO* mididev); void remove_midi_device(const string& name); void add_default_midi_device(void); /*@}*/ // ------------------------------------------------------------------- /** @name Functions for chain operators */ /*@{*/ void add_chain_operator(CHAIN_OPERATOR* cotmp); void add_controller(GENERIC_CONTROLLER* csrc); void set_target_to_controller(void); /*@}*/ // ------------------------------------------------------------------- /** @name Functions for configuration (default values, settings) */ /*@{*/ void toggle_precise_sample_rates(bool value) { precise_sample_rates_rep = value; } void toggle_ignore_xruns(bool v) { ignore_xruns_rep = v; } void set_output_openmode(int value) { output_openmode_rep = value; } void set_default_audio_format(ECA_AUDIO_FORMAT& value); void set_default_midi_device(const string& name) { default_midi_device_rep = name; } void set_buffering_mode(Buffering_mode_t value); void set_audio_io_manager_option(const string& mgrname, const string& optionstr); void set_mix_mode(Mix_mode_t value) { mix_mode_rep = value; } bool precise_sample_rates(void) const { return precise_sample_rates_rep; } bool ignore_xruns(void) const { return ignore_xruns_rep; } const ECA_AUDIO_FORMAT& default_audio_format(void) const; const string& default_midi_device(void) const { return default_midi_device_rep; } int output_openmode(void) const { return output_openmode_rep; } Buffering_mode_t buffering_mode(void) const { return buffering_mode_rep; } bool is_valid_for_connection(bool verbose) const; bool multitrack_mode(void) const { return multitrack_mode_rep; } long int multitrack_mode_offset(void) const { return multitrack_mode_offset_rep; } Mix_mode_t mix_mode(void) const { return mix_mode_rep; } /*@}*/ // ------------------------------------------------------------------- /** @name Functions for overriding current buffering mode parameters */ /*@{*/ void set_buffersize(long int value); void toggle_raised_priority(bool value); void set_sched_priority(int value); void toggle_double_buffering(bool value); void set_double_buffer_size(long int v); void toggle_max_buffers(bool v); long int buffersize(void) const; bool raised_priority(void) const; int get_sched_priority(void) const; bool double_buffering(void) const; long int double_buffer_size(void) const; bool max_buffers(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Functions that modify current state */ /*@{*/ void set_name(const string& str) { setup_name_rep = str; } void set_filename(const string& str) { setup_filename_rep = str; } void enable(void) throw(ECA_ERROR&); void disable(void); const string& name(void) const { return setup_name_rep; } const string& filename(void) const { return setup_filename_rep; } bool execute_edit(const ECA::chainsetup_edit_t& edit); /*@}*/ // ------------------------------------------------------------------- /** @name Functions implemented from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ // ------------------------------------------------------------------- /** @name Functions implemented from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ // ------------------------------------------------------------------- /** @name Functions for observing current state */ /*@{*/ /** * Checks whether chainsetup is enabled (devices ready for use). */ bool is_enabled(void) const { return is_enabled_rep; } /** * Checks whether chainsetup is locked by ECA_ENGINE. * If locked, only a limited access to the chainsetup * data is allowed. */ bool is_locked(void) const { return is_locked_rep; } bool is_valid(void) const; bool has_realtime_objects(void) const; bool has_nonrealtime_objects(void) const; string options_to_string(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Functions for string->state conversions */ /*@{*/ /** * Returns the result of last call to interpret_option(), interpret_global_option() * or interpret_object_option(). * * @result true if options interpreted successfully, otherwise false */ bool interpret_result(void) const { return cparser_rep.interpret_result(); } const string& interpret_result_verbose(void) const { return cparser_rep.interpret_result_verbose(); } void interpret_option(const string& arg); void interpret_global_option(const string& arg); void interpret_object_option(const string& arg); void interpret_options(const vector& opts); /*@}*/ // ------------------------------------------------------------------- /** @name Functions for string<->state conversions */ /*@{*/ void save(void) throw(ECA_ERROR&); void save_to_file(const string& filename) throw(ECA_ERROR&); /*@}*/ // ------------------------------------------------------------------- private: /** @name Configuration data (settings and values) */ /*@{*/ ECA_CHAINSETUP_impl* impl_repp; ECA_CHAINSETUP_PARSER cparser_rep; bool precise_sample_rates_rep; bool ignore_xruns_rep; bool rtcaps_rep; int output_openmode_rep; long int double_buffer_size_rep; string default_midi_device_rep; /*@}*/ // ------------------------------------------------------------------- /** @name Current setup data (internal state, objects) */ /*@{*/ bool is_locked_rep; bool is_enabled_rep; bool multitrack_mode_rep; bool multitrack_mode_override_rep; bool memory_locked_rep; bool midi_server_needed_rep; /* FIXME: only needed by ECA_ENGINE */ int selected_chain_index_rep; int selected_cop_index_rep; int selected_cop_param_index_rep; int selected_ctrl_index_rep; int selected_ctrl_param_index_rep; int db_clients_rep; long int multitrack_mode_offset_rep; string setup_name_rep; string setup_filename_rep; vector selected_chainids; map loop_map; vector input_start_pos; vector output_start_pos; Buffering_mode_t buffering_mode_rep; Buffering_mode_t active_buffering_mode_rep; Mix_mode_t mix_mode_rep; vector inputs; vector inputs_direct_rep; vector outputs; vector outputs_direct_rep; vector aio_managers_rep; map aio_manager_option_map_rep; vector chains; vector midi_devices; AUDIO_IO_DB_SERVER* pserver_repp; MIDI_SERVER* midi_server_repp; ECA_ENGINE_DRIVER* engine_driver_repp; /*@}*/ // ------------------------------------------------------------------- /** @name Functions for handling audio objects */ /*@{*/ AUDIO_IO_MANAGER* get_audio_object_manager(AUDIO_IO* aio) const; AUDIO_IO_MANAGER* get_audio_object_type_manager(AUDIO_IO* aio) const; void register_engine_driver(AUDIO_IO_MANAGER* amgr); void register_audio_object_to_manager(AUDIO_IO* aio); void unregister_audio_object_from_manager(AUDIO_IO* aio); void propagate_audio_io_manager_options(void); AUDIO_IO* add_audio_object_helper(AUDIO_IO* aio); void remove_audio_object_proxy(AUDIO_IO* aio); void remove_audio_object_loop(const AUDIO_IO* aobj, AUDIO_IO* loop_aio, int dir); void remove_audio_object_impl(const AUDIO_IO* aobj, int dir, bool destroy); // ------------------------------------------------------------------- /** @name Functions for state<->string conversions */ /*@{*/ void load_from_file(const string& filename, vector& opts) const throw(ECA_ERROR&); /*@}*/ // ------------------------------------------------------------------- /** @name Functions for internal state changes */ /*@{*/ void select_active_buffering_mode(void); void enable_active_buffering_mode(void); void switch_to_direct_mode(void); void switch_to_direct_mode_helper(vector* objs, const vector& directobjs); void switch_to_db_mode(void); void switch_to_db_mode_helper(vector* objs, const vector& directobjs); void lock_all_memory(void); void unlock_all_memory(void); void set_defaults (void); int number_of_realtime_inputs(void) const; int number_of_realtime_outputs(void) const; int number_of_non_realtime_inputs(void) const; int number_of_non_realtime_outputs(void) const; int number_of_chain_operators(void) const; void toggle_locked_state(bool value) { is_locked_rep = value; } long int check_for_locked_buffersize(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Private helper functions */ /*@{*/ const ECA_CHAINSETUP_BUFPARAMS& active_buffering_parameters(void) const; const ECA_CHAINSETUP_BUFPARAMS& override_buffering_parameters(void) const; vector get_attached_chains_to_input(AUDIO_IO* aiod) const; vector get_attached_chains_to_output(AUDIO_IO* aiod) const; int number_of_attached_chains_to_input(AUDIO_IO* aiod) const; int number_of_attached_chains_to_output(AUDIO_IO* aiod) const; void add_chain_helper(const string& name); void enable_audio_object_helper(AUDIO_IO* aobj) const; void calculate_processing_length(void); /*@}*/ // ------------------------------------------------------------------- /** @name Static private helper functions */ /*@{*/ static bool ok_audio_object_helper(const AUDIO_IO* aobj, const vector& aobjs); static void check_object_samplerate(const AUDIO_IO* obj, SAMPLE_SPECS::sample_rate_t srate) throw(ECA_ERROR&); static string set_resource_helper(const ECA_RESOURCES& ecaresources, const string& tag, const string& alternative); static void audio_object_open_info(const AUDIO_IO* aio); /*@}*/ }; #endif ecasound-2.9.3/libecasound/eca-operator.h0000644000076400007640000000426610664032032015305 00000000000000#ifndef INCLUDED_OPERATOR_H #define INCLUDED_OPERATOR_H #include "sample-specs.h" #include "dynamic-object.h" /** * All ecasound objects which can be used as targets * for dynamic control, are called operators. * * @author Kai Vehmanen */ class OPERATOR : public DYNAMIC_OBJECT { public: typedef SAMPLE_SPECS::sample_t parameter_t; /** * Structure describing one operator parameter. */ struct PARAM_DESCRIPTION { /** * A reasonable default value. */ parameter_t default_value; /** * Parameter description. */ std::string description; /** * Is parameter bounded above? */ bool bounded_above; /** * If 'bounded_above', contains the bound value. */ parameter_t upper_bound; /** * Is parameter bounded below? */ bool bounded_below; /** * If 'bounded_below', contains the bound value. */ parameter_t lower_bound; /** * Whether parameter should be treated as a boolean toggle? * Parameter value of less than or equal to zero (x <= 0) should * be considered `off' or `false,' and value above zero (x > 0) * should be considered `on' or `true. */ bool toggled; /** * Parameter value is best represented as an integer. */ bool integer; /** * Value range from lower_bound to upper_bound is best * represented on a logarithmic scale. */ bool logarithmic; /** * Parameter value can change during operation. This * makes it possible to have separate parameters for * storing processing results. */ bool output; }; /** * An optional function for querying parameter descriptions. * This is meant primarily for building generic user-interfaces. * It's important to note that these values only serve as hints, * they are not meant to be absolute. * * @param param parameter id * @pre param > 0 && param <= number_of_params() */ virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual OPERATOR* clone(void) const = 0; virtual OPERATOR* new_expr(void) const = 0; virtual ~OPERATOR (void); }; #endif ecasound-2.9.3/libecasound/eca-control-main.h0000644000076400007640000001027411762413277016066 00000000000000// ------------------------------------------------------------------------ // eca-control-main.h: ECA_CONTROL_MAIN class // Copyright (C) 2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_CONTROL_MAIN_H #define INCLUDED_ECA_CONTROL_MAIN_H #include #include #include "eca-chainsetup-edit.h" struct eci_return_value { enum { retval_none = 0, retval_string_list, retval_string, retval_float, retval_integer, retval_long_integer, retval_error } type; std::vector string_list_val; std::string string_val; union { double float_val; int int_val; long int long_int_val; } m; }; /** * High-level interface for using libecasound functionality * * This class is the abstract interface. Actual implementations * are done in subclasses - e.g. ECA_CONTROL and * ECA_CONTROL_MT (multi-threaded). * * Related design patters: Facade (GoF185) */ class ECA_CONTROL_MAIN { public: /** @name Constructors and dtors */ /*@{*/ virtual ~ECA_CONTROL_MAIN(void); /*@}*/ // ------------------------------------------------------------------- /** @name Runtime control */ /*@{*/ virtual void engine_start(void) = 0; virtual int start(void) = 0; virtual void stop(void) = 0; virtual void stop_on_condition(void) = 0; virtual int run(bool batchmode = true) = 0; virtual void quit(void) = 0; virtual void quit_async(void) = 0; virtual bool is_running(void) const = 0; virtual bool is_connected(void) const = 0; virtual bool is_selected(void) const = 0; virtual bool is_finished(void) const = 0; virtual bool is_valid(void) const = 0; virtual bool is_engine_created(void) const = 0; virtual bool is_engine_ready_for_commands(void) const = 0; virtual const ECA_CHAINSETUP* get_connected_chainsetup(void) const = 0; virtual void connect_chainsetup(struct eci_return_value *retval) = 0; virtual void disconnect_chainsetup(void) = 0; /*@}*/ // ------------------------------------------------------------------- /** @name Execute edit objects */ /*@{*/ virtual bool execute_edit_on_connected(const ECA::chainsetup_edit_t& edit) = 0; virtual bool execute_edit_on_selected(const ECA::chainsetup_edit_t& edit, int index = -1) = 0; /*@}*/ /** @name Building blocks for ECI -Ecasound Control Interface */ /*@{*/ /** * Parses and executes a string containing a single Ecasound * Interactive Mode (EIAM) command and its arguments. * * Result of the command is stored to 'retval'. */ virtual void command(const std::string& cmd_and_args, struct eci_return_value *retval) = 0; /** * A special version of 'command()' which parses a command taking * a single double parameter. * * Result of the command is stored to 'retval'. */ virtual void command_float_arg(const std::string& cmd, double arg, struct eci_return_value *retval) = 0; virtual void print_last_value(struct eci_return_value *retval) const = 0; /*@}*/ // ------------------------------------------------------------------- /** @name Static helper functions */ /*@{*/ static std::string return_value_to_string(const struct eci_return_value *retval, int float_precision = 9); static const char* return_value_type_to_string(const struct eci_return_value *retval); static void clear_return_value(struct eci_return_value *retval); /*@}*/ // ------------------------------------------------------------------- }; #endif /* INCLUDED_ECA_CONTROL_MAIN_H */ ecasound-2.9.3/libecasound/eca-fileio-stream.h0000644000076400007640000000252210664032032016203 00000000000000#ifndef INCLUDED_FILEIO_STREAM_H #define INCLUDED_FILEIO_STREAM_H #include #include #include "eca-fileio.h" /** * File-I/O and buffering routines using normal file streams. */ class ECA_FILE_IO_STREAM : public ECA_FILE_IO { public: ECA_FILE_IO_STREAM (void) { } virtual ~ECA_FILE_IO_STREAM(void); // -- // Open/close routines // --- virtual void open_file(const std::string& fname, const std::string& fmode); virtual void open_stdin(void); virtual void open_stdout(void); virtual void open_stderr(void); virtual void close_file(void); // -- // Normal file operations // --- virtual void read_to_buffer(void* obuf, off_t bytes); virtual void write_from_buffer(void* obuf, off_t bytes); virtual void set_file_position(off_t newpos); virtual void set_file_position_advance(off_t fw); virtual void set_file_position_end(void); virtual off_t get_file_position(void) const; virtual off_t get_file_length(void) const; // -- // Status // --- virtual bool is_file_ready(void) const; virtual bool is_file_error(void) const; virtual off_t file_bytes_processed(void) const; virtual const std::string& file_mode(void) const { return(mode_rep); } private: FILE *f1; off_t curpos_rep; off_t last_rep; std::string mode_rep; std::string fname_rep; bool standard_mode; }; #endif ecasound-2.9.3/libecasound/audioio-db-server_impl.h0000644000076400007640000000164010664032032017256 00000000000000#ifndef INCLUDED_AUDIOIO_DB_SERVER_IMPL_H #define INCLUDED_AUDIOIO_DB_SERVER_IMPL_H #include #include class AUDIO_IO_DB_SERVER_impl { public: friend class AUDIO_IO_DB_SERVER; private: pthread_t io_thread_rep; pthread_cond_t client_cond_rep; pthread_mutex_t client_mutex_rep; pthread_cond_t data_cond_rep; pthread_mutex_t data_mutex_rep; pthread_cond_t full_cond_rep; pthread_mutex_t full_mutex_rep; pthread_cond_t stop_cond_rep; pthread_mutex_t stop_mutex_rep; pthread_cond_t flush_cond_rep; pthread_mutex_t flush_mutex_rep; size_t profile_full_rep; size_t profile_no_processing_rep; size_t profile_not_full_anymore_rep; size_t profile_processing_rep; size_t profile_read_xrun_danger_rep; size_t profile_write_xrun_danger_rep; size_t profile_rounds_total_rep; PROCEDURE_TIMER looptimer_rep; }; #endif /* INCLUDED_AUDIOIO_DB_SERVER_IMPL_H */ ecasound-2.9.3/libecasound/audioio-aac.h0000644000076400007640000000447011141362354015100 00000000000000#ifndef INCLUDED_AUDIOIO_AAC_H #define INCLUDED_AUDIOIO_AAC_H #include #include #include "audioio-buffered.h" #include "audioio-forked-stream.h" /** * Interface to FAAC/FAAD encoder and decoder using UNIX pipe i/o. * * @author Kai Vehmanen */ class AAC_FORKED_INTERFACE : public AUDIO_IO_BUFFERED, public AUDIO_IO_FORKED_STREAM { private: static std::string default_input_cmd; static std::string default_output_cmd; public: static void set_input_cmd(const std::string& value); static void set_output_cmd(const std::string& value); public: AAC_FORKED_INTERFACE (const std::string& name = ""); virtual ~AAC_FORKED_INTERFACE(void); virtual AAC_FORKED_INTERFACE* clone(void) const { return new AAC_FORKED_INTERFACE(*this); } virtual AAC_FORKED_INTERFACE* new_expr(void) const { return new AAC_FORKED_INTERFACE(*this); } virtual std::string name(void) const { return("AAC stream"); } virtual std::string description(void) const { return("Interface to FAAC/FAAD encoder and decoder using UNIX pipe i/o."); } virtual std::string parameter_names(void) const { return("label"); } virtual bool locked_audio_format(void) const { return true; } virtual int supported_io_modes(void) const { return (io_read | io_write); } virtual bool supports_seeking(void) const { return false; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const { return(finished_rep); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; virtual void start_io(void); virtual void stop_io(void); // -- // Realtime related functions // -- protected: /* functions called by AUDIO_IO_FORKED_STREAM that require * the use of AUDIO_IO methods */ virtual bool do_supports_seeking(void) const { return supports_seeking(); } virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { set_position_in_samples(pos); } private: bool triggered_rep; bool finished_rep; long int bytes_rep; int filedes_rep; FILE* f1_rep; void fork_input_process(void); void fork_output_process(void); }; #endif ecasound-2.9.3/libecasound/eca-control-base.cpp0000644000076400007640000004224711762412271016405 00000000000000// ------------------------------------------------------------------------ // eca-control-base.cpp: Base class providing basic functionality // for controlling the ecasound library // Copyright (C) 1999-2004,2006,2008,2009,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include #include "eca-engine.h" #include "eca-session.h" #include "eca-chainsetup.h" #include "eca-resources.h" #include "eca-control.h" #include "eca-error.h" #include "eca-logger.h" /** * Import namespaces */ using std::list; using std::string; using std::vector; /** * Definitions for member functions */ /** * Helper function for starting the slave thread. */ void* ECA_CONTROL::start_normal_thread(void *ptr) { ECA_CONTROL* ctrl_base = static_cast(ptr); ctrl_base->engine_pid_rep = getpid(); DBC_CHECK(ctrl_base->engine_pid_rep >= 0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Engine thread started with pid: " + kvu_numtostr(ctrl_base->engine_pid_rep)); ctrl_base->run_engine(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Engine thread " + kvu_numtostr(ctrl_base->engine_pid_rep) + " will exit.\n"); ctrl_base->engine_pid_rep = -1; return 0; } /** * Initializes the engine * * @pre is_connected() == true * @pre is_engine_created() != true */ void ECA_CONTROL::engine_start(void) { // -------- DBC_REQUIRE(is_connected() == true); DBC_REQUIRE(is_engine_created() != true); // -------- start_engine_sub(false); } /** * Start the processing engine * * @pre is_connected() == true * @pre is_running() != true * @post is_engine_created() == true * * @return negative on error, zero on success */ int ECA_CONTROL::start(void) { // -------- DBC_REQUIRE(is_connected() == true); DBC_REQUIRE(is_running() != true); // -------- int result = 0; ECA_LOG_MSG(ECA_LOGGER::subsystems, "Controller/Processing started"); if (is_engine_created() != true) { /* request_batchmode=false */ start_engine_sub(false); } if (is_engine_created() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "Can't start processing: couldn't start engine."); result = -1; } else { engine_repp->command(ECA_ENGINE::ep_start, 0.0); } // -------- DBC_ENSURE(result != 0 || is_engine_created() == true); // -------- return result; } /** * Starts the processing engine and blocks until * processing is finished. * * @param batchmode if true, runs until finished/stopped state is reached, and * then returns; if false, will run infinitely * * @pre is_connected() == true * @pre is_running() != true * @post is_finished() == true || * processing_started == true && is_running() != true || * processing_started != true && * (is_engine_created() != true || * is_engine_created() == true && * engine_repp->status() != ECA_ENGINE::engine_status_stopped)) * * @return negative on error, zero on success */ int ECA_CONTROL::run(bool batchmode) { // -------- DBC_REQUIRE(is_connected() == true); DBC_REQUIRE(is_running() != true); // -------- ECA_LOG_MSG(ECA_LOGGER::subsystems, "Controller/Starting batch processing"); bool processing_started = false; int result = -1; if (is_engine_created() != true) { /* request_batchmode=true */ start_engine_sub(batchmode); } if (is_engine_created() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "Can't start processing: couldn't start the engine. (2)"); } else { engine_repp->command(ECA_ENGINE::ep_start, 0.0); DBC_CHECK(is_finished() != true); result = 0; /* run until processing is finished; in batchmode run forever (or * until error occurs) */ while(is_finished() != true || batchmode != true) { /* sleep for 250ms */ kvu_sleep(0, 250000000); if (processing_started != true) { if (is_running() == true || is_finished() == true || engine_exited_rep.get() == 1) { /* make a note that engine state changed to 'running' */ processing_started = true; } else if (is_engine_created() == true) { if (engine_repp->status() == ECA_ENGINE::engine_status_error) { /* not running, so status() is either 'not_ready' or 'error' */ ECA_LOG_MSG(ECA_LOGGER::info, "Can't start processing: engine startup failed. (3)"); result = -2; break; } /* other valid state alternatives: */ DBC_CHECK(engine_repp->status() == ECA_ENGINE::engine_status_stopped || engine_repp->status() == ECA_ENGINE::engine_status_notready); } else { /* ECA_CONTROL_BASE destructor has been run and * engine_repp is now 0 (--> is_engine_created() != true) */ break; } } else { /* engine was started successfully (processing_started == true) */ if (is_running() != true) { /* operation successfully completed, exit from run() unless * infinite operation is requested (batchmode) */ if (batchmode == true) break; } } } } if (last_exec_res_rep < 0) { /* error occured during processing */ result = -3; } ECA_LOG_MSG(ECA_LOGGER::subsystems, std::string("Controller/Batch processing finished (") + kvu_numtostr(result) + ")"); // -------- DBC_ENSURE(is_finished() == true || (processing_started == true && is_running()) != true || (processing_started != true && (is_engine_created() != true || (is_engine_created() == true && engine_repp->status() != ECA_ENGINE::engine_status_stopped)))); // -------- return result; } /** * Stops the processing engine. * * @see stop_on_condition() * * @pre is_engine_created() == true * @post is_running() == false */ void ECA_CONTROL::stop(void) { // -------- DBC_REQUIRE(is_engine_created() == true); // -------- ECA_LOG_MSG(ECA_LOGGER::subsystems, "Controller/Processing stopped"); engine_repp->command(ECA_ENGINE::ep_stop, 0.0); // -------- // ensure: // assert(is_running() == false); // -- there's a small timeout so assertion cannot be checked // -------- } /** * Stop the processing engine using thread-to-thread condition * signaling. * * @pre is_engine_created() == true * @post is_running() == false */ void ECA_CONTROL::stop_on_condition(void) { // -------- DBC_REQUIRE(is_engine_created() == true); // -------- ECA_LOG_MSG(ECA_LOGGER::subsystems, "Controller/Processing stopped (cond)"); engine_repp->command(ECA_ENGINE::ep_stop, 0.0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Received stop-cond"); // -- // blocks until engine has stopped (or 5 sec has passed); engine_repp->wait_for_stop(5); // -------- DBC_ENSURE(is_running() == false); // -------- } /** * Stops the processing engine. * Call will block until engine has terminated. */ void ECA_CONTROL::quit(void) { close_engine(); } /** * Stops the processing engine. A thread-safe variant of * quit(). Call will not block. * */ void ECA_CONTROL::quit_async(void) { if (is_engine_ready_for_commands() != true) return; engine_repp->command(ECA_ENGINE::ep_exit, 0.0); } /** * Starts the processing engine. * * @pre is_connected() == true * @pre is_engine_ready_for_commands() != true */ void ECA_CONTROL::start_engine_sub(bool batchmode) { // -------- DBC_REQUIRE(is_connected() == true); DBC_REQUIRE(is_engine_ready_for_commands() != true); // -------- DBC_CHECK(engine_exited_rep.get() != 1); unsigned int p = session_repp->connected_chainsetup_repp->first_selected_chain(); if (p < session_repp->connected_chainsetup_repp->chains.size()) session_repp->connected_chainsetup_repp->selected_chain_index_rep = p; if (engine_repp) close_engine(); DBC_CHECK(is_engine_created() != true); engine_repp = new ECA_ENGINE (session_repp->connected_chainsetup_repp); DBC_CHECK(is_engine_created() == true); /* to relay the batchmode parameter to created new thread */ req_batchmode_rep = batchmode; pthread_attr_t th_attr; pthread_attr_init(&th_attr); int retcode_rep = pthread_create(&th_cqueue_rep, &th_attr, start_normal_thread, static_cast(this)); if (retcode_rep != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Unable to create a new thread for engine."); ECA_ENGINE *engine_tmp = engine_repp; engine_repp = 0; delete engine_tmp; } DBC_ENSURE(is_engine_created() == true); } /** * Routine used for launching the engine. */ void ECA_CONTROL::run_engine(void) { last_exec_res_rep = 0; last_exec_res_rep = engine_repp->exec(req_batchmode_rep); engine_exited_rep.set(1); } /** * Closes the processing engine. * * ensure: * is_engine_created() != true * is_engine_ready_for_commands() != true */ void ECA_CONTROL::close_engine(void) { if (is_engine_created() != true) return; engine_repp->command(ECA_ENGINE::ep_exit, 0.0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Waiting for engine thread to exit."); if (joining_rep != true) { joining_rep = true; int res = pthread_join(th_cqueue_rep,NULL); joining_rep = false; ECA_LOG_MSG(ECA_LOGGER::system_objects, "pthread_join returned: " + kvu_numtostr(res)); } else { DBC_CHECK(engine_pid_rep >= 0); int i; for (i = 0; i < 30; i++) { if (engine_exited_rep.get() ==1) break; /* 100ms sleep */ kvu_sleep(0, 100000000); } ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: engine is stuck, sending SIGKILL."); DBC_CHECK(engine_pid_rep >= 0); /* note: we use SIGKILL as SIGTERM, SIGINT et al are blocked and * handled by the watchdog thread */ pthread_kill(th_cqueue_rep, SIGKILL); } if (engine_exited_rep.get() == 1) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Engine thread has exited successfully."); delete engine_repp; engine_repp = 0; engine_exited_rep.set(0); } else { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Problems while shutting down the engine!"); } // --- DBC_ENSURE(is_engine_created() != true); DBC_ENSURE(is_engine_ready_for_commands() != true); // --- } /** * Is currently selected chainsetup valid? * * @pre is_selected() */ bool ECA_CONTROL::is_valid(void) const { // -------- DBC_REQUIRE(is_selected()); // -------- /* use is_valid_for_connection() instead of is_valid() to * report any detected errors via the logging subsystem */ return selected_chainsetup_repp->is_valid_for_connection(true); } /** * Returns true if active chainsetup exists and is connected. */ bool ECA_CONTROL::is_connected(void) const { if (session_repp->connected_chainsetup_repp == 0) { return false; } return (session_repp->connected_chainsetup_repp->is_valid() && session_repp->connected_chainsetup_repp->is_enabled()); } /** * Returns true if some chainsetup is selected. */ bool ECA_CONTROL::is_selected(void) const { return selected_chainsetup_repp != 0; } /** * Returns true if processing engine is running. */ bool ECA_CONTROL::is_running(void) const { return (is_engine_created() == true && engine_repp->status() == ECA_ENGINE::engine_status_running); } /** * Returns true if engine has finished processing. Engine state is * either "finished" or "error". */ bool ECA_CONTROL::is_finished(void) const { return (is_engine_created() == true && (engine_repp->status() == ECA_ENGINE::engine_status_finished || engine_repp->status() == ECA_ENGINE::engine_status_error)); } string ECA_CONTROL::resource_value(const string& key) const { ECA_RESOURCES ecarc; return ecarc.resource(key); } /** * Returns the length of the selected chainsetup (in samples). * * @pre is_selected() == true */ SAMPLE_SPECS::sample_pos_t ECA_CONTROL::length_in_samples(void) const { // -------- DBC_REQUIRE(is_selected()); // -------- SAMPLE_SPECS::sample_pos_t cslen = 0; if (selected_chainsetup_repp->length_set() == true) { cslen = selected_chainsetup_repp->length_in_samples(); } if (selected_chainsetup_repp->max_length_set() == true) { cslen = selected_chainsetup_repp->max_length_in_samples(); } return cslen; } /** * Returns the length of the selected chainsetup (in seconds). * * @pre is_selected() == true */ double ECA_CONTROL::length_in_seconds_exact(void) const { // -------- DBC_REQUIRE(is_selected()); // -------- double cslen = 0.0f; if (selected_chainsetup_repp->length_set() == true) { cslen = selected_chainsetup_repp->length_in_seconds_exact(); } if (selected_chainsetup_repp->max_length_set() == true) { cslen = selected_chainsetup_repp->max_length_in_seconds_exact(); } return cslen; } /** * Returns the current position of the selected chainsetup (in samples). * * @pre is_selected() == true */ SAMPLE_SPECS::sample_pos_t ECA_CONTROL::position_in_samples(void) const { // -------- DBC_REQUIRE(is_selected()); // -------- return selected_chainsetup_repp->position_in_samples(); } /** * Returns the current position of the selected chainsetup (in seconds). * * @pre is_selected() == true */ double ECA_CONTROL::position_in_seconds_exact(void) const { // -------- DBC_REQUIRE(is_selected()); // -------- return selected_chainsetup_repp->position_in_seconds_exact(); } /** * Returns true if engine object has been created. * If true, the engine object is available for use, but * the related engine thread is not necessarily running. * * @see is_engine_ready_for_commands() */ bool ECA_CONTROL::is_engine_created(void) const { return (engine_repp != 0); } /** * Returns true if engine is running and ready to receive * control commands via the message queue. * * In practise running means that the engine thread * has been created and it is running the exec() method * of the engine. * * @see is_engine_created() */ bool ECA_CONTROL::is_engine_ready_for_commands(void) const { bool started = is_engine_created(); if (started != true) return false; /* note: has been started, but run_engine() has returned */ if (engine_pid_rep < 0) return false; DBC_CHECK(engine_repp != 0); if (engine_repp->status() == ECA_ENGINE::engine_status_notready) return false; return true; } /** * Return info about engine status. */ string ECA_CONTROL::engine_status(void) const { if (is_engine_created() == true) { switch(engine_repp->status()) { case ECA_ENGINE::engine_status_running: { return "running"; } case ECA_ENGINE::engine_status_stopped: { return "stopped"; } case ECA_ENGINE::engine_status_finished: { return "finished"; } case ECA_ENGINE::engine_status_error: { return "error"; } case ECA_ENGINE::engine_status_notready: { return "not ready"; } default: { return "unknown status"; } } } return "not started"; } void ECA_CONTROL::set_last_string(const list& s) { string s_rep; DBC_CHECK(s_rep.size() == 0); list::const_iterator p = s.begin(); while(p != s.end()) { s_rep += *p; ++p; if (p != s.end()) s_rep += "\n"; } set_last_string(s_rep); } void ECA_CONTROL::set_last_string_list(const vector& s) { last_retval_rep.type = eci_return_value::retval_string_list; last_retval_rep.string_list_val = s; } void ECA_CONTROL::set_last_string(const string& s) { last_retval_rep.type = eci_return_value::retval_string; last_retval_rep.string_val = s; } void ECA_CONTROL::set_last_float(double v) { last_retval_rep.type = eci_return_value::retval_float; last_retval_rep.m.float_val = v; } void ECA_CONTROL::set_last_integer(int v) { last_retval_rep.type = eci_return_value::retval_integer; last_retval_rep.m.int_val = v; } void ECA_CONTROL::set_last_long_integer(long int v) { last_retval_rep.type = eci_return_value::retval_long_integer; last_retval_rep.m.long_int_val = v; } void ECA_CONTROL::set_last_error(const string& s) { last_retval_rep.type = eci_return_value::retval_error; last_retval_rep.string_val = s; } string ECA_CONTROL::last_error(void) const { if (last_retval_rep.type == eci_return_value::retval_error) return last_retval_rep.string_val; return string(); } void ECA_CONTROL::clear_last_values(void) { ECA_CONTROL_MAIN::clear_return_value(&last_retval_rep); } void ECA_CONTROL::set_float_to_string_precision(int precision) { float_to_string_precision_rep = precision; } std::string ECA_CONTROL::float_to_string(double n) const { return kvu_numtostr(n, float_to_string_precision_rep); } ecasound-2.9.3/libecasound/eca-control-dump.h0000644000076400007640000000642510664032032016074 00000000000000#ifndef INCLUDED_ECA_CONTROL_DUMP_H #define INCLUDED_ECA_CONTROL_DUMP_H #include #include class ECA_CONTROL; /** * Class for dumping status information to a standard output stream. * @author Kai Vehmanen */ class ECA_CONTROL_DUMP { public: // -- // Global info // -- /** * Dumps engine status - 'running', 'stopped', 'finished' or 'notready'. */ void dump_status(void); /** * Dumps the global position. Printed in seconds using a floating-point * representation. */ void dump_position(void); /** * Dumps the overall processing length. Printed in seconds using a floating-point * representation. */ void dump_length(void); // -- // Chainsetups and chains // -- /** * Dumps status std::string for the currently selected chainsetup - 'connected', * 'selected' or an empty std::string. */ void dump_chainsetup_status(void); /** * Dumps the name of currently selected chain. */ void dump_selected_chain(void); // -- // Audio objects // -- /** * Dumps label of currently selected audio input. If no * input is selected, dumps an empty std::string. */ void dump_selected_audio_input(void); /** * Dumps position of currently selected audio input. * Printed in seconds, using a floating-point representation. */ void dump_audio_input_position(void); /** * Dumps length of currently selected audio input. * Printed in seconds, using a floating-point representation. */ void dump_audio_input_length(void); /** * Dumps audio input state info. Either 'open' or 'closed'. */ void dump_audio_input_open_state(void); /** * Dumps label of currently selected audio output. If no * output is selected, dumps an empty std::string. */ void dump_selected_audio_output(void); /** * Dumps position of currently selected audio outputs. * Printed in seconds, using a floating-point representation. */ void dump_audio_output_position(void); /** * Dumps length of currently selected audio output. * Printed in seconds, using a floating-point representation. */ void dump_audio_output_length(void); /** * Dumps audio output state info. Either 'open' or 'closed'. */ void dump_audio_output_open_state(void); // -- // Chain operators // -- /** * Dumps chain operator parameter value * * @param chainop operator index 1...n * @param param parameter index 1...n */ void dump_chain_operator_value(int chainop, int param); /** * Set target stream for dumping. */ void set_dump_target(std::ostream* target) { dostream_repp = target; internal_rep = false; } /** * Set target stream for dumping. */ void set_dump_target(const std::string& filename) { dostream_repp = new std::ofstream(filename.c_str()); internal_rep = true; } /** * Class constructor */ ECA_CONTROL_DUMP (ECA_CONTROL* ctrl) : ctrl_repp(ctrl), dostream_repp(&std::cout), internal_rep(false) { } /** * Virtual destructor */ ~ECA_CONTROL_DUMP (void) { if (internal_rep == true) delete dostream_repp; } private: ECA_CONTROL* ctrl_repp; std::ostream* dostream_repp; bool internal_rep; void dump(const std::string& key, const std::string& value) { *dostream_repp << key << " " << value << std::endl; } }; #endif ecasound-2.9.3/libecasound/eca-session_test.h0000644000076400007640000000372011166145462016200 00000000000000// ------------------------------------------------------------------------ // eca-session_test.h: Unit test for ECA_SESSION // Copyright (C) 2003,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "kvu_utils.h" /* kvu_sleep() */ #include "eca-control.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_SESSION. * * FIXME: implementation not ready */ class ECA_SESSION_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for ECA_SESSION"); } virtual void do_run(void); public: virtual ~ECA_SESSION_TEST(void) { } private: void do_run_chainsetup_creation(void); }; void ECA_SESSION_TEST::do_run(void) { cout << "libecasound_tester: eca-session - exception test" << endl; COMMAND_LINE cmdline; cmdline.push_back("-d:511"); cmdline.push_back("-i:invalidinvalidinvalid"); bool exceptionseen = false; try { ECA_SESSION *esession = new ECA_SESSION(cmdline); delete esession; } catch(...) { cerr << "libecasound_tester: catched exception" << endl; exceptionseen = true; } if (exceptionseen != true) { ECA_TEST_FAILURE("No exception raised when parsing an invalid chainsetup."); } } ecasound-2.9.3/libecasound/audioio-proxy.h0000644000076400007640000000770011433043167015536 00000000000000#ifndef INCLUDED_AUDIO_IO_PROXY_H #define INCLUDED_AUDIO_IO_PROXY_H #include #include "audioio.h" #include "audioio-barrier.h" class SAMPLE_BUFFER; /** * Generic interface for objects that act as * proxies for other objects of type AUDIO_IO. * * Related design patterns: * - Proxy (GoF207 * * Guide lines for subclassing: * - reimplement (or explicitly use the existing implementation) * all public getter and setter functions * -> rationale: otherwise the class might return invalid * data not related to the proxied child object, or setting * parameters never affect the proxy target * * @author Kai Vehmanen */ class AUDIO_IO_PROXY : public AUDIO_IO, public AUDIO_IO_BARRIER { public: /** @name Public functions */ /*@{*/ AUDIO_IO_PROXY (void); virtual ~AUDIO_IO_PROXY(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return(string("Proxy => ") + child_repp->name()); } virtual std::string description(void) const { return(child_repp->description()); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual bool variable_params(void) const { return true; } virtual std::string parameter_names(void) const; virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_IO_PROXY* clone(void) const { return(new AUDIO_IO_PROXY()); } virtual AUDIO_IO_PROXY* new_expr(void) const { return(new AUDIO_IO_PROXY()); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos) { return child_repp->seek_position(pos); } virtual bool supports_seeking(void) const { return child_repp->supports_seeking(); } virtual bool supports_seeking_sample_accurate(void) const { return child_repp->supports_seeking_sample_accurate(); } /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return(child_repp->supported_io_modes()); } virtual bool supports_nonblocking_mode(void) const { return(child_repp->supports_nonblocking_mode()); } virtual bool finite_length_stream(void) const { return( child_repp->finite_length_stream()); } virtual bool locked_audio_format(void) const { return(child_repp->locked_audio_format()); } virtual void set_buffersize(long int samples); virtual long int buffersize(void) const { return(buffersize_rep); } virtual void read_buffer(SAMPLE_BUFFER* sbuf) { child_repp->read_buffer(sbuf); } virtual void write_buffer(SAMPLE_BUFFER* sbuf) { child_repp->write_buffer(sbuf); } virtual bool finished(void) const { return(child_repp->finished()); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_FORMAT */ /*@{*/ virtual void set_channels(SAMPLE_SPECS::channel_t v); virtual void set_sample_format(Sample_format v) throw(ECA_ERROR&); virtual void set_audio_format(const ECA_AUDIO_FORMAT& f_str); virtual void toggle_interleaved_channels(bool v); /*@}*/ /** @name Reimplemented functions from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ /** @name Reimplemented functions from AUDIO_IO_BARRIER */ /*@{*/ virtual void start_io(void); virtual void stop_io(void); /*@}*/ protected: void set_child(AUDIO_IO* v); void release_child_no_delete(void); void pre_child_open(void); void post_child_open(void); bool is_child_initialized(void) const { return child_initialized_rep; } std::string child_params_as_string(int first, std::vector* params); AUDIO_IO* child(void) const { return child_repp; } private: AUDIO_IO* child_repp; long int buffersize_rep; bool child_initialized_rep; }; #endif // INCLUDED_AUDIO_IO_PROXY ecasound-2.9.3/libecasound/osc-gen.cpp0000644000076400007640000001600611747065162014622 00000000000000// ------------------------------------------------------------------------ // osc-gen.cpp: Generic oscillator // Copyright (C) 1999-2002,2008,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include "eca-object-factory.h" #include "osc-gen.h" #include "oscillator.h" #include "eca-logger.h" /* For hunting bugs in envelope code */ //#define DEBUG_ENVELOPE_POINTS #ifdef DEBUG_ENVELOPE_POINTS #define _DEBUG_ENVELOPE(x) do { x; } while(0) #include #else #define _DEBUG_ENVELOPE(x) #endif size_t GENERIC_OSCILLATOR::current_stage(double pos) { size_t start, n; // note: like 'std::fmod(pos, loop_length_rep)' but faster double loop_pos = pos - static_cast(pos / loop_length_rep) * loop_length_rep; // note: optimize for the case where position changes // linearly start = last_stage_rep; for(n = start;;) { double pos_scaled = loop_pos / loop_length_rep; double p1 = envtable_rep[n].pos; double p2 = envtable_rep[n + 1].pos; _DEBUG_ENVELOPE(std::cout << "looking for stage " + kvu_numtostr(n) + ", stages " + kvu_numtostr(envtable_rep.size()) + ", pos " + kvu_numtostr(pos) + ", looppos " + kvu_numtostr(loop_pos) + ", scaled " + kvu_numtostr(pos_scaled) + ", p1 " + kvu_numtostr(p1) + ", p2 " + kvu_numtostr(p2) << "\n"); if (pos_scaled >= p1 && pos_scaled < p2) { _DEBUG_ENVELOPE(std::cout << "found stage " + kvu_numtostr(n) << "\n"); last_pos_scaled_rep = pos_scaled; break; } n++; if (n + 1 == envtable_rep.size()) n = 0; if (n == start) { static bool once = true; if (once) { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: invalid envelop"); once = false; } break; } } _DEBUG_ENVELOPE(if (last_stage_rep != n) { \ std::cout << "stage change from " \ << kvu_numtostr(last_stage_rep) \ <<" to " << kvu_numtostr(n) << "\n"; } ); last_stage_rep = n; return n; } CONTROLLER_SOURCE::parameter_t GENERIC_OSCILLATOR::value(double pos) { size_t stage = current_stage(pos); double retval = 0.0f; /* case: hold/step */ if (mode_rep == 0) { retval = envtable_rep[stage].val; _DEBUG_ENVELOPE(std::cout << "hold value " << retval << ", stage " << stage << "\n"); } /* case: linear interpolation */ else { double p1 = envtable_rep[stage].pos; double p2 = envtable_rep[stage + 1].pos; double v1 = envtable_rep[stage].val; double v2 = envtable_rep[stage + 1].val; double mult = 1.0 - ((p2 - last_pos_scaled_rep) / (p2 - p1)); retval = v1 + (mult * (v2 - v1)); _DEBUG_ENVELOPE(std::cout << "linear value " << retval << ", stage " << stage << ", v1 " << v1 << ", v2 " << v2 << ", scaledpos " << last_pos_scaled_rep << "\n"); } return retval; } GENERIC_OSCILLATOR::GENERIC_OSCILLATOR(double freq, int mode) : OSCILLATOR(freq, 0.0) { last_stage_rep = 0; set_param_count(0); set_parameter(1, get_parameter(1)); set_parameter(2, mode); } void GENERIC_OSCILLATOR::init(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Generic oscillator init with params: " + ECA_OBJECT_FACTORY::operator_parameters_to_eos(this)); if (envtable_rep.size() < 2) envtable_rep.resize(2); } GENERIC_OSCILLATOR::~GENERIC_OSCILLATOR (void) { } void GENERIC_OSCILLATOR::set_param_count(int params) { param_names_rep = "freq,mode,pcount,start_val,end_val"; if (params > 0) { for(int n = 0; n < params; n++) { std::string num = kvu_numtostr(n + 1); param_names_rep += ",pos"; param_names_rep += num; param_names_rep += ",val"; param_names_rep += num; } } } std::string GENERIC_OSCILLATOR::parameter_names(void) const { return param_names_rep; } void GENERIC_OSCILLATOR::prepare_envelope(void) { size_t len = 2 + (params_rep.size() + 1) / 2; envtable_rep.resize(len); envtable_rep[0].pos = 0.0; envtable_rep[0].val = first_value_rep; size_t n = 0; size_t p1_offset = 1; size_t p_end_offset = params_rep.size() / 2 + p1_offset; for(; n < params_rep.size(); n++) { envtable_rep[n / 2 + p1_offset].pos = params_rep[n]; if (++n == params_rep.size()) break; envtable_rep[n / 2 + p1_offset].val = params_rep[n]; } DBC_CHECK(p_end_offset < envtable_rep.size()); envtable_rep[p_end_offset].pos = 1.0; envtable_rep[p_end_offset].val = last_value_rep; } void GENERIC_OSCILLATOR::set_parameter(int param, CONTROLLER_SOURCE::parameter_t value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "setting param " + kvu_numtostr(param) + " (" + get_parameter_name(param) + ")" + " => " + kvu_numtostr(value)); switch (param) { case 1: frequency(value); loop_length_rep = 1.0f / frequency(); // length of one wave in seconds break; case 2: mode_rep = static_cast(value); break; case 3: set_param_count(static_cast(value)); break; case 4: first_value_rep = value; break; case 5: last_value_rep = value; break; default: { int pointnum = param - 5; if (pointnum > 0) { if (pointnum > static_cast(params_rep.size())) params_rep.resize(pointnum); params_rep[pointnum - 1] = value; } prepare_envelope(); break; } } } CONTROLLER_SOURCE::parameter_t GENERIC_OSCILLATOR::get_parameter(int param) const { switch (param) { case 1: return frequency(); case 2: return static_cast(mode_rep); case 3: return static_cast((number_of_params() - 5) / 2); case 4: return static_cast(first_value_rep); case 5: return static_cast(last_value_rep); default: int pointnum = param - 5; if (pointnum > 0) { if (pointnum <= static_cast(params_rep.size())) { return static_cast(params_rep[pointnum - 1]); } } } return 0.0; } ecasound-2.9.3/libecasound/eca-version.cpp0000644000076400007640000000050010664032032015455 00000000000000#ifdef HAVE_CONFIG_H #include #endif #include "eca-version.h" const long int ecasound_library_version_current = LIBECASOUND_VERSION; const long int ecasound_library_version_revision = 0; const long int ecasound_library_version_age = LIBECASOUND_VERSION_AGE; const char* ecasound_library_version = VERSION; ecasound-2.9.3/libecasound/ChangeLog0000644000076400007640000014771411762640642014347 000000000000002012-06-03 Kai Vehmanen * library interface version 24:0:0 frozen (2.9.0 release) 2012-04-14 Kai Vehmanen * modifications to classes, ABI change * library interface version to 24:0:0 2012-04-13 Kai Vehmanen ============================================================= NOTE: as ecasound has full git/VCS history, tracking of added/removed functions will be stopped in this file and in the future it is only recorded when the library API has changed (details will be in git) ============================================================= 2012-04-09 Kai Vehmanen * eca-engine.h (ECA_ENGINE): added is_started() * eca-control-main.h (ECA_CONTROL_MAIN): added is_started() * library interface version to 24:0:1 2011-05-11 Kai Vehmanen * library interface version 23:0:0 frozen (2.8.0 release) 2011-05-04 Kai Vehmanen * eca-engine.h (Engine_command): added 'ep_stop_with_drain' 2011-05-02 Kai Vehmanen * audioio-device.h (stop): add drain parameter * library interface version to 23:0:0 2009-10-17 Kai Vehmanen * library interface version 22:0:0 frozen (2.7.0 release) 2009-10-04 Kai Vehmanen * samplebuffer_functions.h (is_almost_equal): Added parameters. New signature still source-compatible with the old one. 2009-04-18 Kai Vehmanen * eca-control-base.h: File removed, ECA_CONTROL_BASE combined into ECA_CONTROL and defined in eca-control.h. * eca-control-objects.h: File removed, ECA_CONTROL_OBJECTS combined into ECA_CONTROL and defined in eca-control.h. * eca-control-main.h: File added. A new abstract interface class defining a minimal public interface to ECA_CONTROL. * eca-control-mt.h: File added. * eca-control.h: Updated signature for command() and command_float_arg(). * eca-control.h: Moved various members functions, not part of the functionality set defined by ECA_CONTROL_MAIN, to private visibility scope. 2009-04-13 Kai Vehmanen * eca-chainsetup.h: Added get_chain_index(). * eca-control-objects.h: get_connected_chainsetup() added. * eca-chain.h: New signature for set_parameter(). * eca-engine.h: Added new type ECA_ENGINE::complex_command_t and new enum type ECA_ENGINE::ep_exec_edit. Removed enum types ECA_ENGINE::ep_ctrl_* and ECA_ENGINE::ep_cop_*. 2009-04-12 Kai Vehmanen * eca-chain.h: Added member function number_of_chain_operator_parameters(). * eca-osc.h: File added. 2009-04-10 Kai Vehmanen * audiofx_amplitude.h: Added EFFECT_AMPLIFY::process_ref(), EFFECT_AMPLIFY_DB::process_ref(), EFFECT_AMPLIFY_CHANNEL::process_ref() and EFFECT_NORMAL_PAN::process_ref(). * samplebuffer_functions.h: Added fill_with_random_samples(), is_almost_equal(). 2009-04-04 Kai Vehmanen * samplebuffer.h: Added member functions multiply_by() (two overloaded versions). * samplebuffer.h: Added unoptimized member funcs make_silent_range_ref(), add_matching_channels_ref(), multiply_by_ref(), divide_by_ref(), make_silent_ref(), limit_values_ref(). 2009-03-28 Kai Vehmanen * samplebuffer.h: Added overloaded make_silent(int channel). 2009-03-24 Kai Vehmanen * eca-control-base.cpp: Removed is_engine_started() and replaced it with is_engine_created() that has slightly different semantics. * eca-control-base.h: Added is_engine_running(). 2009-03-23 Kai Vehmanen * samplebuffer.h: copy_range() now requires the object channel counts to match. 2009-03-22 Kai Vehmanen * samplebuffer.h: Renamed copy() member function into copy_matching_channels() to more accurately describe the semantics. * samplebuffer.h: Renamed add() into add_matching_channels(). * samplebuffer.h: Added copy_all_content(). * samplebuffer.h: Added event_tag_set(), event_tag_test(), event_tags_set(), event_tags_add() and event_tags_clear() member functions. Added new Tag_name enum type. * library interface version to 22:0:0 2009-03-21 Kai Vehmanen * samplebuffer_iterators.h: Added optional second argument to SAMPLE_ITERATOR_CHANNEL::init() and an overloaded version of SAMPLE_ITERATOR_CHANNEL::begin(). 2009-02-08 Kai Vehmanen * library interface version 21:0:1 frozen (2.6.0 release) 2009-02-02 Kai Vehmanen * eca-object-map.h (toggle_case_sensitive_expressions, case_sensitive_expressions): Member functions added. 2009-01-31 Kai Vehmanen * eca-test-case.h (run): A new overloaded function taking a string argument added. * eca-chainsetup-parser.h (interpret_audio_format): Corrected function signature, may throw an exception. 2008-09-28 Kai Vehmanen * eca-logger.h (ECA_LOG_MSG_NOPREFIX): Added. 2008-09-21 Kai Vehmanen * eca-chainsetup-parser.cpp (interpret_options): Now takes a const vector. * eca-chainsetup.cpp (interpret_options): Now takes a const vector. 2008-08-20 Kai Vehmanen * jack-connection.h (file added): * library interface version to 21:0:1. 2008-08-21 Kai Vehmanen * library interface version 20 frozen (2.5.1 release) 2008-08-20 Kai Vehmanen * eca-control-base.cpp (quit_async added): * library interface version to 20:0:0. 2008-08-16 Kai Vehmanen * library interface version 19 frozen (2.5.0 release) * audioio-loop.h (id): Renamed to tag(). 2008-07-13 Kai Vehmanen * eca-chainsetup.cpp (audio_object_open_info): Renamed from audio_object_info and moved to private scope. * eca-object-factory.cpp (audio_object_format_to_eos): Added. 2008-07-08 Kai Vehmanen * ctrl-source.h: Major refactoring. No longer inherits ECA_AUDIO_POSITION. * generic-controller.h: Now inherits ECA_AUDIO_POSITION. 2008-07-06 Kai Vehmanen * eca-audio-time.h (valid): Added. * eca-audio-time.h (mark_as_invalid): Added. 2008-07-02 Kai Vehmanen * eca-audio-position.h (seek_position): Moved to protected scope. The signature and the call semantics were also changed. All classed inhering from ECA_AUDIO_POSITION need to be updated. * eca-audio-position.h (supports_seeking, supports_seeking_sample_accurate): Added as pure virtual methods. * audioio.h (supports_seeking_sample_accurate): Added as implemented inherited method. 2008-03-11 Kai Vehmanen * dynamic-parameters.h (variable_params): Added. 2008-03-10 Kai Vehmanen * eca-audio-time.h: Modified constructor variants. Added sample_rate as a parameter to most setter functions. * audioio-aac.h, audioio-flac.h, audioio-mikmod.h, audioio-ogg.h, audioio-timidity.h: Inheritance of AUDIO_IO_FORKED_STREAM changed from protected to public. * audioio-forked-stream.h (start_io,stop_io): Added new functions. Most of the other public functions moved to protected status. * audioio-forked-stream.h: Class now inherits AUDIO_IO_BARRIER. * audioio-barrier.h: File added. 2008-03-09 Kai Vehmanen * eca-audio-time.h: Added overloaded constructor that takes a std::string as parameter. * eca-audio-time.h (set_time_string): Added. * library interface version to 19:0:0. * audioio-tone.h: File added. * audioio-seqbase.h: File added. * audioio-acseq.h: File added. * audioio-ewf.h: Rebased implementation on the new AUDIO_SEQUENCER_BASE interface. 2007-08-14 Kai Vehmanen * library interface version 18 frozen (2.4.6 release) 2007-08-13 Kai Vehmanen * eca-resources.h: Added static member 'rc_override_file' of type std::string. 2007-08-12 Kai Vehmanen * samplebuffer.h: Added make_empty() and is_empty() public methods. * eca-chain.h: Added is_finished() and toggle_finished() methods. * library interface version to 18:0:0. 2006-12-07 Kai Vehmanen * library interface version 17 frozen (2.4.5 release) 2006-04-24 Kai Vehmanen * eca-control-base.cpp (start): Added non-void return value to report errors. 2006-04-20 Kai Vehmanen * audioio-forked-stream.h (clean_child): Added force argument. * eca-engine.h (exec): Added non-void return value to report exit status. * eca-control-base.h (run): Added non-void return value to report exit status. 2006-03-31 Kai Vehmanen * eca-chainsetup.h: Added enum 'Audio_dir'. * eca-chainsetup.h (remove_audio_object_impl): Added. * library interface version updated to 17:0:0 * eca-chainsetup.h: Renamed remove_audio_object_helper() to remove_audio_object_proxy(). 2006-01-27 Kai Vehmanen * library interface version 16 frozen (2.4.4 release) 2005-09-01 Kai Vehmanen * midi-server.h (add_controller_trace): Added optional 3rd argument. * ctrl-source.h (set_initial_value): Added. 2005-08-31 Kai Vehmanen * eca-object-factory.h (*_to_eos): Added. * eca-chain.cpp (chain_operator_to_string): Removed. * eca-chain.cpp (controller_to_string): Removed. * eca-chain.cpp (operator_params_to_string): Removed. * eca-chainsetup-parser.cpp (audioio_to_string): Removed. * library interface version updated to 16:0:0 2005-08-21 Kai Vehmanen * library interface version 15 frozen (2.4.3 release) 2005-08-20 Kai Vehmanen * midi-server.h: Added MIDI_SERVER::set_schedrealtime(). 2005-08-19 Pedro Lopez-Cabanillas * midiio-aseq.h: Added. * library interface version updated to 15:0:1 2005-08-07 Kai Vehmanen * eca-control-base.cpp (run): Added optional "batchmode" parameter. 2005-03-12 Kai Vehmanen * library interface version 14 frozen (2.4.0 release) 2004-12-21 Kai Vehmanen * eca-chainsetup.h (Mix_mode_t): Added. * eca-chainsetup.h (set_mix_mode, mix_mode): Added. 2004-12-12 Kai Vehmanen * eca-audio-format.h (format_string): Function signature changed; no longer throws an exception. * sample-specs.h: SAMPLE_SPECS::is_system_littleendian removed as obsolete. * eca-chainsetup.cpp (is_valid_for_connection): Function signature changed, added an argument. 2004-12-11 Kai Vehmanen * eca-logger-interface.cpp (set_backlog_length): Added. * eca-logger-interface.cpp (backlog): Added. * eca-logger.h (level_to_string): Added. * eca-engine-driver.h (exec): Signature changed. * library interface version to 14:0:0 2004-12-09 Kai Vehmanen * sample-ops_impl.h: Added, not part of the public interface. 2004-10-27 Kai Vehmanen * library interface version 13 frozen 2004-10-23 Kai Vehmanen * eca-control-base.h (set_float_to_string_precision): Added to protected API. * eca-control-base.h (float_to_string_precision): Added to public API. * eca-control-base.h (set_float_to_string_precision_rep): Added to protected API. 2004-07-13 Kai Vehmanen * audioio-aac.h: Added. 2004-07-09 Kai Vehmanen * eca-audio-format.h (Sample_endianess, set_sample_endianess, sample_endianess): Added. * eca-audio-format.h (Sample_coding, set_sample_coding, sample_coding): Added. * audioio-forked-stream.h (fork_command): Added. * audioio-flac.h: Added. * library interface version to 13:0:4 2004-05-05 Kai Vehmanen * library interface version 12 frozen 2004-05-04 Kai Vehmanen * eca-object-factory.cpp (probe_default_output_device): Added. 2004-05-02 Kai Vehmanen * eca-chain.h (operator_params_to_string): Added. * library interface version to 12:0:3 2003-08-29 Kai Vehmanen * library interface version 11 frozen 2003-08-26 Kai Vehmanen * eca-chainsetup.h (multitrack_mode_offset): Added. 2003-08-14 Kai Vehmanen * eca-control-base.h (engine_start): Moved to public scope, signature changed. 2003-08-13 Kai Vehmanen * eca-chainsetup.cpp (add_default_midi_device): Added. 2003-05-29 Kai Vehmanen * eca-audio-time.h (set_samples_per_second_keeptime): Added. * library version to 11:0:2 2003-02-15 Kai Vehmanen * library interface version 10 frozen 2003-02-05 Kai Vehmanen * eca-engine.cpp (is_finite_length): Added. 2003-02-03 Kai Vehmanen * eca-engine.h (is_locked_for_editing): Added. * eca-engine.h (ECA_ENGINE::Engine_command): Added enums 'ep_edit_lock' and 'ep_edit_unlock'. 2003-02-02 Kai Vehmanen * eca-engine.h (ECA_ENGINE::Engine_command): Added enum 'ep_prepare'. 2003-01-30 Kai Vehmanen * samplebuffer.cpp (resample_get_quality): added * samplebuffer.cpp (resample_set_quality): added * library version to 10:0:1 2003-01-07 Kai Vehmanen * library interface version 9 frozen 2002-11-18 Kai Vehmanen * eca-chainsetup-position.h: Added a separate public API for maximum chainsetup length. This is to avoid confusion between maximum and actual lengths. 2002-10-30 Kai Vehmanen * eca-control.cpp (last_value_to_string): added * eca-logger-wellformed.cpp (create_wellformed_message): added 2002-10-26 Kai Vehmanen * eca-chainop.h (output_samples): renamed to max_output_samples() * eca-audio-position.h (set_length_in_samples, length_in_samples, set_position_in_samples, position_in_samples): turned into non-virtuals 2002-10-22 Kai Vehmanen * eca-operator.h (parameter_description): turned into const member 2002-10-16 Kai Vehmanen * NOTE: from now on, the library version presents the public API version number, not the ABI version. * removed interface version from library base name * library version changed to 9:0:0 2002-10-04 Kai Vehmanen * eca-control.h (print_last_error): function removed 2002-09-29 Kai Vehmanen * audioio-resample.h: modified to inherit AUDIO_IO_PROXY instead of AUDIO_IO * audioio-reverse.h: modified to inherit AUDIO_IO_PROXY instead of AUDIO_IO * audioio-typeselect.h: modified to inherit AUDIO_IO_PROXY instead of AUDIO_IO * audioio-proxy.h (all): added * various: all AUDIO_IO_PROXY_XXX classes renamed to AUDIO_IO_DB_XXX * various: AUDIO_IO_BUFFERED_PROXY renamed to AUDIO_IO_DB_CLIENT 2002-08-22 Kai Vehmanen * sample-specs.h: sample conversion constants removed 2002-07-18 Kai Vehmanen * eca-sample-conversion.h: new file * eca-sample-conversion_test.h: new file 2002-07-17 Kai Vehmanen * audiofx.h (class EFFECT_BASE): channels() from protected to public scope * audiofx_analysis.cpp (EFFECT_VOLUME_BUCKETS): renamed from EFFECT_ANALYZE (EFFECT_VOLUME_PEAK): new class 2002-06-28 Kai Vehmanen * eca-comhelp.h: file removed 2002-06-24 Kai Vehmanen * eca-engine.h: ECA_ENGINE::set_position_samples() added 2002-06-23 Kai Vehmanen * eca-resources.h: removed ECA_RESOURCES::set_default() * eca-resources.h: ECA_RESOURCES::has_any() added 2002-05-18 Kai Vehmanen * audioio-manager.h (get_object_list): return type changed 2002-05-17 Kai Vehmanen * audioio-manager.h (all): added inheritance of DYNAMIC_OBJECT * eca-chainsetup.h (set_audio_io_manager_option): added 2002-05-16 Kai Vehmanen * audioio-proxy-server.h (set_priority): removed * eca-engine-driver.h (stop,exit): blocking arg dropped 2002-05-13 Kai Vehmanen * ctrl-source.h (init): arg dropped * ctrl-source.h (step_length): removed * generic-controller.h (param_number, low_range_limit, high_range_limit): removed * generic-controller.h (all): changed to derive CONTROLLER_SOURCE instead of OPERATOR * finite-envelope.h (all): file removed 2002-04-29 Kai Vehmanen * eca-object-factory.h (all): turned into a singleton class * eca-object-factory.h (reserve_factory, free_factory): removed * eca-object-factory.h (*_list, *_object): removed * eca-object-factory.h (object_identifier): removed 2002-04-28 Kai Vehmanen * eca-logger.h (all): added * eca-logger-interface.h (all): added * eca-logger-default.h (all): added * eca-debug.h (all): removed, replaced by eca-logger.h 2002-04-25 Kai Vehmanen * library version number added to library name; current name is libecasound8 * eca-chainsetup.h, eca-chainsetup-bufparams.h (sched_priority): renamed to get_sched_priority to avoid namespace conflict with system header sched.h which introduces a macro with the same name 2002-04-25 Kai Vehmanen * eca-version.h: replaced all macros with static const variables 2002-03-13 Kai Vehmanen * eca-chainsetup.h (multitrack_mode): added 2002-03-11 Kai Vehmanen * eca-chainsetup.h (set_mixmode, mixmode): removed * audioio-device.h (supports_prefill): renamed to prefill_space 2002-02-27 Kai Vehmanen * eca-engine.h (various): added * eca-chainsetup.h (add_output): second parameter added * audioio-device.h (supports_prefill, delay): added 2002-02-26 Kai Vehmanen * eca-chainsetup.h (is_in_use, toggle_is_in_use): renamed to is_locked and toggle_locked_state * eca-control-base.h (start_engine,run_engine,close_engine): moved to private scope * eca-control-base.h (toggle_interactive_mode): removed * eca-session (is_interactive, toggle_interactive_mode): removed 2002-02-24 Kai Vehmanen * eca-audio-format (set_audio_format): turned into a virtual function 2002-02-13 Kai Vehmanen * eca-chainop.h (release): added * eca-chain.h (release): added 2002-02-09 Kai Vehmanen * eca-audio-format.h (set_audio_format): renamed to set_audio_format_string to avoid clashed with virtual overloaded function set_audio_format() 2002-02-01 Kai Vehmanen * eca-audio-position.h (length_in_samples): renamed to set_length_in_samples * eca-audio-position.h (position_in_samples): renamed to set_position_in_samples * eca-audio-position.h (position_in_seconds): renamed to set_position_in_seconds * eca-audio-position.h (position_in_samples_advance): renamed to change_position_in_samples * eca-chainsetup-position.h (): changed to inherit ECA_AUDIO_POSITION * eca-chain.h (): changed to inherit ECA_AUDIO_POSITION * finite-envelope.h (): changed to inherit ECA_AUDIO_POSITION * eca-control-objects.h (rewind_chains): removed * eca-control-objects.h (forward_chains): removed * eca-control-objects.h (set_position_chains): removed * eca-control-objects.h (change_position_chains): removed 2002-01-31 Kai Vehmanen * samplebuffer.h (constructor): srate param removed * samplebuffer.h (resample_to,resample_from): replaced with resample() * samplebuffer.h (export_*,import_): srate param removed * samplebuffer.h (sample_rate): function removed * samplebuffer.h (length_in_seconds): function removed * eca-audio-time.h (): all samplerate information moved to ECA_SAMPLERATE_AWARE * eca-audio-time.h (bytes_per_second): return changed to 'long int' * audiofx.h (): added inheritance of ECA_SAMPLERATE_AWARE * eca-audio-format.h (channels_changed): removed * eca-audio-format.h (sample_format_changed): removed * eca-audio-format.h (samples_per_second_changed): removed * eca-audio-format.h (interleaved_channels_changed): removed * eca-audio-format.h (set_channels): turned into virtual * eca-audio-format.h (set_sample_format): turned into virtual * eca-audio-format.h (toggle_interleaved_channels): turned into virtual * audioio.h (buffersize): modifying version renamed to set_buffersize; second parameter dropped * audioio.h (io_mode,label): modifying versions renamed to set_io_mode and set_label * audioio.h (toggle_open_state): removed * audioio.h (open, closed): added a default implementation * audioio-device.h (is_running, is_prepared): turned into non-virtual * sample-specs.h (channel_count_default, sample_rate_default): removed * eca-chain.h (): added inheritance of ECA_SAMPLERATE_AWARE * eca-audio-position.h (): added direct inheritance of ECA_SAMPLERATE_AWARE * audioio.h (): added inheritance of both ECA_AUDIO_POSITION and ECA_AUDIO_FORMAT 2002-01-28 Kai Vehmanen * audioio-proxy-server.h (wait_for_data): added * audioio-reverse.h (all): added 2002-01-24 Kai Vehmanen * eca-audio-format.h (channels_changed): added * eca-audio-format.h (sample_format_changed): added * eca-audio-format.h (samples_per_second_changed): added * eca-audio-format.h (interleaved_channels_changed): added * eca-audio-position.h (extend_position): moved from public to protected scope 2001-12-22 Kai Vehmanen * samplebuffer.h (copy_from_buffer): renamed to export_interleaved() * samplebuffer.h (copy_from_buffer_vector): renamed to export_noninterleaved() * samplebuffer.h (copy_to_buffer): renamed to import_interleaved() * samplebuffer.h (copy_to_buffer_vector): renamed to import_noninterleaved() * samplebuffer.h (reserve_length_in_samples,reserve_channels): added * samplebuffer.h (assign-operator,copy-constructor): moved to private access scope * samplebuffer.h (set_rt_lock): added * samplebuffer.h (get_pointer_reflock,release_pointer_reflock): added 2001-12-19 Kai Vehmanen * audioio-types.h (all): removed - replaced by audioio-buffered.h and audioio-device.h * audioio-manager.h (all): added * audioio.h (create_object_manager): added 2001-12-08 Kai Vehmanen * samplebuffer.h (resample_init_memory): added 2001-12-06 Kai Vehmanen * eca-resources.h (all): dropped inheritance of RESOURCE_FILE * audioio-mp3.h (default_mp3_output_default_bitrate): added 2001-11-29 Kai Vehmanen * eca-fileio.h, eca-fileio-mmap.h, eca-fileio-stream.h (all): added support for 64bit files; long ints changed to fpos_t in all public interfaces * eca-fileio-stream.h (open_stderr): added * sample-specs.h (sample_type): renamed to sample_t * sample-specs.h (sample_pos_t,sample_rate_t,channel_t): added * dynamic-parameters.h (parameter_type): renamed to parameter_t 2001-11-19 Kai Vehmanen * resource-file.h (is_modified): added 2001-10-30 Kai Vehmanen * samplebuffer.h (all): class de-templatized 2001-10-28 Kai Vehmanen * eca-static-object-maps.h (all): all global functions and variables encapsulated into the ECA_STATIC_OBJECT_MAPS class; from now on, all access to object maps only throuh ECA_OBJECT_FACTORY * eca-object-map.h (registered_objects): return type changed * eca-object-map.h (object_regex): added * eca-operator.h (new_expr,clone): changed to const; affect all subclasses * audioio-plugin.h (audio_io_keyword, audio_io_keyword_regex): added * eca-object-factory.h (object_identifier): added * eca-object-factory.h (reserve_factory, free_factory): added * eca-object-map.h (keyword_to_expr, expr_to_keyword): added * eca-object-factory (register_chain_operator,register_controller): added 2001-10-17 Kai Vehmanen * eca-chainsetup.h (is_in_use): added 2001-10-13 Kai Vehmanen * eca-chainsetup.h (options_to_string): added * eca-control.h (print_general_status): removed 2001-10-11 Kai Vehmanen * audioio-types.h (AUDIO_IO_DEVICE::is_realtime_object): added * eca-engine.h (is_realtime_object): removed 2001-10-11 Kai Vehmanen * eca-chainsetup-bufparams.h (number_of_set): added * eca-chainsetup.h (has_nonrealtime_objects): added 2001-10-10 Kai Vehmanen * midiio.h (file_descriptor): renamed to poll_descriptor * audioio.h (poll_descriptor): added * eca-debug (detach_debug_object): added 2001-10-06 Kai Vehmanen * eca-main.h (all): renamed to eca-engine.h * eca-engine.h (ECA_PROCESSOR): renamed to ECA_ENGINE * eca-engine.h (status,finished): added * eca-control-objects.h (set_default_audio_format_to_selected): divided into _to_selected_input() and to_selected_output() * eca-chainsetup.h (is_slave_output): renamed to is_realtime_target_output * eca-session.h (session): added * eca-control-base.h (set_buffersize): moved to eca-control-objects.h and renamed to set_chainsetup_buffersize() * eca-control-base.h (toggle_raise_priority,toggle_multitrack_mode): removed 2001-10-05 Kai Vehmanen * eca-chainsetup.h (ok_audio_object): added 2001-10-04 Kai Vehmanen * eca-chainsetup.h (set_buffering_mode, buffering_mode): added * eca-session.h (raised_priority, toggle_raised_priority): moved to eca-chainsetup.h * eca-chainsetup.h (sched_priority, set_sched_priority): added * eca-chainsetup-bufparams.h (all): added * eca-chain.h (connect_input,connected_input,connect_output, connected_output): return type changed * eca-session.h (number_of_attached_chains_to_*): removed * eca-session.h (get_attached_chains_to_*): removed * eca-chain.h (get_chain_operator, get_controller): added * eca-chain.h (get_selected_chain_operator, get_selected_controller): added * eca-control-objects.h (get_*): return type changed to const pointers * eca-control-objects.h (set_audio_object_position_samples): added * eca-chainsetup-position.h (seek_position): added * eca-chainsetup.h (seek_position): added * eca-chainsetup.h (change_position_exact, set_position_exactseek_position): removed * eca-control-objects.h (set_default_audio_format_to_selected,default_audio_format,chainsetup_buffersize): added 2001-10-03 Kai Vehmanen * eca-main.h (has_realtime_objects): moved to eca-chainsetup.h * eca-main.h (is_slave_output): moved to eca-chainsetup.h * eca-main.h (init): moved to private scope * audioio-proxy-server (wait_for_full, wait_for_stop, wait_for_flush): added 2001-10-01 Kai Vehmanen * eca-audio-objects.h (all): functionality relocated to eca-chainsetup.h * eca-chainsetup-parser.h (all): added * eca-chainsetup.h (all): all public data members move to private scope * eca-chainsetup.h (create_*): moved to eca-object-factory.h 2001-09-23 Kai Vehmanen * eca-chainsetup.h (preprocess_options): removed * eca-session.h (preprocess_options): added * eca-session.h (interpret_general_options,interpret_general_options): changed * eca-session.h (interpret_chainsetup): renamed to interpret_chainsetup_option 2001-09-20 Kai Vehmanen * audiofx.h (init): added virtual function implementation 2001-08-19 Kai Vehmanen * library version changed to 8:0:0 * eca-session.h (add_chainsetup): doesn't throw exceptions anymore * eca-audio-objects.h (class): no longer inherits DEFINITION_BY_CONTRACT * eca-audio-objects.h (desctructor): changed from virtual to non-virtual * eca-audio-objects.h (is_valid): renamed to is_valid_for_connection() * eca-chainsetup.h (interpret_*): don't throw exceptions anymore * eca-static-objects-maps (create_plugins): doesn't throw exceptions anymore * eca-session.h (constructor): will throw an exception if fails * eca-control-base.h (class): no longer inherits DEFINITION_BY_CONTRACT * audioio-buffered-proxy.h (class): no longer inherits DEFINITION_BY_CONTRACT * midi-server.h (class): no longer inherits DEFINITION_BY_CONTRACT * generic-controller.h (class): no longer inherits DEFINITION_BY_CONTRACT * preset.h (class): no longer inherits DEFINITION_BY_CONTRACT 2001-05-02 Kai Vehmanen * ecasound 2.0.0 released 2001-04-27 Kai Vehmanen * library interface version 7 frozen 2001-04-25 Kai Vehmanen * generic-linear-envelope.h (all): added 2001-04-24 Kai Vehmanen * eca-control-objects.h (selected_chain_operator): added * eca-control-objects.h (selected_chain_operator_parameter): added * eca-control-objects.h (selected_controller): added * eca-control-objects.h (chain_operator_names): added * eca-control-objects.h (chain_operator_parameter_names): added * eca-control-objects.h (controller_names): added * eca-chain.h (chain_operator_name): added * eca-chain.h (chain_operator_parameter_name): added * eca-chain.h (controller_name): added * eca-chain.h (number_of_chain_operator_parameters): added 2001-04-23 Kai Vehmanen * eca-iamode-parser.h (action_requires_selected_audio_input): added * eca-iamode-parser.h (action_requires_selected_audio_output): added * eca-iamode-parser.h (action_requires_selected_audio_object): removed * eca-control-objects.h (get_audio_input): added * eca-control-objects.h (get_audio_output): added * eca-control-objects.h (get_audio_object): removed * eca-control-objects.h (select_audio_input_by_index): added * eca-control-objects.h (select_audio_output_by_index): added * eca-control-objects.h (select_audio_object_by_index): removed * eca-control-objects.h (attach_audio_input): added * eca-control-objects.h (attach_audio_output): added * eca-control-objects.h (attach_audio_object): removed * eca-control-objects.h (remove_audio_input): added * eca-control-objects.h (remove_audio_output): added * eca-control-objects.h (remove_audio_object): removed * eca-control-dump.h (dump_selected_audio_input): added * eca-control-dump.h (dump_audio_input_position): added * eca-control-dump.h (dump_audio_input_length): added * eca-control-dump.h (dump_audio_input_open_state): added * eca-control-dump.h (dump_selected_audio_output): added * eca-control-dump.h (dump_audio_output_position): added * eca-control-dump.h (dump_audio_output_length): added * eca-control-dump.h (dump_audio_output_open_state): added * eca-control-dump.h (dump_selected_audio_object): removed * eca-control-dump.h (dump_audio_object_position): removed * eca-control-dump.h (dump_audio_object_length): removed * eca-control-dump.h (dump_audio_object_open_state): removed * eca-control-objects.h (change_position_chains): added * eca-control-objects.h (select_audio_object): removed * eca-control-objects.h (rewind_audio_object): moved to protected scope * eca-control-objects.h (forward_audio_object): moved to protected scope * eca-control-objects.h (set_audio_object_position): moved to protected scope * eca-control-objects.h (wave_edit_audio_object): moved to protected scope * eca-control-objects.h (select_chainsetup_by_index): argument type changed * eca-control-objects.h (select_chains_by_index): added * eca-control-objects.h (audio_input_names,audio_output_names): added * eca-audio-objects.h (audio_input_names,audio_output_names): added 2001-04-09 Kai Vehmanen * eca-chainsetup-position.h (set_position_exact): added * eca-chainsetup-position.h (change_position_exact): renamed from change_position(double) * eca-chainsetup.h (change_position, set_position): added 2001-04-08 Kai Vehmanen * eca-control-objects.h (change_chainsetup_position): added * eca-control-objects.h (set_chainsetup_position): added 2001-03-20 Kai Vehmanen * eca-iamode-parser.h (registered_commands_list): added 2001-03-06 Kai Vehmanen * eca-audio-format.h (default_ecasound_audio_format): removed * eca-object-map.h (flush): added * eca-ladspa-plugin-map.h (all): removed * eca-controller-map.h (all): removed * eca-audio-object-map.h (all): removed * eca-chainop-map.h (all): removed * eca-object-factory.h (ladspa_map_object): added * eca-object-factory.h (controller_map_object,chain_operator_map_object): added * eca-object-factory.h (chain_operator_map_object): added * eca-object-factory.h (audio_io_map_object): added * eca-static-object-maps.h (eca_audio_device_map): removed * eca-static-object-maps.h (object map objects): changed into pointers * eca-static-object-maps.h (unregister_default_objects): added 2001-02-19 Kai Vehmanen * midi-server (register_handler, unregister_handler): added 2001-02-14 Kai Vehmanen * midi-parser.h (all): new module * midi-server.h (various): added * eca-midi.h (all): module dropped 2001-02-08 Kai Vehmanen * audioio-types.h (toggle_max_buffers,max_buffers): added * audioio-types.h (toggle_ignore_xruns,ignore_xruns): added * eca-audio-objects.h (toggle_max_buffers,max_buffers): added * eca-audio-objects.h (toggle_ignore_xruns,ignore_xruns): added * midiio.h (all): added * midiio-raw.h (all): added * midiio-server.h (all): added * midiio-client.h (all): added * eca-static-object-maps.h (register_default_midi_devices): added * eca-audio-objects.h (add_midi_device, remove_midi_device): added * eca-chainsetup.h (interpret_midi_device): added * eca-object-factory (create_midi_device): added * eca-audio-objects.h (set_default_midi_device,default_midi_device): added 2001-02-07 Kai Vehmanen * eca-iamode-parser.h (enum Commands): moved from public to protected scope 2001-02-06 Kai Vehmanen * eca-midi.h (various): many type changes 2000-12-13 Kai Vehmanen * audiofx.h (EFFECT_DCFIX,EFFECT_PITCH_SHIFTER): moved to audiofx.h * audiofx_misc.h (EFFECT_AUDIO_STAMP): added * audiofx_impl.h (all): removed * stamp-ctrl.h (all): added * audio-stamp.h (all): added * generic-controller.h (source_pointer): added 2000-12-12 Kai Vehmanen * eca-session.h (Engine_status): 'ep_status_error' added * eca-contol-interface.h (error): added 2000-12-10 Kai Vehmanen * osc-gen.h (all): completely rewritten * osc-gen-file.h (all): added 2000-12-09 Kai Vehmanen * eca-control-base.h (destructor): changed into non-virtual * eca-control-objects.h (destructor): changed into non-virtual * eca-control.h (destructor): changed into non-virtual * eca-control-interface.h (last_boolean): added * eca-chainsetup.h (constructor): new overloaded version added 2000-12-08 Kai Vehmanen * eca-control.h (): now inherits ECA_CONTROL_OBJECTS directly * eca-contro-dump.h (): dropped inheritance of ECA_CONTROL_OBJECTS; now a non-virtual, concrete class * eca-chain.h (various): added support for selecting individual chainops, controllers and their parameters * eca-control-objects (all chainop and ctrl related routines): layout changes * eca-audio-objects (first_selected_chain): added 2000-12-07 Kai Vehmanen * eca-operator.h (is_toggled, default_parameter_range): removed * eca-operator.h (parameter_description): added 2000-12-05 Kai Vehmanen * eca-main.h (ecasound_queue, ecasound_stop_cond, ecasound_stop_mutex): removed from global namespace * eca-control-base.h (ecasound_lockfile): removed from global namespace * eca-control-base.h (start_engine, start): 1st argument dropped * eca-control-base.h (start_normal, start_normal_thread): removed from global namespace * eca-control-base.h (various routines for ECI implementation): added * eca-control.h (print_last_error, print_last_value): added 2000-11-22 Kai Vehmanen * eca-audio-objects.h (set_double_buffer_size,double_buffer_size): added 2000-11-19 Kai Vehmanen * audioio-buffered-proxy.h (all): added * audioio-proxy-server.h (all): added * audioio-proxy-buffer.h (all): added 2000-11-17 Kai Vehmanen * preset.h (copy-constructor): from private to public scope 2000-11-17 Kai Vehmanen * resource-file.h (load, save): added 2000-11-09 Rob Coker * audiofx_envelope_modulation.h (): EFFECT_TREMOLO added 2000-11-01 Kai Vehmanen * audiofx_envelope_modulation.h (): EFFECT_PULSE_GATE_BPM added 2000-10-29 Rob Coker * audiofx_envelope_modulation.h (): file added 2000-10-21 Kai Vehmanen * eca-mthreaded-processor.h (): file removed * eca-fileio-mmap-fthread.h (): file removed 2000-10-17 Kai Vehmanen * eca-control-objects (set_default_audio_format): added parameter 'interleaving' * samplebuffer.h (copy_from_buffer_vector,copy_to_buffer_vector): added * audioio.h (finite_length_stream): added 2000-10-14 Kai Vehmanen * dynamic-parameters.h (): dropped inheritance of DEFINITION_BY_CONTRACT (three days, I changed my mind :)) 2000-10-11 Kai Vehmanen * dynamic-parameters.h (): now inherits DEFINITION_BY_CONTRACT * dynamic-parameters.h (default_parameter_range,is_toggle): moved to OPERATOR * dynamic-parameters.h (map_parameters, get_parameter_id): removed * dynamic-parameters.h (get_parameter_name): changed prototype 2000-10-10 Kai Vehmanen * audioio-types.h (AUDIO_IO_DEVICE): is_running(), is_prepared(), toggle_running_state() and toggle_prepared_state() added * eca-chainsetup.h (enable): changed exception specification * eca-session.h (connect_chainsetup): changed exception specification 2000-10-08 Kai Vehmanen * eca-version.h (): added version numbering as C defines * audioio-plugin.h (audio_io_interface_version): added * eca-object-map.h (object): added a second argument; affects 2000-10-07 Kai Vehmanen * eca-error.h (all): classes made non-virtual, many other big changes * audioio-mikmod.h (MIKMOD_INTERFACE): default_mikmod_path and default_mikmod_args combined into default_mikmod_cmd) * audioio-timidity.h (all): a new file * audioio.h (all): various changes and code cleanups * audioio-forked-stream.h (all): new file other object map classes 2000-09-24 Kai Vehmanen * audiofx_timebased.h (EFFECT_MODULATING_DELAY): constructor parameters changed 2000-09-17 Kai Vehmanen * library version changed to 7:0:0 * eca-object-factory.h (): new file * eca-chainop.h (CHAIN_OPERATOR): dropped inheritance of ECA_AUDIO_FORMAT * audiofx.h (set_samples_per_second,samples_per_second): added * audiofx.h (set_channels,channels): added * eca-chainsetup.h (add_default_output): added * eca-chainsetup.h (preprocess_options): added * eca-chainsetup.h (interpret_option):added * eca-chainsetup.h (interpret_object_option): added * eca-chainsetup.h (interpret_global_option): added * eca-chainsetup.h (interpret_*): most interpretation routines moved from public to private scope * various: renamed all enum type names from "ALL_CAPITAL" to "Starting_capital_only" * eca-audio-objects.h (interpret_audio_object): moved to eca-chainsetup.h * eca-audio-objects.h (create_audio_object): moved to eca-object-factory.h * eca-chainsetup.h (constructor): removed interaction with COMMAND_LINE objects 2000-09-16 Kai Vehmanen * ecasound 1.8.2r14 released * library interface version 6 frozen 2000-06-27 Kai Vehmanen * eca-audio-objects.h (attach_input_to_selected_chains,attach_input_to_selected_chains): changed parameter format 2000-06-18 Kai Vehmanen * audioio-alsa*.h (all): renamed all ALSA_PCMx_DEVICE classes to ALSA_PCM_DEVICE 2000-06-12 Kai Vehmanen * eca-chain.h (connected_input, connected_output): added 2000-06-11 Kai Vehmanen * audioio.h (samples_available,supported_io_modes): added * audioio-mp3.h (default cmds): new more generic interface * eca-control*.h (all): files and classes renamed; ECA_CONTROLLER* -> ECA_CONTROL* * eca-chainsetup-position.h (all): file and class renamed; ECA_CONTROLLER_POSITION -> ECA_CHAINSETUP_POSITION * eca-control-objects.h (chainsetup_names,chain_names): added * eca-control-objects.h (get_controller, remove_controller): added * eca-control-objects.h (get_chain,select_chain): added * eca-session.h (chainsetup_names): added * eca-audio-objects.h (chain_names): added * eca-chain.h (remove_controller): added 2000-06-10 Jeremy Hall * audioio-alsa3.h (all): added 2000-06-06 Kai Vehmanen * library version changed to 6:0:0 * development of ecasound 1.8.x started * moved all files from src/ and include/ subdirs to the same directory (top-level libecasound dir) * audioio.h (enum Io_type): replaces the unnamed enums 2000-05-29 Kai Vehmanen * audiofx_reverb.h: a new file containing more advanced reverb effects 2000-05-21 Kai Vehmanen * library version changed to 6:0:1 * audiofx_ladspa.h (unique_number): added * eca-ladspa-plugin-map.h (object, register_object): new overloaded versions 2000-05-02 Kai Vehmanen * library interface version 5 frozen 2000-04-26 Kai Vehmanen * eca-chain.h (selected_target): added 2000-04-15 Kai Vehmanen * eca-controller-objects.h (set_default_audio_format): signature changed * eca-audio-format.h (audio_format): added * eca-session.h (get_attached_chains_to_input, _output): renamed from get_connected_chains...() * eca-controller-base.h (attached_chains_input, _output): renamed from connected_chains...() * eca-audio-objects.h (get_attached_chains...): renamed from get_connected_chains...() 2000-04-14 Kai Vehmanen * audioio-alsa2-plugin.h: added, contains the class ALSA_PCM2_PLUGIN_DEVICE * eca-controller.h (direct_command): private function, added 2000-04-03 Kai Vehmanen * eca-controller-objects.h (set_chainsetup_output_mode): added * eca-alsa-dyn.h: removed as obsolete * audiofx_vst.h: added * eca-vst-plugin-map.h: added 2000-03-27 Kai Vehmanen * eca-static-object-maps (various): changes in map representation, affects all object maps 2000-03-24 Kai Vehmanen * eca-version.h (ecasound_library_version_current): added * eca-version.h (ecasound_library_version_revision): added * eca-version.h (ecasound_library_version_age): added * eca-version.h (ecasound_library_version): added * eca-version.h (ecasound_version): removed * eca-controller-objects.h (get_audio_format): no longer const 2000-03-23 Kai Vehmanen * samplebuffer_functions.h: added * samplebuffer.h: removed all non-template code 2000-03-22 Kai Vehmanen * eca-chainsetup.h (combine_options): moved to libkvutils 2000-03-20 Kai Vehmanen * eca-static-object-maps.h (eca_ladspa_plugin_map): added * audiofx_ladspa.h: added * eca-chainsetup.h (create_ladspa_plugin): added * ladspa.h: added * eca-ladspa-plugin-map.h: added 2000-03-18 Kai Vehmanen * eca-controller-dump.h (various): added, affects ECA_CONTROLLER, ECA_CONTROLLER_OBJECTS and ECA_IAMODE_PARSER 2000-03-13 Kai Vehmanen * eca-operator.h (various): added * eca-object.h (various): added 2000-03-12 Kai Vehmanen * dynamic-parameters.h (is_toggle): added * eca-audio-objects.h (audio_object_info): return type changed to void 2000-03-10 Kai Vehmanen * eca-object-map.h (various): template parameter is now the same as DYNAMIC_PARAMETERS::parameter_type * eca-object-map.h (registered_keywords): added 2000-03-09 Kai Vehmanen * dynamic-object.h (description): added * audioio.h (locked_audio_format): added 2000-03-05 Kai Vehmanen * audioio-types.h (various): major changes in class hiearchy * audioio.h (supported_io_modes): added 2000-03-03 Kai Vehmanen * eca-audio-format.h (set_audio_format): renamed from set_sample_format, added a new overloaded version 2000-03-03 Kai Vehmanen * eca-audio-objecs (create_loop_input, create_loop_output): added * eca-audio-objecs (create_audio_object): now a static member, removed exceptions 2000-03-02 Kai Vehmanen * dynamic-parameters.h (new_expr): added, affects all subclasses * audioio-types.h (constructor): removed default arguments, affects all subclasses * resource-file.h (resource_file): added * audioio.h (SI_MODE): enum removed, replaced with AUDIO_IO::{io_read,io_write,io_readwrite} * eca-static-object-maps.h (various): added * eca-audio-object-map.h (various): added 2000-02-29 Kai Vehmanen * dynamic-parameters.h (various): converted to a class template * dynamic-objects.h (various): converted to template class, affects all subclasses * audioio-types.h (various): reorganized file, device and buffering classes * audioio.h (label,io_mode): protected -> public * audioio.h (constructor): all arguments now optional * dynamic-parameters.h (valid_parameter): removed * dynamic-parameters.h (default_parameter_range): added * dynamic-parameters.h (name): removed 2000-02-24 Kai Vehmanen * audiofx_timebased.h (various) EFFECT_MODULATING_DELAY, EFFECT_CHORUS, EFFECT_FLANGE and EFFECT_MULTITAP_DELAY classes added 2000-02-23 Kai Vehmanen * audiofx_filter.h (various): class EFFECT_ALLPASS_FILTER added * audiofx_filter.h (various): class EFFECT_COMB_FILTER added * samplebuffer.h (various): made sample_rate a normal class member instead of a static member -> affect many other classes * eca-chainop.h (output_samples): added * eca-chainop.h (class): now inherits ECA_AUDIO_FORMAT * eca-chainsetup.h (is_enabled): added const member modifier * audiofx_timebased.h (various): class DELAY interface has changed 2000-02-22 Kai Vehmanen * eca-audio-objects.h (interpret_audioio_device): second parameter omitted 2000-02-21 Kai Vehmanen * eca-chainsetup.h: ECA_RESOURCES removed from constructor parameters * eca-chain.h (init): more arguments 2000-02-20 Kai Vehmanen * preset.h: added * file-preset.h: added * global-preset.h: added * eca-preset-map.h: added 2000-02-18 Kai Vehmanen * eca-chainsetup.h (create_chain_operator, create_controller): added * eca-chain.h (constructor): moved sample buffer objects outside, now chain's just have a pointer to a buffer 2000-02-15 Kai Vehmanen * resource-file.h (keywords): added 2000-02-14 Kai Vehmanen * audioio-ewf.h (various): new functionality * resource-file.h (load, save, is_modified, set_modified_state): removed * resource-file.h (set_resource_file, get_resource_file): renamed * eca-controller-base.h (resource_value): return value changed 2000-02-13 Kai Vehmanen * audioio.h (various): added support for class ECA_AUDIO_TIME 2000-02-11 Kai Vehmanen * audioio-types.h (prepare): added to AUDIO_IO_DEVICE and all its subclasses 2000-02-09 Kai Vehmanen * eca-debug.h (): class MAINDEBUG renamed to ECA_DEBUG * eca-debug.h (): new enums and debug-level specs 2000-02-08 Kai Vehmanen * eca-chain.h (select_controller): added * eca-chain.h (selected_controller): added * eca-chain.h (number_of_controllers): added * eca-chain.h (selected_chain_operator_as_target): added * eca-chain.h (selected_controller_as_target): added * eca-chainsetup.h (set_target_to_controller): added * generic-controller.h (status): added * eca-controller.h (controller_status): added 2000-02-05 Kai Vehmanen * eca-audio-objects.h (create_audio_object): const removed * eca-controller-base.h (run): added 2000-02-04 Kai Vehmanen * audioio.h (is_realtime): removed as obsolete * audioio.h (start, stop, latency): moved to audioio-types.h * library version changed to 5:0:0 2000-01-31 Kai Vehmanen * eca-control-position.h (change_position): added an overloaded version that takes a double argument * library version changed to 5:0:1 2000-01-29 Kai Vehmanen * library interface version 4 frozen * ecasound 1.6.12r10 released 2000-01-28 Kai Vehmanen * library version 4:0:0 feature freeze * ecasound 1.6.12d10 released 2000-01-25 Kai Vehmanen * eca-audio-time.h: added * eca-chainop.h (status): changed to const * eca-chainop.h (output_channels): changed to const 2000-01-22 Kai Vehmanen * eca-controller-base.h (is_finished): added 2000-01-15 Kai Vehmanen * samplebuffer.h (swap_bytes): removed * samplebuffer.h (copy): added * eca-audio-objects (get_type_from_extension): now a static member * eca-controller.h: split into eca-controller.h, eca-controller-base.h and eca-controller-objects.h - only minor changes to ECA_CONTROLLER interface 2000-01-13 Kai Vehmanen * audioio-alsa2.*: added * audioio-alsa.*: ALSADEVICE renamed to ALSA_PCM_DEVICE * audioio-lbalsa.*: ALSALBDEVICE renamed to ALSA_LOOPBACK_DEVICE 2000-01-07 Kai Vehmanen * audiofx_rcfilter.h, audiofx_rcfilter.src: added 1999-12-21 Kai Vehmanen * audioio-ewf.h: EWFFILE now directly inherits AUDIO_IO 1999-12-16 Kai Vehmanen * audiofx_amplitude.cpp: NOISEGATE_MONO -> NOISEGATE * library version changed to 4:0:0 1999-12-15 Kai Vehmanen * 1.6.9r9 released * library interface version 3 frozen 1999-12-11 Kai Vehmanen * dynamic-object.h: added * ctrl_source.h -> ctrl-source.h * gcontroller.* -> generic-controller.* * parameter control subsystem rewritten, affects all related classes (class inheriting from CONTROLLER_SOURCE, GENERIC_CONTROLLER, ECA_OBJECT_MAP, ECA_CHAIN, ECA_CHAINSETUP and so on) 1999-12-06 Kai Vehmanen * ctrl_source.h: controller sources now inheric from DYNAMIC_PARAMETERS - this required many changes to controller source classes * eca-chainop-map.h: renamed to eca-object-map.h * dynamic-parameters.h (name): added * dynamic-parameters.h (parameter_names): changed return type, affects all sub-classes * library version changed to 3:0:0 1999-12-04 Kai Vehmanen * 1.6.8r8 released * library interface version 2 frozen * library version changed to 2:0:1 1999-12-02 Kai Vehmanen * eca-controller.h (select_chainsetup_by_index): a new routine 1999-11-23 Kai Vehmanen * 1.6.7r7 released * library interface version 1 frozen 1999-11-08 Kai Vehmanen * major changes in nearly all interfaces * library version changed 1:0:0 1999-09-14 Kai Vehmanen * 1.5.12r6 released * first public release of libecasound; libtool version number 0:0:0 (current:revision:age) ----------------------------------------------------------------------- ecasound-2.9.3/libecasound/audioio-device_test.h0000644000076400007640000000354610664032032016651 00000000000000// ------------------------------------------------------------------------ // audioio-device_test.h: Unit test for AUDIO_IO_DEVICE // Copyright (C) 2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "audioio-device.h" #include "eca-object-factory.h" #include "eca-object-map.h" #include "kvu_numtostr.h" #include "eca-logger.h" #include "eca-test-case.h" using namespace std; /** * Unit test for AUDIO_IO_DEVICE. * * FIXME: implementation not ready */ class AUDIO_IO_DEVICE_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for AUDIO_IO_DEVICE"); } virtual void do_run(void); public: virtual ~AUDIO_IO_DEVICE(void) { } }; void AUDIO_IO_DEVICETEST::do_run(void) { /** * - like audioio_test.h, but with additional tests for prepare, * start and stop member functions * - generate different permutations of 'audio_format' and * 'buffersize' - especially buffersize can cause problems * to devices * - test prefilling (if supported) * - verify that position_in_samples increases during * processing */ } ecasound-2.9.3/libecasound/stamp-ctrl.cpp0000644000076400007640000000420211034535055015340 00000000000000// ------------------------------------------------------------------------ // stamp-ctrl.cpp: Controller sources that analyze audio stamps // and produce control data. // Copyright (C) 2000,2001,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "samplebuffer_functions.h" #include "stamp-ctrl.h" VOLUME_ANALYZE_CONTROLLER::VOLUME_ANALYZE_CONTROLLER(void) { } CONTROLLER_SOURCE::parameter_t VOLUME_ANALYZE_CONTROLLER::value(double pos) { parameter_t v = 0.0f; fetch_stamp(&sbuf_rep); if (rms_mode_rep != 0) v = SAMPLE_BUFFER_FUNCTIONS::RMS_volume(sbuf_rep); else v = SAMPLE_BUFFER_FUNCTIONS::average_amplitude(sbuf_rep); if (!(v > 0.0f)) v = 0.0f; // cerr << "(volume-analyze-ctrl) Fetches a sbuf with value " << v << endl; return v; } void VOLUME_ANALYZE_CONTROLLER::init(void) { } void VOLUME_ANALYZE_CONTROLLER::set_parameter(int param, CONTROLLER_SOURCE::parameter_t value) { switch (param) { case 1: set_id(static_cast(value)); break; case 2: rms_mode_rep = static_cast(value); break; } } CONTROLLER_SOURCE::parameter_t VOLUME_ANALYZE_CONTROLLER::get_parameter(int param) const { switch (param) { case 1: return static_cast(id()); case 2: return static_cast(rms_mode_rep); } return 0.0f; } ecasound-2.9.3/libecasound/audioio-typeselect.h0000644000076400007640000000321110765534060016533 00000000000000#ifndef INCLUDED_AUDIOIO_TYPESELECT_H #define INCLUDED_AUDIOIO_TYPESELECT_H #include #include #include #include "audioio-proxy.h" /** * A proxy class for overriding default keyword * and filename associations in ecasound's object * maps. * * Related design patterns: * - Proxy (GoF207) * * @author Kai Vehmanen */ class AUDIO_IO_TYPESELECT : public AUDIO_IO_PROXY { public: /** @name Public functions */ /*@{*/ AUDIO_IO_TYPESELECT (void); virtual ~AUDIO_IO_TYPESELECT(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return(string("Typeselect => ") + child()->name()); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual std::string parameter_names(void) const; virtual bool variable_params(void) const { return true; } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_IO_TYPESELECT* clone(void) const; virtual AUDIO_IO_TYPESELECT* new_expr(void) const { return(new AUDIO_IO_TYPESELECT()); } /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); /*@}*/ private: std::string type_rep; mutable std::vector params_rep; bool init_rep; AUDIO_IO_TYPESELECT& operator=(const AUDIO_IO_TYPESELECT& x) { return *this; } AUDIO_IO_TYPESELECT (const AUDIO_IO_TYPESELECT& x) { } }; #endif ecasound-2.9.3/libecasound/midi-cc.h0000644000076400007640000000226611034532033014225 00000000000000#ifndef INCLUDE_MIDI_CC_H #define INCLUDE_MIDI_CC_H #include #include "ctrl-source.h" #include "midi-client.h" /** * Interface to MIDI continuous controllers */ class MIDI_CONTROLLER : public CONTROLLER_SOURCE, public MIDI_CLIENT { public: /** @name Functions implemented from CONTROLLER_SOURCE */ /*@{*/ virtual void init(void); virtual parameter_t value(double pos_secs); virtual void set_initial_value(parameter_t arg); /*@}*/ /** @name Functions implemented from DYNAMIC_PARAMETERS */ /*@{*/ std::string parameter_names(void) const { return("controller,channel"); } void set_parameter(int param, parameter_t value); parameter_t get_parameter(int param) const; std::string name(void) const { return("MIDI-Controller"); } /*@}*/ /** @name Functions implemented from ECA_OBJECT */ /*@{*/ MIDI_CONTROLLER* clone(void) const { return new MIDI_CONTROLLER(*this); } MIDI_CONTROLLER* new_expr(void) const { return new MIDI_CONTROLLER(); } /*@}*/ MIDI_CONTROLLER(int controller_number = 0, int midi_channel = 0); private: int controller_rep, channel_rep; parameter_t init_value_rep; bool trace_request_rep; }; #endif ecasound-2.9.3/libecasound/audioio-buffered.h0000644000076400007640000000305710664032032016132 00000000000000#ifndef INCLUDED_AUDIOIO_BUFFERED_H #define INCLUDED_AUDIOIO_BUFFERED_H #include "audioio.h" class SAMPLE_BUFFER; /** * A lower level interface for audio I/O objects. Derived classes * must implement routines for reading and/or writing buffers of raw data. */ class AUDIO_IO_BUFFERED : public AUDIO_IO { public: virtual ~AUDIO_IO_BUFFERED(void); AUDIO_IO_BUFFERED(void); virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual void set_buffersize(long int samples); virtual long int buffersize(void) const { return(buffersize_rep); } /** * Low-level routine for reading samples. Number of read sample * frames is returned. This must be implemented by all subclasses. */ virtual long int read_samples(void* target_buffer, long int sample_frames) = 0; /** * Low-level routine for writing samples. This must be implemented * by all subclasses. */ virtual void write_samples(void* target_buffer, long int sample_frames) = 0; /** @name Reimplemented functions from ECA_AUDIO_FORMAT */ /*@{*/ virtual void set_channels(SAMPLE_SPECS::channel_t v); virtual void set_sample_format(Sample_format v) throw(ECA_ERROR&); /*@{*/ protected: void reserve_buffer_space(long int bytes); unsigned char* get_iobuf(void) const { return(iobuf_uchar_repp); } size_t get_iobuf_size(void) const { return(iobuf_size_rep); } private: long int buffersize_rep; unsigned char* iobuf_uchar_repp; // buffer for raw-I/O size_t iobuf_size_rep; }; #endif // INCLUDED_AUDIO_IO_BUFFERED ecasound-2.9.3/libecasound/two-stage-linear-envelope.cpp0000644000076400007640000000530411034532156020252 00000000000000// ------------------------------------------------------------------------ // two-stage-linear-envelope.cpp: Two-stage linear envelope // Copyright (C) 2000-2002,2005,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "two-stage-linear-envelope.h" #include "eca-logger.h" CONTROLLER_SOURCE::parameter_t TWO_STAGE_LINEAR_ENVELOPE::value(double pos_secs) { parameter_t stages_len = first_stage_length_rep + second_stage_length_rep; parameter_t retval; /* note: position may go beyond stages_len_rep */ /* phase: hold start value */ if (pos_secs < first_stage_length_rep) { retval = 0.0f; } /* phase: linear fade */ else if (pos_secs < stages_len) { DBC_CHECK(second_stage_length_rep > 0); retval = ((pos_secs - first_stage_length_rep) / second_stage_length_rep); } /* phase: hold end value */ else retval = 1.0; return retval; } TWO_STAGE_LINEAR_ENVELOPE::TWO_STAGE_LINEAR_ENVELOPE(void) { first_stage_length_rep = 0; second_stage_length_rep = 0; } void TWO_STAGE_LINEAR_ENVELOPE::init(void) { MESSAGE_ITEM otemp; otemp << "Two-stage envelope initialized: "; otemp.setprecision(3); otemp << "1. initial hold " << get_parameter(1) << "secs, 2. linear ramp len " << get_parameter(2) << "secs."; ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } void TWO_STAGE_LINEAR_ENVELOPE::set_parameter(int param, CONTROLLER_SOURCE::parameter_t value) { switch (param) { case 1: { first_stage_length_rep = value; break; } case 2: { second_stage_length_rep = value; break; } } } CONTROLLER_SOURCE::parameter_t TWO_STAGE_LINEAR_ENVELOPE::get_parameter(int param) const { switch (param) { case 1: return first_stage_length_rep; case 2: return second_stage_length_rep; } return 0.0; } ecasound-2.9.3/libecasound/file-preset.h0000644000076400007640000000112010664032032015125 00000000000000#ifndef INCLUDED_FILE_PRESET_H #define INCLUDED_FILE_PRESET_H #include #include "preset.h" /** * File based effect preset * * @author Kai Vehmanen */ class FILE_PRESET : public PRESET { std::string filename_rep; public: std::string filename(void) const { return(filename_rep); } void set_filename(const std::string& v) { filename_rep = v; } virtual FILE_PRESET* clone(void) const; virtual FILE_PRESET* new_expr(void) const { return(new FILE_PRESET(filename_rep)); } virtual ~FILE_PRESET (void) { } FILE_PRESET(const std::string& file_name = ""); }; #endif ecasound-2.9.3/libecasound/audiofx_timebased.h0000644000076400007640000001604011744604400016375 00000000000000#ifndef INCLUDED_AUDIOFX_TIMEBASED_H #define INCLUDED_AUDIOFX_TIMEBASED_H #include #include #include #include "audiofx.h" #include "audiofx_filter.h" #include "osc-sine.h" typedef std::deque SINGLE_BUFFER; /** * Base class for time-based effects (delays, reverbs, etc). */ class EFFECT_TIME_BASED : public EFFECT_BASE { public: virtual EFFECT_TIME_BASED* clone(void) const = 0; }; /** * Delay effect */ class EFFECT_DELAY : public EFFECT_TIME_BASED { private: SAMPLE_ITERATOR_CHANNEL l,r; parameter_t surround; parameter_t dnum; long int dtime; parameter_t dtime_msec; parameter_t mix; parameter_t feedback; parameter_t laskuri; std::vector > buffer; public: virtual std::string name(void) const { return("Delay"); } virtual std::string parameter_names(void) const { return("delay-time-msec,surround-mode,number-of-delays,mix-%,feedback-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* insample); virtual void process(void); virtual int output_channels(int i_channels) const { return(2); } parameter_t get_delta_in_samples(void) { return(dnum * dtime); } EFFECT_DELAY* clone(void) const { return new EFFECT_DELAY(*this); } EFFECT_DELAY* new_expr(void) const { return new EFFECT_DELAY(); } EFFECT_DELAY (parameter_t delay_time = 100.0, int surround_mode = 0, int num_of_delays = 1, parameter_t mix_percent = 50.0, parameter_t feedback_percent = 100.0); }; /** * Multi-tap delay */ class EFFECT_MULTITAP_DELAY : public EFFECT_TIME_BASED { private: SAMPLE_ITERATOR_INTERLEAVED i; parameter_t surround; parameter_t mix; parameter_t dtime_msec; long int dtime, dnum; std::vector delay_index; std::vector > filled; std::vector > buffer; public: virtual std::string name(void) const { return("Multitap delay"); } virtual std::string parameter_names(void) const { return("delay-time-msec,number-of-delays,mix-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* insample); virtual void process(void); EFFECT_MULTITAP_DELAY* clone(void) const { return new EFFECT_MULTITAP_DELAY(*this); } EFFECT_MULTITAP_DELAY* new_expr(void) const { return new EFFECT_MULTITAP_DELAY(); } EFFECT_MULTITAP_DELAY (parameter_t delay_time = 100.0, int num_of_delays = 1, parameter_t mix_percent = 50.0); }; /** * Transforms a mono signal to stereo using a panned delay signal. * Suitable delays values range from 1 to 40 milliseconds. */ class EFFECT_FAKE_STEREO : public EFFECT_TIME_BASED { std::vector > buffer; SAMPLE_ITERATOR_CHANNEL l,r; long int dtime; parameter_t dtime_msec; public: std::string name(void) const { return("Fake stereo"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual std::string parameter_names(void) const { return("delay-time-msec"); } virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* insample); virtual void process(void); virtual int output_channels(int i_channels) const { return(2); } EFFECT_FAKE_STEREO* clone(void) const { return new EFFECT_FAKE_STEREO(*this); } EFFECT_FAKE_STEREO* new_expr(void) const { return new EFFECT_FAKE_STEREO(); } EFFECT_FAKE_STEREO (parameter_t delay_time = 20.0); }; /** * Simple reverb (based on a iir comb filter) */ class EFFECT_REVERB : public EFFECT_TIME_BASED { private: std::vector > buffer; SAMPLE_ITERATOR_CHANNEL l,r; parameter_t surround; parameter_t feedback; long int dtime; parameter_t dtime_msec; public: virtual std::string name(void) const { return("Reverb"); } virtual std::string parameter_names(void) const { return("delay-time,surround-mode,feedback-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* insample); virtual void process(void); virtual int output_channels(int i_channels) const { return(2); } parameter_t get_delta_in_samples(void) { return(dtime); } EFFECT_REVERB* clone(void) const { return new EFFECT_REVERB(*this); } EFFECT_REVERB* new_expr(void) const { return new EFFECT_REVERB(); } EFFECT_REVERB (parameter_t delay_time = 20.0, int surround_mode = 0, parameter_t feedback_percent = 50.0); }; /** * Base class for modulating delay effects */ class EFFECT_MODULATING_DELAY : public EFFECT_TIME_BASED { protected: std::vector > buffer; SAMPLE_ITERATOR_CHANNELS i; double advance_len_secs_rep, lfo_pos_secs_rep; long int dtime; parameter_t dtime_msec; parameter_t feedback, vartime; SINE_OSCILLATOR lfo; std::vector delay_index; std::vector filled; public: virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* insample); virtual void process(void); EFFECT_MODULATING_DELAY(parameter_t delay_time = 2.0, long int vartime_in_samples = 20, parameter_t feedback_percent = 50.0, parameter_t lfo_freq = 0.4); }; /** * Flanger */ class EFFECT_FLANGER : public EFFECT_MODULATING_DELAY { public: virtual std::string name(void) const { return("Flanger"); } virtual std::string parameter_names(void) const { return("delay-time-msec,variance-time-samples,feedback-%,lfo-freq"); } void process(void); EFFECT_FLANGER* clone(void) const { return new EFFECT_FLANGER(*this); } EFFECT_FLANGER* new_expr(void) const { return new EFFECT_FLANGER(); } }; /** * Chorus */ class EFFECT_CHORUS : public EFFECT_MODULATING_DELAY { public: virtual std::string name(void) const { return("Chorus"); } virtual std::string parameter_names(void) const { return("delay-time-msec,variance-time-samples,feedback-%,lfo-freq"); } void process(void); EFFECT_CHORUS* clone(void) const { return new EFFECT_CHORUS(*this); } EFFECT_CHORUS* new_expr(void) const { return new EFFECT_CHORUS(); } }; /** * Phaser */ class EFFECT_PHASER : public EFFECT_MODULATING_DELAY { public: virtual std::string name(void) const { return("Phaser"); } virtual std::string parameter_names(void) const { return("delay-time-msec,variance-time-samples,feedback-%,lfo-freq"); } void process(void); EFFECT_PHASER* clone(void) const { return new EFFECT_PHASER(*this); } EFFECT_PHASER* new_expr(void) const { return new EFFECT_PHASER(); } }; #endif ecasound-2.9.3/libecasound/eca-control_test.h0000644000076400007640000000617411172665025016202 00000000000000// ------------------------------------------------------------------------ // eca-control_test.h: Unit test for ECA_CONTROL // Copyright (C) 2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "kvu_utils.h" /* kvu_sleep() */ #include "eca-session.h" #include "eca-control.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_CONTROL. * * FIXME: implementation not ready */ class ECA_CONTROL_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for ECA_CONTROL"); } virtual void do_run(void); public: virtual ~ECA_CONTROL_TEST(void) { } private: void do_run_chainsetup_creation(void); }; void ECA_CONTROL_TEST::do_run(void) { cout << "libecasound_tester: eca-control - chainsetup creation stress test" << endl; do_run_chainsetup_creation(); } void ECA_CONTROL_TEST::do_run_chainsetup_creation(void) { ECA_SESSION *esession = new ECA_SESSION(); ECA_CONTROL *ectrl = new ECA_CONTROL(esession); int iterations = 15; for(int i = 0; i < iterations; i++) { cout << "libecasound_tester: do_run_chainsetup_creation() iteration " << i + 1 << " of " << iterations << "." << endl; ectrl->add_chainsetup("default"); if (ectrl->is_selected() != true) ECA_TEST_FAILURE("Chainsetup creation failed."); ectrl->add_chain("default"); if (ectrl->selected_chains().size() != 1 || ectrl->selected_chains()[0] != "default") ECA_TEST_FAILURE("Chain addition failed."); ectrl->add_audio_input("null"); ectrl->add_audio_output("null"); ectrl->add_chain_operator("-ea:100"); if (ectrl->selected_chain_operator() < 0 || ectrl->selected_chain_operator() > 1) ECA_TEST_FAILURE("Chain operator addition failed."); ectrl->connect_chainsetup(0); if (ectrl->is_connected() != true) ECA_TEST_FAILURE("Chainsetup connection failed."); ectrl->start(); kvu_sleep(0, 200000000); /* 200ms */ if (ectrl->is_running() != true) ECA_TEST_FAILURE("Chainsetup start failed."); ectrl->stop_on_condition(); if (ectrl->is_running() == true) ECA_TEST_FAILURE("Chainsetup stop failed."); ectrl->disconnect_chainsetup(); if (ectrl->is_connected() == true) ECA_TEST_FAILURE("Chainsetup disconnection failed."); ectrl->remove_chainsetup(); if (ectrl->chainsetup_names().size() > 0) ECA_TEST_FAILURE("Chainsetup removal failed."); } delete ectrl; delete esession; } ecasound-2.9.3/libecasound/generic-linear-envelope.cpp0000644000076400007640000001053311544710440017754 00000000000000// ------------------------------------------------------------------------ // generic-linear-envelope.cpp: Generic linear envelope // Copyright (C) 2000-2002,2006,2008,2011 Kai Vehmanen // Copyright (C) 2001 Arto Hamara // // Attributes: // eca-style-version: 3 // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "generic-linear-envelope.h" #include "eca-logger.h" /* Debug controller source values */ // #define DEBUG_CONTROLLERS #ifdef DEBUG_CONTROLLERS #define DEBUG_CTRL_STATEMENT(x) x #else #define DEBUG_CTRL_STATEMENT(x) ((void)0) #endif GENERIC_LINEAR_ENVELOPE::GENERIC_LINEAR_ENVELOPE(void) { pos_rep.resize(1); val_rep.resize(1); curstage = -2; /* processing not yet started */ pos_rep[0] = 0; val_rep[0] = 0; set_param_count(0); } GENERIC_LINEAR_ENVELOPE::~GENERIC_LINEAR_ENVELOPE(void) { } bool GENERIC_LINEAR_ENVELOPE::is_valid_for_stage(double pos, int stage) const { if ((stage >= 0) && (stage < static_cast(pos_rep.size()-1)) && (pos >= pos_rep[stage]) && (pos < pos_rep[stage+1])) return true; return false; } void GENERIC_LINEAR_ENVELOPE::set_stage(double curpos) { /* case: init not called yet */ if (curstage == -2) return; if (curpos < pos_rep[0]) { curstage = -1; return; } int n; for(n = 0; n < static_cast(pos_rep.size() - 1); n++) { if (curpos < pos_rep[n + 1]) { break; } } curstage = n; } CONTROLLER_SOURCE::parameter_t GENERIC_LINEAR_ENVELOPE::value(double curpos) { if (is_valid_for_stage(curpos, curstage)) { curval = (((curpos - pos_rep[curstage]) * val_rep[curstage+1] + (pos_rep[curstage+1] - curpos) * val_rep[curstage]) / (pos_rep[curstage+1] - pos_rep[curstage])); } else { set_stage(curpos); if (is_valid_for_stage(curpos, curstage)) return value(curpos); if (curstage < 0) curval = val_rep[0]; else curval = val_rep.back(); } DEBUG_CTRL_STATEMENT(std::cerr << "generic-linear-envelope: type '" << name() << "', pos " << curpos << ", value " << curval << ", stage " << curstage << "." << std::endl); return curval; } void GENERIC_LINEAR_ENVELOPE::init(void) { curval = 0.0f; curstage = -1; /* processing started */ ECA_LOG_MSG(ECA_LOGGER::info, "Envelope created."); } void GENERIC_LINEAR_ENVELOPE::set_param_count(int params) { param_names_rep = "point_count"; if (params > 0) { for(int n = 0; n < params; ++n) { param_names_rep += ",pos"; param_names_rep += kvu_numtostr(n + 1); param_names_rep += ",val"; param_names_rep += kvu_numtostr(n + 1); } } } std::string GENERIC_LINEAR_ENVELOPE::parameter_names(void) const { return param_names_rep; } void GENERIC_LINEAR_ENVELOPE::set_parameter(int param, parameter_t value) { switch(param) { case 1: set_param_count(static_cast(value)); pos_rep.resize(static_cast(value)); val_rep.resize(static_cast(value)); break; default: int pointnum = param/2 - 1; if (pointnum >= static_cast(pos_rep.size())) break; if (param % 2 == 0) pos_rep[pointnum] = value; else val_rep[pointnum] = value; } } CONTROLLER_SOURCE::parameter_t GENERIC_LINEAR_ENVELOPE::get_parameter(int param) const { switch(param) { case 1: return static_cast(pos_rep.size()); break; default: int pointnum = param/2 - 1; if (pointnum >= static_cast(pos_rep.size())) { return 0.0f; } if (param % 2 == 0) return pos_rep[pointnum]; else return val_rep[pointnum]; } } ecasound-2.9.3/libecasound/osc-gen.h0000644000076400007640000000251211747065175014270 00000000000000#ifndef INCLUDED_GENERIC_OSCILLATOR_H #define INCLUDED_GENERIC_OSCILLATOR_H #include #include #include "oscillator.h" #include "eca-error.h" /** * Generic oscillator * * Oscillator value varies according to discrete * envelope points. */ class GENERIC_OSCILLATOR : public OSCILLATOR { public: virtual void init(void); virtual parameter_t value(double pos_secs); virtual std::string parameter_names(void) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; std::string name(void) const { return "Generic oscillator"; } GENERIC_OSCILLATOR* clone(void) const { return new GENERIC_OSCILLATOR(*this); } GENERIC_OSCILLATOR* new_expr(void) const { return new GENERIC_OSCILLATOR(*this); } GENERIC_OSCILLATOR(double freq = 0.0f, int mode = 0); virtual ~GENERIC_OSCILLATOR (void); protected: void prepare_envelope(void); private: class POINT { public: double pos; double val; }; size_t current_stage(double pos); void set_param_count(int n); std::vector envtable_rep; std::vector params_rep; size_t last_stage_rep; double last_pos_scaled_rep; int mode_rep; double first_value_rep, last_value_rep; double loop_length_rep; // loop length in seconds std::string param_names_rep; }; #endif ecasound-2.9.3/libecasound/generic-controller.h0000644000076400007640000000431711034750421016517 00000000000000#ifndef INCLUDED_GENERIC_CONTROLLER_H #define INCLUDED_GENERIC_CONTROLLER_H #include "ctrl-source.h" #include "eca-operator.h" /** * Generic controller class that connects controller sources * to objects supporting dynamic parameter control (classes * which inherit DYNAMIC_PARAMETERS). * * Related design patterns: * - Decorator (GoF175) */ class GENERIC_CONTROLLER : public CONTROLLER_SOURCE { public: /** @name Constructors and destructors */ /*@{*/ GENERIC_CONTROLLER(CONTROLLER_SOURCE* source, OPERATOR* dobj = 0, int param_id = 0, double range_low = 0.0, double range_high = 0.0); GENERIC_CONTROLLER* clone(void) const { return(0); } GENERIC_CONTROLLER* new_expr(void) const { return(new GENERIC_CONTROLLER(0)); } /*@}*/ /** @name Public functions reimplemented from CONTROLLER_SOURCE */ /*@{*/ virtual void init(void); /** * Returns the current value, scale it and * applies it to target objects. * * @pre is_valid() == true */ virtual parameter_t value(double pos_secs); virtual void set_initial_value(parameter_t arg) { } /*@}*/ /** @name Public functions reimplemented from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return(source == 0 ? string("") : source->name()); } /*@}*/ /** @name Public functions reimplemented from DYNAMIC_PARAMETERS */ /*@{*/ virtual bool variable_params(void) const { return true; } virtual std::string parameter_names(void) const { return("param-id,range-low,range-high," + source->parameter_names()); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; /*@}*/ /** @name Public functions */ /*@{*/ bool is_valid(void) const { return(target != 0 && source != 0); } std::string status(void) const; void assign_target(OPERATOR* obj); void assign_source(CONTROLLER_SOURCE* obj); CONTROLLER_SOURCE* source_pointer(void) const { return(source); } OPERATOR* target_pointer(void) const { return(target); } /*@}*/ private: OPERATOR* target; CONTROLLER_SOURCE* source; bool init_called_rep; int param_id_rep; double rangelow_rep, rangehigh_rep; double last_value_pos_rep; }; #endif ecasound-2.9.3/libecasound/audioio-ewf.h0000644000076400007640000000457010765534163015150 00000000000000#ifndef INCLUDED_AUDIOIO_EWF_H #define INCLUDED_AUDIOIO_EWF_H #include #include "audioio-seqbase.h" #include "samplebuffer.h" #include "eca-audio-time.h" #include "resource-file.h" /** * Ecasound Wave File - a simple wrapper class for handling * other audio objects. When writing .ewf files, it's possible to * seek beyond end position. When first write_buffer() call is issued, * current sample offset is stored into the .ewf file and corresponding * child object is opened for writing. Read_buffer() calls return silent * buffers until sample_offset is reached. After that, audio object is * processed normally. Similarly .ewf supports audio relocation, looping, etc... * * Related design patterns: * - Proxy (GoF207 * * @author Kai Vehmanen */ class EWFFILE : public AUDIO_SEQUENCER_BASE { public: /** @name Public functions */ /*@{*/ EWFFILE (void); virtual ~EWFFILE(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return("Ecasound wave file"); } virtual std::string description(void) const { return("Special format acts as a wrapper for other file formats. It can used for looping, audio data relocation and other special tasks."); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual std::string parameter_names(void) const; virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual EWFFILE* clone(void) const; virtual EWFFILE* new_expr(void) const { return new EWFFILE(); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ /* none */ /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); /*@}*/ /** @name New functions */ /*@{*/ /*@}*/ private: RESOURCE_FILE ewf_rc; void dump_child_debug(void); void read_ewf_data(void) throw(ECA_ERROR&); void write_ewf_data(void); void init_default_child(void) throw(ECA_ERROR&); SAMPLE_SPECS::sample_pos_t priv_public_to_child_pos(SAMPLE_SPECS::sample_pos_t pubpos) const; EWFFILE& operator=(const EWFFILE& x) { return *this; } EWFFILE (const EWFFILE& x) { } }; #endif ecasound-2.9.3/libecasound/audioio-buffered.cpp0000644000076400007640000000774211161544004016472 00000000000000// ------------------------------------------------------------------------ // audioio-buffered.cpp: A lower level interface for audio I/O objects // Copyright (C) 1999-2002,2008,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include /* ceil() */ #include #include "eca-logger.h" #include "samplebuffer.h" #include "audioio-buffered.h" AUDIO_IO_BUFFERED::AUDIO_IO_BUFFERED(void) : buffersize_rep(0), iobuf_uchar_repp(0), iobuf_size_rep(0) { } AUDIO_IO_BUFFERED::~AUDIO_IO_BUFFERED(void) { if (iobuf_uchar_repp != 0) { delete[] iobuf_uchar_repp; iobuf_uchar_repp = 0; iobuf_size_rep = 0; } } void AUDIO_IO_BUFFERED::reserve_buffer_space(long int bytes) { if (bytes > static_cast(iobuf_size_rep)) { if (iobuf_uchar_repp != 0) { delete[] iobuf_uchar_repp; iobuf_uchar_repp = 0; } // remember to include // std::cerr << "Reserving " << bytes << " bytes (" << label() << ").\n"; iobuf_uchar_repp = new unsigned char [bytes]; iobuf_size_rep = bytes; } } void AUDIO_IO_BUFFERED::set_buffersize(long int samples) { if (buffersize_rep != samples || static_cast(iobuf_size_rep) < buffersize_rep * frame_size()) { buffersize_rep = samples; reserve_buffer_space(buffersize_rep * frame_size()); } } void AUDIO_IO_BUFFERED::read_buffer(SAMPLE_BUFFER* sbuf) { // -------- DBC_REQUIRE(iobuf_uchar_repp != 0); DBC_REQUIRE(static_cast(iobuf_size_rep) >= buffersize_rep * frame_size()); // -------- if (interleaved_channels() == true) { sbuf->import_interleaved(iobuf_uchar_repp, read_samples(iobuf_uchar_repp, buffersize_rep), sample_format(), channels()); } else { sbuf->import_noninterleaved(iobuf_uchar_repp, read_samples(iobuf_uchar_repp, buffersize_rep), sample_format(), channels()); } if (sbuf->length_in_samples() < buffersize_rep) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "end-of-stream tag detected for '" + description() + "'"); sbuf->event_tag_set(SAMPLE_BUFFER::tag_end_of_stream); } change_position_in_samples(sbuf->length_in_samples()); // -------- DBC_ENSURE(sbuf->number_of_channels() == channels()); // -------- } void AUDIO_IO_BUFFERED::write_buffer(SAMPLE_BUFFER* sbuf) { // -------- DBC_REQUIRE(iobuf_uchar_repp != 0); DBC_REQUIRE(static_cast(iobuf_size_rep) >= buffersize_rep * frame_size()); // -------- set_buffersize(sbuf->length_in_samples()); if (interleaved_channels() == true) { sbuf->export_interleaved(iobuf_uchar_repp, sample_format(), channels()); } else { sbuf->export_noninterleaved(iobuf_uchar_repp, sample_format(), channels()); } write_samples(iobuf_uchar_repp, sbuf->length_in_samples()); change_position_in_samples(sbuf->length_in_samples()); extend_position(); } void AUDIO_IO_BUFFERED::set_channels(SAMPLE_SPECS::channel_t v) { AUDIO_IO::set_channels(v); /* adjust allocated buffers if audio format has changed */ set_buffersize(buffersize_rep); } void AUDIO_IO_BUFFERED::set_sample_format(Sample_format v) throw(ECA_ERROR&) { AUDIO_IO::set_sample_format(v); /* adjust allocated buffers if audio format has changed */ set_buffersize(buffersize_rep); } ecasound-2.9.3/libecasound/eca-control-mt.cpp0000644000076400007640000001223211762413374016107 00000000000000// ------------------------------------------------------------------------ // eca-control-mt.h: ECA_CONTROL_MT class implementation // Copyright (C) 2009,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #include "eca-control-mt.h" #include "eca-control.h" ECA_CONTROL_MT::ECA_CONTROL_MT(ECA_SESSION* psession) { pthread_mutexattr_t mutex_attr; pthread_mutexattr_init(&mutex_attr); pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&mutex_rep, &mutex_attr); ec_repp = new ECA_CONTROL(psession); } ECA_CONTROL_MT::~ECA_CONTROL_MT(void) { pthread_mutex_destroy(&mutex_rep); delete ec_repp; } void ECA_CONTROL_MT::lock_control(void) { pthread_mutex_lock(&mutex_rep); } void ECA_CONTROL_MT::unlock_control(void) { pthread_mutex_unlock(&mutex_rep); } void ECA_CONTROL_MT::engine_start(void) { pthread_mutex_lock(&mutex_rep); ec_repp->engine_start(); pthread_mutex_unlock(&mutex_rep); } int ECA_CONTROL_MT::start(void) { int res; pthread_mutex_lock(&mutex_rep); res = ec_repp->start(); pthread_mutex_unlock(&mutex_rep); return res; } void ECA_CONTROL_MT::stop(void) { pthread_mutex_lock(&mutex_rep); ec_repp->stop(); pthread_mutex_unlock(&mutex_rep); } void ECA_CONTROL_MT::stop_on_condition(void) { pthread_mutex_lock(&mutex_rep); ec_repp->stop_on_condition(); pthread_mutex_unlock(&mutex_rep); } int ECA_CONTROL_MT::run(bool batchmode) { int res; pthread_mutex_lock(&mutex_rep); res = ec_repp->run(batchmode); pthread_mutex_unlock(&mutex_rep); return res; } void ECA_CONTROL_MT::quit(void) { pthread_mutex_lock(&mutex_rep); ec_repp->quit(); pthread_mutex_unlock(&mutex_rep); } void ECA_CONTROL_MT::quit_async(void) { /* note: does not need locking! */ ec_repp->quit_async(); } bool ECA_CONTROL_MT::is_running(void) const { /* note: thread-safe as the member function is thread-safe, * but ordering across CPUs is not guaranteed (one * might get stale data */ return ec_repp->is_running(); } bool ECA_CONTROL_MT::is_connected(void) const { /* see note for is_running() */ return ec_repp->is_connected(); } bool ECA_CONTROL_MT::is_selected(void) const { /* see note for is_running() */ return ec_repp->is_selected(); } bool ECA_CONTROL_MT::is_finished(void) const { /* see note for is_running() */ return ec_repp->is_finished(); } bool ECA_CONTROL_MT::is_valid(void) const { /* see note for is_running() */ return ec_repp->is_valid(); } bool ECA_CONTROL_MT::is_engine_created(void) const { /* see note for is_running() */ return ec_repp->is_engine_created(); } bool ECA_CONTROL_MT::is_engine_ready_for_commands(void) const { /* see note for is_running() */ return ec_repp->is_engine_ready_for_commands(); } const ECA_CHAINSETUP* ECA_CONTROL_MT::get_connected_chainsetup(void) const { /* note: locking even though this is const */ const ECA_CHAINSETUP* res; pthread_mutex_lock(&mutex_rep); res = ec_repp->get_connected_chainsetup(); pthread_mutex_unlock(&mutex_rep); return res; } void ECA_CONTROL_MT::connect_chainsetup(struct eci_return_value *retval) { pthread_mutex_lock(&mutex_rep); ec_repp->connect_chainsetup(retval); pthread_mutex_unlock(&mutex_rep); } void ECA_CONTROL_MT::disconnect_chainsetup(void) { pthread_mutex_lock(&mutex_rep); ec_repp->disconnect_chainsetup(); pthread_mutex_unlock(&mutex_rep); } bool ECA_CONTROL_MT::execute_edit_on_connected(const ECA::chainsetup_edit_t& edit) { bool res; pthread_mutex_lock(&mutex_rep); res = ec_repp->execute_edit_on_connected(edit); pthread_mutex_unlock(&mutex_rep); return res; } bool ECA_CONTROL_MT::execute_edit_on_selected(const ECA::chainsetup_edit_t& edit, int index) { bool res; pthread_mutex_lock(&mutex_rep); res = ec_repp->execute_edit_on_selected(edit); pthread_mutex_unlock(&mutex_rep); return res; } void ECA_CONTROL_MT::command(const std::string& cmd_and_args, struct eci_return_value *retval) { pthread_mutex_lock(&mutex_rep); ec_repp->command(cmd_and_args, retval); pthread_mutex_unlock(&mutex_rep); } void ECA_CONTROL_MT::command_float_arg(const std::string& cmd, double arg, struct eci_return_value *retval) { pthread_mutex_lock(&mutex_rep); ec_repp->command_float_arg(cmd, arg, retval); pthread_mutex_unlock(&mutex_rep); } void ECA_CONTROL_MT::print_last_value(struct eci_return_value *retval) const { /* note: a const function that only depends on 'retval', so * this is safe */ ec_repp->print_last_value(retval); } ecasound-2.9.3/libecasound/audioio-db-buffer.cpp0000644000076400007640000000643711562466671016566 00000000000000// ------------------------------------------------------------------------ // audioio-db-buffer.cpp: Buffer used between db server and client // Copyright (C) 2000-2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "samplebuffer.h" #include "audioio-db-buffer.h" /** * Constructor. */ AUDIO_IO_DB_BUFFER::AUDIO_IO_DB_BUFFER(int number_of_buffers, long int buffersize, int channels) : readptr_rep(0), writeptr_rep(0), finished_rep(0), sbufs_rep(number_of_buffers) { for(size_t n = 0; n < sbufs_rep.size(); n++) { sbufs_rep[n] = new SAMPLE_BUFFER(buffersize, channels); } // std::cerr << "Created a new client buffer with " << sbufs_rep.size() << " buffers." << std::endl; } AUDIO_IO_DB_BUFFER::~AUDIO_IO_DB_BUFFER(void) { for(size_t n = 0; n < sbufs_rep.size(); n++) { delete sbufs_rep[n]; } } /** * Resets all pointers to their initial state. */ void AUDIO_IO_DB_BUFFER::reset(void) { readptr_rep.set(0); writeptr_rep.set(0); finished_rep.set(0); } /** * Number of sample buffer available for reading. * * Note! As concurrent access is allowed by * the implement, the actual number of * samples available for reading can * be greater than that reported by * read_space(). */ int AUDIO_IO_DB_BUFFER::read_space(void) { int write = writeptr_rep.get(); int read = readptr_rep.get(); if (write >= read) return(write - read); else return((write - read + sbufs_rep.size()) % sbufs_rep.size()); } /** * Number of sample buffers available for writing. * * Note! As concurrent access is allowed by * the implement, the actual number of * samples available for writing can * be greater than that reported by * write_space(). */ int AUDIO_IO_DB_BUFFER::write_space(void) { int write = writeptr_rep.get(); int read = readptr_rep.get(); if (write > read) return(((read - write + sbufs_rep.size()) % sbufs_rep.size()) - 1); else if (write < read) return(read - write - 1); else return(sbufs_rep.size() - 1); } /** * Increment the read pointer by one. * * Note! Cannot be called from multiple concurrent * execution contexts. **/ void AUDIO_IO_DB_BUFFER::advance_read_pointer(void) { readptr_rep.set((readptr_rep.get() + 1) % sbufs_rep.size()); } /** * Increment the write pointer by one. * * Note! Cannot be called from multiple concurrent * execution contexts. **/ void AUDIO_IO_DB_BUFFER::advance_write_pointer(void) { writeptr_rep.set((writeptr_rep.get() + 1) % sbufs_rep.size()); } ecasound-2.9.3/libecasound/eca-samplerate-aware.cpp0000644000076400007640000000245010664032032017230 00000000000000// ------------------------------------------------------------------------ // eca-samplerate-aware.: Interface class implemented by all types that // require knowledge of system samplerate // Copyright (C) 2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "eca-samplerate-aware.h" ECA_SAMPLERATE_AWARE::ECA_SAMPLERATE_AWARE(SAMPLE_SPECS::sample_rate_t srate) : srate_rep(srate) { } ECA_SAMPLERATE_AWARE::~ECA_SAMPLERATE_AWARE(void) { } void ECA_SAMPLERATE_AWARE::set_samples_per_second(long int v) { srate_rep = v; } ecasound-2.9.3/libecasound/audioio-loop.cpp0000644000076400007640000001016611501252077015657 00000000000000// ------------------------------------------------------------------------ // audioio-loop.cpp: Audio object that routes data between reads and writes // Copyright (C) 2000-2001,2004,2007,2008,2010 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include "samplebuffer.h" #include "sample-specs.h" #include "audioio-buffered.h" #include "audioio-loop.h" #include "eca-error.h" #include "eca-logger.h" using std::string; LOOP_DEVICE::LOOP_DEVICE(string tag) : AUDIO_IO("loop", io_readwrite), tag_rep(tag), sbuf(buffersize(), 0) { writes_rep = 0; registered_inputs_rep = 0; registered_outputs_rep = 0; filled_rep = false; finished_rep = false; empty_rounds_rep = 0; } LOOP_DEVICE::~LOOP_DEVICE(void) { if (is_open() == true) { close(); } } void LOOP_DEVICE::open(void) throw(AUDIO_IO::SETUP_ERROR&) { /* FIXME: once the enum is moved to sample-specs.h, * set this to whatever is set as the default * in sample-specs.h */ set_sample_format(ECA_AUDIO_FORMAT::sfmt_f32); AUDIO_IO::open(); } LOOP_DEVICE* LOOP_DEVICE::clone(void) const { LOOP_DEVICE* target = new LOOP_DEVICE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } bool LOOP_DEVICE::finished(void) const { return finished_rep; } SAMPLE_SPECS::sample_pos_t LOOP_DEVICE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { writes_rep = 0; empty_rounds_rep = 0; filled_rep = false; finished_rep = false; return pos; } void LOOP_DEVICE::read_buffer(SAMPLE_BUFFER* buffer) { if (empty_rounds_rep == 0) { if (filled_rep == true) { buffer->copy_all_content(sbuf); /* note: read_buffer() should never be called in the middle * of the 'X * write_buffer()' sequence (where X is the number * of chain outputs connected to this loop device */ DBC_CHECK(writes_rep == 0); } else { buffer->number_of_channels(channels()); buffer->make_silent(); } } else { finished_rep = true; buffer->number_of_channels(channels()); buffer->make_silent(); } DBC_ENSURE(buffer->number_of_channels() == channels()); } void LOOP_DEVICE::write_buffer(SAMPLE_BUFFER* buffer) { ++writes_rep; /* first write of a new engine iteration (and after a read) */ if (writes_rep == 1) { change_position_in_samples(buffer->length_in_samples()); extend_position(); sbuf.number_of_channels(channels()); sbuf.make_silent(); } /* check if this is the last write for this engine iteration */ if (writes_rep == registered_outputs_rep) writes_rep = 0; /* store data from 'buffer' */ if (buffer->is_empty() != true) { empty_rounds_rep = 0; sbuf.add_with_weight(*buffer, registered_outputs_rep); filled_rep = true; } /* empty 'buffer' */ else { ++empty_rounds_rep; } DBC_CHECK(sbuf.number_of_channels() == channels()); } void LOOP_DEVICE::set_parameter(int param, string value) { switch (param) { case 1: AUDIO_IO::set_parameter(param, value); break; case 2: tag_rep = value; break; } } string LOOP_DEVICE::get_parameter(int param) const { switch (param) { case 1: return AUDIO_IO::get_parameter(param); case 2: return tag_rep; } return ""; } ecasound-2.9.3/libecasound/audiofx_timebased.cpp0000644000076400007640000006027111755705217016747 00000000000000// ------------------------------------------------------------------------ // audiofx_timebased.cpp: Routines for time-based effects. // Copyright (C) 1999-2005,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include "eca-logger.h" #include "samplebuffer_iterators.h" #include "sample-ops_impl.h" #include "audiofx_timebased.h" static void priv_check_for_zerodelay(long int *dtime, OPERATOR::parameter_t *dtime_msec, long int srate) { if (*dtime == 0) { *dtime = 1; *dtime_msec = 1 / (CHAIN_OPERATOR::parameter_t)srate * 1000.0; ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: delay of 0 samples not supported, delay set to 1 sample"); } } EFFECT_DELAY::EFFECT_DELAY (CHAIN_OPERATOR::parameter_t delay_time, int surround_mode, int num_of_delays, CHAIN_OPERATOR::parameter_t mix_percent, CHAIN_OPERATOR::parameter_t feedback_percent) { laskuri = 0.0; set_parameter(1, delay_time); set_parameter(2, surround_mode); set_parameter(3, num_of_delays); set_parameter(4, mix_percent); set_parameter(5, feedback_percent); } void EFFECT_DELAY::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 100.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 2: pd->default_value = 0.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 1.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = true; pd->integer = true; pd->logarithmic = false; pd->output = false; break; case 3: pd->default_value = 1.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; // pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; break; case 4: pd->default_value = 50.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 5: pd->default_value = 100.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: {} } } CHAIN_OPERATOR::parameter_t EFFECT_DELAY::get_parameter(int param) const { switch (param) { case 1: return dtime_msec; case 2: return surround; case 3: return dnum; case 4: return mix * 100.0; case 5: return feedback * 100.0; } return 0.0; } void EFFECT_DELAY::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: { dtime_msec = value; dtime = dtime_msec * (CHAIN_OPERATOR::parameter_t)samples_per_second() / 1000; priv_check_for_zerodelay(&dtime, &dtime_msec, samples_per_second()); std::vector >::iterator p = buffer.begin(); while(p != buffer.end()) { std::vector::iterator q = p->begin(); while(q != p->end()) { if (q->size() > static_cast(dtime)) { q->resize(static_cast(dtime)); laskuri = dtime; } ++q; } ++p; } break; } case 2: surround = value; break; case 3: { if (value != 0.0) dnum = static_cast(value); else dnum = 1.0; std::vector >::iterator p = buffer.begin(); while(p != buffer.end()) { p->resize(static_cast(dnum)); ++p; } laskuri = 0; break; } case 4: mix = value / 100.0; break; case 5: if (value == 0 || value > 100) { feedback = 1.0; } else { feedback = value / 100.0; } break; } } void EFFECT_DELAY::init(SAMPLE_BUFFER* insample) { l.init(insample); r.init(insample); EFFECT_BASE::init(insample); set_parameter(1, dtime_msec); buffer.resize(2, std::vector (static_cast(dnum))); for(size_t i = 0; i < buffer.size(); i++) { for(size_t j = 0; j < buffer[i].size(); j++) { buffer[i].clear(); } } } void EFFECT_DELAY::process(void) { l.begin(SAMPLE_SPECS::ch_left); r.begin(SAMPLE_SPECS::ch_right); while(!l.end() && !r.end()) { SAMPLE_SPECS::sample_t temp2_left = 0.0; SAMPLE_SPECS::sample_t temp2_right = 0.0; // Initializing the feedback factor to one. (x*1 = x) SAMPLE_SPECS::sample_t feedfact = 1; for(int nm2 = 0; nm2 < dnum; nm2++) { SAMPLE_SPECS::sample_t temp_left = 0.0; SAMPLE_SPECS::sample_t temp_right = 0.0; // Preparing the factor... feedfact *= feedback; if (laskuri >= dtime * (nm2 + 1)) { switch ((int)surround) { case 0: { // --- // surround temp_left = buffer[SAMPLE_SPECS::ch_left][nm2].front(); temp_right = buffer[SAMPLE_SPECS::ch_right][nm2].front(); break; } case 1: { // --- // surround temp_left = buffer[SAMPLE_SPECS::ch_right][nm2].front(); temp_right = buffer[SAMPLE_SPECS::ch_left][nm2].front(); break; } case 2: { if (nm2 % 2 == 0) { temp_left = (buffer[SAMPLE_SPECS::ch_left][nm2].front() + buffer[SAMPLE_SPECS::ch_right][nm2].front()) / 2.0; temp_right = 0.0; } else { temp_right = (buffer[SAMPLE_SPECS::ch_left][nm2].front() + buffer[SAMPLE_SPECS::ch_right][nm2].front()) / 2.0; temp_left = 0.0; } break; } } // switch // Applying the reduction. temp_left *= feedfact; temp_right *= feedfact; buffer[SAMPLE_SPECS::ch_left][nm2].pop_front(); buffer[SAMPLE_SPECS::ch_right][nm2].pop_front(); } buffer[SAMPLE_SPECS::ch_left][nm2].push_back(*l.current()); buffer[SAMPLE_SPECS::ch_right][nm2].push_back(*r.current()); temp2_left += temp_left / dnum; temp2_right += temp_right / dnum; } *l.current() = (*l.current() * (1.0 - mix)) + (temp2_left * mix); *r.current() = (*r.current() * (1.0 - mix)) + (temp2_right * mix); l.next(); r.next(); if (laskuri < dtime * dnum) laskuri++; } } EFFECT_MULTITAP_DELAY::EFFECT_MULTITAP_DELAY (CHAIN_OPERATOR::parameter_t delay_time, int num_of_delays, CHAIN_OPERATOR::parameter_t mix_percent) : delay_index(0), filled (0), buffer (0) { set_parameter(1, delay_time); set_parameter(2, num_of_delays); set_parameter(3, mix_percent); } void EFFECT_MULTITAP_DELAY::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 100.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 2: pd->default_value = 1.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; // pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; break; case 3: pd->default_value = 50.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: {} } } CHAIN_OPERATOR::parameter_t EFFECT_MULTITAP_DELAY::get_parameter(int param) const { switch (param) { case 1: return dtime_msec; case 2: return dnum; case 3: return mix * 100.0; } return 0.0; } void EFFECT_MULTITAP_DELAY::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: { dtime_msec = value; dtime = static_cast(dtime_msec * (CHAIN_OPERATOR::parameter_t)samples_per_second() / 1000); priv_check_for_zerodelay(&dtime, &dtime_msec, samples_per_second()); DBC_CHECK(buffer.size() == filled.size()); for(int n = 0; n < static_cast(buffer.size()); n++) { if ((dtime * dnum) > static_cast(buffer[n].size())) { buffer[n].resize(dtime * dnum); } delay_index[n] = dtime * dnum - 1; for(int m = 0; m < static_cast(filled[n].size()); m++) { filled[n][m] = false; } } break; } case 2: { if (value != 0.0) dnum = static_cast(value); else dnum = 1; DBC_CHECK(buffer.size() == filled.size()); for(int n = 0; n < static_cast(buffer.size()); n++) { if ((dtime * dnum) > static_cast(buffer[n].size())) { buffer[n].resize(dtime * dnum); } for(int m = 0; m < static_cast(filled[n].size()); m++) { filled[n][m] = false; } delay_index[n] = dtime * dnum - 1; } break; } case 3: mix = value / 100.0; break; } } void EFFECT_MULTITAP_DELAY::init(SAMPLE_BUFFER* insample) { i.init(insample); EFFECT_BASE::init(insample); set_parameter(1, dtime_msec); delay_index.resize(channels(), dtime * dnum - 1); filled.resize(channels(), std::vector (dnum, false)); buffer.resize(channels(), std::vector (dtime * dnum)); for(int i = 0; i < channels(); i++) { delay_index[i] = dtime * dnum - 1; for(size_t j = 0; j < filled[i].size(); j++) filled[i][j] = false; for(size_t j = 0; j < buffer[i].size(); j++) buffer[i][j] = 0.0f; } } void EFFECT_MULTITAP_DELAY::process(void) { long int len = dtime * dnum; i.begin(); while(!i.end()) { for(int n = 0; n < channels(); n++) { SAMPLE_SPECS::sample_t temp1 = 0.0; for(int nm2 = 0; nm2 < dnum; nm2++) { if (filled[n][nm2] == true) { DBC_CHECK((delay_index[n] + nm2 * dtime) % len >= 0); DBC_CHECK((delay_index[n] + nm2 * dtime) % len < len); temp1 += buffer[n][(delay_index[n] + nm2 * dtime) % len]; } } buffer[n][delay_index[n]] = *i.current(n); *i.current(n) = (*i.current(n) * (1.0 - mix)) + (temp1 * mix / dnum); --(delay_index[n]); for(int nm2 = 0; nm2 < dnum; nm2++) { if (delay_index[n] < len - dtime * nm2) filled[n][nm2] = true; } if (delay_index[n] == -1) delay_index[n] = len - 1; } i.next(); } } EFFECT_FAKE_STEREO::EFFECT_FAKE_STEREO (CHAIN_OPERATOR::parameter_t delay_time) { set_parameter(1, delay_time); } void EFFECT_FAKE_STEREO::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 20.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: {} } } CHAIN_OPERATOR::parameter_t EFFECT_FAKE_STEREO::get_parameter(int param) const { switch (param) { case 1: return dtime_msec; } return 0.0; } void EFFECT_FAKE_STEREO::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: dtime_msec = value; dtime = dtime_msec * (CHAIN_OPERATOR::parameter_t)samples_per_second() / 1000; priv_check_for_zerodelay(&dtime, &dtime_msec, samples_per_second()); std::vector >::iterator p = buffer.begin(); while(p != buffer.end()) { if (p->size() > static_cast(dtime)) { p->resize(static_cast(dtime)); } ++p; } break; } } void EFFECT_FAKE_STEREO::init(SAMPLE_BUFFER* insample) { l.init(insample); r.init(insample); EFFECT_BASE::init(insample); set_parameter(1, dtime_msec); buffer.resize(2); for(size_t i = 0; i < buffer.size(); i++) { for(size_t j = 0; j < buffer[i].size(); j++) { buffer[i].clear(); } } } void EFFECT_FAKE_STEREO::process(void) { l.begin(SAMPLE_SPECS::ch_left); r.begin(SAMPLE_SPECS::ch_right); while(!l.end() && !r.end()) { SAMPLE_SPECS::sample_t temp_left = 0; SAMPLE_SPECS::sample_t temp_right = 0; if (buffer[SAMPLE_SPECS::ch_left].size() >= static_cast(dtime)) { temp_left = buffer[SAMPLE_SPECS::ch_left].front(); temp_right = buffer[SAMPLE_SPECS::ch_right].front(); temp_right = (temp_left + temp_right) / 2.0; temp_left = (*l.current() + *r.current()) / 2.0; buffer[SAMPLE_SPECS::ch_left].pop_front(); buffer[SAMPLE_SPECS::ch_right].pop_front(); } else { temp_left = (*l.current() + *r.current()) / 2.0; temp_right = 0.0; } buffer[SAMPLE_SPECS::ch_left].push_back(*l.current()); buffer[SAMPLE_SPECS::ch_right].push_back(*r.current()); *l.current() = temp_left; *r.current() = temp_right; l.next(); r.next(); } } EFFECT_REVERB::EFFECT_REVERB (CHAIN_OPERATOR::parameter_t delay_time, int surround_mode, CHAIN_OPERATOR::parameter_t feedback_percent) { set_parameter(1, delay_time); set_parameter(2, surround_mode); set_parameter(3, feedback_percent); } void EFFECT_REVERB::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 20.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; // pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 2: pd->default_value = 0.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 1.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = true; pd->integer = true; pd->logarithmic = false; pd->output = false; break; case 3: pd->default_value = 50.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: {} } } CHAIN_OPERATOR::parameter_t EFFECT_REVERB::get_parameter(int param) const { switch (param) { case 1: return dtime_msec; case 2: return surround; case 3: return feedback * 100.0; } return 0.0; } void EFFECT_REVERB::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: { dtime_msec = value; dtime = dtime_msec * (CHAIN_OPERATOR::parameter_t)samples_per_second() / 1000; priv_check_for_zerodelay(&dtime, &dtime_msec, samples_per_second()); std::vector >::iterator p = buffer.begin(); while(p != buffer.end()) { if (p->size() > static_cast(dtime)) { p->resize(static_cast(dtime)); } ++p; } break; } case 2: surround = value; break; case 3: feedback = value / 100.0; break; } } void EFFECT_REVERB::init(SAMPLE_BUFFER* insample) { l.init(insample); r.init(insample); EFFECT_BASE::init(insample); set_parameter(1, dtime_msec); buffer.resize(2); for(size_t i = 0; i < buffer.size(); i++) { for(size_t j = 0; j < buffer[i].size(); j++) { buffer[i].clear(); } } } void EFFECT_REVERB::process(void) { l.begin(SAMPLE_SPECS::ch_left); r.begin(SAMPLE_SPECS::ch_right); while(!l.end() && !r.end()) { SAMPLE_SPECS::sample_t temp_left = 0.0; SAMPLE_SPECS::sample_t temp_right = 0.0; if (buffer[SAMPLE_SPECS::ch_left].size() >= static_cast(dtime)) { temp_left = buffer[SAMPLE_SPECS::ch_left].front(); temp_right = buffer[SAMPLE_SPECS::ch_right].front(); if (surround == 0) { *l.current() = (*l.current() * (1 - feedback)) + (temp_left * feedback); *r.current() = (*r.current() * (1 - feedback)) + (temp_right * feedback); } else { *l.current() = (*l.current() * (1 - feedback)) + (temp_right * feedback); *r.current() = (*r.current() * (1 - feedback)) + (temp_left * feedback); } buffer[SAMPLE_SPECS::ch_left].pop_front(); buffer[SAMPLE_SPECS::ch_right].pop_front(); } else { *l.current() = (*l.current() * (1 - feedback)); *r.current() = (*r.current() * (1 - feedback)); } *l.current() = ecaops_flush_to_zero(*l.current()); *r.current() = ecaops_flush_to_zero(*r.current()); buffer[SAMPLE_SPECS::ch_left].push_back(*l.current()); buffer[SAMPLE_SPECS::ch_right].push_back(*r.current()); l.next(); r.next(); } } EFFECT_MODULATING_DELAY::EFFECT_MODULATING_DELAY(CHAIN_OPERATOR::parameter_t delay_time, long int vartime_in_samples, CHAIN_OPERATOR::parameter_t feedback_percent, CHAIN_OPERATOR::parameter_t lfo_freq) { set_parameter(1, delay_time); set_parameter(2, vartime_in_samples); set_parameter(3, feedback_percent); set_parameter(4, lfo_freq); } void EFFECT_MODULATING_DELAY::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 2.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 2: pd->default_value = 20.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; // pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; break; case 3: pd->default_value = 50.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 4: pd->default_value = 0.4f; pd->description = get_parameter_name(param); pd->bounded_above = false; // pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: {} } } CHAIN_OPERATOR::parameter_t EFFECT_MODULATING_DELAY::get_parameter(int param) const { switch (param) { case 1: return dtime_msec; case 2: return vartime; case 3: return feedback * 100.0; case 4: return lfo.get_parameter(1); } return 0.0; } void EFFECT_MODULATING_DELAY::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: { dtime_msec = value; dtime = static_cast(dtime_msec * (CHAIN_OPERATOR::parameter_t)samples_per_second() / 1000); priv_check_for_zerodelay(&dtime, &dtime_msec, samples_per_second()); DBC_CHECK(buffer.size() == delay_index.size()); DBC_CHECK(buffer.size() == filled.size()); for(int n = 0; n < static_cast(buffer.size()); n++) { if (dtime * 2 > static_cast(buffer[n].size())) { buffer[n].resize(dtime * 2); } delay_index[n] = 0; filled[n] = false; } break; } case 2: vartime = value; break; case 3: feedback = value / 100.0; break; case 4: lfo.set_parameter(1, value); break; } } void EFFECT_MODULATING_DELAY::init(SAMPLE_BUFFER* insample) { i.init(insample); lfo.init(); if (samples_per_second() > 0) advance_len_secs_rep = ((double)insample->length_in_samples()) / samples_per_second(); else advance_len_secs_rep = 0; set_parameter(1, dtime_msec); EFFECT_BASE::init(insample); filled.resize(channels(), false); delay_index.resize(channels(), 2 * dtime); buffer.resize(channels(), std::vector (2 * dtime)); for(size_t i = 0; i < buffer.size(); i++) { for(size_t j = 0; j < buffer[i].size(); j++) { buffer[i][j] = 0.0f; } } } void EFFECT_MODULATING_DELAY::process(void) { lfo_pos_secs_rep += advance_len_secs_rep; } void EFFECT_FLANGER::process(void) { EFFECT_MODULATING_DELAY::process(); i.begin(); while(!i.end()) { SAMPLE_SPECS::sample_t temp1 = 0.0; parameter_t p = vartime * lfo.value(lfo_pos_secs_rep); if (filled[i.channel()] == true) { DBC_CHECK((dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2) >= 0); DBC_CHECK((dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2) < static_cast(buffer[i.channel()].size())); temp1 = buffer[i.channel()][(dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2)]; } *i.current() = ecaops_flush_to_zero((*i.current() * (1.0 - feedback)) + (temp1 * feedback)); buffer[i.channel()][delay_index[i.channel()]] = *i.current(); ++(delay_index[i.channel()]); if (delay_index[i.channel()] == 2 * dtime) { delay_index[i.channel()] = 0; filled[i.channel()] = true; } i.next(); } } void EFFECT_CHORUS::process(void) { EFFECT_MODULATING_DELAY::process(); i.begin(); while(!i.end()) { SAMPLE_SPECS::sample_t temp1 = 0.0; parameter_t p = vartime * lfo.value(lfo_pos_secs_rep); if (filled[i.channel()] == true) { DBC_CHECK((dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2) >= 0); DBC_CHECK((dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2) < static_cast(buffer[i.channel()].size())); temp1 = buffer[i.channel()][(dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2)]; } buffer[i.channel()][delay_index[i.channel()]] = *i.current(); *i.current() = (*i.current() * (1.0 - feedback)) + (temp1 * feedback); ++(delay_index[i.channel()]); if (delay_index[i.channel()] == 2 * dtime) { delay_index[i.channel()] = 0; filled[i.channel()] = true; } i.next(); } } void EFFECT_PHASER::process(void) { EFFECT_MODULATING_DELAY::process(); i.begin(); while(!i.end()) { SAMPLE_SPECS::sample_t temp1 = 0.0; parameter_t p = vartime * lfo.value(lfo_pos_secs_rep); if (filled[i.channel()] == true) { DBC_CHECK((dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2) >= 0); DBC_CHECK((dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2) < static_cast(buffer[i.channel()].size())); temp1 = buffer[i.channel()][(dtime + delay_index[i.channel()] + static_cast(p)) % (dtime * 2)]; // cerr << "b: " // << (delay_index[i.channel()] + static_cast(p)) % dtime // << "," << p << ".\n"; } *i.current() = ecaops_flush_to_zero(*i.current() * (1.0 - feedback) + (-1.0 * temp1 * feedback)); buffer[i.channel()][delay_index[i.channel()]] = *i.current(); ++(delay_index[i.channel()]); if (delay_index[i.channel()] == 2 * dtime) { delay_index[i.channel()] = 0; filled[i.channel()] = true; } i.next(); } } ecasound-2.9.3/libecasound/eca-logger-wellformed.h0000644000076400007640000000144110664032032017057 00000000000000#ifndef INCLUDE_ECA_LOGGER_WELLFORMED_H #define INCLUDE_ECA_LOGGER_WELLFORMED_H #include #include #include "eca-logger-interface.h" /** * Logging implementation that outputs * messages in a well-formed format. The * exact syntax is defined in TBD. * * @author Kai Vehmanen */ class ECA_LOGGER_WELLFORMED : public ECA_LOGGER_INTERFACE { public: ECA_LOGGER_WELLFORMED(void); virtual ~ECA_LOGGER_WELLFORMED(void); virtual void do_msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message); virtual void do_flush(void); virtual void do_log_level_changed(void); static std::string create_wellformed_message(ECA_LOGGER::Msg_level_t level, const std::string& message); }; #endif /* INCLUDE_ECA_LOGGER_WELLFORMED_H */ ecasound-2.9.3/libecasound/libecasound-config.in0000755000076400007640000000175511167714635016660 00000000000000#!/bin/sh usage() { echo "usage: $0 [OPTIONS]" cat << EOH options: [--prefix] [--libs] [--libs_debug] [--ldflags] [--cflags] [--version] EOH exit 1; } prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ libecasound_version=@LIBECASOUND_VERSION@ libkvutils_version=@LIBKVUTILS_VERSION@ flags="" while test $# -gt 0 do case $1 in --prefix) flags="$flags $prefix" ;; --libs) flags="$flags -L$libdir -lecasound -lkvutils @ECA_S_EXTRA_LIBS@" ;; --libs_debug) flags="$flags -L$libdir -lecasound_debug -lkvutils_debug @ECA_S_EXTRA_LIBS@" ;; --ldflags) case "$libdir" in /usr/lib);; *) flags="$flags -Wl,--rpath -Wl,$libdir" ;; esac ;; --cflags) flags="$flags -I$includedir/libecasound -I$includedir/kvutils @ECA_S_EXTRA_CPPFLAGS@" ;; --version) echo @VERSION@ ;; *) echo "$0: unknown option $1" echo usage ;; esac shift done if test -n "$flags" then echo $flags fi ecasound-2.9.3/libecasound/eca-logger-interface.h0000644000076400007640000000542011172717317016673 00000000000000// ------------------------------------------------------------------------ // eca-logger-interface.h: Logging subsystem interface // Copyright (C) 2002-2004,2009 Kai Vehmanen // // Attributes: // eca-style-version: 2 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDE_ECA_LOGGER_INTERFACE_H #define INCLUDE_ECA_LOGGER_INTERFACE_H #include /* remove me */ #include #include #include "eca-logger.h" /** * Virtual base class for logging subsystem implementations. * * @author Kai Vehmanen */ class ECA_LOGGER_INTERFACE { public: ECA_LOGGER_INTERFACE(void); virtual ~ECA_LOGGER_INTERFACE(void); void msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message); void flush(void); void disable(void); void set_log_history_length(int len); void set_log_level(ECA_LOGGER::Msg_level_t level, bool enabled); const std::list& log_history(void) const { return log_history_rep; } /** * Gets current log level bitmask. */ int get_log_level_bitmask(void) const { return debug_value_rep; } /** * Sets state of all logging types according to 'bitmask'. */ void set_log_level_bitmask(int level_bitmask) { debug_value_rep = static_cast(level_bitmask); } /** * Whether 'level' is set or not? */ bool is_log_level_set(ECA_LOGGER::Msg_level_t level) const { return (level & debug_value_rep) > 0 ? true : false; } protected: virtual void do_msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message) = 0; virtual void do_flush(void) = 0; virtual void do_log_level_changed(void) = 0; static std::string filter_module_name(const std::string& rawmodule); static void format_log_msg(std::string *logmsg, ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message); private: int debug_value_rep; int log_history_len_rep; std::list log_history_rep; int extlog_debug_level_rep; FILE *extlog_file_repp; }; #endif ecasound-2.9.3/libecasound/eca-test-case.h0000644000076400007640000000303211141030171015321 00000000000000#ifndef INCLUDE_ECA_TEST_CASE_H #define INCLUDE_ECA_TEST_CASE_H #include #include /** * Macro definitions for subclasses * of ECA_TEST_CASE */ /** * Reports a failed assertion. * * @see ECA_TEST_CASE::report_failure * * @param x description, type 'const string&' */ #define ECA_TEST_FAILURE(x) \ do { report_failure(__FILE__, __LINE__, x); } while(0) /** * Abstract interface for implementing * test cases for component testing. * * @author Kai Vehmanen */ class ECA_TEST_CASE { public: /** @name Constructors and destructors */ /*@{*/ ECA_TEST_CASE(void); virtual ~ECA_TEST_CASE(void); /*@}*/ /** @name Public interface for running tests */ void run(void); void run(const std::string &name); /*@}*/ /** @name Public interface for queryng test results */ std::string name(void) const; bool success(void) const; const std::list& failures(void) const; /*@}*/ protected: /** @name Protected interface for reporting test failures */ void report_failure(const std::string& filename, int lineno, const std::string& description); /*@}*/ /** * @name Abtract virtual functions that need * to be defined by all subclasses. */ virtual std::string do_name(void) const = 0; virtual void do_run(void) = 0; virtual void do_run(const std::string& name); /*@}*/ private: void run_common_before(void); void run_common_after(void); std::list failures_rep; bool success_rep; }; #endif /* INCLUDE_ECA_TEST_CASE_H */ ecasound-2.9.3/libecasound/audioio_test.h0000644000076400007640000000455310664032032015413 00000000000000// ------------------------------------------------------------------------ // audioio_test.h: Unit test for AUDIO_IO // Copyright (C) 2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "audioio.h" #include "eca-object-factory.h" #include "eca-object-map.h" #include "kvu_numtostr.h" #include "eca-logger.h" #include "eca-test-case.h" using namespace std; /** * Unit test for AUDIO_IO. * * FIXME: implementation not ready */ class AUDIO_IO_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for AUDIO_IO"); } virtual void do_run(void); public: virtual ~AUDIO_IO(void) { } }; void AUDIO_IOTEST::do_run(void) { /** * - create AUDIO_IO types from ECA_OBJECT_FACTORY * - check that type supports both read and write modes * - create a test filename * - repeat for permutations of 'audio_format' * and buffersize: * - open for write * - verify is_open ' * - write random length of data (len1, predefined content) * - close * - verify close * - if read_n_write mode supported: * - open for read_write * - verify is_open * - seek_to_end * - write random length of data (len2, predefined content) * - close * - verify close * - open for read * - verify is_open * - read clip1 from start (seek + read) * - read clip2 from random pos * - verify that clip1 and clip2 match written data * - check file length against len1+len2 * - close * - verify close * - remove file */ } ecasound-2.9.3/libecasound/eca-chainop.h0000644000076400007640000000452411755700042015075 00000000000000#ifndef INCLUDED_CHAINOP_H #define INCLUDED_CHAINOP_H #include #include #include "eca-operator.h" #include "eca-audio-format.h" #include "sample-specs.h" class SAMPLE_BUFFER; /** * Virtual base class for chain operators. * @author Kai Vehmanen */ class CHAIN_OPERATOR : public OPERATOR { public: /** * Virtual destructor. */ virtual ~CHAIN_OPERATOR (void) { } /** * Prepares chain operator for processing. * * This function is called at least once before * the first call to process(). * * Whenever attributes of the sample buffer pointed * by 'sbuf' are changed, chain operator should * be reinitialized with a new call to init(). * * Init should also reset any state, including any audio * buffers, from previous process() cycles. * * @param sbuf pointer to a sample buffer object * * @see release */ virtual void init(SAMPLE_BUFFER* sbuf) = 0; /** * Releases the buffer that was used to initialize * the chain operator. * * This function is called after the last call * to process(). * * After release(), chain operator is not * allowed to access the sample buffer given * to init(). * * @see init() */ virtual void release(void) { } /** * Processes sample data in the buffer passed * to init(). */ virtual void process(void) = 0; /** * Returns a string describing chain operator's * current status. * * @param single_sample pointer to a single sample */ virtual std::string status(void) const { return(""); } /** * Returns the maximum length of the sample buffer after * a call to process(), if the buffer's original * length was 'i_samples'. * * This function should be reimplemented by chain * operator types that add or remove samples * from the input data stream. * * @see process() */ virtual long int max_output_samples(long int i_samples) const { return(i_samples); } /** * Returns number of channels of the sample buffer * after a call to process(), if the buffer originally * had 'i_channels' channels. * * This function should be reimplemented by chain * operator types that change the channel count * during processing. * * @see process() */ virtual int output_channels(int i_channels) const { return(i_channels); } }; #endif ecasound-2.9.3/libecasound/layer.h0000644000076400007640000000506010664032032014031 00000000000000/* layer.h Created by SMF aka Antoine Laydier . Minor modifications by Kai Vehmanen . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _LAYER_ #define _LAYER_ /*============================================================================= HEADERs =============================================================================*/ #include /*============================================================================= CLASSes =============================================================================*/ //----------------------------------------------------------------------------- // class Layer //----------------------------------------------------------------------------- /** * Mp3 header parsing */ class Layer { public: const char * mode_name(void); const char * layer_name(void); const char * version_name(void); const char * version_num(void); unsigned int bitrate(void); unsigned int sfreq(void); unsigned long length(void); unsigned int pcmPerFrame(void); int mode(void); bool get(const char* filename); static const char * mode_names[5]; static const char * layer_names[3]; static const char * version_names[3]; static const char * version_nums[3]; static const unsigned int bitrates[3][3][15]; static const unsigned int s_freq[3][4]; static const int MPG_MD_STEREO; static const int MPG_MD_JOINT_STEREO; static const int MPG_MD_DUAL_CHANNEL; static const int MPG_MD_MONO; static const int MPG_MD_LR_LR; static const int MPG_MD_LR_I; static const int MPG_MD_MS_LR; static const int MPG_MD_MS_I; private: int version_rep; int lay_rep; int error_protection_rep; int bitrate_index_rep; int sampling_frequency_rep; int padding_rep; int extension_rep; int mode_rep; int mode_ext_rep; int copyright_rep; int original_rep; int emphasis_rep; int stereo_rep; unsigned int pcm_rep; unsigned long fileSize_rep; }; #endif ecasound-2.9.3/libecasound/audioio-resample.cpp0000644000076400007640000003166011352471254016524 00000000000000// ------------------------------------------------------------------------ // audioio-resample.cpp: A proxy class that resamples the child // object's data. // Copyright (C) 2002-2004,2008,2009,2010 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include /* atoi() */ #include /* ceil(), floor() */ #include #include #include #include #include "audioio-resample.h" #include "eca-logger.h" #include "eca-object-factory.h" #include "samplebuffer.h" // #define RESAMPLE_VERBOSE_DEBUG 1 /** * Constructor. */ AUDIO_IO_RESAMPLE::AUDIO_IO_RESAMPLE (void) : psfactor_rep(1.0f), sbuf_rep(buffersize(), 0) { init_rep = false; quality_rep = 50; } /** * Destructor. */ AUDIO_IO_RESAMPLE::~AUDIO_IO_RESAMPLE (void) { } AUDIO_IO_RESAMPLE* AUDIO_IO_RESAMPLE::clone(void) const { AUDIO_IO_RESAMPLE* target = new AUDIO_IO_RESAMPLE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIO_IO_RESAMPLE::recalculate_psfactor(void) { DBC_REQUIRE(child_srate_conf_rep > 0); DBC_REQUIRE(io_mode() == AUDIO_IO::io_read); psfactor_rep = static_cast(samples_per_second()) / child_srate_conf_rep; child()->set_buffersize(static_cast(std::floor(buffersize() * (1.0f / psfactor_rep)))); ECA_LOG_MSG(ECA_LOGGER::user_objects, "recalc; psfactor=" + kvu_numtostr(psfactor_rep)); } void AUDIO_IO_RESAMPLE::open(void) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "open " + child_params_as_string(1 + AUDIO_IO_RESAMPLE::child_parameter_offset, ¶ms_rep) + "."); if (init_rep != true) { AUDIO_IO* tmp = 0; const string& objname = child_params_as_string(1 + AUDIO_IO_RESAMPLE::child_parameter_offset, ¶ms_rep); if (objname.size() > 0) tmp = ECA_OBJECT_FACTORY::create_audio_object(objname); /* FIXME: add check for real-time devices, resample does _not_ * work with them (rt API not proxied properly) */ if (tmp == 0) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-RESAMPLE: unable to open child object '" + objname + "'")); set_child(tmp); int numparams = child()->number_of_params(); for(int n = 0; n < numparams; n++) { child()->set_parameter(n + 1, get_parameter(n + 1 + AUDIO_IO_RESAMPLE::child_parameter_offset)); if (child()->variable_params()) numparams = child()->number_of_params(); } init_rep = true; /* must be set after dyn. parameters */ } if (child_srate_conf_rep == 0) { /* query the sampling rate from child object */ child()->set_io_mode(io_mode()); child()->set_audio_format(audio_format()); child()->open(); child_srate_conf_rep = child()->samples_per_second(); child()->close(); } if (io_mode() != AUDIO_IO::io_read) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-RESAMPLE: 'io_write' and 'io_readwrite' modes are not supported.")); recalculate_psfactor(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "pre-open(); psfactor=" + kvu_numtostr(psfactor_rep) + ", child_srate=" + kvu_numtostr(child_srate_conf_rep) + ", srate=" + kvu_numtostr(samples_per_second()) + ", bsize=" + kvu_numtostr(buffersize()) + ", c-bsize=" + kvu_numtostr(child()->buffersize()) + ", child=" + child()->label() + "."); /* note, we don't use pre_child_open() as * we want to set srate differently */ child()->set_io_mode(io_mode()); child()->set_audio_format(audio_format()); child()->set_samples_per_second(child_srate_conf_rep); child()->open(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "post-open(); child=" + child()->label() + "."); /* same for the post processing */ SAMPLE_SPECS::sample_rate_t orig_srate = samples_per_second(); if (child()->locked_audio_format() == true) { set_channels(child()->channels()); set_sample_format(child()->sample_format()); set_samples_per_second(orig_srate); toggle_interleaved_channels(child()->interleaved_channels()); } sbuf_rep.length_in_samples(buffersize()); sbuf_rep.number_of_channels(channels()); sbuf_rep.resample_init_memory(child_srate_conf_rep, samples_per_second()); sbuf_rep.resample_set_quality(quality_rep); set_label("resample:" + child()->label()); set_length_in_samples(static_cast(std::ceil(child()->length_in_samples() * psfactor_rep))); //set_length_in_seconds(child()->length_in_seconds_exact()); AUDIO_IO_PROXY::open(); } void AUDIO_IO_RESAMPLE::close(void) { if (child()->is_open() == true) child()->close(); init_rep = false; AUDIO_IO_PROXY::close(); } void AUDIO_IO_RESAMPLE::set_buffersize(long int samples) { if (samples != buffersize()) { long old_bsize = buffersize(); AUDIO_IO_PROXY::set_buffersize(samples); child()->set_buffersize(static_cast(std::floor(samples * (1.0f / psfactor_rep)))); ECA_LOG_MSG(ECA_LOGGER::user_objects, "setting bsize from " + kvu_numtostr(old_bsize) + " to " + kvu_numtostr(child()->buffersize())); } } long int AUDIO_IO_RESAMPLE::buffersize(void) const { return AUDIO_IO_PROXY::buffersize(); } string AUDIO_IO_RESAMPLE::parameter_names(void) const { return string("resample,srate,") + child()->parameter_names(); } void AUDIO_IO_RESAMPLE::set_parameter(int param, string value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, AUDIO_IO::parameter_set_to_string(param, value)); /* total of n+1 params, where n is number of childobj params */ if (param > static_cast(params_rep.size())) params_rep.resize(param); if (param > 0) { params_rep[param - 1] = value; if (param == 1) { if (value == "resample-hq") { quality_rep = 100; ECA_LOG_MSG(ECA_LOGGER::user_objects, "using high-quality resampler"); } else if (value == "resample-lq") { quality_rep = 5; ECA_LOG_MSG(ECA_LOGGER::user_objects, "using low-quality resampler"); } else { quality_rep = 50; ECA_LOG_MSG(ECA_LOGGER::user_objects, "using default resampler"); } } else if (param == 2) { if (value == "auto") { if (init_rep != true) child_srate_conf_rep = 0; ECA_LOG_MSG(ECA_LOGGER::user_objects, "resampling with automatic detection of child srate"); } else { child_srate_conf_rep = std::atoi(value.c_str()); ECA_LOG_MSG(ECA_LOGGER::user_objects, "resampling w/ child srate of " + kvu_numtostr(child_srate_conf_rep)); } } } sbuf_rep.resample_set_quality(quality_rep); if (param > AUDIO_IO_RESAMPLE::child_parameter_offset && init_rep == true) { child()->set_parameter(param - AUDIO_IO_RESAMPLE::child_parameter_offset, value); } } string AUDIO_IO_RESAMPLE::get_parameter(int param) const { if (param > 0 && param < static_cast(params_rep.size()) + 1) { if (param > AUDIO_IO_RESAMPLE::child_parameter_offset && init_rep == true) { params_rep[param - 1] = child()->get_parameter(param - AUDIO_IO_RESAMPLE::child_parameter_offset); } return params_rep[param - 1]; } return ""; } SAMPLE_SPECS::sample_pos_t AUDIO_IO_RESAMPLE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { SAMPLE_SPECS::sample_pos_t pub_pos, child_pos = static_cast(std::floor(pos * (1.0f / psfactor_rep))); child()->seek_position_in_samples(child_pos); child_pos = child()->position_in_samples(); pub_pos = static_cast(std::floor(child_pos * (psfactor_rep))); return pub_pos; } void AUDIO_IO_RESAMPLE::set_audio_format(const ECA_AUDIO_FORMAT& f_str) { AUDIO_IO::set_audio_format(f_str); child()->set_audio_format(f_str); /* set_audio_format() also sets the sample rate so we need to reset the value back to the correct one */ child()->set_samples_per_second(child_srate_conf_rep); } void AUDIO_IO_RESAMPLE::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { /* the child srate is set in open */ if (child()->is_open() == true) recalculate_psfactor(); AUDIO_IO::set_samples_per_second(v); } void AUDIO_IO_RESAMPLE::read_buffer(SAMPLE_BUFFER* dst_sbuf) { long int dst_left = buffersize(); SAMPLE_BUFFER::buf_size_t dst_write_pos = 0; dst_sbuf->number_of_channels(channels()); dst_sbuf->length_in_samples(dst_left); #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "--- (%ld samples)\n", dst_left); #endif /* step: copy any leftover resampled audio from * last iteration */ if (dst_left > 0 && leftoverbuf_rep.length_in_samples() > 0) { DBC_CHECK(leftoverbuf_rep.length_in_samples() <= dst_left); #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "leftover copy_range 0..%ld -> %ld..%ld, copied %ld, dst_left=%ld\n", leftoverbuf_rep.length_in_samples() - 1, dst_write_pos, dst_write_pos + leftoverbuf_rep.length_in_samples() - 1, leftoverbuf_rep.length_in_samples(), dst_left); #endif dst_sbuf->copy_range(leftoverbuf_rep, 0, leftoverbuf_rep.length_in_samples(), dst_write_pos); dst_sbuf->event_tags_add(leftoverbuf_rep); dst_left -= leftoverbuf_rep.length_in_samples(); dst_write_pos += leftoverbuf_rep.length_in_samples();; #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "copied %ld leftover samples, %ld remain, dst_write_pos=%ld\n", leftoverbuf_rep.length_in_samples(), dst_left, dst_write_pos); #endif leftoverbuf_rep.length_in_samples(0); } DBC_CHECK(leftoverbuf_rep.length_in_samples() == 0); /* note: loop until we have buffersize() worth of samples, * or until we encounter end-of-stream */ for(int i = 0; dst_left > 0; i++) { long int src_to_copy = dst_left; /* step: read sample buffer, src-rate */ child()->read_buffer(&sbuf_rep); #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "%d: asked for %ld samples, got %ld\n", i, child()->buffersize(), sbuf_rep.length_in_samples()); #endif /* step: resample dst-rate */ sbuf_rep.resample(child_srate_conf_rep, samples_per_second()); #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "after resample, %ld samples\n", sbuf_rep.length_in_samples()); #endif /* step: if we didn't get enough samples, adjust src_to_copy */ if (sbuf_rep.length_in_samples() < src_to_copy) src_to_copy = sbuf_rep.length_in_samples(); /* step: copy src_to_copy resampled samples */ #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "copy_range 0..%ld -> %ld..%ld, copied %ld, dst_left=%ld\n", src_to_copy - 1, dst_write_pos, dst_write_pos + src_to_copy - 1, src_to_copy, dst_left); #endif dst_sbuf->copy_range(sbuf_rep, 0, src_to_copy, dst_write_pos); dst_sbuf->event_tags_add(sbuf_rep); dst_write_pos += src_to_copy; dst_left -= src_to_copy; if (dst_left > 0 && sbuf_rep.event_tag_test(SAMPLE_BUFFER::tag_end_of_stream)) { dst_sbuf->event_tag_set(SAMPLE_BUFFER::tag_end_of_stream); dst_sbuf->length_in_samples(dst_sbuf->length_in_samples() - dst_left); break; } /* step: if there are any new leftovers, store them for * the next iteration */ if (sbuf_rep.length_in_samples() > src_to_copy) { DBC_CHECK(dst_left <= 0); SAMPLE_BUFFER::buf_size_t leftover = sbuf_rep.length_in_samples() - src_to_copy; leftoverbuf_rep.length_in_samples(leftover); leftoverbuf_rep.number_of_channels(channels()); #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "copy_range leftovers %ld..%ld -> %ld..%ld, copied %ld, dst_left=%ld\n", src_to_copy, sbuf_rep.length_in_samples() - 1, 0, leftover - 1, leftover, dst_left); #endif leftoverbuf_rep.copy_range(sbuf_rep, src_to_copy, sbuf_rep.length_in_samples(), 0); leftoverbuf_rep.event_tags_set(sbuf_rep); } } change_position_in_samples(dst_sbuf->length_in_samples()); #ifdef RESAMPLE_VERBOSE_DEBUG std::fprintf(stderr, "exit with %ld samples\n", dst_sbuf->length_in_samples()); #endif DBC_ENSURE(dst_sbuf->length_in_samples() <= buffersize()); DBC_ENSURE(dst_sbuf->number_of_channels() == channels()); } void AUDIO_IO_RESAMPLE::write_buffer(SAMPLE_BUFFER* sbuf) { /* FIXME: not implemented */ DBC_NEVER_REACHED(); change_position_in_samples(sbuf->length_in_samples()); } ecasound-2.9.3/libecasound/eca-resources.h0000644000076400007640000000203410664032032015453 00000000000000#ifndef INCLUDED_ECA_RESOURCES_H #define INCLUDED_ECA_RESOURCES_H #include class RESOURCE_FILE; /** * Class for representing ecasound user settings stored * in global ({prefix}/share/ecasound/ecasoundrc) and * user-specific (~/.ecasoundrc) resource files. */ class ECA_RESOURCES { public: std::string resource(const std::string& tag) const; bool boolean_resource(const std::string& tag) const; bool has(const std::string& tag) const; bool has_any(void) const; void resource(const std::string& tag, const std::string& value); ECA_RESOURCES(void); ~ECA_RESOURCES(void); public: /** * If non-empty, will override all other resource files for * newly created ECA_RESOURCES instances. */ static std::string rc_override_file; private: ECA_RESOURCES(const ECA_RESOURCES&); ECA_RESOURCES& operator=(const ECA_RESOURCES&); RESOURCE_FILE* globalrc_repp; RESOURCE_FILE* userrc_repp; RESOURCE_FILE* overriderc_repp; std::string user_resource_directory_rep; bool resources_found_rep; }; #endif ecasound-2.9.3/libecasound/audioio-flac.h0000644000076400007640000000441511141362402015252 00000000000000#ifndef INCLUDED_AUDIOIO_FLAC_H #define INCLUDED_AUDIOIO_FLAC_H #include #include #include "audioio-buffered.h" #include "audioio-forked-stream.h" /** * Interface to FLAC decoders and encoders using UNIX pipe i/o. * * @author Kai Vehmanen */ class FLAC_FORKED_INTERFACE : public AUDIO_IO_BUFFERED, public AUDIO_IO_FORKED_STREAM { private: static std::string default_input_cmd; static std::string default_output_cmd; public: static void set_input_cmd(const std::string& value); static void set_output_cmd(const std::string& value); public: FLAC_FORKED_INTERFACE (const std::string& name = ""); virtual ~FLAC_FORKED_INTERFACE(void); virtual FLAC_FORKED_INTERFACE* clone(void) const { return new FLAC_FORKED_INTERFACE(*this); } virtual FLAC_FORKED_INTERFACE* new_expr(void) const { return new FLAC_FORKED_INTERFACE(*this); } virtual std::string name(void) const { return("FLAC stream"); } virtual std::string description(void) const { return("Interface to FLAC decoders and encoders using UNIX pipe i/o."); } virtual std::string parameter_names(void) const { return("label"); } virtual bool locked_audio_format(void) const { return(true); } virtual int supported_io_modes(void) const { return(io_read | io_write); } virtual bool supports_seeking(void) const { return(false); } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const { return(finished_rep); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; virtual void start_io(void); virtual void stop_io(void); protected: /* functions called by AUDIO_IO_FORKED_STREAM that require * the use of AUDIO_IO methods */ virtual bool do_supports_seeking(void) const { return supports_seeking(); } virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { set_position_in_samples(pos); } private: bool triggered_rep; bool finished_rep; long int bytes_rep; int filedes_rep; FILE* f1_rep; void fork_input_process(void); void fork_output_process(void); }; #endif ecasound-2.9.3/libecasound/eca-fileio-stream.cpp0000644000076400007640000001155711162771714016561 00000000000000// ------------------------------------------------------------------------ // eca-fileio-stream.cpp: File-I/O and buffering routines using normal // file streams. // Copyright (C) 1999-2002,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* LONG_MAX */ #include #include /* stat() */ #include /* stat() */ #ifdef HAVE_SYS_TYPES_H #include /* off_t */ #endif #include #include "eca-logger.h" #include "eca-fileio.h" #include "eca-fileio-stream.h" ECA_FILE_IO_STREAM::~ECA_FILE_IO_STREAM(void) { if (mode_rep != "") close_file(); } void ECA_FILE_IO_STREAM::open_file(const std::string& fname, const std::string& fmode) { fname_rep = fname; f1 = std::fopen(fname_rep.c_str(), fmode.c_str()); if (!f1) { mode_rep = ""; } else { mode_rep = fmode; } standard_mode = false; curpos_rep = 0; } void ECA_FILE_IO_STREAM::open_stdin(void) { f1 = stdin; mode_rep = "rb"; standard_mode = true; curpos_rep = 0; } void ECA_FILE_IO_STREAM::open_stdout(void) { f1 = stdout; mode_rep = "wb"; standard_mode = true; curpos_rep = 0; } void ECA_FILE_IO_STREAM::open_stderr(void) { f1 = stderr; mode_rep = "wb"; standard_mode = true; curpos_rep = 0; } void ECA_FILE_IO_STREAM::close_file(void) { if (standard_mode != true) std::fclose(f1); mode_rep = ""; } void ECA_FILE_IO_STREAM::read_to_buffer(void* obuf, off_t bytes) { if (is_file_ready() == true) { last_rep = std::fread(obuf, 1, bytes, f1); curpos_rep += last_rep; } else { last_rep = 0; } } void ECA_FILE_IO_STREAM::write_from_buffer(void* obuf, off_t bytes) { if (is_file_ready() == true) { last_rep = std::fwrite(obuf, 1, bytes, f1); curpos_rep += last_rep; } else { last_rep = 0; } } off_t ECA_FILE_IO_STREAM::file_bytes_processed(void) const { return(last_rep); } bool ECA_FILE_IO_STREAM::is_file_ready(void) const { if (mode_rep == "" || std::feof(f1) || std::ferror(f1)) return(false); return(true); } bool ECA_FILE_IO_STREAM::is_file_error(void) const { if (std::ferror(f1)) return(true); return(false); } void ECA_FILE_IO_STREAM::set_file_position(off_t newpos) { curpos_rep = newpos; if (standard_mode != true) { /* fseeko doesn't seem to work with glibc 2.1.x */ #if _FILE_OFFSET_BITS==64 off_t seekpos = 0; off_t seekstep = 0; int whence = SEEK_SET; while(curpos_rep - seekpos >= 0) { if (curpos_rep - seekpos > LONG_MAX) seekstep = LONG_MAX; else seekstep = curpos_rep - seekpos; /* null seek, break */ if (seekstep == 0 && whence == SEEK_CUR) break; // std::cerr << "(eca-fileio-stream) fw-seeking from " << seekpos << " to " << seekpos+seekstep << std::endl; int res = std::fseek(f1, seekstep, whence); if (res != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "(eca-fileio-stream) fseek() error! (lfs)."); curpos_rep = 0; std::fseek(f1, 0, SEEK_SET); break; } if (seekpos == 0) whence = SEEK_CUR; seekpos += seekstep; } #else /* note: curpos_rep is of type off_t, there might be a size * mismatch between long int and off_t, but both * are signed integers */ std::fseek(f1, static_cast(curpos_rep), SEEK_SET); #endif } } void ECA_FILE_IO_STREAM::set_file_position_advance(off_t fw) { if (standard_mode != true) { set_file_position(curpos_rep + fw); } } void ECA_FILE_IO_STREAM::set_file_position_end(void) { if (standard_mode == false) { int res = std::fseek(f1, 0, SEEK_END); if (res != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "(eca-fileio-stream) fseek() error! (seek_end)."); } else { curpos_rep = get_file_length(); } } } off_t ECA_FILE_IO_STREAM::get_file_position(void) const { if (standard_mode == true) return(0); return(curpos_rep); } off_t ECA_FILE_IO_STREAM::get_file_length(void) const { if (standard_mode == true) return(0); struct stat temp; stat(fname_rep.c_str(), &temp); off_t lentemp = temp.st_size; return(lentemp); } ecasound-2.9.3/libecasound/audiofx_ladspa.h0000644000076400007640000000453511053763201015710 00000000000000#ifndef INCLUDED_AUDIOFX_LADSPA_H #define INCLUDED_AUDIOFX_LADSPA_H #include #include #include "audiofx.h" /* prefer already installed LADSPA header over the * version shipped with ecasound */ #ifdef HAVE_LADSPA_H #include #else #include "ladspa.h" #endif class SAMPLE_BUFFER; /** * Wrapper class for LADSPA plugins * @author Kai Vehmanen */ class EFFECT_LADSPA : public EFFECT_BASE { public: EFFECT_LADSPA (const LADSPA_Descriptor *plugin_desc = 0) throw(ECA_ERROR&); virtual ~EFFECT_LADSPA (void); EFFECT_LADSPA* clone(void) const; EFFECT_LADSPA* new_expr(void) const { return new EFFECT_LADSPA(plugin_desc); } virtual std::string name(void) const { return(name_rep); } virtual std::string description(void) const; virtual std::string parameter_names(void) const { return(param_names_rep); } /** * This identifier can be used as a unique, case-sensitive * identifier for the plugin type within the plugin file. * Labels must not contain white-space characters. */ std::string unique(void) const { return(unique_rep); } /** * 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. */ long int unique_number(void) const { return(unique_number_rep); } virtual int output_channels(int i_channels) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); private: EFFECT_LADSPA (const EFFECT_LADSPA& x) { } EFFECT_LADSPA& operator=(const EFFECT_LADSPA& x) { return *this; } private: SAMPLE_BUFFER* buffer_repp; const LADSPA_Descriptor *plugin_desc; std::vector plugins_rep; unsigned long port_count_rep; int in_audio_ports; int out_audio_ports; long unique_number_rep; std::string name_rep, maker_rep, unique_rep, param_names_rep; std::vector params; std::vector param_descs_rep; void init_ports(void); void parse_parameter_hint_information(int portnum, int paramnum, struct PARAM_DESCRIPTION *pd); }; #endif ecasound-2.9.3/libecasound/jack-connections.cpp0000644000076400007640000000636711440422070016511 00000000000000// ------------------------------------------------------------------------ // jack-connections.cpp: Utility class to manage JACK port connections // Copyright (C) 2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "eca-logger.h" #include "jack-connections.h" using std::string; JACK_CONNECTIONS::JACK_CONNECTIONS(void) { } JACK_CONNECTIONS::~JACK_CONNECTIONS(void) { } static jack_client_t *priv_prepare(void) { int pid = getpid(); std::string clntname = "libecasound-ctrl-" + kvu_numtostr(pid); jack_client_t *client = jack_client_open(clntname.c_str(), JackNullOption, NULL); return client; } static void priv_cleanup(jack_client_t *client) { jack_client_close(client); } bool JACK_CONNECTIONS::connect(const char* src, const char* dest) { int result = -1; jack_client_t *client = priv_prepare(); if (client != 0) { result = jack_connect(client, src, dest); ECA_LOG_MSG(ECA_LOGGER::user_objects, std::string("Connected JACK ports ") + src + " and " + dest + " with result of " + kvu_numtostr(result)); priv_cleanup(client); } return result == 0; } bool JACK_CONNECTIONS::disconnect(const char* src, const char* dest) { int result = -1; jack_client_t *client = priv_prepare(); if (client != 0) { result = jack_disconnect(client, src, dest); ECA_LOG_MSG(ECA_LOGGER::user_objects, std::string("Connected JACK ports ") + src + " and " + dest + " with result of " + kvu_numtostr(result)); priv_cleanup(client); } return result == 0; } bool JACK_CONNECTIONS::list_connections(std::string* output) { jack_client_t *client = priv_prepare(); if (client != 0) { const char **next, **ports = jack_get_ports(client, NULL, NULL, 0); if (ports) { *output += "\n"; for (next = ports; *next; next++) { jack_port_t *port; *output += string(*next); port = jack_port_by_name(client, *next); const char **nextconn, **conns = jack_port_get_all_connections(client, port); if (conns) { for(nextconn = conns; *nextconn; nextconn++) { *output += string("\n\t") + string(*nextconn) + string("\n"); } free(conns); } else { *output += "\n"; } } free(ports); } priv_cleanup(client); } return client != 0; } ecasound-2.9.3/libecasound/audiofx_reverb.h0000644000076400007640000000266710664032032015733 00000000000000#ifndef INCLUDED_AUDIOFX_REVERB_H #define INCLUDED_AUDIOFX_REVERB_H #include #include "audiofx_timebased.h" /** * Reverb effect * * May 2000, Stefan Fendt (C++ version by Kai Vehmanen) */ class ADVANCED_REVERB : public EFFECT_TIME_BASED { private: SAMPLE_ITERATOR_CHANNELS i_channels; parameter_t roomsize_rep; parameter_t feedback_rep; parameter_t wet_rep; class CHANNEL_DATA { public: std::vector buffer; std::vector dpos; std::vector mul; long int bufferpos_rep; SAMPLE_SPECS::sample_t oldvalue, lpvalue; CHANNEL_DATA(void) : buffer(65536, 0.0), dpos(200), mul(200), bufferpos_rep(0) { } }; std::vector cdata; public: virtual std::string name(void) const { return("Advanced reverb"); } virtual std::string parameter_names(void) const { return("Room-size,feedback-%,wet-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* insample); virtual void process(void); ADVANCED_REVERB* clone(void) const { return new ADVANCED_REVERB(*this); } ADVANCED_REVERB* new_expr(void) const { return new ADVANCED_REVERB(); } ADVANCED_REVERB (parameter_t roomsize = 10.0, parameter_t feedback_percent = 50.0, parameter_t wet_percent = 50.0); }; #endif ecasound-2.9.3/libecasound/midiio.cpp0000644000076400007640000000751510664032032014531 00000000000000// ------------------------------------------------------------------------ // midiio.cpp: Routines common for all MIDI IO-devices. // Copyright (C) 2000 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "midiio.h" #include "samplebuffer.h" #include "eca-error.h" #include "eca-logger.h" // =================================================================== // Attributes /** * Returns info about supported I/O modes (bitwise-OR) * * By default, all I/O modes are supported. */ int MIDI_IO::supported_io_modes(void) const { return(io_read | io_readwrite | io_write); } /** * Whether device supports non-blocking I/O mode. * * By default, nonblocking mode is not supported. */ bool MIDI_IO::supports_nonblocking_mode(void) const { return(false); } // =================================================================== // Configuration (setting and getting configuration parameters) /** * Returns info about the current I/O mode. */ int MIDI_IO::io_mode(void) const { return(io_mode_rep); } /** * Set object input/output-mode. If the requested mode isn't * supported, the nearest supported mode is used. Because * of this, it's wise to afterwards check whether the requested * mode was accepted. * * require: * is_open() != true */ void MIDI_IO::io_mode(int mode) { io_mode_rep = mode; } /** * Sets object label. Label is used to identify the object instance. * Unlike ECA_OBJECT::name(), label() is not necessarily unique * among different class instances. Device and file names are typical * label values. * * require: * is_open() != true */ void MIDI_IO::label(const std::string& id_label) { id_label_rep = id_label; } /** * Enable/disbale nonblocking mode. * * require: * is_open() != true */ void MIDI_IO::toggle_nonblocking_mode(bool value) { nonblocking_rep = value; } /** * Returns the current label. See documentation for * label(const std::string&). */ const std::string& MIDI_IO::label(void) const { return(id_label_rep); } void MIDI_IO::set_parameter(int param, std::string value) { if (param == 1) label(value); } std::string MIDI_IO::get_parameter(int param) const { if (param == 1) return(label()); return(""); } // =================================================================== // Runtime information /** * Is nonblocking mode is enabled? */ bool MIDI_IO::nonblocking_mode(void) const { return(nonblocking_rep); } /** * Is the MIDI object ready for reading? */ bool MIDI_IO::readable(void) const { return(is_open() && io_mode() != io_write); } /** * Is the MIDI object ready for writing? */ bool MIDI_IO::writable(void) const { return(is_open() && io_mode() != io_read); } /** * Sets device's state to enabled or disabled. */ void MIDI_IO::toggle_open_state(bool value) { open_rep = value; } // =================================================================== // Constructors and destructors MIDI_IO::~MIDI_IO(void) { } MIDI_IO::MIDI_IO(const std::string& name, int mode) { label(name); io_mode(mode); nonblocking_rep = false; readable_rep = writable_rep = open_rep = false; } ecasound-2.9.3/libecasound/audiofx_compressor.cpp0000644000076400007640000003002610664032032017163 00000000000000// ------------------------------------------------------------------------ // audiofx_compressor.cpp: C++ implementation of John S. Dyson's // compressor code. If you want the original // C-sources, mail me. // Copyright (C) 1999-2000 Kai Vehmanen // // Copyright for the actual algorithm (compressor2.c): // *************************************************** /* * Copyright (c) 1996, John S. Dyson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * This code (easily) runs realtime on a P5-166 w/EDO, Triton-II on FreeBSD. * * More info/comments: dyson@freebsd.org * * This program provides compression of a stereo 16bit audio stream, * such as that contained by a 16Bit wav file. Extreme measures have * been taken to make the compression as subtile as possible. One * possible purpose for this code would be to master cassette tapes from * CD's for playback in automobiles where dynamic range needs to be * restricted. * * Suitably recoded for an embedded DSP, this would make a killer audio * compressor for broadcast or recording. When writing this code, I * ignored the issues of roundoff error or trucation -- Pentiums have * really nice FP processors :-). */ // ------------------------------------------------------------------------ #include #include #include #include #include "samplebuffer_iterators.h" #include "audiofx_amplitude.h" #include "eca-logger.h" ADVANCED_COMPRESSOR::ADVANCED_COMPRESSOR (double peak_limit, double release_time, double cfrate, double crate) : rlevelsqn(ADVANCED_COMPRESSOR::NFILT), rlevelsqe(ADVANCED_COMPRESSOR::NEFILT) { init_values(); set_parameter(1, peak_limit); set_parameter(2, release_time); set_parameter(3, cfrate); set_parameter(4, crate); MESSAGE_ITEM otemp; otemp.setprecision(2); otemp << "(audiofx_compressor) Advanced compressor enabled;"; otemp << " peak limit " << peakpercent; otemp << " release time " << release_time; otemp << " cfrate " << fastgaincompressionratio; otemp << " crate " << compressionratio << "."; ECA_LOG_MSG(ECA_LOGGER::info, otemp.to_string()); } void ADVANCED_COMPRESSOR::init_values(void) { mingain = 10000; maxgain = 0; /* These filters should filter at least the lowest audio freq */ rlevelsq0filter = .001; rlevelsq1filter = .010; /* These are the attack time for the rms measurement */ rlevelsq0ffilter = .001; rlevelsqefilter = .001; /* * maximum gain for fast compressor */ maxfastgain = 3; /* * maximum gain for slow compressor */ maxslowgain = 9; /* * Level below which gain tracking shuts off */ floorlevel = SAMPLE_SPECS::max_amplitude * 0.06; // was 2000 // floorlevel = 2000; /* * Slow compressor time constants */ rmastergain0filter = .000003; rpeakgainfilter = .001; rpeaklimitdelay = 2500; rgain = rmastergain0 = 1.0; rlevelsq0 = levelsq1 = 0; rlevelsq1 = 0; compress = 1; ndelay = (int)(1.0 / rlevelsq0ffilter); // ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audiofx_compressor) Number of delays : " + // kvu_numtostr(ndelay) + "."); rightdelay.resize(ndelay); leftdelay.resize(ndelay); // rlevelsqn = new vector (NFILT + 1); // rlevelsqe = new vector (NEFILT + 1); rpeakgain0 = 1.0; rpeakgain1 = 1.0; rpeaklimitdelay = 0; ndelayptr = 0; lastrgain = 1.0; for(i = 0; i < NFILT;i++) rlevelsqn[i] = 0.0; for(i = 0; i < NEFILT;i++) rlevelsqe[i] = 0.0; /* set defaults to some sane values */ peakpercent = 100.0f; releasetime = 0; fratio = 1.0; ratio = 1.0; } ADVANCED_COMPRESSOR::~ADVANCED_COMPRESSOR (void) { } void ADVANCED_COMPRESSOR::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { // cerr << "Param: " << param << ", value: " << value << ".\n"; switch (param) { case 1: { // --- // target level for compression // --- maxlevel = SAMPLE_SPECS::max_amplitude * 0.9; // limiter level (was 32000) // maxlevel = 32000; peakpercent = value; if (peakpercent == 0) peakpercent = 69; targetlevel = maxlevel * peakpercent / 100.0; break; } case 2: { // -- // Linear gain filters as opposed to the level measurement filters // -- DBC_CHECK(samples_per_second() != 0); releasetime = value; if (releasetime == 0) releasetime = 0.01; rgainfilter = 1.0 / (releasetime * samples_per_second()); break; } case 3: { // -- // compression ratio for fast gain. This will determine how // much the audio is made more dense. .5 is equiv to 2:1 // compression. 1.0 is equiv to inf:1 compression. // -- fratio = value; if (fratio == 0) fratio = 0.5; fastgaincompressionratio = fratio; break; } case 4: { // -- // overall ompression ratio. // -- ratio = value; if (ratio == 0) ratio = 1.0; compressionratio = ratio; break; } } } CHAIN_OPERATOR::parameter_t ADVANCED_COMPRESSOR::get_parameter(int param) const { switch (param) { case 1: return(peakpercent); case 2: return(releasetime); case 3: return(fratio); case 4: return(ratio); } return(0.0); } double ADVANCED_COMPRESSOR::hardlimit(double value, double knee, double limit) { // double lrange = (limit - knee); double ab = fabs(value); /* if (ab > knee) { double abslimit = (limit * 1.1); if (ab < abslimit) value = knee + lrange * sin( ((value - knee)/abslimit) * (3.14 / (4*1.1))); } */ if (ab >= limit) value = value > 0 ? limit : -limit; return value; } void ADVANCED_COMPRESSOR::init(SAMPLE_BUFFER* insample) { iter.init(insample); set_channels(insample->number_of_channels()); set_samples_per_second(samples_per_second()); } void ADVANCED_COMPRESSOR::process(void) { iter.begin(); while(!iter.end()) { // right = insample->get_right() * 32767.0; // left = insample->get_left() * 32767.0; left = (*iter.current(0)); right = (*iter.current(1)); rightdelay[ndelayptr] = right; leftdelay[ndelayptr] = left; ndelayptr++; // cerr << "1.l:" << left << "\n"; // cerr << "1.r:" << right << "\n"; // cerr << "2.l:" << leftdelay[ndelayptr - 1] << "should be 1=2\n"; if (ndelayptr >= ndelay) ndelayptr = 0; /* enable/disable compression */ skipmode = 0; if (compress == 0) { skipmode = 1; goto skipagc; } levelsq0 = (right) * (right) + (left) * (left); // if (ndelayptr == 0) { // cerr << "3.1.l: " << "rlevelsq0 " << rlevelsq0 << "\n"; // cerr << "3.2.l: " << "rlevelsq0ffilter " << rlevelsq0ffilter << "\n"; // cerr << "3.2.l: " << "rlevelsq0filter " << rlevelsq0filter << "\n"; // } if (levelsq0 > rlevelsq0) { rlevelsq0 = (levelsq0 * rlevelsq0ffilter) + rlevelsq0 * (1 - rlevelsq0ffilter); } else { rlevelsq0 = (levelsq0 * rlevelsq0filter) + rlevelsq0 * (1 - rlevelsq0filter); } if (rlevelsq0 <= floorlevel * floorlevel) goto skipagc; // if (ndelayptr == 0) // cerr << "3.3.l: " << "rlevelsq0 " << rlevelsq0 << "\n"; if (rlevelsq0 > rlevelsq1) { rlevelsq1 = rlevelsq0; } else { rlevelsq1 = rlevelsq0 * rlevelsq1filter + rlevelsq1 * (1 - rlevelsq1filter); } // vika.. rlevelsq1 joskus menee pahasti yli ayrauden // if (ndelayptr == 0) // cerr << "3.3.l: " << "rlevelsq1 " << rlevelsq1 << "\n"; rlevelsqn[0] = rlevelsq1; for(i = 0; i < NFILT-1; i++) { if (rlevelsqn[i] > rlevelsqn[i+1]) rlevelsqn[i+1] = rlevelsqn[i]; else rlevelsqn[i+1] = rlevelsqn[i] * rlevelsq1filter + rlevelsqn[i+1] * (1 - rlevelsq1filter); } efilt = rlevelsqefilter; levelsqe = rlevelsqe[0] = rlevelsqn[NFILT-1]; for(i = 0; i < NEFILT-1; i++) { // if (rlevelsqe[i] > FLT_MAX) rlevelsqe[i] = FLT_MAX; // else { rlevelsqe[i+1] = rlevelsqe[i] * efilt + rlevelsqe[i+1] * (1.0 - efilt); if (rlevelsqe[i+1] > levelsqe) levelsqe = rlevelsqe[i+1]; efilt *= 1.0 / 1.5; } gain = targetlevel / sqrt(levelsqe); if (compressionratio < 0.99) { if (compressionratio == 0.50) gain = sqrt(gain); else gain = exp(log(gain) * compressionratio); } if (gain < rgain) rgain = gain * rlevelsqefilter/2 + rgain * (1 - rlevelsqefilter/2); else rgain = gain * rgainfilter + rgain * (1 - rgainfilter); lastrgain = rgain; if ( gain < lastrgain) lastrgain = gain; skipagc:; tgain = lastrgain; leftd = leftdelay[ndelayptr]; rightd = rightdelay[ndelayptr]; // cerr << "4.l:" << leftd << ", ndelayptr " << ndelayptr << "\n"; fastgain = tgain; if (fastgain > maxfastgain) fastgain = maxfastgain; if (fastgain < 0.0001) fastgain = 0.0001; if (fastgaincompressionratio == 0.25) { qgain = sqrt(sqrt(fastgain)); } else if (fastgaincompressionratio == 0.5) { qgain = sqrt(fastgain); } else if (fastgaincompressionratio == 1.0) { qgain = fastgain; } else { qgain = exp(log(fastgain) * fastgaincompressionratio); } // cerr << "4.4-qgain: " << qgain << "\n"; tslowgain = tgain / qgain; if (tslowgain > maxslowgain) tslowgain = maxslowgain; if (tslowgain < rmastergain0) rmastergain0 = tslowgain; else rmastergain0 = tslowgain * rmastergain0filter + (1 - rmastergain0filter) * rmastergain0; slowgain = rmastergain0; if (skipmode == 0) npeakgain = slowgain * qgain; /**/ newright = rightd * npeakgain; if (fabs(newright) >= maxlevel) nrgain = maxlevel / fabs(newright); else nrgain = 1.0; newleft = leftd * npeakgain; if (fabs(newleft) >= maxlevel) nlgain = maxlevel / fabs(newleft); else nlgain = 1.0; // cerr << "4.5.l:" << newleft << "\n"; ngain = nrgain; if (nlgain < ngain) ngain = nlgain; ngsq = ngain * ngain; if (ngsq <= rpeakgain0) { // --debug // if (ngsq < rpeakgain0) // cerr << "*"; rpeakgain0 = ngsq /* * 0.50 + rpeakgain0 * 0.50 */; rpeaklimitdelay = peaklimitdelay; } else if (rpeaklimitdelay == 0) { if (nrgain > 1.0) tnrgain = 1.0; else tnrgain = nrgain; rpeakgain0 = tnrgain * rpeakgainfilter + (1.0 - rpeakgainfilter) * rpeakgain0; } if (rpeakgain0 <= rpeakgain1) { rpeakgain1 = rpeakgain0; rpeaklimitdelay = peaklimitdelay; } else if (rpeaklimitdelay == 0) { rpeakgain1 = rpeakgainfilter * rpeakgain0 + (1.0 - rpeakgainfilter) * rpeakgain1; } else { --rpeaklimitdelay; } sqrtrpeakgain = sqrt(rpeakgain1); totalgain = npeakgain * sqrtrpeakgain; right = newright * sqrtrpeakgain; *iter.current(1) = right; //insample->put_left(left / 32767.0); // *righta = hardlimit(right, 32200, 32767); // cerr << "5.l:" << newleft << "\n"; left = newleft * sqrtrpeakgain; *iter.current(0) = left; // insample->put_left(left / 32767.0); // cerr << "6.l:" << left << "\n"; // // *lefta = hardlimit(left, 32200, 32767); // if (right != *righta || left != *lefta) { // fprintf(stderr,"!"); // } if (totalgain > maxgain) maxgain = totalgain; if (totalgain < mingain) mingain = totalgain; if (right > extra_maxlevel) extra_maxlevel = right; if (left > extra_maxlevel) extra_maxlevel = left; iter.next(); } // cerr << "post:" << insample->get_left() << "\n"; } ecasound-2.9.3/libecasound/audioio-seqbase.cpp0000644000076400007640000003744212260762753016351 00000000000000// ------------------------------------------------------------------------ // audioio-seqbase.cpp: Base class for audio sequencer objects // Copyright (C) 1999,2002,2005,2008-2010,2013 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include "eca-object-factory.h" #include "samplebuffer.h" #include "audioio-seqbase.h" #include "eca-error.h" #include "eca-logger.h" using std::cout; using std::endl; using SAMPLE_SPECS::sample_pos_t; /** * FIXME notes (last update 2008-03-04) * * - Add check for supports_sample_accurate_seek(). This could * be used to warn users if EWF source file cannot provide * accurate enough seeking (which will lead to unexpected * results). * - Remove write-support altogether (changes supported io_modes(), * modify write_buffer(), and remove child_write_started. * - Should extend the object length when looping is enabled. */ /** * Returns the child position in samples for the given * public position. */ sample_pos_t AUDIO_SEQUENCER_BASE::priv_public_to_child_pos(sample_pos_t pubpos) const { if (pubpos <= child_offset_rep.samples()) return child_start_pos_rep.samples(); if (child_looping_rep == true) { DBC_CHECK(child()->finite_length_stream() == true); sample_pos_t one_loop = child_length_rep.samples() - child_start_pos_rep.samples(); sample_pos_t res = pubpos - child_offset_rep.samples(); DBC_CHECK(res > 0); if (one_loop > 0) res = res % one_loop; return res + child_start_pos_rep.samples(); } else { /* not looping */ return pubpos - child_offset_rep.samples() + child_start_pos_rep.samples(); } } AUDIO_SEQUENCER_BASE::AUDIO_SEQUENCER_BASE (void) : child_looping_rep(false), child_length_set_by_client_rep(false), buffersize_rep(-1), child_write_started(false), init_rep(false) { } AUDIO_SEQUENCER_BASE::~AUDIO_SEQUENCER_BASE(void) { } AUDIO_SEQUENCER_BASE* AUDIO_SEQUENCER_BASE::clone(void) const { AUDIO_SEQUENCER_BASE* target = new AUDIO_SEQUENCER_BASE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIO_SEQUENCER_BASE::change_child_name(const string& child_name) throw(AUDIO_IO::SETUP_ERROR &) { AUDIO_IO* tmp = 0; if (child_name.size() > 0) tmp = ECA_OBJECT_FACTORY::create_audio_object(child_name); if (tmp == 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-SEQBASE: Could not create child object.")); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Creating audio sequencer file:" + tmp->label() + "."); set_child(tmp); init_rep = true; } void AUDIO_SEQUENCER_BASE::open(void) throw(AUDIO_IO::SETUP_ERROR &) { if (init_rep != true) change_child_name(child_object_str_rep); pre_child_open(); child()->open(); if (child()->finite_length_stream() != true && child_looping_rep) { child()->close(); throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-SEQBASE: Unable to loop an object with infinite length.")); } if (child()->supports_seeking_sample_accurate() != true && child_start_pos_rep.samples() > 0) { child()->close(); throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-SEQBASE: Unable use sections of an object that does not support seeking.")); } /* step: set srate for audio time variable */ child_offset_rep.set_samples_per_second_keeptime(child()->samples_per_second()); child_start_pos_rep.set_samples_per_second_keeptime(child()->samples_per_second()); child_length_rep.set_samples_per_second_keeptime(child()->samples_per_second()); post_child_open(); /* step: unless overridden by the client, store the length * of child object */ ECA_AUDIO_TIME len_tmp (child()->length_in_samples(), child()->samples_per_second()); if (child_length_set_by_client_rep != true) set_child_length_private(len_tmp); else if (len_tmp.valid() == true && child_length_rep.valid() == true) { if (len_tmp.seconds() < child_length_rep.seconds()) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: object \"" + child()->label() + "\" is too short, reducing segment length to '" + kvu_numtostr(len_tmp.seconds()) + "'sec."); } /* step: set public length of the EWF object; * child length is infinite, we will extend our object * length in read_buffer(), see also * AUDIO_SEQUENCER_BASE::finite_length_stream() */ if (child_looping_rep != true) set_length_in_samples(child_offset_rep.samples() + child_length_rep.samples()); //dump_child_debug("open"); tmp_buffer.number_of_channels(child()->channels()); tmp_buffer.length_in_samples(child()->buffersize()); AUDIO_IO_PROXY::open(); } void AUDIO_SEQUENCER_BASE::close(void) { if (child()->is_open() == true) child()->close(); AUDIO_IO_PROXY::close(); } void AUDIO_SEQUENCER_BASE::read_buffer(SAMPLE_BUFFER* sbuf) { /** * implementation notes: * * position: the current global position (note, this * can exceed child_offset+child_length when * looping is used. * child_offset: global position when child is activated * child_start_position: position inside the child-object where * input is started (data between child * beginning and child_start_pos is not used) * child_length: amount of child data between start and end * positions (end can in middle of stream or * at end-of-file position) * child_looping: when child end is reached, whether to jump * back to start position? * * note! all cases (if-else blocks) end to setting a new * position_in_samples value */ //dump_child_debug("read_buffer"); if (position_in_samples() + buffersize() <= child_offset_rep.samples()) { // --- // case 1: child not active yet // --- /* ensure that channel count matches that of child */ sbuf->number_of_channels(child()->channels()); sbuf->length_in_samples(buffersize()); sbuf->make_silent(); change_position_in_samples(buffersize()); //dump_child_debug("case1-out"); } else if (position_in_samples() < child_offset_rep.samples()) { // --- // case 2: next read will bring in the first child samples // --- DBC_CHECK(position_in_samples() + buffersize() > child_offset_rep.samples()); /* make sure child position is correct at start */ sample_pos_t chipos = priv_public_to_child_pos(position_in_samples()); if (chipos != child()->position_in_samples()) child()->seek_position_in_samples(chipos); sample_pos_t segment = position_in_samples() + buffersize() - child_offset_rep.samples(); if (segment > buffersize()) segment = buffersize(); // dump_child_debug("case2-in"); ECA_LOG_MSG(ECA_LOGGER::user_objects, "child-object \"" + child()->label() + "\" activated."); /* step: read segment of audio and copy it to the correct * location */ long int save_bsize = buffersize(); DBC_CHECK(save_bsize == buffersize()); child()->set_buffersize(segment); child()->read_buffer(&tmp_buffer); /* ensure that channel count matches that of child */ sbuf->number_of_channels(child()->channels()); sbuf->length_in_samples(buffersize()); sbuf->copy_range(tmp_buffer, 0, tmp_buffer.length_in_samples(), buffersize() - segment); child()->set_buffersize(save_bsize); change_position_in_samples(buffersize()); //dump_child_debug("case2-out"); } else { // --- // case 3: child is active // --- sample_pos_t chipos1 = priv_public_to_child_pos(position_in_samples()); sample_pos_t chipos2 = priv_public_to_child_pos(position_in_samples() + buffersize()); if (chipos2 >= (child_length_rep.samples() + child_start_pos_rep.samples()) && child_looping_rep != true && child()->finite_length_stream() == true) { // --- // case 3a: not looping, reaching child file end during the next read // --- /* note: max samples to included (assuming child object does * not reach end-of-stream */ sample_pos_t samples_to_include = (child_length_rep.samples() + child_start_pos_rep.samples()) - chipos1; //dump_child_debug("case3a-in"); child()->set_buffersize(buffersize()); child()->read_buffer(sbuf); /* resize the sbuf if needed: either EOF was encountered * and sbuf is shorter than buffersize() or otherwise we * need to drop some of the samples read so at to not * go beyond set length */ if (sbuf->length_in_samples() > samples_to_include) { sbuf->length_in_samples(samples_to_include); } change_position_in_samples(sbuf->length_in_samples()); //dump_child_debug("case3a-out"); } else if (chipos2 < chipos1 && child_looping_rep == true) { // --- // case 3b: looping, we will run out of data during read // --- //dump_child_debug("case3b-in"); child()->set_buffersize(buffersize()); child()->read_buffer(sbuf); sample_pos_t over_child_eof = chipos2 - child_start_pos_rep.samples(); /* step: copy segment 1 from loop end, and segment 2 from * loop start point */ sample_pos_t chistartpos = priv_public_to_child_pos(position_in_samples() + buffersize() - over_child_eof); DBC_CHECK(chistartpos == child_start_pos_rep.samples()); child()->seek_position_in_samples(chistartpos); if (over_child_eof > 0) { long int save_bsize = buffersize(); DBC_CHECK(save_bsize == buffersize()); child()->set_buffersize(over_child_eof); child()->read_buffer(&tmp_buffer); DBC_CHECK(tmp_buffer.length_in_samples() == over_child_eof); DBC_CHECK((buffersize() - over_child_eof) < buffersize()); sbuf->length_in_samples(buffersize()); sbuf->number_of_channels(channels()); sbuf->copy_range(tmp_buffer, 0, tmp_buffer.length_in_samples(), buffersize() - over_child_eof); child()->set_buffersize(save_bsize); } change_position_in_samples(buffersize()); //dump_child_debug("case3b-out"); } else { // --- // case 3c: normal case, read samples from child // --- child()->set_buffersize(buffersize()); child()->read_buffer(sbuf); /* note: if the 'length' parameter value is longer than * actual child object length, less than buffersize() * samples will be read */ change_position_in_samples(sbuf->length_in_samples()); //dump_child_debug("case3c-out"); } // dump_child_debug("case3-e"); } /* note: as we are looping indefinitely, so our length must * be continuously updated (see child_lengt() implementation) */ if (child_looping_rep == true || (child_length_set_by_client_rep != true && child()->finite_length_stream() != true)) extend_position(); DBC_ENSURE(channels() == child()->channels()); DBC_ENSURE(sbuf->number_of_channels() == channels()); DBC_ENSURE(sbuf->length_in_samples() <= buffersize()); } void AUDIO_SEQUENCER_BASE::dump_child_debug(const char *tag) { sample_pos_t chipos1 = priv_public_to_child_pos(position_in_samples()); cout << "TAG:" << tag << endl; cout << "global position (in samples): " << position_in_samples() << endl; cout << "child-pos: " << child()->position_in_samples() << endl; cout << "child-derived-pos: " << chipos1 << endl; cout << "child-offset: " << child_offset_rep.samples() << endl; cout << "child-startpos: " << child_start_pos_rep.samples() << endl; cout << "child-length: " << child_length_rep.samples() << endl; } void AUDIO_SEQUENCER_BASE::write_buffer(SAMPLE_BUFFER* sbuf) { if (child_write_started != true) { child_write_started = true; child_offset_rep.set_samples(position_in_samples()); MESSAGE_ITEM m; m << "found child_offset_rep " << child_offset_rep.seconds() << "."; ECA_LOG_MSG(ECA_LOGGER::user_objects, m.to_string()); } child()->write_buffer(sbuf); change_position_in_samples(sbuf->length_in_samples()); extend_position(); } SAMPLE_SPECS::sample_pos_t AUDIO_SEQUENCER_BASE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { /* in write mode, seek can be only performed once * the initial write has been performed to the child */ if (is_open() == true && (io_mode() == AUDIO_IO::io_read || (io_mode() != AUDIO_IO::io_read && child_write_started == true))) { sample_pos_t chipos = priv_public_to_child_pos(pos); child()->seek_position_in_samples(chipos); } return pos; } void AUDIO_SEQUENCER_BASE::set_child_object_string(const std::string& v) { child_object_str_rep = v; change_child_name(child_object_str_rep); } void AUDIO_SEQUENCER_BASE::set_child_offset(const ECA_AUDIO_TIME& v) { child_offset_rep = v; } void AUDIO_SEQUENCER_BASE::set_child_start_position(const ECA_AUDIO_TIME& v) { if (is_open() == true && child()->supports_seeking_sample_accurate() != true) { ECA_LOG_MSG(ECA_LOGGER::errors, "ERROR: object \"" + child()->label() + "\" does not support sample accurate seeking, unable to set start position."); return; } child_start_pos_rep = v; } void AUDIO_SEQUENCER_BASE::set_child_length_private(const ECA_AUDIO_TIME& v) { child_length_rep = v; } void AUDIO_SEQUENCER_BASE::set_child_length(const ECA_AUDIO_TIME& v) { set_child_length_private(v); child_length_set_by_client_rep = true; } ECA_AUDIO_TIME AUDIO_SEQUENCER_BASE::child_length(void) const { /* case: infinite child length */ if (child_length_set_by_client_rep != true && child()->finite_length_stream() != true) { ECA_AUDIO_TIME tmp; tmp.mark_as_invalid(); return tmp; } return child_length_rep; } bool AUDIO_SEQUENCER_BASE::finite_length_stream(void) const { if (child_looping_rep == true) return false; return child()->finite_length_stream(); } bool AUDIO_SEQUENCER_BASE::finished(void) const { /** * File is finished if... * 1) the child object is out of data (implies that looping * is disabled), or * 2) file is open in read mode, looping is disabled, child is * a finite length stream and its position has gone beyond * the requested child_length */ if (child()->finished()) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Child object " + child()->label() + " finished."); return true; } if (io_mode() != AUDIO_IO::io_read) { return false; } if (child_looping_rep != true && child()->finite_length_stream() == true && priv_public_to_child_pos(position_in_samples()) >= child_length_rep.samples() + child_start_pos_rep.samples()) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Finite length child object " + child()->label() + " finished. All samples from the requested range have been read."); return true; } return false; } ecasound-2.9.3/libecasound/audioio-ewf.cpp0000644000076400007640000001127611035215603015466 00000000000000// ------------------------------------------------------------------------ // audioio-ewf.cpp: Ecasound wave format input/output // Copyright (C) 1999-2002,2005,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include "eca-object-factory.h" #include "samplebuffer.h" #include "audioio-ewf.h" #include "eca-error.h" #include "eca-logger.h" using std::cout; using std::endl; using SAMPLE_SPECS::sample_pos_t; /** * FIXME notes (last update 2008-03-09) * * - Add (more) sanity checks for ewf fields. */ EWFFILE::EWFFILE (void) { } EWFFILE::~EWFFILE(void) { } EWFFILE* EWFFILE::clone(void) const { EWFFILE* target = new EWFFILE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void EWFFILE::open(void) throw(AUDIO_IO::SETUP_ERROR &) { if (io_mode() != AUDIO_IO::io_read) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Writing to EWF files is a deprecated feature since 2.4.7 (2008), and it will be disabled in a future release."); ewf_rc.resource_file(label()); ewf_rc.load(); read_ewf_data(); AUDIO_SEQUENCER_BASE::open(); } void EWFFILE::close(void) { if (io_mode() != AUDIO_IO::io_read) write_ewf_data(); AUDIO_SEQUENCER_BASE::close(); } void EWFFILE::init_default_child(void) throw(ECA_ERROR&) { string::const_iterator e = std::find(label().begin(), label().end(), '.'); if (e == label().end()) { throw(ECA_ERROR("AUDIOIO-EWF", "Invalid file name; unable to open file.",ECA_ERROR::retry)); } string child_name (label().begin(), e); child_name += ".wav"; set_child_object_string(child_name); DBC_CHECK(child_name == child_object_string()); ewf_rc.resource("source", child_object_string()); } void EWFFILE::read_ewf_data(void) throw(ECA_ERROR&) { if (ewf_rc.has("source")) set_child_object_string(ewf_rc.resource("source")); else init_default_child(); if (ewf_rc.has("offset")) { set_child_offset(ECA_AUDIO_TIME(ewf_rc.resource("offset"))); } else set_child_offset(ECA_AUDIO_TIME()); /* FIXME: doesn't work, if child has different srate and start-pos * specified in samples, the result is incorrect! */ if (ewf_rc.has("start-position")) { set_child_start_position(ECA_AUDIO_TIME(ewf_rc.resource("start-position"))); } else set_child_start_position(ECA_AUDIO_TIME()); if (ewf_rc.has("length")) { set_child_length(ECA_AUDIO_TIME(ewf_rc.resource("length"))); } toggle_looping(ewf_rc.boolean_resource("looping")); const std::vector keys = ewf_rc.keywords(); std::vector::const_iterator p = keys.begin(); while(p != keys.end()) { if (*p != "source" && *p != "offset" && *p != "start-position" && *p != "length" && *p != "looping") ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Unknown keyword '" + *p + "' in EWF file '" + label() + "'."); ++p; } } void EWFFILE::write_ewf_data(void) { ewf_rc.resource("source", child_object_string()); if (child_offset().samples() > 0) ewf_rc.resource("offset", kvu_numtostr(child_offset().seconds(),6)); if (child_start_position().samples() != 0) ewf_rc.resource("start-position", kvu_numtostr(child_start_position().seconds(), 6)); if (child_looping() == true) ewf_rc.resource("looping","true"); if (child_length().valid() == true) ewf_rc.resource("length", kvu_numtostr(child_length().seconds(), 6)); ewf_rc.save(); } std::string EWFFILE::parameter_names(void) const { return AUDIO_IO::parameter_names(); } void EWFFILE::set_parameter(int param, std::string value) { AUDIO_IO::set_parameter(param, value); } std::string EWFFILE::get_parameter(int param) const { return AUDIO_IO::get_parameter(param); } ecasound-2.9.3/libecasound/eca-iamode-parser.cpp0000644000076400007640000005075011762501733016545 00000000000000// ------------------------------------------------------------------------ // eca-iamode-parser.cpp: Class that handles registering and querying // interactive mode commands. // Copyright (C) 1999-2005,2008,2012 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "kvu_message_item.h" #include "kvu_locks.h" #include "eca-iamode-parser.h" #include "eca-logger.h" using namespace std; map* ECA_IAMODE_PARSER::cmd_map_repp = 0; pthread_mutex_t ECA_IAMODE_PARSER::lock_rep = PTHREAD_MUTEX_INITIALIZER; ECA_IAMODE_PARSER::ECA_IAMODE_PARSER(void) { } ECA_IAMODE_PARSER::~ECA_IAMODE_PARSER(void) { } const map& ECA_IAMODE_PARSER::registered_commands(void) { // // Note! Below we use the Double-Checked Locking Pattern // to protect against concurrent access if (cmd_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_IAMODE_PARSER::lock_rep); if (cmd_map_repp == 0) { cmd_map_repp = new map; register_commands_misc(); register_commands_cs(); register_commands_c(); register_commands_aio(); register_commands_ai(); register_commands_ao(); register_commands_cop(); register_commands_copp(); register_commands_ctrl(); register_commands_ctrlp(); register_commands_dump(); register_commands_external(); } } return *cmd_map_repp; } vector ECA_IAMODE_PARSER::registered_commands_list(void) { vector cmdlist; const map& map_ref = ECA_IAMODE_PARSER::registered_commands(); map::const_iterator p = map_ref.begin(); while (p != map_ref.end()) { cmdlist.push_back(p->first); ++p; } return cmdlist; } void ECA_IAMODE_PARSER::register_commands_misc(void) { (*cmd_map_repp)["help"] = ec_help; (*cmd_map_repp)["?"] = ec_help; (*cmd_map_repp)["h"] = ec_help; (*cmd_map_repp)["quit"] = ec_exit; (*cmd_map_repp)["q"] = ec_exit; (*cmd_map_repp)["start"] = ec_start; (*cmd_map_repp)["t"] = ec_start; (*cmd_map_repp)["stop"] = ec_stop; (*cmd_map_repp)["s"] = ec_stop; (*cmd_map_repp)["stop-sync"] = ec_stop_sync; (*cmd_map_repp)["run"] = ec_run; (*cmd_map_repp)["debug"] = ec_debug; (*cmd_map_repp)["resource-file"] = ec_resource_file; (*cmd_map_repp)["engine-launch"] = ec_engine_launch; (*cmd_map_repp)["engine-halt"] = ec_engine_halt; (*cmd_map_repp)["engine-status"] = ec_engine_status; (*cmd_map_repp)["status"] = ec_cs_status; (*cmd_map_repp)["st"] = ec_cs_status; (*cmd_map_repp)["cs"] = ec_c_status; (*cmd_map_repp)["es"] = ec_cop_status; (*cmd_map_repp)["fs"] = ec_aio_status; (*cmd_map_repp)["int-cmd-list"] = ec_int_cmd_list; (*cmd_map_repp)["int-log-history"] = ec_int_log_history; (*cmd_map_repp)["int-output-mode-wellformed"] = ec_int_output_mode_wellformed; (*cmd_map_repp)["int-set-float-to-string-precision"] = ec_int_set_float_to_string_precision; (*cmd_map_repp)["int-set-log-history-length"] = ec_int_set_log_history_length; (*cmd_map_repp)["int-version-string"] = ec_int_version_string; (*cmd_map_repp)["int-version-lib-current"] = ec_int_version_lib_current; (*cmd_map_repp)["int-version-lib-revision"] = ec_int_version_lib_revision; (*cmd_map_repp)["int-version-lib-age"] = ec_int_version_lib_age; (*cmd_map_repp)["preset-register"] = ec_preset_register; (*cmd_map_repp)["ladspa-register"] = ec_ladspa_register; (*cmd_map_repp)["lv2-register"] = ec_lv2_register; (*cmd_map_repp)["map-cop-list"] = ec_map_cop_list; (*cmd_map_repp)["map-preset-list"] = ec_map_preset_list; (*cmd_map_repp)["map-ladspa-list"] = ec_map_ladspa_list; (*cmd_map_repp)["map-ladspa-id-list"] = ec_map_ladspa_id_list; (*cmd_map_repp)["map-lv2-list"] = ec_map_lv2_list; (*cmd_map_repp)["map-ctrl-list"] = ec_map_ctrl_list; } void ECA_IAMODE_PARSER::register_commands_cs(void) { (*cmd_map_repp)["cs-add"] = ec_cs_add; (*cmd_map_repp)["cs-remove"] = ec_cs_remove; (*cmd_map_repp)["cs-list"] = ec_cs_list; (*cmd_map_repp)["cs-select"] = ec_cs_select; (*cmd_map_repp)["cs-selected"] = ec_cs_selected; (*cmd_map_repp)["cs-index-select"] = ec_cs_index_select; (*cmd_map_repp)["cs-iselect"] = ec_cs_index_select; (*cmd_map_repp)["cs-load"] = ec_cs_load; (*cmd_map_repp)["cs-save"] = ec_cs_save; (*cmd_map_repp)["cs-save-as"] = ec_cs_save_as; (*cmd_map_repp)["cs-edit"] = ec_cs_edit; (*cmd_map_repp)["cs-is-valid"] = ec_cs_is_valid; (*cmd_map_repp)["cs-connect"] = ec_cs_connect; (*cmd_map_repp)["cs-connected"] = ec_cs_connected; (*cmd_map_repp)["cs-disconnect"] = ec_cs_disconnect; (*cmd_map_repp)["cs-set-param"] = ec_cs_set_param; (*cmd_map_repp)["cs-set-audio-format"] = ec_cs_set_audio_format; (*cmd_map_repp)["cs-status"] = ec_cs_status; (*cmd_map_repp)["cs-rewind"] = ec_cs_rewind; (*cmd_map_repp)["rewind"] = ec_cs_rewind; (*cmd_map_repp)["rw"] = ec_cs_rewind; (*cmd_map_repp)["cs-forward"] = ec_cs_forward; (*cmd_map_repp)["forward"] = ec_cs_forward; (*cmd_map_repp)["fw"] = ec_cs_forward; (*cmd_map_repp)["cs-setpos"] = ec_cs_set_position; (*cmd_map_repp)["cs-set-position"] = ec_cs_set_position; (*cmd_map_repp)["cs-set-position-samples"] = ec_cs_set_position_samples; (*cmd_map_repp)["setpos"] = ec_cs_set_position; (*cmd_map_repp)["set-position"] = ec_cs_set_position; (*cmd_map_repp)["cs-getpos"] = ec_cs_get_position; (*cmd_map_repp)["cs-get-position"] = ec_cs_get_position; (*cmd_map_repp)["cs-get-position-samples"] = ec_cs_get_position_samples; (*cmd_map_repp)["getpos"] = ec_cs_get_position; (*cmd_map_repp)["get-position"] = ec_cs_get_position; (*cmd_map_repp)["cs-get-length"] = ec_cs_get_length; (*cmd_map_repp)["cs-get-length-samples"] = ec_cs_get_length_samples; (*cmd_map_repp)["get-length"] = ec_cs_get_length; (*cmd_map_repp)["cs-set-length"] = ec_cs_set_length; (*cmd_map_repp)["cs-set-length-samples"] = ec_cs_set_length_samples; (*cmd_map_repp)["cs-toggle-loop"] = ec_cs_toggle_loop; (*cmd_map_repp)["cs-option"] = ec_cs_option; } void ECA_IAMODE_PARSER::register_commands_c(void) { (*cmd_map_repp)["c-add"] = ec_c_add; (*cmd_map_repp)["c-remove"] = ec_c_remove; (*cmd_map_repp)["c-list"] = ec_c_list; (*cmd_map_repp)["c-select"] = ec_c_select; (*cmd_map_repp)["c-selected"] = ec_c_selected; (*cmd_map_repp)["c-index-select"] = ec_c_index_select; (*cmd_map_repp)["c-iselect"] = ec_c_index_select; (*cmd_map_repp)["c-deselect"] = ec_c_deselect; (*cmd_map_repp)["c-selected"] = ec_c_selected; (*cmd_map_repp)["c-select-all"] = ec_c_select_all; (*cmd_map_repp)["c-select-add"] = ec_c_select_add; (*cmd_map_repp)["c-clear"] = ec_c_clear; (*cmd_map_repp)["c-rename"] = ec_c_rename; (*cmd_map_repp)["c-muting"] = ec_c_muting; (*cmd_map_repp)["c-mute"] = ec_c_muting; (*cmd_map_repp)["c-bypass"] = ec_c_bypass; (*cmd_map_repp)["c-status"] = ec_c_status; (*cmd_map_repp)["c-is-muted"] = ec_c_is_muted; (*cmd_map_repp)["c-is-bypassed"] = ec_c_is_bypassed; } void ECA_IAMODE_PARSER::register_commands_aio(void) { (*cmd_map_repp)["aio-register"] = ec_aio_register; (*cmd_map_repp)["aio-status"] = ec_aio_status; } void ECA_IAMODE_PARSER::register_commands_ai(void) { (*cmd_map_repp)["ai-add"] = ec_ai_add; (*cmd_map_repp)["ai-describe"] = ec_ai_describe; (*cmd_map_repp)["ai-remove"] = ec_ai_remove; (*cmd_map_repp)["ai-list"] = ec_ai_list; (*cmd_map_repp)["ai-select"] = ec_ai_select; (*cmd_map_repp)["ai-index-select"] = ec_ai_index_select; (*cmd_map_repp)["ai-iselect"] = ec_ai_index_select; (*cmd_map_repp)["ai-selected"] = ec_ai_selected; (*cmd_map_repp)["ai-attach"] = ec_ai_attach; (*cmd_map_repp)["ai-status"] = ec_ai_status; (*cmd_map_repp)["ai-forward"] = ec_ai_forward; (*cmd_map_repp)["ai-rewind"] = ec_ai_rewind; (*cmd_map_repp)["ai-setpos"] = ec_ai_set_position; (*cmd_map_repp)["ai-set-position"] = ec_ai_set_position; (*cmd_map_repp)["ai-set-position-samples"] = ec_ai_set_position_samples; (*cmd_map_repp)["ai-getpos"] = ec_ai_get_position; (*cmd_map_repp)["ai-get-position"] = ec_ai_get_position; (*cmd_map_repp)["ai-get-position-samples"] = ec_ai_get_position_samples; (*cmd_map_repp)["ai-get-length"] = ec_ai_get_length; (*cmd_map_repp)["ai-get-length-samples"] = ec_ai_get_length_samples; (*cmd_map_repp)["ai-get-format"] = ec_ai_get_format; (*cmd_map_repp)["ai-wave-edit"] = ec_ai_wave_edit; } void ECA_IAMODE_PARSER::register_commands_ao(void) { (*cmd_map_repp)["ao-add"] = ec_ao_add; (*cmd_map_repp)["ao-add-default"] = ec_ao_add_default; (*cmd_map_repp)["ao-describe"] = ec_ao_describe; (*cmd_map_repp)["ao-list"] = ec_ao_list; (*cmd_map_repp)["ao-select"] = ec_ao_select; (*cmd_map_repp)["ao-index-select"] = ec_ao_index_select; (*cmd_map_repp)["ao-iselect"] = ec_ao_index_select; (*cmd_map_repp)["ao-selected"] = ec_ao_selected; (*cmd_map_repp)["ao-attach"] = ec_ao_attach; (*cmd_map_repp)["ao-remove"] = ec_ao_remove; (*cmd_map_repp)["ao-status"] = ec_ao_status; (*cmd_map_repp)["ao-forward"] = ec_ao_forward; (*cmd_map_repp)["ao-rewind"] = ec_ao_rewind; (*cmd_map_repp)["ao-setpos"] = ec_ao_set_position; (*cmd_map_repp)["ao-set-position"] = ec_ao_set_position; (*cmd_map_repp)["ao-set-position-samples"] = ec_ao_set_position_samples; (*cmd_map_repp)["ao-getpos"] = ec_ao_get_position; (*cmd_map_repp)["ao-get-position"] = ec_ao_get_position; (*cmd_map_repp)["ao-get-position-samples"] = ec_ao_get_position_samples; (*cmd_map_repp)["ao-get-length"] = ec_ao_get_length; (*cmd_map_repp)["ao-get-length-samples"] = ec_ao_get_length_samples; (*cmd_map_repp)["ao-get-format"] = ec_ao_get_format; (*cmd_map_repp)["ao-wave-edit"] = ec_ao_wave_edit; } void ECA_IAMODE_PARSER::register_commands_cop(void) { (*cmd_map_repp)["cop-add"] = ec_cop_add; (*cmd_map_repp)["cop-bypass"] = ec_cop_bypass; (*cmd_map_repp)["cop-describe"] = ec_cop_describe; (*cmd_map_repp)["cop-remove"] = ec_cop_remove; (*cmd_map_repp)["cop-list"] = ec_cop_list; (*cmd_map_repp)["cop-select"] = ec_cop_select; (*cmd_map_repp)["cop-index-select"] = ec_cop_select; (*cmd_map_repp)["cop-iselect"] = ec_cop_select; (*cmd_map_repp)["cop-is-bypassed"] = ec_cop_is_bypassed; (*cmd_map_repp)["cop-register"] = ec_cop_register; (*cmd_map_repp)["cop-selected"] = ec_cop_selected; (*cmd_map_repp)["cop-set"] = ec_cop_set; (*cmd_map_repp)["cop-get"] = ec_cop_get; (*cmd_map_repp)["cop-status"] = ec_cop_status; } void ECA_IAMODE_PARSER::register_commands_copp(void) { (*cmd_map_repp)["copp-list"] = ec_copp_list; (*cmd_map_repp)["copp-select"] = ec_copp_select; (*cmd_map_repp)["copp-index-select"] = ec_copp_select; (*cmd_map_repp)["copp-iselect"] = ec_copp_select; (*cmd_map_repp)["copp-selected"] = ec_copp_selected; (*cmd_map_repp)["copp-set"] = ec_copp_set; (*cmd_map_repp)["copp-get"] = ec_copp_get; } void ECA_IAMODE_PARSER::register_commands_ctrl(void) { (*cmd_map_repp)["ctrl-add"] = ec_ctrl_add; (*cmd_map_repp)["ctrl-describe"] = ec_ctrl_describe; (*cmd_map_repp)["ctrl-remove"] = ec_ctrl_remove; (*cmd_map_repp)["ctrl-list"] = ec_ctrl_list; (*cmd_map_repp)["ctrl-select"] = ec_ctrl_select; (*cmd_map_repp)["ctrl-index-select"] = ec_ctrl_select; (*cmd_map_repp)["ctrl-iselect"] = ec_ctrl_select; (*cmd_map_repp)["ctrl-register"] = ec_ctrl_register; (*cmd_map_repp)["ctrl-selected"] = ec_ctrl_selected; (*cmd_map_repp)["ctrl-status"] = ec_ctrl_status; (*cmd_map_repp)["ctrl-get-target"] = ec_ctrl_get_target; } void ECA_IAMODE_PARSER::register_commands_ctrlp(void) { (*cmd_map_repp)["ctrlp-list"] = ec_ctrlp_list; (*cmd_map_repp)["ctrlp-select"] = ec_ctrlp_select; (*cmd_map_repp)["ctrlp-selected"] = ec_ctrlp_selected; (*cmd_map_repp)["ctrlp-get"] = ec_ctrlp_get; (*cmd_map_repp)["ctrlp-set"] = ec_ctrlp_set; } void ECA_IAMODE_PARSER::register_commands_dump(void) { (*cmd_map_repp)["dump-target"] = ec_dump_target; (*cmd_map_repp)["dump-status"] = ec_dump_status; (*cmd_map_repp)["dump-position"] = ec_dump_position; (*cmd_map_repp)["dump-length"] = ec_dump_length; (*cmd_map_repp)["dump-cs-status"] = ec_dump_cs_status; (*cmd_map_repp)["dump-c-selected"] = ec_dump_c_selected; (*cmd_map_repp)["dump-ai-selected"] = ec_dump_ai_selected; (*cmd_map_repp)["dump-ai-position"] = ec_dump_ai_position; (*cmd_map_repp)["dump-ai-length"] = ec_dump_ai_length; (*cmd_map_repp)["dump-ai-open-state"] = ec_dump_ai_open_state; (*cmd_map_repp)["dump-ao-selected"] = ec_dump_ao_selected; (*cmd_map_repp)["dump-ao-position"] = ec_dump_ao_position; (*cmd_map_repp)["dump-ao-length"] = ec_dump_ao_length; (*cmd_map_repp)["dump-ao-open-state"] = ec_dump_ao_open_state; (*cmd_map_repp)["dump-cop-value"] = ec_dump_cop_value; } void ECA_IAMODE_PARSER::register_commands_external(void) { #if ECA_COMPILE_JACK (*cmd_map_repp)["jack-connect"] = ec_jack_connect; (*cmd_map_repp)["jack-disconnect"] = ec_jack_disconnect; (*cmd_map_repp)["jack-list-connections"] = ec_jack_list_connections; #endif } int ECA_IAMODE_PARSER::command_to_action_id(const std::string& cmdstring) { return (*cmd_map_repp)[cmdstring]; } bool ECA_IAMODE_PARSER::action_requires_params(int id) { switch(id) { case ec_debug: case ec_cs_add: case ec_cs_select: case ec_cs_index_select: case ec_cs_load: case ec_cs_save_as: case ec_cs_set_param: case ec_cs_set_audio_format: case ec_cs_set_length: case ec_cs_set_length_samples: case ec_cs_rewind: case ec_cs_forward: case ec_cs_set_position: case ec_cs_option: case ec_c_add: case ec_c_select: case ec_c_index_select: case ec_c_deselect: case ec_c_select_add: case ec_c_rename: case ec_ai_add: case ec_ai_select: case ec_ai_index_select: case ec_ai_forward: case ec_ai_rewind: case ec_ai_set_position: case ec_ai_set_position_samples: case ec_ao_add: case ec_ao_select: case ec_ao_index_select: case ec_ao_forward: case ec_ao_rewind: case ec_ao_set_position: case ec_ao_set_position_samples: case ec_cop_add: case ec_cop_select: case ec_cop_set: case ec_cop_get: case ec_copp_select: case ec_copp_set: case ec_ctrl_add: case ec_ctrl_select: case ec_int_set_float_to_string_precision: case ec_dump_target: case ec_dump_cop_value: case ec_jack_connect: case ec_jack_disconnect: return true; default: break; } return false; } bool ECA_IAMODE_PARSER::action_requires_connected(int id) { switch(id) { case ec_engine_launch: case ec_engine_halt: case ec_start: case ec_run: case ec_cs_disconnect: case ec_cs_set_position: case ec_cs_set_position_samples: return true; default: break; } return false; } bool ECA_IAMODE_PARSER::action_requires_selected(int id) { switch(id) { case ec_cs_remove: case ec_cs_edit: case ec_cs_is_valid: case ec_cs_save: case ec_cs_save_as: case ec_cs_connect: case ec_cs_set_param: case ec_cs_rewind: case ec_cs_forward: case ec_cs_set_position: case ec_cs_set_position_samples: case ec_cs_get_position: case ec_cs_get_position_samples: case ec_cs_get_length: case ec_cs_get_length_samples: case ec_cs_set_length: case ec_cs_set_length_samples: case ec_cs_toggle_loop: case ec_cs_option: case ec_c_remove: case ec_c_clear: case ec_c_rename: case ec_c_muting: case ec_c_bypass: case ec_c_status: case ec_c_list: case ec_c_select: case ec_c_selected: case ec_aio_status: case ec_ai_add: case ec_ai_select: case ec_ai_selected: case ec_ai_index_select: case ec_ai_remove: case ec_ai_attach: case ec_ai_status: case ec_ai_forward: case ec_ai_rewind: case ec_ai_set_position: case ec_ai_set_position_samples: case ec_ai_get_position: case ec_ai_get_position_samples: case ec_ai_get_length: case ec_ai_get_length_samples: case ec_ai_get_format: case ec_ai_wave_edit: case ec_ao_add: case ec_ao_add_default: case ec_ao_select: case ec_ao_selected: case ec_ao_index_select: case ec_ao_remove: case ec_ao_attach: case ec_ao_status: case ec_ao_forward: case ec_ao_rewind: case ec_ao_set_position: case ec_ao_set_position_samples: case ec_ao_get_position: case ec_ao_get_position_samples: case ec_ao_get_length: case ec_ao_get_length_samples: case ec_ao_get_format: case ec_ao_wave_edit: case ec_cop_add: case ec_cop_bypass: case ec_cop_is_bypassed: case ec_cop_list: case ec_cop_select: case ec_cop_selected: case ec_cop_set: case ec_cop_get: case ec_cop_status: case ec_copp_list: case ec_copp_select: case ec_copp_selected: case ec_copp_set: case ec_ctrl_add: case ec_ctrl_select: case ec_ctrl_selected: case ec_ctrl_status: return true; default: break; } return false; } bool ECA_IAMODE_PARSER::action_requires_selected_not_connected(int id) { switch(id) { case ec_cs_remove: case ec_cs_set_length: case ec_cs_set_length_samples: case ec_cs_toggle_loop: case ec_cs_set_param: case ec_cs_option: case ec_c_add: case ec_c_remove: case ec_c_rename: case ec_c_clear: case ec_cop_remove: case ec_ctrl_remove: case ec_ai_add: case ec_ai_remove: case ec_ai_attach: case ec_ai_forward: case ec_ai_rewind: case ec_ai_set_position: case ec_ai_set_position_samples: case ec_ai_wave_edit: case ec_ao_add: case ec_ao_add_default: case ec_ao_remove: case ec_ao_attach: case ec_ao_forward: case ec_ao_rewind: case ec_ao_set_position: case ec_ao_set_position_samples: case ec_ao_wave_edit: return true; default: break; } return false; } bool ECA_IAMODE_PARSER::action_requires_selected_audio_input(int id) { switch(id) { case ec_ai_describe: case ec_ai_remove: case ec_ai_attach: case ec_ai_forward: case ec_ai_rewind: case ec_ai_set_position: case ec_ai_set_position_samples: case ec_ai_get_position: case ec_ai_get_position_samples: case ec_ai_selected: case ec_ai_get_length: case ec_ai_get_length_samples: case ec_ai_get_format: case ec_ai_wave_edit: return true; default: break; } return false; } bool ECA_IAMODE_PARSER::action_requires_selected_audio_output(int id) { switch(id) { case ec_ao_describe: case ec_ao_remove: case ec_ao_attach: case ec_ao_forward: case ec_ao_rewind: case ec_ao_set_position: case ec_ao_set_position_samples: case ec_ao_get_position: case ec_ao_get_position_samples: case ec_ao_selected: case ec_ao_get_length: case ec_ao_get_length_samples: case ec_ao_get_format: case ec_ao_wave_edit: return true; default: break; } return false; } void show_controller_help(void) { MESSAGE_ITEM mitem; mitem << "\n-------------------------------------------------------------------"; mitem << "\n ecasound interactive-mode - command reference"; mitem << "\n-------------------------------------------------------------------"; mitem << "\n'q' - Quits ecasound"; mitem << "\n'start', 't' - Processing is started (play)"; mitem << "\n'stop', 's' - Stops processing"; mitem << "\n'rewind time-in-seconds', 'rw time-in-seconds' - Rewind"; mitem << "\n'forward time-in-seconds', 'fw time-in-seconds' - Forward"; mitem << "\n'setpos time-in-seconds' - Sets the current position to 'time-in-seconds' seconds from the beginning."; mitem << "\n'engine-launch' - Initialize and start engine"; mitem << "\n'engine-status' - Engine status"; mitem << "\n'cs-status', 'st' - Chainsetup status"; mitem << "\n'c-status', 'cs' - Chain status"; mitem << "\n'cop-status', 'es' - Chain operator status"; mitem << "\n'ctrl-status' - Controller status"; mitem << "\n'aio-status', 'fs' - Audio input/output status"; mitem << "\n--- see ecasound-iam(1) manual page for more info -----------------\n"; // mitem << "\n'chain chainname', 'c chainname' - Enable/disable the the chain 'chainname'"; ECA_LOG_MSG(ECA_LOGGER::info, mitem.to_string()); } ecasound-2.9.3/libecasound/samplebuffer_iterators.cpp0000644000076400007640000000477211161425434020035 00000000000000// ------------------------------------------------------------------------ // audiofx_mixing.cpp: Effects for channel mixing and routing // Copyright (C) 1999-2005,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "samplebuffer.h" #include "samplebuffer_iterators.h" // --------------------------------------------------------------------- void SAMPLE_ITERATOR::begin(void) { index = 0; channel_index = 0; if (target->buffersize_rep == 0) channel_index = target->channel_count_rep; } void SAMPLE_ITERATOR::next(void) { ++index; if (index == target->buffersize_rep) { ++channel_index; index = 0; } } // --------------------------------------------------------------------- void SAMPLE_ITERATOR_CHANNEL::init(SAMPLE_BUFFER* buf, int channel) { target = buf; index = 0; channel_index = channel; if (channel_index < 0 || channel_index >= target->number_of_channels()) index = target->buffersize_rep; DBC_CHECK(index == 0); } void SAMPLE_ITERATOR_CHANNEL::begin(int channel) { index = 0; channel_index = channel; if (channel_index < 0 || channel_index >= target->number_of_channels()) index = target->buffersize_rep; DBC_CHECK(index == 0); } // --------------------------------------------------------------------- void SAMPLE_ITERATOR_CHANNELS::begin(void) { index = 0; channel_index = 0; if (target->buffersize_rep == 0) channel_index = target->channel_count_rep; } void SAMPLE_ITERATOR_CHANNELS::next(void) { ++index; if (index == target->buffersize_rep) { ++channel_index; index = 0; } } // --------------------------------------------------------------------- ecasound-2.9.3/libecasound/generic-controller.cpp0000644000076400007640000000776311034750412017062 00000000000000// ------------------------------------------------------------------------ // generic_controller.cpp: General sources for control signals // Copyright (C) 1999-2002,2005,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "generic-controller.h" #include "eca-chainop.h" #include "eca-logger.h" /* Debug controller source values */ // #define DEBUG_CONTROLLERS 1 #ifdef DEBUG_CONTROLLERS #define DEBUG_CTRL_STATEMENT(x) x #else #define DEBUG_CTRL_STATEMENT(x) ((void)0) #endif GENERIC_CONTROLLER::GENERIC_CONTROLLER(CONTROLLER_SOURCE* src, OPERATOR* dobj, int par_id, double range_low, double range_high) { source = src; target = dobj; init_called_rep = false; param_id_rep = par_id; rangelow_rep = range_low; rangehigh_rep = range_high; last_value_pos_rep = -1; } void GENERIC_CONTROLLER::init(void) { source->init(); double init_value = target->get_parameter(param_id_rep); init_value = (init_value - rangelow_rep) / (rangehigh_rep - rangelow_rep); source->set_initial_value(init_value); DEBUG_CTRL_STATEMENT(std::cerr << "generic-controller: init type '" << source->name() << "', init_value " << init_value << "." << std::endl); init_called_rep = true; last_value_pos_rep = -1; } CONTROLLER_SOURCE::parameter_t GENERIC_CONTROLLER::value(double pos) { // -------- DBC_REQUIRE(is_valid() == true); // -------- double new_value = rangelow_rep + (source->value(pos) * (rangehigh_rep - rangelow_rep)); DEBUG_CTRL_STATEMENT(std::cerr << "generic-controller: type '" << source->name() << "', pos_sec " << pos << ", source_value " << source->value(pos) << ", scaled_value " << new_value << "." << std::endl); target->set_parameter(param_id_rep, new_value); last_value_pos_rep = pos; return new_value; } string GENERIC_CONTROLLER::status(void) const { if (is_valid() == true) { double value = -1.0f; if (last_value_pos_rep > 0) { value = source->value(last_value_pos_rep); } return "Source \"" + source->name() + "\" connected to target \"" + target->name() + "\"." + " Current source value is " + kvu_numtostr(value) + " and target " + kvu_numtostr(target->get_parameter(param_id_rep)) + "."; } else { return "Controller not valid."; } } void GENERIC_CONTROLLER::assign_target(OPERATOR* obj) { target = obj; } void GENERIC_CONTROLLER::assign_source(CONTROLLER_SOURCE* obj) { if (init_called_rep == true && source != obj) init(); source = obj; } void GENERIC_CONTROLLER::set_parameter(int param, CHAIN_OPERATOR::parameter_t v) { switch (param) { case 1: param_id_rep = static_cast(v); break; case 2: rangelow_rep = v; break; case 3: rangehigh_rep = v; break; default: source->set_parameter(param - 3, v); } } CHAIN_OPERATOR::parameter_t GENERIC_CONTROLLER::get_parameter(int param) const { switch (param) { case 1: return static_cast(param_id_rep); case 2: return rangelow_rep; case 3: return rangehigh_rep; default: return source->get_parameter(param - 3); } return 0.0; } ecasound-2.9.3/libecasound/eca-preset-map.h0000644000076400007640000000234010664032032015516 00000000000000#ifndef INCLUDED_ECA_PRESET_MAP_H #define INCLUDED_ECA_PRESET_MAP_H #include #include #include "preset.h" #include "eca-object-map.h" #include "resource-file.h" class ECA_OBJECT; /** * Dynamic register for storing effect presets * * @see ECA_OBJECT_MAP * * @author Kai Vehmanen */ class ECA_PRESET_MAP : public ECA_OBJECT_MAP { public: /** @name Constructors and destructors */ /*@{*/ ECA_PRESET_MAP(void); virtual ~ECA_PRESET_MAP(void); /*@}*/ /** @name Object registration */ /*@{*/ virtual void register_object(const std::string& keyword, const std::string& matchstr, ECA_OBJECT* object); virtual void unregister_object(const std::string& keyword); /*@}*/ /** @name Object creation using object prototypes instances */ /*@{*/ virtual const ECA_OBJECT* object(const std::string& keyword) const; virtual const ECA_OBJECT* object_expr(const string& expr) const; /*@}*/ /** @name Query the object map */ /*@{*/ virtual bool has_keyword(const std::string& keyword) const; virtual const std::list& registered_objects(void) const; /*@}*/ private: std::list preset_keywords_rep; void load_preset_file(const std::string& fname); }; #endif ecasound-2.9.3/libecasound/samplebuffer_iterators.h0000644000076400007640000001032611161425434017472 00000000000000#ifndef INCLUDED_SAMPLEBUFFER_ITERATORS_H #define INCLUDED_SAMPLEBUFFER_ITERATORS_H #include "samplebuffer.h" /** * Iterate through all samples. No specific order. * * Related design patterns: * - Iterator (GoF257) */ class SAMPLE_ITERATOR { private: SAMPLE_BUFFER* target; SAMPLE_BUFFER::buf_size_t index; // index of the current sample SAMPLE_BUFFER::channel_size_t channel_index; // index of current channel public: /** * Prepare iterator for processing. */ void init(SAMPLE_BUFFER* buf) { target = buf; } /** * Start iteration from the first audio item; */ void begin(void); /** * True if iterator is past the last audio item. */ inline bool end(void) { return(channel_index >= static_cast(target->channel_count_rep)); } /** * Move iterator to the next audio item. */ void next(void); /** * Returns a pointer to the current sample. */ inline SAMPLE_SPECS::sample_t* current(void) { return(&(target->buffer[channel_index][index])); } }; /** * Iterate through all samples of one channel. * * Notice! This iterator can be used to add extra * channels to the sample data. * * Related design patterns: * - Iterator (GoF257) */ class SAMPLE_ITERATOR_CHANNEL { private: SAMPLE_BUFFER* target; SAMPLE_BUFFER::buf_size_t index; // index of the current sample SAMPLE_BUFFER::channel_size_t channel_index; // index of current channel public: /** * Prepare iterator for processing. */ void init(SAMPLE_BUFFER* buf, int channel = 0); /** * Start iteration from the first sample of 'channel'. More channels * are allocated, if sample buffer has fewer channels than asked for. * * @param channel number of iterated channel (0, 1, ... , n) */ void begin(int channel); /** * Start iteration from the first audio item (using the previously * set channel). */ void begin(void) { index = 0; } /** * Move iterator to the next audio item. */ void next(void) { ++index; } /** * True if iterator is past the last audio item. */ inline bool end(void) { return(static_cast(index) >= target->buffersize_rep); } /** * Returns a pointer to the current sample. */ inline SAMPLE_SPECS::sample_t* current(void) { return(&target->buffer[channel_index][index]); } }; /** * Iterate through all samples, one channel at a time. * * Related design patterns: * - Iterator (GoF257) */ class SAMPLE_ITERATOR_CHANNELS { private: SAMPLE_BUFFER* target; SAMPLE_BUFFER::buf_size_t index; // index of the current sample SAMPLE_BUFFER::channel_size_t channel_index; // index of current channel public: /** * Prepare iterator for processing. */ void init(SAMPLE_BUFFER* buf) { target = buf; } /** * Start iteration from the first audio item; */ void begin(void); /** * Move iterator to the next audio item. */ void next(void); /** * True if iterator is past the last audio item. */ inline bool end(void) { return(channel_index >= static_cast(target->channel_count_rep)); } /** * Returns a pointer to the current sample. */ inline SAMPLE_SPECS::sample_t* current(void) { return(&(target->buffer[channel_index][index])); } /** * Returns current channel index (starting from 0) */ inline int channel(void) const { return(channel_index); } }; /** * Iterate through all samples, one sample frame (interleaved) at a time. * * Related design patterns: * - Iterator (GoF257) */ class SAMPLE_ITERATOR_INTERLEAVED { private: SAMPLE_BUFFER* target; SAMPLE_BUFFER::buf_size_t index; // index of the current sample public: /** * Prepare iterator for processing. */ void init(SAMPLE_BUFFER* buf) { target = buf; } /** * Start iteration from the first audio item; */ void begin(void) { index = 0; } /** * Move iterator to the next audio item. */ inline void next(void) { ++index; } /** * True if iterator is past the last audio item. */ inline bool end(void) { return(static_cast(index) >= target->buffersize_rep); } /** * Returns a pointer to the current sample. */ inline SAMPLE_SPECS::sample_t* current(int channel) { return(&target->buffer[channel][index]); } }; #endif ecasound-2.9.3/libecasound/eca-object-factory_test.h0000644000076400007640000001713312260762753017437 00000000000000// ------------------------------------------------------------------------ // eca-object-factory_test.h: Unit test for ECA_OBJECT_FACTORY // Copyright (C) 2002,2008,2009,2012 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include /* std::fabs() */ #include #include #include /* typeid() */ #ifdef HAVE_CONFIG_H #include #endif #include "kvu_numtostr.h" #include "audioio.h" #include "audioio-device.h" #include "eca-chainop.h" #include "audiofx_ladspa.h" #include "audiofx_lv2.h" #include "preset.h" #include "generic-controller.h" #include "midiio.h" #include "eca-operator.h" #include "eca-object-factory.h" #include "eca-object-map.h" #include "eca-preset-map.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_OBJECT_FACTORY. * * 1. Checks that all factory object maps have * at least one registered object. * 2. Creates one instance of each object and * verifies that DYNAMIC_OBJECT::new_expr() and * DYNAMIC_OBJECT::clone() member functions * are correctly defined. * 3. Checks that LADSPA id and unique_name * maps have same number of registered objects. */ class ECA_OBJECT_FACTORY_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("ECA_OBJECT_FACTORY_TEST"); } virtual void do_run(void); public: virtual ~ECA_OBJECT_FACTORY_TEST(void) { } private: template void test_map(const ECA_OBJECT_MAP& objmap); template void test_object_types(const T* source, const T* target, const string& description); }; template void ECA_OBJECT_FACTORY_TEST::test_object_types(const T* source, const T* target, const string& description) { if (target == 0) { ECA_TEST_FAILURE("Unable to create object (" + description + ") of type \"" + source->name() + "\""); } else if (target->name() != source->name()) { ECA_TEST_FAILURE("Type mismatch (name) between (" + description + ") and original object; type name \"" + source->name() + "\""); } else if (typeid(target) != typeid(source)) { ECA_TEST_FAILURE("Type mismatch (type_id) between (" + description + ") and original object; type name \"" + source->name() + "\""); } } template void ECA_OBJECT_FACTORY_TEST::test_map(const ECA_OBJECT_MAP& objmap) { const list& regobjs = objmap.registered_objects(); list::const_iterator p = regobjs.begin(); while(p != regobjs.end()) { const T* obj = dynamic_cast(objmap.object(*p)); if (obj == 0) { ECA_TEST_FAILURE("Unable to create object from keyword \"" + *p + "\""); } else { ECA_LOG_MSG(ECA_LOGGER::user_objects, "libecasound_tester: Object type \"" + obj->name() + "\" successfully created."); T* target = dynamic_cast(obj->new_expr()); test_object_types(obj, target, "new_expr"); if (target != 0) delete target; target = dynamic_cast(obj->clone()); test_object_types(obj, target, "clone"); if (target != 0) { if (obj->number_of_params() != target->number_of_params() && target->variable_params() != true) { ECA_TEST_FAILURE("Cloned object has different number of arguments " "than original object; type name \"" + obj->name() + "\"."); } else { const OPERATOR* operator_source = dynamic_cast(obj); OPERATOR* operator_target = dynamic_cast(target); const AUDIO_IO* audioio_source = dynamic_cast(obj); AUDIO_IO* audioio_target = dynamic_cast(target); for(int n = 0; n < obj->number_of_params(); n++) { if (obj->get_parameter_name(n + 1) != target->get_parameter_name(n + 1)) { ECA_TEST_FAILURE("Cloned object has different parameter name \"" + target->get_parameter_name(n + 1) + "\" than that of original object \"" + obj->get_parameter_name(n + 1) + "\"; type name \"" + obj->name() + "\"."); } else { if (operator_source != 0 && operator_target != 0) { /* OPERATOR binds parameter type to 'SAMPLE_SPECS::sample_t' (float) */ SAMPLE_SPECS::sample_t diffval = std::fabs(operator_source->get_parameter(n + 1) - operator_target->get_parameter(n + 1)); if (diffval > 0.1f) { ECA_TEST_FAILURE("Cloned object has different parameter value \"" + kvu_numtostr(operator_target->get_parameter(n + 1)) + "\" than that of the original object \"" + kvu_numtostr(operator_source->get_parameter(n + 1)) + "\", diff " + kvu_numtostr(diffval) + "; type name \"" + operator_source->name() + "\"."); } } else if (audioio_source != 0 && audioio_target != 0) { /* AUDIO_IO binds parameter type to 'std::string' */ if (audioio_source->get_parameter(n + 1) != audioio_target->get_parameter(n + 1)) { ECA_TEST_FAILURE("Cloned object has different parameter value \"" + audioio_target->get_parameter(n + 1) + "\" than that of the original object \"" + audioio_source->get_parameter(n + 1) + "\"; type name \"" + audioio_source->name() + "\"."); } } } } } } delete target; } ++p; } } void ECA_OBJECT_FACTORY_TEST::do_run(void) { ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - rt-map"); ECA_OBJECT_MAP& rt_map = ECA_OBJECT_FACTORY::audio_io_rt_map(); test_map(rt_map); ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - nonrt-map"); ECA_OBJECT_MAP& nonrt_map = ECA_OBJECT_FACTORY::audio_io_nonrt_map(); test_map(nonrt_map); ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - chainop-map"); ECA_OBJECT_MAP& chainop_map = ECA_OBJECT_FACTORY::chain_operator_map(); test_map(chainop_map); ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - LADSPA-map"); ECA_OBJECT_MAP& ladspa_map = ECA_OBJECT_FACTORY::ladspa_plugin_map(); test_map(ladspa_map); ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - LADSPA-id-map"); ECA_OBJECT_MAP& ladspa_id_map = ECA_OBJECT_FACTORY::ladspa_plugin_id_map(); test_map(ladspa_id_map); if (ladspa_map.registered_objects().size() != ladspa_id_map.registered_objects().size()) { ECA_TEST_FAILURE("LADSPA plugin name and id maps have different number of plugins!"); } #if ECA_USE_LIBLILV ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - LV2-map"); ECA_OBJECT_MAP& lv2_map = ECA_OBJECT_FACTORY::lv2_plugin_map(); test_map(lv2_map); #endif ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factories - preset-map"); ECA_PRESET_MAP& preset_map = ECA_OBJECT_FACTORY::preset_map(); test_map(preset_map); ECA_LOG_MSG(ECA_LOGGER::info, "libecasound_tester: object factory test done"); } ecasound-2.9.3/libecasound/eca-object-factory.cpp0000644000076400007640000006374311760510671016735 00000000000000// ------------------------------------------------------------------------ // eca-object-factory.cpp: Abstract factory for creating libecasound // objects. // Copyright (C) 2000-2005,2007,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include /* ANSI-C++: find() */ #include #include #include #include #include #include #include #ifdef ECA_COMPILE_JACK #include #endif #include #include "kvu_locks.h" #include #include #include "audioio.h" #include "audioio-loop.h" #include "midiio.h" #include "audiofx_ladspa.h" #include "audiofx_lv2.h" #include "generic-controller.h" #include "eca-static-object-maps.h" #include "eca-object-map.h" #include "eca-preset-map.h" #include "eca-object-factory.h" #include "eca-resources.h" #include "eca-logger.h" /** * Import std namespace. */ using std::list; using std::map; using std::string; /** * Initialize static member variables. */ ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::audio_io_rt_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::audio_io_nonrt_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::chain_operator_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::lv2_plugin_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::ladspa_plugin_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::ladspa_plugin_id_map_repp = 0; ECA_PRESET_MAP* ECA_OBJECT_FACTORY::preset_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::controller_map_repp = 0; ECA_OBJECT_MAP* ECA_OBJECT_FACTORY::midi_device_map_repp = 0; pthread_mutex_t ECA_OBJECT_FACTORY::lock_rep = PTHREAD_MUTEX_INITIALIZER; /** * Definitions for static member functions. */ /** * Returns an object map containing all registered * realtime audio i/o object types. * * All stored objects are derived from AUDIO_IO_DEVICE. */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::audio_io_rt_map(void) { // // Note! Below we use the Double-Checked Locking Pattern // to protect against concurrent access if (audio_io_rt_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (audio_io_rt_map_repp == 0) { audio_io_rt_map_repp = new ECA_OBJECT_MAP(); ECA_STATIC_OBJECT_MAPS::register_audio_io_rt_objects(audio_io_rt_map_repp); } } return *audio_io_rt_map_repp; } /** * Returns an object map containing all registered * non-realtime audio i/o object types. * * All stored objects are derived from AUDIO_IO. */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::audio_io_nonrt_map(void) { if (audio_io_nonrt_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (audio_io_nonrt_map_repp == 0) { audio_io_nonrt_map_repp = new ECA_OBJECT_MAP(); ECA_STATIC_OBJECT_MAPS::register_audio_io_nonrt_objects(audio_io_nonrt_map_repp); } } return *audio_io_nonrt_map_repp; } /** * Returns an object map containing all registered * chain operator object types. * * All stored objects are derived from CHAIN_OPERATOR. */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::chain_operator_map(void) { if (chain_operator_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (chain_operator_map_repp == 0) { chain_operator_map_repp = new ECA_OBJECT_MAP(); ECA_STATIC_OBJECT_MAPS::register_chain_operator_objects(chain_operator_map_repp); } } return *chain_operator_map_repp; } /** * Returns an object map containing all registered * LV2 plugin types. * * All stored objects are derived from EFFECT_LV2. * * @see ladspa_plugin_id_map() */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::lv2_plugin_map(void) { if (lv2_plugin_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (lv2_plugin_map_repp == 0) { lv2_plugin_map_repp = new ECA_OBJECT_MAP(); DBC_CHECK(lv2_plugin_map_repp != 0); /* note: matching LADSPA unique names must be case sensitive */ lv2_plugin_map_repp->toggle_case_sensitive_expressions(true); ECA_STATIC_OBJECT_MAPS::register_lv2_plugin_objects(lv2_plugin_map_repp); } } return *lv2_plugin_map_repp; } /** * Returns an object map containing all registered * LADSPA plugin types. * * * All stored objects are derived from EFFECT_LADSPA. * * @see ladspa_plugin_id_map() */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::ladspa_plugin_map(void) { if (ladspa_plugin_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (ladspa_plugin_map_repp == 0) { ladspa_plugin_map_repp = new ECA_OBJECT_MAP(); DBC_CHECK(ladspa_plugin_map_repp != 0); /* note: matching LADSPA unique names must be case sensitive */ ladspa_plugin_map_repp->toggle_case_sensitive_expressions(true); ECA_STATIC_OBJECT_MAPS::register_ladspa_plugin_objects(ladspa_plugin_map_repp); } } return *ladspa_plugin_map_repp; } /** * Returns an object map containing all registered * LADSPA plugin types. Plugins are identified using * their unique LADSPA id number. * * All stored objects are derived from EFFECT_LADSPA. * * @see ladspa_plugin_map() */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::ladspa_plugin_id_map(void) { if (ladspa_plugin_id_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (ladspa_plugin_id_map_repp == 0) { ladspa_plugin_id_map_repp = new ECA_OBJECT_MAP(); ECA_STATIC_OBJECT_MAPS::register_ladspa_plugin_id_objects(ladspa_plugin_id_map_repp); } } return *ladspa_plugin_id_map_repp; } /** * Returns an object map containing all registered * chain operator preset object types. * * All stored objects are derived from PRESET. */ ECA_PRESET_MAP& ECA_OBJECT_FACTORY::preset_map(void) { if (preset_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (preset_map_repp == 0) { preset_map_repp = new ECA_PRESET_MAP(); ECA_STATIC_OBJECT_MAPS::register_preset_objects(preset_map_repp); } } return *preset_map_repp; } /** * Returns an object map containing all registered * controller object types. * * All stored objects are derived from GENERIC_CONTROLLER. */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::controller_map(void) { if (controller_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (controller_map_repp == 0) { controller_map_repp = new ECA_OBJECT_MAP(); ECA_STATIC_OBJECT_MAPS::register_controller_objects(controller_map_repp); } } return *controller_map_repp; } /** * Returns an object map containing all registered * MIDI-device types. * * * All stored objects are derived from MIDI_IO. */ ECA_OBJECT_MAP& ECA_OBJECT_FACTORY::midi_device_map(void) { if (midi_device_map_repp == 0) { KVU_GUARD_LOCK guard(&ECA_OBJECT_FACTORY::lock_rep); if (midi_device_map_repp == 0) { midi_device_map_repp = new ECA_OBJECT_MAP(); ECA_STATIC_OBJECT_MAPS::register_midi_device_objects(midi_device_map_repp); } } return *midi_device_map_repp; } /** * Create a new audio object based on the formatted argument string. * * @param arg a formatted string describing an audio object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre arg.empty() != true */ AUDIO_IO* ECA_OBJECT_FACTORY::create_audio_object(const string& arg) { // -- DBC_REQUIRE(arg.empty() != true); // -- int args_given = kvu_get_number_of_arguments(arg); string fname = kvu_get_argument_number(1, arg); const AUDIO_IO* main_file = 0; main_file = dynamic_cast(ECA_OBJECT_FACTORY::audio_io_rt_map().object_expr(fname)); if (main_file == 0) { main_file = dynamic_cast(ECA_OBJECT_FACTORY::audio_io_nonrt_map().object_expr(fname)); } AUDIO_IO* new_file = 0; if (main_file != 0) { new_file = main_file->new_expr(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Object \"" + arg + "\" created, type \"" + new_file->name() + "\". Has " + kvu_numtostr(new_file->number_of_params()) + " parameter(s) (variable: " + (new_file->variable_params() == true ? string("yes).") : string("no)."))); /* if more params are given and the object supports * variable number of args, pass them all to the object */ int params = new_file->number_of_params(); if (new_file->variable_params() && args_given > params) params = args_given; for(int n = 0; n < params; n++) { new_file->set_parameter(n + 1, kvu_get_argument_number(n + 1, arg)); } } return new_file; } /** * Create a new MIDI-device object based on the formatted argument string. * * @param arg a formatted string describing a MIDI-device object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * require: * arg.empty() != true */ MIDI_IO* ECA_OBJECT_FACTORY::create_midi_device(const string& arg) { // -------- DBC_REQUIRE(arg.empty() != true); // -------- string fname = kvu_get_argument_number(1, arg); const MIDI_IO* device = 0; device = dynamic_cast(ECA_OBJECT_FACTORY::midi_device_map().object_expr(fname)); MIDI_IO* new_device = 0; if (device != 0) { new_device = device->new_expr(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Object \"" + arg + "\" created, type \"" + new_device->name() + "\". Has " + kvu_numtostr(new_device->number_of_params()) + " parameter(s)."); for(int n = 0; n < new_device->number_of_params(); n++) { new_device->set_parameter(n + 1, kvu_get_argument_number(n + 1, arg)); } } return new_device; } /** * Create a new loop input object. * * @param arg a formatted string describing an loop object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre argu.empty() != true */ AUDIO_IO* ECA_OBJECT_FACTORY::create_loop_input(const string& argu, map* loop_map) { // -------- DBC_REQUIRE(argu.empty() != true); // -------- LOOP_DEVICE* p = 0; string tname = kvu_get_argument_number(1, argu); if (tname == "loop") { string id = kvu_get_argument_number(2, argu); p = new LOOP_DEVICE(id); if (loop_map->find(id) == loop_map->end()) { (*loop_map)[id] = p; } else p = (*loop_map)[id]; p->register_input(); } return p; } /** * Create a new loop output object. * * @param arg a formatted string describing an loop object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre argu.empty() != true */ AUDIO_IO* ECA_OBJECT_FACTORY::create_loop_output(const string& argu, map* loop_map) { // -------- DBC_REQUIRE(argu.empty() != true); // -------- LOOP_DEVICE* p = 0; string tname = kvu_get_argument_number(1, argu); if (tname == "loop") { string id = kvu_get_argument_number(2, argu); p = new LOOP_DEVICE(id); if (loop_map->find(id) == loop_map->end()) { (*loop_map)[id] = p; } else p = (*loop_map)[id]; p->register_output(); } return p; } /** * Creates a new LADSPA plugin. * * @param arg a formatted string describing an LADSPA object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre argu.size() > 0 * @pre argu[0] == '-' */ CHAIN_OPERATOR* ECA_OBJECT_FACTORY::create_ladspa_plugin (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); // -------- MESSAGE_ITEM otemp; otemp.setprecision(3); const CHAIN_OPERATOR* cop = 0; string prefix = kvu_get_argument_prefix(argu); if (prefix == "el" || prefix == "eli") { string unique = kvu_get_argument_number(1, argu); if (prefix == "el") cop = dynamic_cast(ECA_OBJECT_FACTORY::ladspa_plugin_map().object(unique)); else cop = dynamic_cast(ECA_OBJECT_FACTORY::ladspa_plugin_id_map().object(unique)); CHAIN_OPERATOR* new_cop = 0; if (cop != 0) { new_cop = dynamic_cast(cop->new_expr()); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Creating LADSPA-plugin \"" + new_cop->name() + "\""); otemp << "Setting parameters: "; for(int n = 0; n < new_cop->number_of_params(); n++) { new_cop->set_parameter(n + 1, atof(kvu_get_argument_number(n + 2, argu).c_str())); otemp << new_cop->get_parameter_name(n + 1) << " = "; otemp << new_cop->get_parameter(n + 1); if (n + 1 < new_cop->number_of_params()) otemp << ", "; } ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } else { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Unable to find LADSPA plugin \"" + unique + "\""); } return new_cop; } return 0; } /** * Creates a new LV2 plugin. * * @param arg a formatted string describing an LV2 object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre argu.size() > 0 * @pre argu[0] == '-' */ CHAIN_OPERATOR* ECA_OBJECT_FACTORY::create_lv2_plugin (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); // -------- MESSAGE_ITEM otemp; otemp.setprecision(3); const CHAIN_OPERATOR* cop = 0; string prefix = kvu_get_argument_prefix(argu); if (prefix == "elv2") { string unique = kvu_get_argument_number(1, argu); cop = dynamic_cast(ECA_OBJECT_FACTORY::lv2_plugin_map().object(unique)); CHAIN_OPERATOR* new_cop = 0; if (cop != 0) { new_cop = dynamic_cast(cop->new_expr()); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Creating LV2-plugin \"" + new_cop->name() + "\""); otemp << "Setting parameters: "; for(int n = 0; n < new_cop->number_of_params(); n++) { new_cop->set_parameter(n + 1, atof(kvu_get_argument_number(n + 2, argu).c_str())); otemp << new_cop->get_parameter_name(n + 1) << " = "; otemp << new_cop->get_parameter(n + 1); if (n + 1 < new_cop->number_of_params()) otemp << ", "; } ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } else { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Unable to find LV2 plugin \"" + unique + "\""); } return new_cop; } return 0; } /** * VST not currently actively supported due to licensing * issues. */ #if 0 /** * Creates a new VST1.0/2.0 plugin. * * Notes: VST support is currently not used * because of licensing problems * (distribution of VST-headers is not * allowed). */ CHAIN_OPERATOR* ECA_OBJECT_FACTORY::create_vst_plugin (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); // -------- MESSAGE_ITEM otemp; otemp.setprecision(3); const CHAIN_OPERATOR* cop = 0; string prefix = kvu_get_argument_prefix(argu); cop = dynamic_cast(ECA_STATIC_OBJECT_MAPS::vst_plugin_map().object(prefix)); CHAIN_OPERATOR* new_cop = 0; if (cop != 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Creating VST-plugin \"" + new_cop->name() + "\""); otemp << "Setting parameters: "; for(int n = 0; n < new_cop->number_of_params(); n++) { new_cop->set_parameter(n + 1, atof(kvu_get_argument_number(n + 1, argu).c_str())); otemp << new_cop->get_parameter_name(n + 1) << " = "; otemp << new_cop->get_parameter(n + 1); if (n + 1 < new_cop->number_of_params()) otemp << ", "; } ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } return new_cop; } #endif /* VST ifdef 0 */ /** * Creates a new chain operator object. * * @param arg a formatted string describing an chain operator object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre argu.size() > 0 * @pre argu[0] == '-' */ CHAIN_OPERATOR* ECA_OBJECT_FACTORY::create_chain_operator (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); // -------- string prefix = kvu_get_argument_prefix(argu); int args_given = kvu_get_number_of_arguments(argu); MESSAGE_ITEM otemp; otemp.setprecision(3); const CHAIN_OPERATOR* cop = dynamic_cast(ECA_OBJECT_FACTORY::chain_operator_map().object(prefix)); CHAIN_OPERATOR* new_cop = 0; if (cop != 0) { new_cop = dynamic_cast(cop->new_expr()); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Creating chain operator \"" + new_cop->name() + "\""); // otemp << "(eca-chainsetup) Adding effect " << new_cop->name(); otemp << "Setting parameters: "; int params = new_cop->number_of_params(); if (new_cop->variable_params() && args_given > params) params = args_given; for(int n = 0; n < params; n++) { new_cop->set_parameter(n + 1, atof(kvu_get_argument_number(n + 1, argu).c_str())); otemp << new_cop->get_parameter_name(n + 1) << " = "; otemp << new_cop->get_parameter(n +1); if (n + 1 < new_cop->number_of_params()) otemp << ", "; } ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); return new_cop; } return 0; } /** * Creates a new generic controller object. * * @param arg a formatted string describing an generic controller object, see ecasound * manuals for detailed info * @return the created object or 0 if an invalid format string was given * as the argument * * @pre argu.size() > 0 * @pre argu[0] == '-' */ GENERIC_CONTROLLER* ECA_OBJECT_FACTORY::create_controller (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); // -------- if (argu.size() > 0 && argu[0] != '-') return 0; string prefix = kvu_get_argument_prefix(argu); const GENERIC_CONTROLLER* gcontroller = dynamic_cast(ECA_OBJECT_FACTORY::controller_map().object(prefix)); GENERIC_CONTROLLER* new_gcontroller = 0; if (gcontroller != 0) { new_gcontroller = gcontroller->new_expr(); if (new_gcontroller != 0) { const CONTROLLER_SOURCE* csource = gcontroller->source_pointer(); CONTROLLER_SOURCE* new_csource = 0; if (csource != 0) { new_csource = csource->new_expr(); } new_gcontroller->assign_source(new_csource); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Creating controller source \"" + new_gcontroller->name() + "\""); MESSAGE_ITEM otemp; otemp.setprecision(3); otemp << "Setting parameters: "; int numparams = new_gcontroller->number_of_params(); for(int n = 0; n < numparams; n++) { new_gcontroller->set_parameter(n + 1, atof(kvu_get_argument_number(n + 1, argu).c_str())); otemp << new_gcontroller->get_parameter_name(n + 1) << " = "; otemp << new_gcontroller->get_parameter(n +1); if (new_gcontroller->variable_params()) numparams = new_gcontroller->number_of_params(); // in case 'n_o_p()' varies if (n + 1 < numparams) otemp << ", "; } ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); return new_gcontroller; } } return 0; } /** * Returns a EOS-compatible string describing the default * output device. This device is determined based on * ecasoundrc settings, available resources, * compile-time options, etc. */ std::string ECA_OBJECT_FACTORY::probe_default_output_device(void) { ECA_RESOURCES ecaresources; const char *output_autodetect = "autodetect"; string default_output = output_autodetect; bool output_selected = true; if (ecaresources.has("default-output") == true) default_output = ecaresources.resource("default-output"); if (default_output == output_autodetect) { output_selected = false; #ifdef ECA_COMPILE_JACK /* phase 1: check for JACK */ int pid = getpid(); string cname = "ecasound-autodetect-" + kvu_numtostr(pid); jack_client_t *client = jack_client_open(cname.c_str(), JackNoStartServer, NULL); if (client != 0) { jack_client_close(client); default_output = "jack_alsa"; output_selected = true; } #endif /* phase 2: check for ALSA support */ if (output_selected != true) { const ECA_OBJECT *obj = ECA_OBJECT_FACTORY::audio_io_rt_map().object("alsa"); if (obj != 0) { default_output = "alsa,default"; output_selected = true; } } /* phase 3: check for OSS support */ if (output_selected != true) { const ECA_OBJECT *obj = ECA_OBJECT_FACTORY::audio_io_rt_map().object("/dev/dsp"); if (obj != 0) { default_output = "/dev/dsp"; output_selected = true; } } /* phase 4: fallback to rtnull */ if (output_selected != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: No default output available. Using 'rtnull' as a fallback."); default_output = "rtnull"; } } return default_output; } /** * Makes an Ecasound Option Syntax (EOS) compatible string * describing the current state of chain operator 'gctrl'. */ string ECA_OBJECT_FACTORY::chain_operator_to_eos(const CHAIN_OPERATOR* chainop) { MESSAGE_ITEM t; // >-- // special handling for LADSPA-plugins #ifndef ECA_DISABLE_EFFECTS const EFFECT_LADSPA* ladspa = dynamic_cast(chainop); const CHAIN_OPERATOR *lv2_cop = 0; string lv2_arg; #ifdef ECA_USE_LIBLILV const EFFECT_LV2* lv2 = dynamic_cast(chainop); if (lv2 != 0) { lv2_cop = static_cast(lv2); lv2_arg = lv2->unique(); } #endif if (lv2_cop != 0) { t << "-elv2:" << lv2_arg; if (chainop->number_of_params() > 0) t << ","; } else if (ladspa != 0) { t << "-eli:" << ladspa->unique_number(); if (chainop->number_of_params() > 0) t << ","; } else { ECA_OBJECT_MAP& copmap = ECA_OBJECT_FACTORY::chain_operator_map(); ECA_PRESET_MAP& presetmap = ECA_OBJECT_FACTORY::preset_map(); string idstring = copmap.object_identifier(chainop); if (idstring.size() == 0) { idstring = presetmap.object_identifier(chainop); } if (idstring.size() == 0) { ECA_LOG_MSG(ECA_LOGGER::errors, "Unable to save chain operator \"" + chainop->name() + "\"."); return t.to_string(); } t << "-" << idstring; if (chainop->number_of_params() > 0) t << ":"; } #endif // --< t << ECA_OBJECT_FACTORY::operator_parameters_to_eos(chainop); return t.to_string(); } /** * Makes an Ecasound Option Syntax (EOS) compatible string * describing the current state of controller object 'gctrl'. */ string ECA_OBJECT_FACTORY::controller_to_eos(const GENERIC_CONTROLLER* gctrl) { MESSAGE_ITEM t; ECA_OBJECT_MAP& ctrlmap = ECA_OBJECT_FACTORY::controller_map(); string idstring = ctrlmap.object_identifier(gctrl); if (idstring.size() == 0) { ECA_LOG_MSG(ECA_LOGGER::errors, "Unable to save controller \"" + gctrl->name() + "\"."); return t.to_string(); } t << "-" << idstring << ":" << ECA_OBJECT_FACTORY::operator_parameters_to_eos(gctrl); return t.to_string(); } /** * Makes an Ecasound Option Syntax (EOS) compatible, * comma-separated list of parameter values for * chain operator 'chainop'. */ string ECA_OBJECT_FACTORY::operator_parameters_to_eos(const OPERATOR* chainop) { MESSAGE_ITEM t; for(int n = 0; n < chainop->number_of_params(); n++) { /* FIXME: escape commas */ t << chainop->get_parameter(n + 1); if (n + 1 < chainop->number_of_params()) t << ","; } return t.to_string(); } /** * Return a string compliant with Ecasound Option Syntax (EOS) * describing the object 'aiod'. * * @pre direction == "i" || direction == "o" */ string ECA_OBJECT_FACTORY::audio_object_to_eos(const AUDIO_IO* aiod, const std::string& direction) { MESSAGE_ITEM t; t << "-" << direction << ":"; for(int n = 0; n < aiod->number_of_params(); n++) { /* step: if parameter has commas, or whitespace, quote the whole parameter */ std::string param = aiod->get_parameter(n + 1); if (find(param.begin(), param.end(), ',') != param.end() || find(param.begin(), param.end(), ' ') != param.end() || find(param.begin(), param.end(), '\t') != param.end()) { param = std::string("\"") + param + std::string("\""); } /* step: add processed parameter to the EOS string */ t << param; if (n + 1 < aiod->number_of_params()) t << ","; } return t.to_string(); } /** * Return a string compliant with Ecasound Option Syntax (EOS) * describing the audio format 'aformat'. */ string ECA_OBJECT_FACTORY::audio_format_to_eos(const ECA_AUDIO_FORMAT* aformat) { MESSAGE_ITEM t; t << "-f:" << aformat->format_string() << "," << aformat->channels() << "," << aformat->samples_per_second(); return t.to_string(); } /** * Return a string compliant with Ecasound Option Syntax (EOS) * describing the audio format of object 'aiod'. */ string ECA_OBJECT_FACTORY::audio_object_format_to_eos(const AUDIO_IO* aio) { return ECA_OBJECT_FACTORY::audio_format_to_eos(dynamic_cast(aio)); #if 0 MESSAGE_ITEM t; t << "-f:" << aiod->format_string() << "," << aiod->channels() << "," << aiod->samples_per_second(); return t.to_string(); #endif } ecasound-2.9.3/libecasound/audioio-ogg.h0000644000076400007640000000461511141362345015131 00000000000000#ifndef INCLUDED_AUDIOIO_OGG_H #define INCLUDED_AUDIOIO_OGG_H #include #include #include "audioio-buffered.h" #include "audioio-forked-stream.h" /** * Interface for Ogg Vorbis decoders and encoders using UNIX * pipe i/o. By default ogg123 and vorbize are used. * * @author Kai Vehmanen */ class OGG_VORBIS_INTERFACE : public AUDIO_IO_BUFFERED, public AUDIO_IO_FORKED_STREAM { private: static std::string default_input_cmd; static std::string default_output_cmd; public: static void set_input_cmd(const std::string& value); static void set_output_cmd(const std::string& value); static long int default_output_default_bitrate; public: OGG_VORBIS_INTERFACE (const std::string& name = ""); virtual ~OGG_VORBIS_INTERFACE(void); virtual OGG_VORBIS_INTERFACE* clone(void) const { return new OGG_VORBIS_INTERFACE(*this); } virtual OGG_VORBIS_INTERFACE* new_expr(void) const { return new OGG_VORBIS_INTERFACE(*this); } virtual std::string name(void) const { return "Ogg Vorbis stream"; } virtual std::string description(void) const { return "Interface for Ogg Vorbis decoders and encoders using UNIX pipe i/o."; } virtual std::string parameter_names(void) const { return "label,bitrate"; } virtual bool locked_audio_format(void) const { return true; } virtual int supported_io_modes(void) const { return io_read | io_write; } virtual bool supports_seeking(void) const { return false; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const { return(finished_rep); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; virtual void start_io(void); virtual void stop_io(void); protected: /* functions called by AUDIO_IO_FORKED_STREAM that require * the use of AUDIO_IO methods */ virtual bool do_supports_seeking(void) const { return supports_seeking(); } virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { set_position_in_samples(pos); } private: bool triggered_rep; bool finished_rep; long int bytes_rep; long int bitrate_rep; int filedes_rep; FILE* f1_rep; void fork_input_process(void); void fork_output_process(void); }; #endif ecasound-2.9.3/libecasound/Makefile.am0000644000076400007640000002521012303075645014610 00000000000000# ---------------------------------------------------------------------- # File: ecasound/libecasound/Makefile.am # Description: Ecasound main library # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- EXTRA_DIST = ChangeLog AUTOMAKE_OPTIONS = foreign SUBDIRS = plugins # ---------------------------------------------------------------------- # build targets and compiler options target defines # ---------------------------------------------------------------------- if ECA_AM_DEBUG_MODE lib_LTLIBRARIES = libecasound_debug.la else lib_LTLIBRARIES = libecasound.la endif TESTS = libecasound_tester check_PROGRAMS = libecasound_tester # ---------------------------------------------------------------------- # compiler and linker options # ---------------------------------------------------------------------- # if ECA_AM_ALL_STATIC # FIXME: always link ecasound-plugins statically if ECA_AM_DEBUG_MODE eca_libadd = $(top_builddir)/libecasound/plugins/libecasound_plugins_debug.la $(ECA_S_EXTRA_LIBS) else eca_libadd = $(top_builddir)/libecasound/plugins/libecasound_plugins.la $(ECA_S_EXTRA_LIBS) endif eca_ldflags = -version-info @LIBECASOUND_VERSION@:0:@LIBECASOUND_VERSION_AGE@ if ECA_AM_DEBUG_MODE libecasound_tester_libs = $(top_builddir)/libecasound/libecasound_debug.la \ $(top_builddir)/kvutils/libkvutils_debug.la else libecasound_tester_libs = $(top_builddir)/libecasound/libecasound.la \ $(top_builddir)/kvutils/libkvutils.la endif # note! Automake >= 1.5 will install stripped libraries # with "make install-strip". Older versions won't # strip libraries even if INSTALL_STRIP_FLAG is set. # also libtool 1.3.2 and older have problems # with stripping libraries. AM_CPPFLAGS = -I$(srcdir) \ -I$(top_srcdir) \ -I$(top_srcdir)/kvutils \ $(ECA_S_EXTRA_CPPFLAGS) # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- ecasound_audiofx_include = \ audiofx.h \ audiofx_misc.h \ audiofx_amplitude.h \ audiofx_compressor.h \ audiofx_analysis.h \ audiofx_envelope_modulation.h \ audiofx_filter.h \ audiofx_rcfilter.h \ audiofx_reverb.h \ audiofx_timebased.h \ audiogate.h \ audiofx_mixing.h \ audiofx_ladspa.h \ audiofx_lv2.h \ audiofx_lv2_world.h \ audio-stamp.h ecasound_preset_include = \ preset.h \ preset_impl.h \ file-preset.h \ global-preset.h ecasound_audioio_include = \ audioio.h \ audioio-buffered.h \ audioio-device.h \ audioio-plugin.h \ audioio-manager.h \ audioio-cdr.h \ audioio-cdr_impl.h \ audioio-ewf.h \ audioio-mp3.h \ audioio-mp3_impl.h \ audioio-ogg.h \ audioio-wave.h \ audioio-raw.h \ audioio-oss.h \ audioio-oss_impl.h \ audioio-null.h \ audioio-rtnull.h \ audioio-mikmod.h \ audioio-loop.h \ audioio-forked-stream.h \ audioio-timidity.h \ audioio-db-server.h \ audioio-db-server_impl.h \ audioio-db-buffer.h \ audioio-db-client.h \ audioio-proxy.h \ audioio-typeselect.h \ audioio-resample.h \ audioio-reverse.h \ audioio-flac.h \ audioio-aac.h \ audioio-tone.h \ audioio-seqbase.h \ audioio-acseq.h \ audioio-barrier.h ecasound_midi_include = \ midi-server.h \ midi-client.h \ midi-parser.h \ midiio.h \ midiio-raw.h \ midiio-aseq.h ecasound_controller_include = \ ctrl-source.h \ midi-cc.h \ oscillator.h \ osc-gen.h \ osc-gen-file.h \ osc-sine.h \ linear-envelope.h \ two-stage-linear-envelope.h \ stamp-ctrl.h \ generic-linear-envelope.h ecasound_general_include = \ eca-chain.h \ eca-chainop.h \ eca-chainsetup-edit.h \ eca-error.h \ eca-logger.h \ eca-logger-default.h \ eca-logger-interface.h \ eca-logger-wellformed.h \ eca-engine.h \ eca-engine-driver.h \ eca-engine_impl.h \ eca-session.h \ eca-resources.h \ resource-file.h \ layer.h \ eca-static-object-maps.h \ eca-object-map.h \ eca-preset-map.h \ samplebuffer.h \ samplebuffer_impl.h \ samplebuffer_functions.h \ samplebuffer_iterators.h \ sample-specs.h \ sample-ops_impl.h \ eca-sample-conversion.h \ eca-version.h \ eca-object-factory.h \ eca-chainsetup.h \ eca-chainsetup_impl.h \ eca-chainsetup-bufparams.h \ eca-chainsetup-parser.h \ eca-chainsetup-position.h \ eca-control.h \ eca-control-dump.h \ eca-control-main.h \ eca-control-mt.h \ eca-iamode-parser.h \ eca-iamode-parser_impl.h \ eca-audio-position.h \ eca-fileio.h \ eca-fileio-stream.h \ eca-fileio-mmap.h \ eca-osc.h \ dynamic-parameters.h \ dynamic-object.h \ eca-object.h \ eca-operator.h \ generic-controller.h \ eca-samplerate-aware.h \ eca-audio-format.h \ eca-audio-time.h \ jack-connections.h ecasound_extra_include = \ ladspa.h ecasound_test_framework_include = \ eca-test-repository.h \ eca-test-case.h \ audiofx_amplitude_test.h \ audioio_test.h \ audioio-device_test.h \ eca-audio-time_test.h \ eca-chainsetup_test.h \ eca-chainsetup-parser_test.h \ eca-control_test.h \ eca-session_test.h \ eca-object-factory_test.h \ eca-sample-conversion_test.h \ generic-linear-envelope_test.h \ samplebuffer_test.h # note! also remembers to update install-data-local and # uninstall-data targets noinst_HEADERS = $(ecasound_audiofx_include) \ $(ecasound_preset_include) \ $(ecasound_audioio_include) \ $(ecasound_midi_include) \ $(ecasound_controller_include) \ $(ecasound_general_include) \ $(ecasound_extra_include) \ $(ecasound_test_framework_include) # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- ecasound_audiofx_src = audiofx.cpp \ audiofx_misc.cpp \ audiofx_amplitude.cpp \ audiofx_compressor.cpp \ audiofx_analysis.cpp \ audiofx_envelope_modulation.cpp \ audiofx_filter.cpp \ audiofx_rcfilter.cpp \ audiofx_reverb.cpp \ audiofx_timebased.cpp \ audiogate.cpp \ audiofx_mixing.cpp \ audiofx_ladspa.cpp \ audiofx_lv2.cpp \ audiofx_lv2_world.cpp \ audio-stamp.cpp ecasound_preset_src = global-preset.cpp \ preset.cpp \ file-preset.cpp ecasound_audioio1_src = audioio-cdr.cpp \ audioio-ewf.cpp \ audioio-mp3.cpp \ audioio-ogg.cpp \ audioio-wave.cpp \ audioio.cpp \ audioio-buffered.cpp \ audioio-device.cpp \ audioio-null.cpp \ audioio-raw.cpp \ audioio-mikmod.cpp \ audioio-rtnull.cpp \ audioio-loop.cpp \ audioio-forked-stream.cpp \ audioio-timidity.cpp \ audioio-db-server.cpp \ audioio-db-buffer.cpp \ audioio-db-client.cpp \ audioio-typeselect.cpp \ audioio-resample.cpp \ audioio-reverse.cpp \ audioio-proxy.cpp \ audioio-flac.cpp \ audioio-aac.cpp \ audioio-tone.cpp \ audioio-seqbase.cpp \ audioio-acseq.cpp if ECA_AM_COMPILE_OSS ecasound_audioio2_src = audioio-oss.cpp else ecasound_audioio2_src = endif if ECA_AM_COMPILE_JACK jack_connections_src = jack-connections.cpp else jack_connections_src = endif ecasound_midi_src = \ midi-server.cpp \ midi-client.cpp \ midi-parser.cpp \ midiio.cpp \ midiio-raw.cpp \ midiio-aseq.cpp ecasound_controller_src = \ midi-cc.cpp \ osc-gen.cpp \ osc-gen-file.cpp \ osc-sine.cpp \ linear-envelope.cpp \ two-stage-linear-envelope.cpp \ stamp-ctrl.cpp \ generic-linear-envelope.cpp ecasound_general_src = eca-chain.cpp \ eca-engine.cpp \ samplebuffer.cpp \ samplebuffer_functions.cpp \ eca-session.cpp \ eca-resources.cpp \ resource-file.cpp \ eca-logger.cpp \ eca-logger-default.cpp \ eca-logger-interface.cpp \ eca-logger-wellformed.cpp \ layer.cpp \ samplebuffer_iterators.cpp \ eca-version.cpp \ eca-operator.cpp \ generic-controller.cpp \ eca-object-factory.cpp \ eca-chainsetup.cpp \ eca-chainsetup-bufparams.cpp \ eca-chainsetup-parser.cpp \ eca-chainsetup-position.cpp \ eca-control.cpp \ eca-control-base.cpp \ eca-control-dump.cpp \ eca-control-main.cpp \ eca-control-mt.cpp \ eca-control-objects.cpp \ eca-iamode-parser.cpp \ eca-samplerate-aware.cpp \ eca-audio-position.cpp \ eca-audio-format.cpp \ eca-audio-time.cpp \ eca-fileio-stream.cpp \ eca-fileio-mmap.cpp \ eca-osc.cpp \ eca-static-object-maps.cpp \ eca-object-map.cpp \ eca-preset-map.cpp ecasound_common1_src = $(ecasound_audioio1_src) \ $(ecasound_audioio2_src) \ $(jack_connections_src) \ $(ecasound_midi_src) \ $(ecasound_general_src) if ECA_AM_DISABLE_EFFECTS ecasound_common2_src = else ecasound_common2_src = $(ecasound_audiofx_src) \ $(ecasound_preset_src) \ $(ecasound_controller_src) endif libecasound_tester_src = \ libecasound_tester.cpp \ eca-test-repository.cpp \ eca-test-case.cpp libecasound_la_SOURCES = $(ecasound_common1_src) $(ecasound_common2_src) libecasound_debug_la_SOURCES = $(ecasound_common1_src) $(ecasound_common2_src) libecasound_la_LDFLAGS = -export-dynamic $(eca_ldflags) -static libecasound_la_LIBADD = $(eca_libadd) libecasound_debug_la_LDFLAGS = $(libecasound_la_LDFLAGS) libecasound_debug_la_LIBADD = $(libecasound_la_LIBADD) libecasound_tester_SOURCES = $(libecasound_tester_src) #libecasound_tester_CFLAGS = $(AM_CFLAGS) libecasound_tester_LDADD = $(libecasound_tester_libs) # Pass pkgdatadir to CPPFLAGS AM_CPPFLAGS += "-DECA_PKGDATADIR=\"${pkgdatadir}\"" # --------------------------------------------------------------------- # Install targets - note! we don't install $ecasound_extra_include # nor $ecasound_test_framework_include install-data-local: $(INSTALL) -d $(DESTDIR)$(includedir)/libecasound cd $(srcdir) ; \ $(INSTALL_DATA) \ $(ecasound_audiofx_include) \ $(ecasound_preset_include) \ $(ecasound_audioio_include) \ $(ecasound_controller_include) \ $(ecasound_midi_include) \ $(ecasound_general_include) \ $(DESTDIR)$(includedir)/libecasound $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL_SCRIPT) libecasound-config $(DESTDIR)$(bindir)/libecasound-config # --------------------------------------------------------------------- # Uninstall targets uninstall-local: cd $(DESTDIR)$(includedir)/libecasound && \ rm -f $(ecasound_audiofx_include) \ $(ecasound_preset_include) \ $(ecasound_audioio_include) \ $(ecasound_controller_include) \ $(ecasound_midi_include) \ $(ecasound_general_include) rmdir $(DESTDIR)$(includedir)/libecasound || echo "Skipping" rm -f $(DESTDIR)$(bindir)/libecasound-config rmdir $(DESTDIR)$(bindir) || echo "Skipping" ecasound-2.9.3/libecasound/eca-chain.h0000644000076400007640000001610112260762753014541 00000000000000// ------------------------------------------------------------------------ // eca-chain.cpp: Class representing an abstract audio signal chain. // Copyright (C) 1999-2009,2012,2013 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifndef INCLUDED_CHAIN_H #define INCLUDED_CHAIN_H #include #include #include "eca-chainop.h" #include "eca-audio-position.h" class GENERIC_CONTROLLER; class OPERATOR; class SAMPLE_BUFFER; /** * Class representing an abstract audio signal chain. */ class CHAIN : public ECA_AUDIO_POSITION { public: /** @name Object construction and destruction */ /*@{*/ CHAIN (void); virtual ~CHAIN (void); /*@}*/ // ------------------------------------------------------------------- /** @name Chain state */ /*@{*/ bool is_initialized(void) const { return initialized_rep; } /** * Is chain muted? If muted, audio buffers are zeroed during * processing. */ bool is_muted(void) const { return muted_rep; } /** * Is chain muted? If muted, audio buffers are zeroed during * processing. */ bool is_operator_bypassed(int op_index) const; /** * Is processing enabled and bypassed? If bypassed, all chain * operators will be skipped during processing. */ bool is_bypassed(void) const { return bypass_rep; } void set_mute(int muted); void set_bypass(int state); std::string name(void) const { return chainname_rep; } void name(const std::string& c) { chainname_rep = c; } bool is_valid(void) const; void init(SAMPLE_BUFFER* sbuf = 0, int in_channels = 0, int out_channels = 0); void release(void); void process(void); void controller_update(void); void refresh_parameters(void); std::string to_string(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Input and output */ /*@{*/ void connect_input(int input); void disconnect_input(void); void connect_output(int output); void disconnect_output(void); void disconnect_buffer(void); void input_removed(int input); void output_removed(int input); /** * Returns an id number to input connected to this chain. If no input * is connected, -1 is returned. */ int connected_input(void) const { return input_id_rep; } /** * Returns an id number to output connected to this chain. If no input * is connected, -1 is returned. */ int connected_output(void) const { return output_id_rep; } /*@}*/ // ------------------------------------------------------------------- /** @name Access objects via stateless addressing */ /*@{*/ void clear(void); void add_chain_operator(CHAIN_OPERATOR* chainop); void add_controller(GENERIC_CONTROLLER* gcontroller); void remove_chain_operator(int op_index); void bypass_operator(int op_index, int bypassed); void set_parameter(int op_index, int param_index, CHAIN_OPERATOR::parameter_t value); int number_of_chain_operators(void) const { return chainops_rep.size(); } int number_of_chain_operator_parameters(int index) const; const CHAIN_OPERATOR* get_chain_operator(int index) const { return chainops_rep[index].cop; } const GENERIC_CONTROLLER* get_controller(int index) const { return gcontrollers_rep[index]; } int number_of_controllers(void) const { return gcontrollers_rep.size(); } void set_controller_parameter(int op_index, int param_index, CHAIN_OPERATOR::parameter_t value); /*@}*/ // ------------------------------------------------------------------- /** @name Access objects via stateful addressing */ /*@{*/ void select_chain_operator(int op_index); void select_chain_operator_parameter(int param_index); /** Index (1..N) of selected chain operator */ int selected_chain_operator(void) const { return selected_chainop_number_rep; } int selected_chain_operator_parameter(void) const { return selected_chainop_parameter_rep; } int number_of_chain_operator_parameters(void) const; CHAIN_OPERATOR::parameter_t get_parameter(void) const; std::string chain_operator_name(void) const; std::string chain_operator_parameter_name(void) const; const CHAIN_OPERATOR* get_selected_chain_operator(void) const; void remove_controller(void); void select_controller(int index); void select_controller_parameter(int index); const GENERIC_CONTROLLER* get_selected_controller(void) const { return selected_controller_repp; } int number_of_controller_parameters(void) const; std::string controller_parameter_name(void) const; CHAIN_OPERATOR::parameter_t get_controller_parameter(void) const; /** Index (1...N) of selected controller */ int selected_controller(void) const { return selected_controller_number_rep; } int selected_controller_parameter(void) const { return selected_controller_parameter_rep; } std::string controller_name(void) const; void selected_chain_operator_as_target(void); void selected_controller_as_target(void); /** * Returns the object that is the current target for * parameter control, or 0 if none selected. */ OPERATOR* selected_target(void) const { return selected_dynobj_repp; } /*@}*/ // ------------------------------------------------------------------- /** @name Functions implemented from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ /** @name Functions implemented from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); virtual bool supports_seeking(void) const { return true; } virtual bool supports_seeking_sample_accurate(void) const { return true; } /*@}*/ // ------------------------------------------------------------------- private: bool is_valid_op_index(int op_index) const; class COP_CONTAINER { public: CHAIN_OPERATOR* cop; bool bypassed; }; bool initialized_rep; std::string chainname_rep; bool muted_rep; bool bypass_rep; int in_channels_rep; int out_channels_rep; std::vector chainops_rep; std::vector gcontrollers_rep; GENERIC_CONTROLLER* selected_controller_repp; OPERATOR* selected_dynobj_repp; int selected_chainop_number_rep; int selected_chainop_parameter_rep; int selected_controller_number_rep; int selected_controller_parameter_rep; int input_id_rep; int output_id_rep; SAMPLE_BUFFER* audioslot_repp; }; #endif ecasound-2.9.3/libecasound/dynamic-object.h0000644000076400007640000000154010765306255015621 00000000000000#ifndef INCLUDED_DYNAMIC_OBJECT_H #define INCLUDED_DYNAMIC_OBJECT_H #include "dynamic-parameters.h" #include "eca-object.h" /** * Virtual class for objects supporting dynamic parameter * control. * * Related design patterns: * - Factory Method / Virtual Constructor (GoF107) * * @author Kai Vehmanen */ template class DYNAMIC_OBJECT : public DYNAMIC_PARAMETERS, public ECA_OBJECT { public: virtual ~DYNAMIC_OBJECT (void) {} /** * Virtual method that clones the current object and returns * a pointer to it. This must be implemented by all subclasses! */ virtual DYNAMIC_OBJECT* clone(void) const = 0; /** * Virtual method that creates a new object of current type. * This must be implemented by all subclasses! */ virtual DYNAMIC_OBJECT* new_expr(void) const = 0; }; #endif ecasound-2.9.3/libecasound/sample-ops_impl.h0000644000076400007640000000330410664032032016015 00000000000000// ------------------------------------------------------------------------ // sample-ops_impl.h: Sample value defaults and constants. // Copyright (C) 2004 Kai Vehmanen // Copyright (C) 2004 Steve Harris, Tim Blechmann // // Attributes: // eca-style-version: 2 // public-libecasound-API: no // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDED_SAMPLE_OPS_IMPL_H #define INCLUDED_SAMPLE_OPS_IMPL_H #include /* 32 bit "pointer cast" union */ typedef union { float f; int32_t i; } ls_pcast32; /** * Truncates small float values 'f' to zero to avoid * denormal floats in processing. * * Taken from swh-plugins 0.4.11 package (ladspa-util.h). * * @author Steve Harris * @author Tim Blechmann */ static inline float ecaops_flush_to_zero(float f) { ls_pcast32 v; v.f = f; // original: return (v.i & 0x7f800000) == 0 ? 0.0f : f; // version from Tim Blechmann return (v.i & 0x7f800000) < 0x08000000 ? 0.0f : f; } #endif ecasound-2.9.3/libecasound/jack-connections.h0000644000076400007640000000072311065163721016154 00000000000000#ifndef INCLUDED_JACK_CONNECTIONS_H #define INCLUDED_JACK_CONNECTIONS_H #include /** * Utility class to manage JACK port connections. */ class JACK_CONNECTIONS { public: static bool connect(const char* src, const char* dest); static bool disconnect(const char* src, const char* dest); static bool list_connections(std::string* output); private: JACK_CONNECTIONS(void); ~JACK_CONNECTIONS(void); }; #endif /* INCLUDED_JACK_CONNECTIONS_H */ ecasound-2.9.3/libecasound/audioio-ogg.cpp0000644000076400007640000001722211137153033015457 00000000000000// ------------------------------------------------------------------------ // audioio-ogg.cpp: Interface for ogg vorbis decoders and encoders. // Copyright (C) 2000-2002,2004-2006,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* atol() */ #include /* stat() */ #include /* stat() */ #include #include #include "audioio-ogg.h" #include "eca-logger.h" string OGG_VORBIS_INTERFACE::default_input_cmd = "ogg123 -d raw -o byteorder:%E --file=- %f"; string OGG_VORBIS_INTERFACE::default_output_cmd = "oggenc -b %B --raw --raw-bits=%b --raw-chan=%c --raw-rate=%s --raw-endianness 0 --output=%f -"; long int OGG_VORBIS_INTERFACE::default_output_default_bitrate = 128000; void OGG_VORBIS_INTERFACE::set_input_cmd(const std::string& value) { OGG_VORBIS_INTERFACE::default_input_cmd = value; } void OGG_VORBIS_INTERFACE::set_output_cmd(const std::string& value) { OGG_VORBIS_INTERFACE::default_output_cmd = value; } OGG_VORBIS_INTERFACE::OGG_VORBIS_INTERFACE(const std::string& name) : triggered_rep(false), finished_rep(false) { set_label(name); bitrate_rep = OGG_VORBIS_INTERFACE::default_output_default_bitrate; } OGG_VORBIS_INTERFACE::~OGG_VORBIS_INTERFACE(void) { clean_child(true); if (is_open() == true) { close(); } } void OGG_VORBIS_INTERFACE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { std::string urlprefix; triggered_rep = false; finished_rep = false; if (io_mode() == io_read) { struct stat buf; int ret = ::stat(label().c_str(), &buf); if (ret != 0) { size_t offset = label().find_first_of("://"); if (offset == std::string::npos) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-OGG: Can't open file " + label() + ".")); } else { urlprefix = std::string(label(), 0, offset); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Found url; protocol '" + urlprefix + "'."); } } /* decoder supports: nothing configurable nor fixed * * FIXME: we have no idea about the audio format of the * stream we get from the decoder... ybe we should force the decoder * to generate RIFF wave to a named pipe and parse the header...? */ } else { /* encoder supports: coding, channel-count and srate configurable, * fixed to little endian */ ECA_AUDIO_FORMAT::set_sample_endianess(ECA_AUDIO_FORMAT::se_little); } AUDIO_IO::open(); } void OGG_VORBIS_INTERFACE::close(void) { if (pid_of_child() > 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Cleaning child process pid=" + kvu_numtostr(pid_of_child()) + "."); clean_child(); triggered_rep = false; } AUDIO_IO::close(); } long int OGG_VORBIS_INTERFACE::read_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_input_process(); } if (f1_rep != 0) { bytes_rep = std::fread(target_buffer, 1, frame_size() * samples, f1_rep); } else { bytes_rep = 0; } if (bytes_rep < samples * frame_size() || bytes_rep == 0) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::info, "Can't start process \"" + fork_command() + "\". Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; } else finished_rep = false; return bytes_rep / frame_size(); } void OGG_VORBIS_INTERFACE::write_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_output_process(); } if (wait_for_child() != true) { finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Attempt to write after child process has terminated."); } else { if (filedes_rep > 0) { bytes_rep = ::write(filedes_rep, target_buffer, frame_size() * samples); } else { bytes_rep = 0; } if (bytes_rep < frame_size() * samples) { finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Error in writing to child process (to write " + kvu_numtostr(frame_size() * samples) + ", result " + kvu_numtostr(bytes_rep) + ")."); } else finished_rep = false; } } void OGG_VORBIS_INTERFACE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: long int numvalue = atol(value.c_str()); if (numvalue > 0) bitrate_rep = numvalue; else bitrate_rep = OGG_VORBIS_INTERFACE::default_output_default_bitrate; break; } } string OGG_VORBIS_INTERFACE::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return kvu_numtostr(bitrate_rep); } return ""; } void OGG_VORBIS_INTERFACE::fork_input_process(void) { string command = OGG_VORBIS_INTERFACE::default_input_cmd; // replace with 'little/big' byteorder if (command.find("%E") != string::npos) { string byteorder ("big"); if (sample_endianess() == ECA_AUDIO_FORMAT::se_little) byteorder = "little"; command.replace(command.find("%E"), 2, byteorder); } set_fork_command(command); set_fork_file_name(label()); set_fork_pipe_name(); fork_child_for_read(); if (child_fork_succeeded() == true) { /* NOTE: the file description will be closed by * AUDIO_IO_FORKED_STREAM::clean_child() */ filedes_rep = file_descriptor(); f1_rep = fdopen(filedes_rep, "r"); /* not part of */ if (f1_rep == 0) { finished_rep = true; triggered_rep = false; } } else f1_rep = 0; } void OGG_VORBIS_INTERFACE::fork_output_process(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Starting to encode " + label() + " with vorbize."); string command = OGG_VORBIS_INTERFACE::default_output_cmd; // replace with bitrate if (command.find("%B") != string::npos) { command.replace(command.find("%B"), 2, kvu_numtostr((long int)(bitrate_rep / 1000))); } set_fork_command(command); set_fork_file_name(label()); set_fork_bits(bits()); set_fork_channels(channels()); set_fork_sample_rate(samples_per_second()); fork_child_for_write(); if (child_fork_succeeded() == true) { filedes_rep = file_descriptor(); } else { filedes_rep = 0; } } void OGG_VORBIS_INTERFACE::start_io(void) { if (triggered_rep != true) { if (io_mode() == io_read) fork_input_process(); else fork_output_process(); triggered_rep = true; } } void OGG_VORBIS_INTERFACE::stop_io(void) { if (triggered_rep == true) { if (io_mode() == io_read) { fclose(f1_rep); f1_rep = 0; clean_child(true); } else clean_child(false); triggered_rep = false; } } ecasound-2.9.3/libecasound/audioio-device.h0000644000076400007640000001262212260762753015623 00000000000000#ifndef INCLUDED_AUDIOIO_DEVICE_H #define INCLUDED_AUDIOIO_DEVICE_H #include "audioio-buffered.h" /** * Virtual base class for real-time devices. * * A realtime device... * * - is disabled after device is opened * * - is enabled with start() * * - once enabled, will handle I/O at a constant speed * based on the sample format paremeters * * - is disabled with stop() * * @author Kai Vehmanen */ class AUDIO_IO_DEVICE : public AUDIO_IO_BUFFERED { public: /** @name Public static functions */ /*@{*/ /** * Whether given object is an AUDIO_IO_DEVICE object. */ static bool is_realtime_object(const AUDIO_IO* aobj); /*@}*/ /** @name Constructors and destructors */ /*@{*/ AUDIO_IO_DEVICE(void); virtual ~AUDIO_IO_DEVICE(void); /*@}*/ /** @name Main functionality */ /*@{*/ virtual void write_buffer(SAMPLE_BUFFER* sbuf); /*@}*/ /** @name Configuration * * For setting and getting configuration parameters. */ /*@{*/ /** * Whether to ignore possible under- and overrun * situations. If enabled, device should try to * recover from these situations, ie. keep on * running. If disabled, processing should be aborted * if an xrun occurs. Should be set before opening * the device. Defaults to 'true'. * * @pre is_open() != true */ virtual void toggle_ignore_xruns(bool v) { ignore_xruns_rep = v; } /** * Whether the device should maximize the use * of internal buffering. If disabled, the device * should use minimal amount of internal buffering. The * recommended size is two or three fragments, each * buffersize() sample frames in size. If enabled, * device is free to use as much as buffering as * is possible. The default state is enabled. * * The exact amount of buffering can be checked * with the latency() function. * * @pre is_open() != true */ virtual void toggle_max_buffers(bool v) { max_buffers_rep = v; } /** * Returns the current setting for xrun handling. */ virtual bool ignore_xruns(void) const { return ignore_xruns_rep; } /** * Returns the current setting for how internal * buffering is used. */ virtual bool max_buffers(void) const { return max_buffers_rep; } /** * Returns the systematic latency in sample frames. * This value is usually a multiple of buffersize(). * Note that the latency introduced by prefilling * outputs is not included in this figure. * * @see delay() * @see prefill_space() * * @pre is_open() == true */ virtual long int latency(void) const { return 0; } /** * How much data in sample frames can be prefilled * to a output device before processing is started * with start() (after prepare())? * * Note! Prefilling will have an affect to * output latency. * * @see latency() */ virtual long int prefill_space(void) const { return 0; } /*@}*/ /** @name Main functionality */ /*@{*/ /** * Prepare device for processing. After this call, device is * ready for input/output (buffer can be pre-filled). * * require: * is_running() != true * * ensure: * (io_mode() == si_read && readable() == true) || writable() */ virtual void prepare(void) { is_prepared_rep = true; } /** * Start prosessing sample data. Underruns will occur if the * calling program can't handle data at the speed of the * source device. Write_buffer() calls are blocked if necessary. * * Note! For output devices, at least one buffer of data * must have been written before issuing start()! * * require: * is_running() != true * is_prepared() == true * * ensure: * is_running() == true */ virtual void start(void) { is_running_rep = true; } /** * Stop processing. Doesn't usually concern non-realtime devices. * I/O is not allowed after this call. This should be used when * audio object is not going to be used for a while. * * @param drain if true, block until all samples already written * are played out (ignored in read mode) * * require: * is_running() == true * * ensure: * is_running() != true * is_prepared() != true * readable() == false * writable() == false */ virtual void stop(bool drain = false) { is_running_rep = false; is_prepared_rep = false; } /*@}*/ /** @name Runtime information */ /*@{*/ /** * Returns the delay between current read/write position * and the exact hardware i/o location. For instance * with soundcard hardware this value tells the distance * to the exact audio frame currently being played or * recorded. * * @see latency() * @see position_in_samples() * * @pre is_running() == true * @post delay() <= latency() */ virtual long int delay(void) const { return 0; } /** * Whether device has been started? */ bool is_running(void) const { return is_running_rep; } /** * Whether device has been prepared for processing? */ bool is_prepared(void) const { return is_prepared_rep; } /*@}*/ /** @name Functions reimplemented from AUDIO_IO */ /*@{*/ virtual bool supports_seeking(void) const { return true; } virtual bool finished(void) const { return is_open() == false; } virtual std::string status(void) const; /*@}*/ private: bool is_running_rep; bool is_prepared_rep; bool ignore_xruns_rep; bool max_buffers_rep; }; #endif ecasound-2.9.3/libecasound/midiio.h0000644000076400007640000001014710664032032014171 00000000000000#ifndef INCLUDED_MIDIIO_H #define INCLUDED_MIDIIO_H #include #include "dynamic-object.h" /** * Virtual base for all MIDI I/O classes. * * - type definitions * * - attributes * * - configuration (setting and getting configuration parameters) * * - functionality (control and runtime information) * * - runtime information * * - constructors and destructors * * @author Kai Vehmanen */ class MIDI_IO : public DYNAMIC_OBJECT { public: /** @name Public type definitions and constants */ /*@{*/ /** * Input/Output mode * * @see io_mode() * * io_read * * Object is opened for input. If opening a file, * it must exist. * * io_write * * Object is opened for output. If opening a file and * and output exists, it is first truncated. * * io_readwrite * * Object is opened for both reading and writing. If * opening a file, a new file is created if needed. * When switching from read to write or vica versa, * position should be reset before using the device. **/ enum Io_mode { io_read = 1, io_write = 2, io_readwrite = 4 }; /*@}*/ public: /** @name Constructors and destructors */ /*@{*/ virtual MIDI_IO* clone(void) const = 0; virtual MIDI_IO* new_expr(void) const = 0; virtual ~MIDI_IO(void); MIDI_IO(const std::string& name = "unknown", int mode = io_read); /*@}*/ /** @name Attribute functions */ /*@{*/ virtual int supported_io_modes(void) const; virtual bool supports_nonblocking_mode(void) const; /*@}*/ /** @name Configuration * * For setting and getting configuration parameters. */ /*@{*/ int io_mode(void) const; const std::string& label(void) const; void io_mode(int mode); void label(const std::string& id_label); void toggle_nonblocking_mode(bool value); virtual std::string parameter_names(void) const { return("label"); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Main functionality */ /*@{*/ public: /** * Low-level routine for reading MIDI bytes. Number of read bytes * is returned. This must be implemented by all subclasses. */ virtual long int read_bytes(void* target_buffer, long int bytes) = 0; /** * Low-level routine for writing MIDI bytes. Number of bytes written * is returned. This must be implemented by all subclasses. */ virtual long int write_bytes(void* target_buffer, long int bytes) = 0; /** * Opens the MIDI object (possibly in exclusive mode). * This routine is meant for opening files and devices, * loading libraries, etc. * * ensure: * readable() == true || writable() == true */ virtual void open(void) = 0; /** * Closes the MIDI object. After calling this routine, * all resources (ie. soundcard) must be freed * (they can be used by other processes). * * ensure: * readable() != true * writable() != true */ virtual void close(void) = 0; /*@}*/ /** @name Runtime information */ /*@{*/ /** * Returns a file descriptor id suitable for poll() and * select() system calls. If polling is not supported, * returns value of '-1'. */ virtual int poll_descriptor(void) const { return(-1); } /** * Has device been opened (with open())? */ bool is_open(void) const { return(open_rep); } /** * Whether all data has been processed? If opened in mode 'io_read', * this means that end of stream has been reached. If opened in * 'io_write' or 'io_readwrite' modes, finished status usually * means that an error has occured (no space left, etc). After * finished() has returned 'true', further calls to read() * and/or write() won't process any data. */ virtual bool finished(void) const = 0; virtual bool nonblocking_mode(void) const; virtual bool readable(void) const; virtual bool writable(void) const; /*@}*/ protected: void toggle_open_state(bool value); private: int io_mode_rep; std::string id_label_rep; bool nonblocking_rep; bool readable_rep; bool writable_rep; bool open_rep; }; #endif ecasound-2.9.3/libecasound/oscillator.h0000644000076400007640000000165011034532355015076 00000000000000#ifndef INCLUDED_OSCILLATOR_H #define INCLUDED_OSCILLATOR_H #include #include #include "ctrl-source.h" /** * Base class for various oscillators * * Unlike finite controller sources, oscillators * produce new values infinately. */ class OSCILLATOR : public CONTROLLER_SOURCE { public: virtual void set_initial_value(parameter_t arg) {} /** * Constructor * * @param freq Oscillator frequency * @param phase Initial phase, multiple of pi */ OSCILLATOR(parameter_t freq = 0, parameter_t initial_phase = 0) { freq_value = freq; phase_value = initial_phase * M_PI; } private: parameter_t freq_value, phase_value; protected: parameter_t phase_offset(void) const { return(phase_value); } parameter_t frequency(void) const { return(freq_value); } void phase_offset(parameter_t v) { phase_value = v; } void frequency(parameter_t v) { freq_value = v; } }; #endif ecasound-2.9.3/libecasound/audioio-rtnull.cpp0000644000076400007640000001466511163001560016227 00000000000000// ------------------------------------------------------------------------ // audioio-rtnull.cpp: Null audio object with realtime behaviour // Copyright (C) 1999,2002,2005 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include /* gettimeofday() */ #include #include #include "audioio-device.h" #include "audioio-rtnull.h" #include "eca-error.h" #include "eca-logger.h" using std::cerr; using std::endl; /** * Definitions from glibc's sys/time.h (LGPL 2.1) */ #ifndef timerclear #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) #endif #ifndef timeradd #define timeradd(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ if ((result)->tv_usec >= 1000000) \ { \ ++(result)->tv_sec; \ (result)->tv_usec -= 1000000; \ } \ } while (0) #endif #ifndef timercmp #define timercmp(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) ? \ ((a)->tv_usec CMP (b)->tv_usec) : \ ((a)->tv_sec CMP (b)->tv_sec)) #endif #ifndef timersub #define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif /** * Function definitions */ REALTIME_NULL::REALTIME_NULL(const std::string& name) { xruns_rep = 0; } REALTIME_NULL::~REALTIME_NULL(void) { if (is_open() == true && is_running()) stop(); if (is_open() == true) { close(); } if (xruns_rep != 0) { cerr << "(audioio-rtnull) WARNING! There were " << xruns_rep << " xruns while "; if (io_mode() != io_read) { cerr << "writing.\n"; } else { cerr << "reading.\n"; } } } void REALTIME_NULL::open(void) throw (AUDIO_IO::SETUP_ERROR &) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "open"); double t = static_cast(buffersize()) / samples_per_second(); buffer_length_rep.tv_sec = static_cast(floor(t)); buffer_length_rep.tv_usec = static_cast((t - buffer_length_rep.tv_sec) * 1000000.0); total_buffers_rep = 3; if (max_buffers() == true) { total_buffers_rep = 8; } total_buffer_length_rep.tv_sec = total_buffers_rep * buffer_length_rep.tv_sec; total_buffer_length_rep.tv_usec = total_buffers_rep * buffer_length_rep.tv_usec; AUDIO_IO_DEVICE::open(); } void REALTIME_NULL::close(void) { AUDIO_IO_DEVICE::close(); } void REALTIME_NULL::prepare(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "prepare"); timerclear(&data_processed_rep); AUDIO_IO_DEVICE::prepare(); } void REALTIME_NULL::start(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "start"); gettimeofday(&start_time_rep, NULL); AUDIO_IO_DEVICE::start(); } void REALTIME_NULL::stop(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "stop"); AUDIO_IO_DEVICE::stop(); } /** * Calculates 'time_since_start_rep'. */ void REALTIME_NULL::calculate_device_position(void) { struct timeval now; gettimeofday(&now, NULL); timersub(&now, &start_time_rep, &time_since_start_rep); } /** * Calculates 'avail_data_rep'. */ void REALTIME_NULL::calculate_available_data(void) const { if (io_mode() == io_read) { /* capture: device is always ahead */ timersub(&time_since_start_rep, &data_processed_rep, &avail_data_rep); } else { /* playback: device is always behind */ struct timeval diff; timersub(&data_processed_rep, &time_since_start_rep, &diff); timersub(&total_buffer_length_rep, &diff, &avail_data_rep); } if (timercmp(&avail_data_rep, &total_buffer_length_rep, >)) { ++xruns_rep; // cerr << "(audioio-rtnull) xrun occured!" << endl; } } void REALTIME_NULL::block_until_data_available(void) { calculate_device_position(); calculate_available_data(); while (timercmp(&avail_data_rep, &buffer_length_rep, <)) { struct timeval delay; timersub(&buffer_length_rep, &avail_data_rep, &delay); // cerr << "(audioio-rtnull) sleeping for: " << ndelay.tv_sec << " sec, " << ndelay.tv_nsec << " nanoseconds.\n"; kvu_sleep(delay.tv_sec, delay.tv_usec * 1000); calculate_device_position(); calculate_available_data(); } } long int REALTIME_NULL::read_samples(void* target_buffer, long int samples) { DBC_CHECK(is_running() == true); for(int n = 0; n < samples * frame_size(); n++) ((char*)target_buffer)[n] = 0; block_until_data_available(); /* read one buffer of audio */ timeradd(&data_processed_rep, &buffer_length_rep, &data_processed_rep); return buffersize(); } void REALTIME_NULL::write_samples(void* target_buffer, long int samples) { if (is_running() != true) { /* prefill phase */ /* write one buffer of audio */ timeradd(&data_processed_rep, &buffer_length_rep, &data_processed_rep); } else { /* block until write space available */ block_until_data_available(); /* write one buffer of audio */ timeradd(&data_processed_rep, &buffer_length_rep, &data_processed_rep); } } long int REALTIME_NULL::prefill_space(void) const { if (io_mode() != io_read) return total_buffers_rep * buffersize(); return 0; } long int REALTIME_NULL::delay(void) const { long int delay = 0; if (is_running() == true) { calculate_available_data(); double time = avail_data_rep.tv_sec * 1000000.0 + avail_data_rep.tv_usec; delay = static_cast (time * samples_per_second() / 1000000.0); } DBC_CHECK(delay >= 0); return delay; } ecasound-2.9.3/libecasound/audiofx_mixing.h0000644000076400007640000001166111170177052015740 00000000000000#ifndef _AUDIOFX_MIXING_H #define _AUDIOFX_MIXING_H #include #include "samplebuffer_iterators.h" #include "audiofx.h" #include "audiofx_amplitude.h" /** * Virtual base class for channel mixing and routing effects * @author Kai Vehmanen */ class EFFECT_MIXING : public EFFECT_BASE { public: typedef std::vector::size_type ch_type; virtual ~EFFECT_MIXING(void); }; /** * Channel copy (one-to-one copy) * @author Kai Vehmanen */ class EFFECT_CHANNEL_COPY : public EFFECT_MIXING { private: ch_type from_channel, to_channel; SAMPLE_ITERATOR_CHANNEL f_iter, t_iter; public: virtual std::string name(void) const { return("Channel copy"); } virtual std::string parameter_names(void) const { return("from-channel,to-channel"); } int output_channels(int i_channels) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_CHANNEL_COPY* clone(void) const { return new EFFECT_CHANNEL_COPY(*this); } EFFECT_CHANNEL_COPY* new_expr(void) const { return new EFFECT_CHANNEL_COPY(); } EFFECT_CHANNEL_COPY (parameter_t from_channel = 1.0, parameter_t to_channel = 1.0); }; /** * Channel move (copy one channel and mute the source) * @author Kai Vehmanen */ class EFFECT_CHANNEL_MOVE : public EFFECT_MIXING { private: ch_type from_channel, to_channel; SAMPLE_ITERATOR_CHANNEL f_iter, t_iter; public: virtual std::string name(void) const { return("Channel move"); } virtual std::string parameter_names(void) const { return("from-channel,to-channel"); } int output_channels(int i_channels) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; void init(SAMPLE_BUFFER *insample); void process(void); EFFECT_CHANNEL_MOVE* clone(void) const { return new EFFECT_CHANNEL_MOVE(*this); } EFFECT_CHANNEL_MOVE* new_expr(void) const { return new EFFECT_CHANNEL_MOVE(); } EFFECT_CHANNEL_MOVE (parameter_t from_channel = 1.0, parameter_t to_channel = 1.0); }; /** * Channel mute (mutes one channel) * @author Kai Vehmanen */ class EFFECT_CHANNEL_MUTE : public EFFECT_AMPLIFY_CHANNEL { public: virtual std::string name(void) const { return("Channel mute"); } virtual std::string parameter_names(void) const { return("channel"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; EFFECT_CHANNEL_MUTE* clone(void) const { return new EFFECT_CHANNEL_MUTE(*this); } EFFECT_CHANNEL_MUTE* new_expr(void) const { return new EFFECT_CHANNEL_MUTE(); } EFFECT_CHANNEL_MUTE (parameter_t channel = 1.0); }; /** * Channel copy (one-to-one copy) * @author Kai Vehmanen */ class EFFECT_MIX_TO_CHANNEL : public EFFECT_MIXING { private: typedef std::vector::size_type ch_type; int channels; ch_type to_channel; parameter_t sum; SAMPLE_ITERATOR_CHANNEL t_iter; SAMPLE_ITERATOR_INTERLEAVED i; public: virtual std::string name(void) const { return("Mix to channel"); } virtual std::string parameter_names(void) const { return("to-channel"); } int output_channels(int i_channels) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; void init(SAMPLE_BUFFER *insample); void process(void); EFFECT_MIX_TO_CHANNEL* clone(void) const { return new EFFECT_MIX_TO_CHANNEL(*this); } EFFECT_MIX_TO_CHANNEL* new_expr(void) const { return new EFFECT_MIX_TO_CHANNEL(); } EFFECT_MIX_TO_CHANNEL (parameter_t to_channel = 1.0); }; /** * Arbitrary channel routing * @author Kai Vehmanen */ class EFFECT_CHANNEL_ORDER : public EFFECT_MIXING { private: SAMPLE_ITERATOR_CHANNEL f_iter, t_iter; SAMPLE_BUFFER *sbuf_repp; SAMPLE_BUFFER bouncebuf_rep; std::string param_names_rep; std::vector chsrc_map_rep; int out_channels_rep; public: virtual std::string name(void) const { return("Channel select"); } virtual std::string parameter_names(void) const; int output_channels(int i_channels) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual bool variable_params(void) const { return true; } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); EFFECT_CHANNEL_ORDER* clone(void) const; EFFECT_CHANNEL_ORDER* new_expr(void) const { return new EFFECT_CHANNEL_ORDER(); } EFFECT_CHANNEL_ORDER(void); }; #endif ecasound-2.9.3/libecasound/audiofx_reverb.cpp0000644000076400007640000001337111755705076016301 00000000000000// ------------------------------------------------------------------------ // audiofx_reverb.cpp: Reverb effect // Copyright (C) 2000 Stefan Fendt // Copyright (C) 2000,2003,2008 Kai Vehmanen (C++ version) // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // // ------------------------------------------------------------------------ // History: // // 2003-01-19 Kai Vehmanen // - Added param hint information. // 2002-12-04 Hans-Georg Fischer // - Fixed a bug in initializing the delay line, which cause // unwanted audible noise at start of processing. // 2000-06-06 Kai Vehmanen // - Initial version. Based on Stefan M. Fendt's reverb // code. // ------------------------------------------------------------------------ #include #include "sample-ops_impl.h" #include "samplebuffer_iterators.h" #include "sample-specs.h" #include "audiofx_reverb.h" ADVANCED_REVERB::ADVANCED_REVERB (parameter_t roomsize, parameter_t feedback_percent, parameter_t wet_percent) { set_parameter(1, roomsize); set_parameter(2, feedback_percent); set_parameter(3, wet_percent); } void ADVANCED_REVERB::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 10.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; // pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 2: pd->default_value = 50.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; case 3: pd->default_value = 50.0f; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: {} } } CHAIN_OPERATOR::parameter_t ADVANCED_REVERB::get_parameter(int param) const { switch (param) { case 1: return roomsize_rep; case 2: return feedback_rep * 100.0; case 3: return wet_rep * 100.0; } return 0.0; } void ADVANCED_REVERB::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: roomsize_rep = value; break; case 2: if (value == 0) feedback_rep = 0.001; else feedback_rep = value / 100.0; break; case 3: wet_rep = value / 100.0; break; } if (param == 1 || param == 2) { std::vector::iterator p = cdata.begin(); while(p != cdata.end()) { p->oldvalue=0.0; p->lpvalue=0.0; p->dpos[0] = static_cast(roomsize_rep * samples_per_second() / 333); p->mul[0] = 0.035; p->bufferpos_rep = 0; for(int i = 1; i < 64; i++) { p->dpos[i] = p->dpos[i-1] + (rand() & 511); p->mul[i] = p->mul[i-1] * (1 - 1 / feedback_rep / 1000); } ++p; } } } void ADVANCED_REVERB::init(SAMPLE_BUFFER *insample) { i_channels.init(insample); cdata.resize(insample->number_of_channels()); std::vector::iterator p = cdata.begin(); while(p != cdata.end()) { p->oldvalue=0.0; p->lpvalue=0.0; p->dpos[0] = static_cast(roomsize_rep * samples_per_second() / 333); p->mul[0] = 0.035; p->bufferpos_rep = 0; for(size_t i = 0; i < p->buffer.size(); i++) p->buffer[i] = 0.0f; for(int i = 1; i < 64; i++) { p->dpos[i] = p->dpos[i-1] + (rand() & 511); p->mul[i] = p->mul[i-1] * (1 - 1 / feedback_rep / 1000); } ++p; } } void ADVANCED_REVERB::process(void) { i_channels.begin(); while(!i_channels.end()) { int ch = i_channels.channel(); cdata[ch].bufferpos_rep++; cdata[ch].bufferpos_rep &= 65535; double old_value = cdata[ch].oldvalue; cdata[ch].buffer[cdata[ch].bufferpos_rep] = ecaops_flush_to_zero(*i_channels.current() + old_value); old_value = 0.0; for(int i = 0; i < 64; i++) { old_value += static_cast(cdata[ch].buffer[(cdata[ch].bufferpos_rep - cdata[ch].dpos[i]) & 65535] * cdata[ch].mul[i]); } /** * This is just a very simple high-pass-filter to remove offsets * which can accour during calculation of the echos */ cdata[ch].lpvalue = ecaops_flush_to_zero(cdata[ch].lpvalue * 0.99 + old_value * 0.01); old_value = old_value - cdata[ch].lpvalue; /** * This is a simple lowpass to make the apearence of the reverb * more realistic... (Walls do not reflect high frequencies very * well at all...) */ cdata[ch].oldvalue = ecaops_flush_to_zero(cdata[ch].oldvalue * 0.75 + old_value * 0.25); *i_channels.current() = cdata[ch].oldvalue * wet_rep + *i_channels.current() * (1 - wet_rep); i_channels.next(); } } ecasound-2.9.3/libecasound/midi-client.cpp0000644000076400007640000000252610664032032015452 00000000000000// ------------------------------------------------------------------------ // midi-client.cpp: Top-level interface for MIDI-clients // Copyright (C) 2001,2005 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "midi-server.h" #include "midi-client.h" MIDI_CLIENT::MIDI_CLIENT(void) : id_rep(0), id_set_rep(false), server_repp(0) { } int MIDI_CLIENT::id(void) const { return(id_rep); } void MIDI_CLIENT::set_id(int n) { id_rep = n; id_set_rep = true; } void MIDI_CLIENT::register_server(MIDI_SERVER* server) { server_repp = server; } ecasound-2.9.3/libecasound/midiio-aseq.cpp0000644000076400007640000001527210664032032015457 00000000000000// ------------------------------------------------------------------------ // midiio-aseq.cpp: Input and output of MIDI streams using // ALSA Sequencer // Copyright (C) 2005 Pedro Lopez-Cabanillas // Copyright (C) 2005 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #ifdef ECA_COMPILE_ALSA #include #include #include #include "midiio-aseq.h" #include "eca-logger.h" MIDI_IO_ASEQ::MIDI_IO_ASEQ(const std::string& name) { label("alsaseq"); device_name_rep = name; } MIDI_IO_ASEQ::~MIDI_IO_ASEQ(void) { if (is_open()) close(); } void MIDI_IO_ASEQ::open(void) { int open_flags = 0, port_flags = 0; switch(io_mode()) { case io_read: { open_flags = SND_SEQ_OPEN_INPUT; port_flags = SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE; break; } case io_write: { open_flags = SND_SEQ_OPEN_OUTPUT; port_flags = SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ; break; } case io_readwrite: { open_flags = SND_SEQ_OPEN_DUPLEX; port_flags = SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE | SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ; break; } } ECA_LOG_MSG(ECA_LOGGER::system_objects, "Opening ALSA sequencer"); int err = snd_seq_open(&seq_handle_repp, "default", open_flags, SND_SEQ_NONBLOCK); if (err < 0) { toggle_open_state(false); } else { toggle_open_state(true); } // Set client name. snd_seq_set_client_name(seq_handle_repp, "ecasound"); // Create a simple port port_rep = snd_seq_create_simple_port( seq_handle_repp, "ecasound", port_flags, SND_SEQ_PORT_TYPE_MIDI_GENERIC); // Parse the device name, and connect it to the port when successful snd_seq_addr_t subs; err = snd_seq_parse_address(seq_handle_repp, &subs, device_name_rep.c_str()); if( err == 0) { switch(io_mode()) { case io_read: snd_seq_connect_to(seq_handle_repp, port_rep, subs.client, subs.port); break; case io_write: snd_seq_connect_from(seq_handle_repp, port_rep, subs.client, subs.port); break; case io_readwrite: snd_seq_connect_to(seq_handle_repp, port_rep, subs.client, subs.port); snd_seq_connect_from(seq_handle_repp, port_rep, subs.client, subs.port); break; } } // Create the encoder/decoder instance err = snd_midi_event_new( buffer_size_rep = 16, &coder_repp ); // ... finished_rep = false; } void MIDI_IO_ASEQ::close(void) { // Release the xxcoder instance snd_midi_event_free( coder_repp ); // Delete the port snd_seq_delete_port( seq_handle_repp, port_rep ); // Close the sequencer client snd_seq_close( seq_handle_repp ); toggle_open_state(false); } int MIDI_IO_ASEQ::poll_descriptor(void) const { struct pollfd *pfds; int npfds; npfds = snd_seq_poll_descriptors_count(seq_handle_repp, POLLIN|POLLOUT); pfds = reinterpret_cast(alloca(sizeof(*pfds) * npfds)); snd_seq_poll_descriptors(seq_handle_repp, pfds, npfds, POLLIN|POLLOUT); return pfds->fd; } bool MIDI_IO_ASEQ::finished(void) const { return finished_rep; } long int MIDI_IO_ASEQ::read_bytes(void* target_buffer, long int bytes) { snd_seq_event_t *event; int err = 0, position = 0; if ( bytes > buffer_size_rep ) { snd_midi_event_resize_buffer ( coder_repp, bytes ); buffer_size_rep = bytes; } while (true) { if (snd_seq_event_input_pending(seq_handle_repp, 1) == 0) { return position; } err = snd_seq_event_input(seq_handle_repp, &event); if (err < 0) { break; } if ( event->type == SND_SEQ_EVENT_CONTROLLER || event->type == SND_SEQ_EVENT_CONTROL14 || event->type == SND_SEQ_EVENT_NONREGPARAM || event->type == SND_SEQ_EVENT_REGPARAM || event->type == SND_SEQ_EVENT_SYSEX ) { err = snd_midi_event_decode( coder_repp, ((unsigned char *)target_buffer) + position, bytes - position, event ); if (err < 0) { break; } position += err; if ( position >= bytes) return position; } } finished_rep = true; ECA_LOG_MSG(ECA_LOGGER::system_objects, std::string("error while reading from ALSA sequencer: ") + snd_strerror(err)); return err; } long int MIDI_IO_ASEQ::write_bytes(void* target_buffer, long int bytes) { snd_seq_event_t ev; int err = 0; if ( bytes > buffer_size_rep ) { snd_midi_event_resize_buffer ( coder_repp, bytes ); buffer_size_rep = bytes; } snd_seq_ev_clear(&ev); snd_seq_ev_set_source(&ev, port_rep); snd_seq_ev_set_subs(&ev); snd_seq_ev_set_direct(&ev); err = snd_midi_event_encode( coder_repp, (unsigned char *)target_buffer, bytes, &ev ); if (err == bytes) { snd_seq_event_output(seq_handle_repp, &ev); snd_seq_drain_output(seq_handle_repp); return err; } finished_rep = true; return err; } void MIDI_IO_ASEQ::set_parameter(int param, std::string value) { switch (param) { case 1: label(value); break; case 2: device_name_rep = value; break; } } std::string MIDI_IO_ASEQ::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return device_name_rep; } return ""; } /** * FIXME: This is an alternative to using the poll_descriptor() * interface... */ bool MIDI_IO_ASEQ::pending_messages(unsigned long timeout) const { struct pollfd *pfds; int result = 0; int npfds = snd_seq_poll_descriptors_count(seq_handle_repp, POLLIN); pfds = (struct pollfd *)alloca(sizeof(*pfds) * npfds); snd_seq_poll_descriptors(seq_handle_repp, pfds, npfds, POLLIN); result = poll(pfds, npfds, timeout); return (result > 0); } #endif /* COMPILE_ALSA */ ecasound-2.9.3/libecasound/eca-chainsetup-bufparams.cpp0000644000076400007640000001024410664032032020117 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup-bufparams.cpp: Container for chainsetup buffering params. // Copyright (C) 2001, 2007 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* kvu_get_argument_number */ #include #include "eca-chainsetup-bufparams.h" ECA_CHAINSETUP_BUFPARAMS::ECA_CHAINSETUP_BUFPARAMS(void) { set_buffersize_rep = false; set_raisedpriority_rep = false; set_sched_priority_rep = false; set_double_buffering_rep = false; set_double_buffer_size_rep = false; set_max_buffers_rep = false; } /** * Sets all buffering parameters based on 'paramstr'. * * @arg paramstr "int_buffersize, bool_raisedprio, int_schedprio, * bool_db, int_db-bufsize, int_buffersize" */ void ECA_CHAINSETUP_BUFPARAMS::set_all(const string& paramstr) { set_buffersize(atoi(kvu_get_argument_number(1, paramstr).c_str())); toggle_raised_priority(kvu_get_argument_number(2, paramstr) == "true"); set_sched_priority(atoi(kvu_get_argument_number(3, paramstr).c_str())); toggle_double_buffering(kvu_get_argument_number(4, paramstr) == "true"); set_double_buffer_size(atol(kvu_get_argument_number(5, paramstr).c_str())); toggle_max_buffers(kvu_get_argument_number(6, paramstr) == "true"); } /** * Returns number of distinct set parameters. */ int ECA_CHAINSETUP_BUFPARAMS::number_of_set(void) const { int res = 0; if (set_buffersize_rep == true) res++; if (set_raisedpriority_rep == true) res++; if (set_sched_priority_rep == true) res++; if (set_double_buffering_rep == true) res++; if (set_double_buffer_size_rep == true) res++; if (set_max_buffers_rep == true) res++; return res; } string ECA_CHAINSETUP_BUFPARAMS::to_string(void) const { string result; result += "\nbuffersize: "; result += kvu_numtostr(buffersize_rep); result += "\nraised_priority: "; result += kvu_numtostr((int)raisedpriority_rep); result += "\nsched_priority: "; result += kvu_numtostr((int)sched_priority_rep); result += "\ndouble buffering: "; result += kvu_numtostr((int)double_buffering_rep); result += "\ndouble buffer size: "; result += kvu_numtostr((int)double_buffer_size_rep); result += "\nmax buffers: "; result += kvu_numtostr(max_buffers_rep); return result; } bool ECA_CHAINSETUP_BUFPARAMS::are_all_set(void) const { if (set_buffersize_rep == true && set_raisedpriority_rep == true && set_sched_priority_rep == true && set_double_buffering_rep == true && set_double_buffer_size_rep == true && set_max_buffers_rep == true) return true; return false; } void ECA_CHAINSETUP_BUFPARAMS::set_buffersize(long int value) { buffersize_rep = value; set_buffersize_rep = true; } void ECA_CHAINSETUP_BUFPARAMS::toggle_raised_priority(bool value) { raisedpriority_rep = value; set_raisedpriority_rep = true; } void ECA_CHAINSETUP_BUFPARAMS::set_sched_priority(int prio) { sched_priority_rep = prio; set_sched_priority_rep = true; } void ECA_CHAINSETUP_BUFPARAMS::toggle_double_buffering(bool value) { double_buffering_rep = value; set_double_buffering_rep = true; } void ECA_CHAINSETUP_BUFPARAMS::set_double_buffer_size(long int v) { double_buffer_size_rep = v; set_double_buffer_size_rep = true; } void ECA_CHAINSETUP_BUFPARAMS::toggle_max_buffers(bool v) { max_buffers_rep = v; set_max_buffers_rep = true; } ecasound-2.9.3/libecasound/plugins/0000755000076400007640000000000013606336217014317 500000000000000ecasound-2.9.3/libecasound/plugins/audioio_sndfile.h0000644000076400007640000000523111747220202017534 00000000000000#ifndef INCLUDED_AUDIOIO_SNDFILE_H #define INCLUDED_AUDIOIO_SNDFILE_H #include #include #include #include "samplebuffer.h" #include "audioio-buffered.h" #include "samplebuffer.h" #ifdef HAVE_CONFIG_H #include #endif /** * Interface to libsndfile library. * @author Kai Vehmanen */ class SNDFILE_INTERFACE : public AUDIO_IO_BUFFERED { public: /** @name Public functions */ /*@{*/ SNDFILE_INTERFACE (const string& name = ""); ~SNDFILE_INTERFACE(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual string name(void) const { return "Libsndfile object"; } virtual string description(void) const { return "Libsndfile object. Supports all commona audio formats."; } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ SNDFILE_INTERFACE* clone(void) const; SNDFILE_INTERFACE* new_expr(void) const { return new SNDFILE_INTERFACE(); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ /** @name Functions reimplemented from AUDIO_IO_BUFFERED */ /*@{*/ virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); /*@}*/ /** @name Functions reimplemented from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return io_read | io_write | io_readwrite; } virtual bool supports_seeking(void) const { return seek_supported_rep; } virtual string parameter_names(void) const { return "filename,opt_filename,format"; } virtual bool locked_audio_format(void) const { return true; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual bool finished(void) const; /*@}*/ /** @name Non-virtual functions */ /*@{*/ std::list supported_extensions(void) const; /*@}*/ private: std::string opt_filename_rep; std::string opt_format_rep; SNDFILE* snd_repp; long samples_read; bool finished_rep; bool closing_rep; bool seek_supported_rep; void open_parse_info(const SF_INFO* sfinfo) throw(AUDIO_IO::SETUP_ERROR&); int find_file_format(const std::string& filename); SNDFILE_INTERFACE& operator=(const SNDFILE_INTERFACE& x) { return *this; } }; #endif ecasound-2.9.3/libecasound/plugins/audioio_jack.h0000644000076400007640000000442111161464275017032 00000000000000#ifndef INCLUDED_AUDIOIO_JACK_H #define INCLUDED_AUDIOIO_JACK_H #include #include #include "audioio-device.h" #include "sample-specs.h" class AUDIO_IO_MANAGER; class AUDIO_IO_JACK_MANAGER; /** * Interface to JACK audio framework. * * @author Kai Vehmanen */ class AUDIO_IO_JACK : public AUDIO_IO_DEVICE { public: virtual std::string name(void) const { return "JACK interface"; } virtual std::string description(void) const { return name(); } virtual std::string parameter_names(void) const; AUDIO_IO_JACK (void); ~AUDIO_IO_JACK(void); virtual bool variable_params(void) const { return true; } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; /** @name Function reimplemented from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return io_read | io_write; } virtual bool locked_audio_format(void) const { return true; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual bool finished(void) const; virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual AUDIO_IO_MANAGER* create_object_manager(void) const; void set_manager(AUDIO_IO_JACK_MANAGER* mgr, int id); /*@}*/ /** @name Function reimplemented from AUDIO_IO_DEVICE */ /*@{*/ virtual void prepare(void); virtual void start(void); virtual void stop(void); virtual long int latency(void) const; virtual long int prefill_space(void) const { return 0; } /*@}*/ AUDIO_IO_JACK* clone(void) const { return new AUDIO_IO_JACK(*this); } AUDIO_IO_JACK* new_expr(void) const { return new AUDIO_IO_JACK(); } private: AUDIO_IO_JACK_MANAGER* jackmgr_rep; int myid_rep; bool error_flag_rep; std::vector params_rep; SAMPLE_SPECS::sample_pos_t curpos_rep; private: AUDIO_IO_JACK (const AUDIO_IO_JACK& x) { } AUDIO_IO_JACK& operator=(const AUDIO_IO_JACK& x) { return *this; } }; #ifdef ECA_ENABLE_AUDIOIO_PLUGINS extern "C" { AUDIO_IO* audio_io_descriptor(void); int audio_io_interface_version(void); const char* audio_io_keyword(void); const char* audio_io_keyword_regex(void); }; #endif #endif ecasound-2.9.3/libecasound/plugins/audioio_arts.cpp0000644000076400007640000000715610664032032017423 00000000000000// ------------------------------------------------------------------------ // audioio-arts.cpp: Interface for communicating with aRts/MCOP. // Copyright (C) 2000,2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "audioio-device.h" #include "eca-logger.h" #include "eca-version.h" extern "C" { #include } #include "audioio_arts.h" #ifdef ECA_ENABLE_AUDIOIO_PLUGINS static const char* audio_io_keyword_const = "arts"; static const char* audio_io_keyword_regex_const = "^arts$"; const char* audio_io_keyword(void){return(audio_io_keyword_const); } const char* audio_io_keyword_regex(void){return(audio_io_keyword_regex_const); } int audio_io_interface_version(void) { return(ecasound_library_version_current); } #endif int ARTS_INTERFACE::ref_rep = 0; ARTS_INTERFACE::ARTS_INTERFACE(const string& name) { set_label(name); } ARTS_INTERFACE::~ARTS_INTERFACE(void) { if (is_open() == true && is_running()) stop(); if (is_open() == true) { close(); } --ref_rep; if (ref_rep == 0) ::arts_free(); } ARTS_INTERFACE* ARTS_INTERFACE::clone(void) const { ARTS_INTERFACE* target = new ARTS_INTERFACE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return(target); } void ARTS_INTERFACE::open(void) throw(AUDIO_IO::SETUP_ERROR&) { if (ref_rep == 0) { int err = ::arts_init(); if (err < 0) { throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ARTS: unable to connect to aRts server: " + string(arts_error_text(err)))); } } ++ref_rep; if (io_mode() == io_read) { stream_rep = ::arts_record_stream(samples_per_second(), bits(), channels(), "ecasound-input"); } else if (io_mode() == io_write) { stream_rep = ::arts_play_stream(samples_per_second(), bits(), channels(), "ecasound-output"); } else { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-ARTS: Simultanious input/output not supported.")); } ::arts_stream_set(stream_rep, ARTS_P_BUFFER_SIZE, buffersize() * frame_size()); ::arts_stream_set(stream_rep, ARTS_P_BLOCKING, 1); samples_rep = 0; double total_latency = ::arts_stream_get(stream_rep, ARTS_P_TOTAL_LATENCY); latency_rep = static_cast(total_latency * samples_per_second() / 1000.0f); AUDIO_IO::open(); } void ARTS_INTERFACE::stop(void) { AUDIO_IO_DEVICE::stop(); } void ARTS_INTERFACE::close(void) { ::arts_close_stream(stream_rep); AUDIO_IO::close(); } void ARTS_INTERFACE::start(void) { AUDIO_IO_DEVICE::start(); } long int ARTS_INTERFACE::read_samples(void* target_buffer, long int samples) { long int res = ::arts_read(stream_rep, target_buffer, frame_size() * samples); if (res >= 0) { return(res / frame_size()); } else { return(0); } } void ARTS_INTERFACE::write_samples(void* target_buffer, long int samples) { ::arts_write(stream_rep, target_buffer, frame_size() * samples); } ecasound-2.9.3/libecasound/plugins/audioio_sndfile.cpp0000644000076400007640000003300113501134022020055 00000000000000// ------------------------------------------------------------------------ // audioio_sndfile.cpp: Interface to the sndfile library. // Copyright (C) 2003-2004,2006-2007,2009,2012 Kai Vehmanen // Copyright (C) 2004 Jesse Chappell // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // References: // http://www.mega-nerd.com/libsndfile/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "audioio_sndfile.h" #include "samplebuffer.h" #include "eca-version.h" #include "eca-error.h" #include "eca-logger.h" #ifdef WORDS_BIGENDIAN static const ECA_AUDIO_FORMAT::Sample_format audioio_sndfile_sfmt = ECA_AUDIO_FORMAT::sfmt_f32_be; #else static const ECA_AUDIO_FORMAT::Sample_format audioio_sndfile_sfmt = ECA_AUDIO_FORMAT::sfmt_f32_le; #endif using namespace std; SNDFILE_INTERFACE::SNDFILE_INTERFACE (const string& name) { finished_rep = false; snd_repp = 0; closing_rep = false; seek_supported_rep = true; set_label(name); } SNDFILE_INTERFACE::~SNDFILE_INTERFACE(void) { if (is_open() == true) { close(); } } SNDFILE_INTERFACE* SNDFILE_INTERFACE::clone(void) const { SNDFILE_INTERFACE* target = new SNDFILE_INTERFACE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } /** * Parses the information given in 'sfinfo'. */ void SNDFILE_INTERFACE::open_parse_info(const SF_INFO* sfinfo) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "audio file format: " + kvu_numtostr(sfinfo->format & SF_FORMAT_SUBMASK)); string format; if (sfinfo->seekable) seek_supported_rep = true; else seek_supported_rep = false; set_samples_per_second(static_cast(sfinfo->samplerate)); set_channels(sfinfo->channels); switch(sfinfo->format & SF_FORMAT_SUBMASK) { case SF_FORMAT_PCM_S8: { format = "s8"; break; } case SF_FORMAT_PCM_U8: { format = "u8"; break; } case SF_FORMAT_PCM_16: { format = "s16"; break; } case SF_FORMAT_PCM_24: { format = "s24"; break; } case SF_FORMAT_PCM_32: { format = "s32"; break; } default: { /* SF_FORMAT_FLOAT */ format = "f32"; break; } } if (sfinfo->format & SF_ENDIAN_LITTLE) format += "_le"; else if (sfinfo->format & SF_ENDIAN_BIG) format += "_be"; set_sample_format_string(format); /* note: we have no way to find out whether frame count of * zero means an empty file, or that that the audio * format does not provide this information, so we * lean towards being cautious; see also finished() */ if (sfinfo->frames > 0) set_length_in_samples(sfinfo->frames); ECA_LOG_MSG(ECA_LOGGER::user_objects, string("file length (frames): ") + kvu_numtostr(sfinfo->frames)); } /** * Returns a list of support file extensions in lower-case. */ std::list SNDFILE_INTERFACE::supported_extensions(void) const { list exts; int i, count; SF_FORMAT_INFO format_info; sf_command (0, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)); for (i = 0 ; i < count ; i++) { format_info.format = i; sf_command (0, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; exts.push_back(string(format_info.extension)); } return exts; } /** * Discovers a matching libsndfile file format for the filename * 'fname'. The filename extension is used to find a matching * format. * * @return sndfile major format identifier */ int SNDFILE_INTERFACE::find_file_format(const std::string& fname) { int file_format = -1, i, count; SF_FORMAT_INFO format_info; size_t pos = fname.rfind("."); string fext; if (pos != string::npos) { fext = string(fname, pos + 1); } ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Searching for fileformat matching extension '") + fext + "'."); sf_command (0, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)); for (i = 0 ; i < count ; i++) { format_info.format = i; sf_command (0, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; if (fext == string(format_info.extension)) { file_format = format_info.format; ECA_LOG_MSG(ECA_LOGGER::user_objects, string("Found matching file format: ") + format_info.name + " (ext=." + fext + ")"); break; } } if (file_format < 0) { ECA_LOG_MSG(ECA_LOGGER::info, string("Warning! Unknown audio format extension '") + fext + "', using WAV format instead."); file_format = SF_FORMAT_WAV; } return file_format; } void SNDFILE_INTERFACE::open(void) throw(AUDIO_IO::SETUP_ERROR&) { SF_INFO sfinfo; string real_filename = label(); if (real_filename == "sndfile") { real_filename = opt_filename_rep; } string mod_filename = real_filename; if (!opt_format_rep.empty()) { mod_filename = opt_format_rep; } kvu_to_lowercase(mod_filename); // need to treat raw specially for read-only opening bool is_raw = false; if (strstr(mod_filename.c_str(),".raw") != 0) { is_raw = true; } if (io_mode() == io_read && !is_raw) { ECA_LOG_MSG(ECA_LOGGER::info, "Using libsndfile to open file \"" + real_filename + "\" for reading."); snd_repp = sf_open(real_filename.c_str(), SFM_READ, &sfinfo); if (snd_repp == NULL) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-SNDFILE: Can't open file \"" + real_filename + "\" for reading.")); } else { open_parse_info(&sfinfo); } } else { /* write or readwrite */ int file_format = -1; // note: support 1.0.0 formats by default, and others via // SF_FORMAT_GET_MAJOR file_format = find_file_format(mod_filename); if (format_string()[0] == 'u' && bits() == 8) file_format |= SF_FORMAT_PCM_S8; else if (format_string()[0] == 's') { if (bits() == 8) { file_format |= SF_FORMAT_PCM_S8; } else if (bits() == 16) { file_format |= SF_FORMAT_PCM_16; } else if (bits() == 24) { file_format |= SF_FORMAT_PCM_24; } else if (bits() == 32) { file_format |= SF_FORMAT_PCM_32; } else { file_format = 0; } } else if (format_string()[0] == 'f') { if (bits() == 32) { file_format |= SF_FORMAT_FLOAT; } else if (bits() == 64) { file_format |= SF_FORMAT_DOUBLE; } else { file_format = 0; } } else { file_format = 0; } if (file_format == 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-SNDFILE: Error! Unknown audio format requested.")); } // set endianess if (sample_endianess() == se_little) { file_format |= SF_ENDIAN_LITTLE; } else if (sample_endianess() == se_big) { file_format |= SF_ENDIAN_BIG; } /* set samplerate and channels */ sfinfo.samplerate = samples_per_second(); sfinfo.channels = channels(); sfinfo.format = file_format; if (io_mode() == io_write) { ECA_LOG_MSG(ECA_LOGGER::info, "Using libsndfile to open file \"" + real_filename + "\" for writing."); /* open the file */ snd_repp = sf_open(real_filename.c_str(), SFM_WRITE, &sfinfo); if (snd_repp == NULL) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-SNDFILE: Can't open file \"" + real_filename + "\" for writing.")); } } else if (io_mode() == io_read) { ECA_LOG_MSG(ECA_LOGGER::info, "Using libsndfile to open file \"" + real_filename + "\" for reading."); snd_repp = sf_open(real_filename.c_str(), SFM_READ, &sfinfo); if (snd_repp == NULL) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-SNDFILE: Can't open file \"" + real_filename + "\" for reading.")); } else { open_parse_info(&sfinfo); } } else { ECA_LOG_MSG(ECA_LOGGER::info, "Using libsndfile to open file \"" + real_filename + "\" for read/write."); DBC_CHECK(sf_format_check(&sfinfo)); /* io_readwrite */ snd_repp = sf_open(real_filename.c_str(), SFM_RDWR, &sfinfo); if (snd_repp == NULL) { /* if open fails, try with SFM_WRITE (formats like flac are not * supported in RDWR mode */ snd_repp = sf_open(real_filename.c_str(), SFM_WRITE, &sfinfo); if (snd_repp == NULL) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-SNDFILE: Can't open file \"" + real_filename + "\" for updating (read/write).")); } else { set_io_mode(io_write); open_parse_info(&sfinfo); } } else { open_parse_info(&sfinfo); } } } /* we need to reserve extra memory as we using 32bit * floats as the internal sample unit */ reserve_buffer_space((sizeof(float) * channels()) * buffersize()); AUDIO_IO::open(); } void SNDFILE_INTERFACE::close(void) { if (is_open() == true) { DBC_CHECK(closing_rep != true); if (snd_repp != 0 && closing_rep != true) { closing_rep = true; sf_close(snd_repp); snd_repp = 0; } } AUDIO_IO::close(); closing_rep = false; } bool SNDFILE_INTERFACE::finished(void) const { if (finished_rep == true || (length_set() == true && (io_mode() == io_read && out_position()))) return true; return false; } long int SNDFILE_INTERFACE::read_samples(void* target_buffer, long int samples) { // samples_read = sf_read_raw(snd_repp, target_buffer, frame_size() * samples); // samples_read /= frame_size(); samples_read = sf_readf_float(snd_repp, (float*)target_buffer, samples); finished_rep = (samples_read < samples) ? true : false; return samples_read; } void SNDFILE_INTERFACE::write_samples(void* target_buffer, long int samples) { //sf_write_raw(snd_repp, target_buffer, frame_size() * samples); sf_writef_float(snd_repp, (float*)target_buffer, samples); } void SNDFILE_INTERFACE::read_buffer(SAMPLE_BUFFER* sbuf) { // -------- DBC_REQUIRE(get_iobuf() != 0); DBC_REQUIRE(static_cast(get_iobuf_size()) >= buffersize() * frame_size()); // -------- /* note! modified from audioio-buffered.cpp */ DBC_CHECK(interleaved_channels() == true); /* in normal conditions this won't cause memory reallocs */ reserve_buffer_space((sizeof(float) * channels()) * buffersize()); sbuf->import_interleaved(get_iobuf(), read_samples(get_iobuf(), buffersize()), audioio_sndfile_sfmt, channels()); change_position_in_samples(sbuf->length_in_samples()); } void SNDFILE_INTERFACE::write_buffer(SAMPLE_BUFFER* sbuf) { // -------- DBC_REQUIRE(get_iobuf() != 0); DBC_REQUIRE(static_cast(get_iobuf_size()) >= buffersize() * frame_size()); // -------- /* note! modified from audioio-buffered.cpp */ DBC_CHECK(interleaved_channels() == true); /* in normal conditions this won't cause memory reallocs */ reserve_buffer_space((sizeof(float) * channels()) * buffersize()); set_buffersize(sbuf->length_in_samples()); sbuf->export_interleaved(get_iobuf(), audioio_sndfile_sfmt, channels()); write_samples(get_iobuf(), sbuf->length_in_samples()); change_position_in_samples(sbuf->length_in_samples()); extend_position(); } SAMPLE_SPECS::sample_pos_t SNDFILE_INTERFACE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { finished_rep = false; sf_count_t res = sf_seek(snd_repp, pos, SEEK_SET); if (res != pos && length_set() == true && io_mode() == io_read && pos >= length_in_samples()) { pos = sf_seek(snd_repp, 0, SEEK_END); } else if (res != pos) { ECA_LOG_MSG(ECA_LOGGER::info, "invalid seek for file " + opt_filename_rep + ", req was to " + kvu_numtostr(pos) + ", result was " + kvu_numtostr(res)); if (res < 0) { res = sf_seek(snd_repp, 0, SEEK_CUR); DBC_CHECK(res >= 0); if (res >= 0) pos = res; else pos = position_in_samples(); } } return pos; } void SNDFILE_INTERFACE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: opt_filename_rep = value; break; case 3: opt_format_rep = value; break; } } string SNDFILE_INTERFACE::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return opt_filename_rep; case 3: return opt_format_rep; } return ""; } ecasound-2.9.3/libecasound/plugins/audioio_af.h0000644000076400007640000000400111141323334016466 00000000000000#ifndef INCLUDED_AUDIOIO_AF_H #define INCLUDED_AUDIOIO_AF_H #include #include #include "samplebuffer.h" #include "audioio-buffered.h" #include "samplebuffer.h" #ifdef HAVE_CONFIG_H #include #endif /** * Interface to SGI audiofile library. * @author Kai Vehmanen */ class AUDIOFILE_INTERFACE : public AUDIO_IO_BUFFERED { std::string opt_filename_rep; long samples_read; bool finished_rep; AFfilehandle afhandle; AUDIOFILE_INTERFACE& operator=(const AUDIOFILE_INTERFACE& x) { return *this; } void debug_print_type(void); public: virtual string name(void) const { return "SGI libaudiofile object"; } virtual string description(void) const { return "SGI libaudiofile object. Supports AIFF (.aiff, .aifc, .aif) and Sun/NeXT audio files (.au, .snd)."; } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; virtual int supported_io_modes(void) const { return (io_read | io_write); } virtual bool supports_seeking(void) const { return (io_mode() == io_read); } virtual string parameter_names(void) const { return "filename,opt_filename"; } virtual bool locked_audio_format(void) const { return true; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const; virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); AUDIOFILE_INTERFACE* clone(void) const; AUDIOFILE_INTERFACE* new_expr(void) const { return new AUDIOFILE_INTERFACE(); } AUDIOFILE_INTERFACE (const string& name = ""); ~AUDIOFILE_INTERFACE(void); }; #ifdef ECA_ENABLE_AUDIOIO_PLUGINS extern "C" { AUDIO_IO* audio_io_descriptor(void) { return(new AUDIOFILE_INTERFACE()); } int audio_io_interface_version(void); const char* audio_io_keyword(void); const char* audio_io_keyword_regex(void); }; #endif #endif ecasound-2.9.3/libecasound/plugins/audioio_jack_manager.cpp0000644000076400007640000016176012260763316021070 00000000000000// ------------------------------------------------------------------------ // audioio_jack_manager.cpp: Manager for JACK client objects // Copyright (C) 2001-2004,2008,2009,2011 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // References: // http://jackit.sourceforge.net/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include /* std::count() */ #include #include #include #include /* gettimeofday() */ #include /* ETIMEDOUT */ #include #include #include #include #include #include "audioio.h" #include "eca-engine.h" #include "eca-chainsetup.h" #include "eca-logger.h" #include /** * Enable and disable features */ /* Debug control flow */ // #define DEBUG_CFLOW /* Profile callback execution */ // #define PROFILE_CALLBACK_EXECUTION /** * Local macro definitions */ #ifdef DEBUG_CFLOW #define DEBUG_CFLOW_STATEMENT(x) (x) #else #define DEBUG_CFLOW_STATEMENT(x) ((void)0) #endif #ifdef PROFILE_CALLBACK_EXECUTION #define PROFILE_CE_STATEMENT(x) (x) static PROCEDURE_TIMER profile_callback_timer; #else #define PROFILE_CE_STATEMENT(x) ((void)0) #endif /** * Prototypes for static functions */ static int eca_jack_process_callback(jack_nframes_t nframes, void *arg); #if ECA_JACK_TRANSPORT_API >= 3 static int eca_jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg); static void eca_jack_sync_start_seek_to(jack_transport_state_t state, jack_position_t *pos, void *arg); static void eca_jack_sync_start_live_seek_to(jack_transport_state_t state, jack_position_t *pos, void *arg); static void eca_jack_process_timebase_slave(jack_nframes_t nframes, void *arg); #endif static void eca_jack_process_engine_iteration(jack_nframes_t nframes, void *arg); static void eca_jack_process_mute(jack_nframes_t nframes, void* arg); #ifdef PROFILE_CALLBACK_EXECUTION static void eca_jack_process_profile_pre(void); static void eca_jack_process_profile_post(void); #endif static int eca_jack_bsize_cb(jack_nframes_t nframes, void *arg); static int eca_jack_srate_cb(jack_nframes_t nframes, void *arg); static void eca_jack_shutdown_cb(void *arg); static std::string eca_get_jack_port_item(const char **ports, int item); #include "audioio_jack_manager.h" using std::cerr; using std::endl; using std::list; using std::string; using std::vector; /** * Implementations of static functions */ /** * How many ecasound JACK manager instances * can run at the same time (affects connection * setup time in some situations). */ const int AUDIO_IO_JACK_MANAGER::instance_limit = 8; /** * Context help: * J = originates from JACK callback * E = ----- " ------- engine thread (exec()) * C = ----- " ------- control/client thread */ #if ECA_JACK_TRANSPORT_API >= 3 /** * JACK sync callback function. Called when someone has * issued a state change request. * * context: J-level-0 */ static int eca_jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg) { // DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_SYNC: entering..."); AUDIO_IO_JACK_MANAGER* current = static_cast(arg); int result = 1; /* ready for rolling */ if (current->exit_request_rep == 1 || current->shutdown_request_rep == 1) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: after exit/shutdown!!!" << endl); return 0; } /* try to get the driver lock; if it fails or connection * is not fully establish, skip this processing cycle */ int ret = pthread_mutex_trylock(¤t->engine_mod_lock_rep); if (ret == 0) { SAMPLE_SPECS::sample_pos_t enginepos = current->engine_repp->current_position_in_samples(); /* 1. engine locked for editing, do not touch! */ // 2012/May: no longer needed /* 2. transport stopped */ if (state == JackTransportStopped) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK stopped" << endl); /* 2.1 engine at correct place; report success */ if (enginepos == pos->frame) { result = 1; } /* 2.2 only start seek if engine is not already at correct place */ else if (current->jackslave_seekahead_target_rep == -1) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: stopped - starting seek to " << pos->frame << "." << endl); eca_jack_sync_start_seek_to(state, pos, arg); } result = 0; } /* 3. transport starting (or looping, all these states are fine to us, as is the case where state info is not available at all) */ else if (state == JackTransportStarting) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK starting" << endl); /* 3.1 engine at correct position */ if (enginepos == pos->frame) { /* 3.1.1 engine ready for process callback; return positive */ if (current->engine_repp->is_prepared() && current->engine_repp->is_running()) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK running; correct position, engine running\n"); result = 1; current->jackslave_seekahead_target_rep = -1; } /* 3.1.2 engine not ready for process callback; request start */ else { current->start_request_rep++; current->engine_repp->command(ECA_ENGINE::ep_start, 0.0f); result = 0; } } /* 3.2 engine at the wrong position but no seek target set; restart seek */ else if (current->jackslave_seekahead_target_rep == -1) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: starting - new seek to " << pos->frame << "." << endl); eca_jack_sync_start_seek_to(state, pos, arg); result = 0; } /* 3.3 engine at the wrong position; seek still ongoing */ else { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: still seeking, pos=" << pos->frame << ", enginepos=" << enginepos << "." << endl); if (pos->frame != static_cast(current->jackslave_seekahead_target_rep)) { eca_jack_sync_start_seek_to(state, pos, arg); } result = 0; } } /* 4. slow-start timeout elapsed; transport forced to rolling */ else { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: JACK running, forced, trying to catch up" << endl); eca_jack_sync_start_live_seek_to(state, pos, arg); } pthread_mutex_unlock(¤t->engine_mod_lock_rep); } else { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: couldn't get lock" << endl); result = 0; } return result; } #endif #if ECA_JACK_TRANSPORT_API >= 3 /** * Helper function to start seeking to a new position. * * context: J-level-1 */ static void eca_jack_sync_start_seek_to(jack_transport_state_t state, jack_position_t *pos, void *arg) { // DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_sync_start_seek_to(): entering..."); AUDIO_IO_JACK_MANAGER* current = static_cast(arg); SAMPLE_SPECS::sample_pos_t enginepos = current->engine_repp->current_position_in_samples(); /* prepare for the next start by seeking to the correct position */ if (enginepos != pos->frame) { current->jackslave_seekahead_target_rep = pos->frame; current->engine_repp->command(ECA_ENGINE::ep_setpos_samples, current->jackslave_seekahead_target_rep); DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_SYNC: seeking to " << pos->frame << endl); } current->engine_repp->command(ECA_ENGINE::ep_prepare, 0.0f); } #endif #if ECA_JACK_TRANSPORT_API >= 3 /** * Helper function to start forced (live-)seeking to a new * position. We have to be prepared to chase the timebase * master. * * context: J-level-1/2 */ static void eca_jack_sync_start_live_seek_to(jack_transport_state_t state, jack_position_t *pos, void *arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); SAMPLE_SPECS::sample_pos_t enginepos = current->engine_repp->current_position_in_samples(); if (current->is_running() != true) { /* transport rolling: engine not started; start it now */ if (current->engine_repp->status() != ECA_ENGINE::engine_status_finished && ((pos->frame <= current->engine_repp->connected_chainsetup()->length_in_samples()) || (current->engine_repp->is_finite_length() != true))) { /* conditions when we should start the engine * a. engine status not finished, AND... * a.1. transport position not beyond csetup length, OR... * a.2. csetup has infinite length */ if (current->engine_repp->is_prepared() == true && (enginepos == pos->frame)) { current->engine_repp->start_operation(); DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_FORCESYNC: Starting engine (direct)\n"); } else { current->start_request_rep++; current->engine_repp->command(ECA_ENGINE::ep_start, 0.0f); DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_FORCESYNC: Starting engine (cmdpipe)\n"); enginepos = -1; } } } else { DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_FORCESYNC: engine curpos '" << current->engine_repp->current_position_in_samples() << "' doesn't match JACK curpos '" << pos->frame << "'!" << endl); if ((pos->frame >= current->engine_repp->connected_chainsetup()->length_in_samples() && (current->engine_repp->is_finite_length() == true))) { DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_FORCESYNC: over max length" << endl); current->stop_request_rep++; current->engine_repp->command(ECA_ENGINE::ep_stop, 0.0f); } else if (current->jackslave_seekahead_target_rep == -1 || current->jackslave_seekahead_target_rep < static_cast(pos->frame + current->buffersize()) || current->jackslave_seekahead_target_rep - current->jackslave_seekahead_rep * current->buffersize() > static_cast(pos->frame + current->buffersize())) { /* note: we use seek-ahead to give time for the disk i/o subsystem to catch up for the next round, seek-ahead must be re-initialized if... a) seek-ahead target not set, b) we have missed the current seek-ahead target, or c) transport position has been rewinded (current seek-ahead target too far in the fututre) */ if (current->jackslave_seekahead_target_rep != -1) { /* previous seek has failed; try again with a longer look-ahead */ current->jackslave_seekahead_rep = (current->jackslave_seekahead_rep < (65536 / current->buffersize()) ? current->jackslave_seekahead_rep * 2 : (65536 / current->buffersize())); DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_FORCESYNC: seek-ahead request failed; increasing seek-ahead to " << current->jackslave_seekahead_rep << endl); } current->jackslave_seekahead_target_rep = pos->frame + current->jackslave_seekahead_rep * current->buffersize(); current->engine_repp->command(ECA_ENGINE::ep_setpos_live_samples, current->jackslave_seekahead_target_rep); DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_FORCESYNC: seek-ahead request sent; seeking to " << current->jackslave_seekahead_target_rep << endl); } else { /* engine is already seeking to a new pos */ DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_FORCESYNC: seek to new pos underway; " << pos->frame << " is transport-curpos." << endl); } } } #endif /** * Processes all registered JACK input and output ports. * This is the main callback function registered to * the JACK framework. * * context: J-level-0 */ static int eca_jack_process_callback(jack_nframes_t nframes, void *arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); PROFILE_CE_STATEMENT(eca_jack_process_profile_pre()); if (current->exit_request_rep == 1 || current->shutdown_request_rep == 1) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: after shutdown/exit!!!" << endl); if (current->exit_request_rep) eca_jack_process_mute(nframes, current); return 0; } if (current->engine_repp == 0) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: after engine destructor!!!" << endl); return 0; } /* try to get the driver lock; if it fails or connection * is not fully establish, skip this processing cycle */ int ret = pthread_mutex_trylock(¤t->engine_mod_lock_rep); if (ret == 0) { // DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: got lock" << endl); /* 1. transport control processing in "notransport" and "transport" mode */ if (current->mode_rep == AUDIO_IO_JACK_MANAGER::Transport_none || current->mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send) { /* execute one engine iteration */ if (current->is_running() == true) { eca_jack_process_engine_iteration(nframes, current); } else { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: not running, mute" << endl); eca_jack_process_mute(nframes, current); } } #if ECA_JACK_TRANSPORT_API >= 3 else { /* 2. transport control processing in "slave" mode */ if (current->mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive || current->mode_rep == AUDIO_IO_JACK_MANAGER::Transport_receive) { eca_jack_process_timebase_slave(nframes, arg); } else { /* never reached */ } } #endif pthread_mutex_unlock(¤t->engine_mod_lock_rep); // DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: released lock" << endl); } else { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: couldn't get lock; muting" << endl); eca_jack_process_mute(nframes, current); } PROFILE_CE_STATEMENT(eca_jack_process_profile_post()); return 0; } /** * Helper routine. Only called by eca_jack_process*() functions. * * context: J-level-1/ */ static void eca_jack_process_engine_iteration(jack_nframes_t nframes, void* arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); /* this is guaranteed by libjack */ DBC_CHECK(current->buffersize_rep == static_cast(nframes)); /* FIXME: remove me! */ if (current->buffersize_rep != static_cast(nframes)) { std::cerr << "JACK_MANAGER: invalid nframes! buffersize=" << current->buffersize_rep << ", nframes=" << nframes << std::endl; } if (current->engine_repp->status() != ECA_ENGINE::engine_status_finished) { /* 1. copy audio data from port input buffers to ecasound buffers */ for(size_t n = 0; n < current->inports_rep.size(); n++) { if (current->inports_rep[n]->cb_buffer != 0) { jack_default_audio_sample_t* in_cb_buffer = static_cast (jack_port_get_buffer(current->inports_rep[n]->jackport, nframes)); memcpy(current->inports_rep[n]->cb_buffer, in_cb_buffer, current->buffersize_rep * sizeof(jack_default_audio_sample_t)); } } // DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_PROCESS: engine_iter_in"); /* 2. execute one engine iteration */ current->engine_repp->engine_iteration(); // DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_PROCESS: engine_iter_out"); /* 3. copy data from ecasound buffers to port output buffers */ for(size_t n = 0; n < current->outports_rep.size(); n++) { if (current->outports_rep[n]->cb_buffer != 0) { jack_default_audio_sample_t* out_cb_buffer = static_cast (jack_port_get_buffer(current->outports_rep[n]->jackport, nframes)); memcpy(out_cb_buffer, current->outports_rep[n]->cb_buffer, current->buffersize_rep * sizeof(jack_default_audio_sample_t)); } } } else { /* 4. chainsetup finished, mute */ DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: chainsetup finished, muting\n"); eca_jack_process_mute(nframes, current); } /* 5. update engine status based on the last iteration */ current->engine_repp->update_engine_state(); } /** * Helper routine. Only called by eca_jack_process*() functions. * * context: J-level-1/2 */ static void eca_jack_process_mute(jack_nframes_t nframes, void* arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); for(size_t n = 0; n < current->outports_rep.size(); n++) { if (current->outports_rep[n]->cb_buffer != 0) { jack_default_audio_sample_t* out_cb_buffer = static_cast (jack_port_get_buffer(current->outports_rep[n]->jackport, nframes)); memset(out_cb_buffer, 0, current->buffersize_rep * sizeof(jack_default_audio_sample_t)); } } } #if ECA_JACK_TRANSPORT_API >= 3 /** * Helper routine. Only called by eca_jack_process_callback() function. * * context: J-level-1 */ static void eca_jack_process_timebase_slave(jack_nframes_t nframes, void *arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); jack_transport_state_t jackstate; jack_position_t jackpos; bool need_mute = true; jackstate = jack_transport_query(current->client_repp, &jackpos); /* 1. engine locked for editing, do not touch! */ // 2012/May: no longer needed /* 2. transport stopped or starting */ if (jackstate == JackTransportStopped) { // DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK state stopped" << endl); ++current->j_stopped_rounds_rep; /* 2.1 transport stopped and no pending start requests */ if (current->is_running() == true && current->j_stopped_rounds_rep > 3) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_PROCESS: running, request stop" << endl); current->stop_request_rep++; current->engine_repp->command(ECA_ENGINE::ep_stop, 0.0f); } } /* 3. transport stopped or starting */ else if (jackstate == JackTransportStarting) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK state starting" << endl); ++current->j_stopped_rounds_rep; } /* 4. transport rolling (or looping, both states are fine to us, as is the case where state info is not available at all) */ else { current->j_stopped_rounds_rep = 0; /* 4.1 engine not running for some odd reason; try a live-seek */ if (current->is_running() != true) { DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): not running!" << endl); eca_jack_sync_start_live_seek_to(jackstate, &jackpos, arg); } /* 4.2 engine running normally */ else { SAMPLE_SPECS::sample_pos_t enginepos = current->engine_repp->current_position_in_samples(); /* 4.2.1 engine at correct position, run the engine cycle */ if (enginepos == jackpos.frame) { if (current->jackslave_seekahead_target_rep != -1) { // report only on the first time DEBUG_CFLOW_STATEMENT(cerr << "eca_jack_process_timebase_slave(): JACK running; correct position\n"); } /* execute engine iteration */ eca_jack_process_engine_iteration(nframes, current); current->jackslave_seekahead_target_rep = -1; need_mute = false; } /* 4.2.2 engine at wrong position for some odd reason; try a live-seek */ else { DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_process_timebase_slave(): engine curpos '" << current->engine_repp->current_position_in_samples() << "' doesn't match JACK curpos '" << jackpos.frame << "'!" << endl); eca_jack_sync_start_live_seek_to(jackstate, &jackpos, arg); } } } if (need_mute == true) { eca_jack_process_mute(nframes, current); } } #endif #ifdef PROFILE_CALLBACK_EXECUTION static void eca_jack_process_profile_pre(void) { profile_callback_timer.start(); DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_PROCESS: entry ----> "); } static void eca_jack_process_profile_post(void) { profile_callback_timer.stop(); DEBUG_CFLOW_STATEMENT(cerr << endl << "eca_jack_PROCESS: process out" << endl); if (profile_callback_timer.last_duration_seconds() > 0.005f) { cerr << "(audioio-jack-manager) event " << profile_callback_timer.event_count(); cerr << ", process() took " << profile_callback_timer.last_duration_seconds() * 1000; cerr << " msecs." << endl; } else { if (profile_callback_timer.event_count() < 5) { cerr << "(audioio-jack-manager) event " << profile_callback_timer.event_count(); cerr << ", process() took " << profile_callback_timer.last_duration_seconds() * 1000; cerr << " msecs." << endl; } } } #endif /* PROFILE_CALLBACK_EXECUTION */ /** * Changes current sampling rate. Callback function registered * to the JACK framework. * * @param nframes new engine sample rate * @param arg pointer to a client supplied structure * * @return zero on success, non-zero on error */ static int eca_jack_srate_cb(jack_nframes_t nframes, void *arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); ECA_LOG_MSG(ECA_LOGGER::user_objects, "[callback] " + current->jackname_rep + ": setting srate to " + kvu_numtostr(nframes)); if (static_cast(nframes) != current->srate_rep) { current->shutdown_request_rep = true; ECA_LOG_MSG(ECA_LOGGER::info, "Unable to adapt to the new samplerate received from JACK, shutting down."); } return 0; } /** * Callback function that is called when the engine * buffersize changes. * * context: J-level-0 * * @param nframes new engine buffer size * @param arg pointer to a client supplied structure * * @return zero on success, non-zero on error */ static int eca_jack_bsize_cb(jack_nframes_t nframes, void *arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); ECA_LOG_MSG(ECA_LOGGER::user_objects, "[callback] " + current->jackname_rep + ": setting buffersize to " + kvu_numtostr(nframes)); if (static_cast(nframes) != current->buffersize()) { // FIXME: leads into a segfault...? current->shutdown_request_rep = true; ECA_LOG_MSG(ECA_LOGGER::info, "Unable to adapt to the new buffersize received from JACK, shutting down."); } return 0; } /** * Shuts down the callback context. Callback function registered * to the JACK framework. * * context: J-level-0 */ static void eca_jack_shutdown_cb(void *arg) { AUDIO_IO_JACK_MANAGER* current = static_cast(arg); ECA_LOG_MSG(ECA_LOGGER::user_objects, "" + current->jackname_rep + ": [callback] jackd shutdown, stopping processing"); current->shutdown_request_rep = true; } /** * Implementations of non-static functions * * context: E-level-0 */ AUDIO_IO_JACK_MANAGER::AUDIO_IO_JACK_MANAGER(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "constructor"); open_rep = false; activated_rep = false; open_clients_rep = 0; last_node_id_rep = 1; jackslave_seekahead_rep = 2; jackslave_seekahead_target_rep = -1; engine_repp = 0; jackname_rep = "ecasound"; pthread_cond_init(&exit_cond_rep, NULL); pthread_mutex_init(&exit_mutex_rep, NULL); pthread_mutex_init(&engine_mod_lock_rep, NULL); mode_rep = AUDIO_IO_JACK_MANAGER::Transport_invalid; shutdown_request_rep = false; cb_allocated_frames_rep = 0; buffersize_rep = 0; } /** * Class destructor. * * context: E-level-0 */ AUDIO_IO_JACK_MANAGER::~AUDIO_IO_JACK_MANAGER(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "destructor"); /* 1. close JACK connection */ if (is_open() == true) close_server_connection(); /* 2. clear input ports */ vector::iterator q = inports_rep.begin(); while(q != inports_rep.end()) { if ((*q)->cb_buffer != 0) { delete[] (*q)->cb_buffer; (*q)->cb_buffer = 0; } delete *q; ++q; } /* 3. clear output ports */ q = inports_rep.begin(); while(q != inports_rep.end()) { if ((*q)->cb_buffer != 0) { delete[] (*q)->cb_buffer; (*q)->cb_buffer = 0; } delete *q; ++q; } /* 4. clear objects */ list::iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { delete *p; ++p; } } /** * context: C-level-1 */ bool AUDIO_IO_JACK_MANAGER::is_managed_type(const AUDIO_IO* aobj) const { // --- DBC_REQUIRE(aobj != 0); // --- if (aobj->name() == "JACK interface") { DBC_CHECK(dynamic_cast(aobj) != 0); return(true); } return false; } /** * context: C-level-1 */ void AUDIO_IO_JACK_MANAGER::register_object(AUDIO_IO* aobj) { // --- DBC_REQUIRE(aobj != 0); DBC_REQUIRE(is_managed_type(aobj) == true); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "register object " + aobj->label()); AUDIO_IO_JACK* jobj = static_cast(aobj); eca_jack_node_t* tmp = new eca_jack_node_t; tmp->aobj = jobj; tmp->origptr = aobj; tmp->client_id = last_node_id_rep; node_list_rep.push_back(tmp); jobj->set_manager(this, tmp->client_id); ++last_node_id_rep; // --- DBC_ENSURE(is_managed_type(aobj) == true); // --- } /** * context: C-level-0 */ int AUDIO_IO_JACK_MANAGER::get_object_id(const AUDIO_IO* aobj) const { // --- DBC_REQUIRE(is_managed_type(aobj) == true); // --- list::const_iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { if ((*p)->origptr == aobj) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "found object id for aobj " + aobj->name() + ": " + kvu_numtostr((*p)->client_id)); return (*p)->client_id; } ++p; } return -1; } /** * context: C-level-0 */ list AUDIO_IO_JACK_MANAGER::get_object_list(void) const { list object_list; list::const_iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { object_list.push_back((*p)->client_id); ++p; } return object_list; } /** * Unregisters object previously registered with register_object() * from the manager. * * @param id unique identifier for managed objects; @see * get_object_id * * context: C-level-0 */ void AUDIO_IO_JACK_MANAGER::unregister_object(int id) { // --- DBC_DECLARE(unsigned int old_total_nodes = node_list_rep.size()); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "unregister object "); list::iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { if ((*p)->client_id == id) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "removing object " + (*p)->aobj->label()); (*p)->aobj->set_manager(0, -1); delete *p; node_list_rep.erase(p); break; } ++p; } // --- DBC_ENSURE(node_list_rep.size() == old_total_nodes - 1); DBC_DECLARE(list ol = get_object_list()); DBC_ENSURE(std::count(ol.begin(), ol.end(), id) == 0); // --- } void AUDIO_IO_JACK_MANAGER::set_transport_mode(enum Operation_mode mode, bool print_trace) { mode_rep = mode; if (print_trace == false) return; switch(mode) { case Transport_none: ECA_LOG_MSG(ECA_LOGGER::info, "JACK transport: send/receive disabled (mode: notransport)"); break; case Transport_receive: ECA_LOG_MSG(ECA_LOGGER::info, "JACK transport: slave, reacting to transport events (mode: recv)"); break; case Transport_send: ECA_LOG_MSG(ECA_LOGGER::info, "JACK transport: master, sending transport events (mode: send)"); break; case Transport_send_receive: ECA_LOG_MSG(ECA_LOGGER::info, "JACK transport: both sending and reacting to transport events (mode: sendrecv)"); break; case Transport_invalid: break; default: ; } } /** * context: E-level-0 */ void AUDIO_IO_JACK_MANAGER::set_parameter(int param, std::string value) { switch(param) { case 1: { jackname_rep = value; ECA_LOG_MSG(ECA_LOGGER::user_objects, "client name set to '" + value + "'."); break; } case 2: { #if ECA_JACK_TRANSPORT_API >= 3 if (value == "notransport" || value == "streaming") { set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_none, true); } else if (value == "send" || value == "master") { set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_send, true); } else if (value == "sendrecv" || value == "slave") { set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_send_receive, true); } else if (value == "recv") { set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_receive, true); } #else set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_none, false); if (value != "notransport") ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: JACK transport support disabled at build time, using 'notransport'."); #endif /* ECA_JACK_TRANSPORT_API */ break; } } } /** * context: E-level-0 */ std::string AUDIO_IO_JACK_MANAGER::get_parameter(int param) const { switch(param) { case 1: { return jackname_rep; } case 2: { switch(mode_rep) { case AUDIO_IO_JACK_MANAGER::Transport_none: return "notransport"; case AUDIO_IO_JACK_MANAGER::Transport_receive: return "recv"; case AUDIO_IO_JACK_MANAGER::Transport_send: return "send"; case AUDIO_IO_JACK_MANAGER::Transport_send_receive: return "sendrecv"; default: return "notransport"; } break; } } return ""; } /** * If transport is stopped, request JACK to seek to * Ecasond's current position. Otherwise let Ecasound seek * to JACK's position. */ void AUDIO_IO_JACK_MANAGER::initial_seek(void) { #if ECA_JACK_TRANSPORT_API >= 3 jack_transport_state_t jackstate; jack_position_t jackpos; jackstate = jack_transport_query(client_repp, &jackpos); if (jackstate == JackTransportStopped && (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive)) { ECA_LOG_MSG(ECA_LOGGER::info, "JACK transport: sending out initial locate to " + kvu_numtostr(engine_repp->current_position_in_seconds_exact(), 3) + "sec"); jack_transport_locate(client_repp, engine_repp->current_position_in_samples()); } #endif } #if ECA_JACK_TRANSPORT_API >= 3 static std::string priv_jack_transport_state_str(jack_transport_state_t state) { switch(state) { case JackTransportStopped: return "STOPPED"; case JackTransportRolling: return "ROLLING"; case JackTransportLooping: return "LOOPING"; case JackTransportStarting: return "STARTING"; default: ; } return std::string(); } static std::string priv_jack_transport_pos_str(jack_position_t *state) { if (state->frame_rate == 0) return std::string(); return kvu_numtostr(static_cast(state->frame) / state->frame_rate, 3) + "sec"; } #endif void AUDIO_IO_JACK_MANAGER::helper_print_transport_state(const std::string& when) const { #if ECA_JACK_TRANSPORT_API >= 3 jack_position_t jpos; jack_transport_state_t jstate; jstate = jack_transport_query(client_repp, &jpos); ECA_LOG_MSG(ECA_LOGGER::info, "JACK transport: at ecasound " + when + " JACK state is " + priv_jack_transport_state_str(jstate) + " (position " + priv_jack_transport_pos_str(&jpos) + ")"); #endif } void AUDIO_IO_JACK_MANAGER::exec_helper_setup_transport(void) { if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_invalid) { /* set default transport mode */ #if ECA_JACK_TRANSPORT_API >= 3 set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_send_receive, true); #else set_transport_mode(AUDIO_IO_JACK_MANAGER::Transport_none, false); #endif } if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_receive) helper_print_transport_state("start"); } void AUDIO_IO_JACK_MANAGER::exec_helper_clean_transport(void) { if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_receive) helper_print_transport_state("stop"); } /** * context: E-level-0 */ int AUDIO_IO_JACK_MANAGER::exec(ECA_ENGINE* engine, ECA_CHAINSETUP* csetup) { int result = 0; ECA_LOG_MSG(ECA_LOGGER::system_objects, "driver exec"); engine_repp = engine; engine->init_engine_state(); exec_helper_setup_transport(); exit_request_rep = false; stop_request_rep = 0; j_stopped_rounds_rep = 0; start_request_rep = 0; activate_server_connection(); if (is_connection_active() != true) { signal_exit(); } initial_seek(); while(true) { DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: wait for commands" << endl); engine_repp->wait_for_commands(); DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: wakes up; commands available" << endl); /* we must take the lock to ensure that * process callback does not run at the same time * * note: the RT-optimized command queue (VALUE_QUEUE_RT_C) is not * safe when accessed from more than 2 threads, but here it is ok * as we limit concurrent threads to two with engine_mod_lock_rep **/ SAMPLE_SPECS::sample_pos_t enginepos = engine_repp->current_position_in_samples(); pthread_mutex_lock(&engine_mod_lock_rep); engine_repp->check_command_queue(); if (exit_request_rep != true && enginepos != engine_repp->current_position_in_samples()) { /* seek requested */ #if ECA_JACK_TRANSPORT_API >= 3 if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive) { if (engine_repp->current_position_in_samples() != jackslave_seekahead_target_rep) { DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: seek requested to pos=" << engine_repp->current_position_in_samples() << "." << endl); jack_transport_locate(client_repp, engine_repp->current_position_in_samples()); } } #endif } pthread_mutex_unlock(&engine_mod_lock_rep); DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: check_commands finished" << endl); /* case 1: external exit request */ if (exit_request_rep == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "exit request in exec"); break; } /* case 2-i: engine finished and in batch mode -> exit */ if (engine_repp->status() == ECA_ENGINE::engine_status_finished && engine_repp->batch_mode() == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "batch finished in exec, exit"); break; } /* case 2-ii: engine error occured -> exit */ else if (engine_repp->status() == ECA_ENGINE::engine_status_error) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "engine error, exit"); break; } /* case 3: problems with jack callbacks -> exit */ if (shutdown_request_rep == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "problems with JACK callbacks"); result = -1; break; } } DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: out of exec" << endl); if (is_connection_active() == true) { deactivate_server_connection(); } exec_helper_clean_transport(); DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: deactivated" << endl); pthread_mutex_lock(&engine_mod_lock_rep); exit_request_rep = 0; engine_repp = 0; pthread_mutex_unlock(&engine_mod_lock_rep); /* signal exit() that we are done */ signal_exit(); DEBUG_CFLOW_STATEMENT(cerr << "jack_exec: exit" << endl); return result; } /** * Activate connection to the JACK server. * * context: E-level-0/3 * Can be called at the same time with * JACK callbacks, so proper locking * must be ensured (engine_mod_lock_rep taken * upon entry). * * @pre is_running() != true * @post is_running() == true * */ void AUDIO_IO_JACK_MANAGER::start(void) { // -- DBC_REQUIRE(is_running() != true); // -- ECA_LOG_MSG(ECA_LOGGER::system_objects, "driver start"); if (engine_repp->is_prepared() != true) engine_repp->prepare_operation(); engine_repp->start_operation(); #if ECA_JACK_TRANSPORT_API >= 3 if (start_request_rep > 0) { start_request_rep = 0; } else { if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive) { jack_transport_start(client_repp); } } j_stopped_rounds_rep = 0; #endif // -- DBC_ENSURE(is_running() == true); // -- } /** * Signals that driver should stop operation. * Once stopped, driver must not call * any ECA_ENGINE functions. * * context: E-level-0/3 * Caller must ensure that JACK process callback * does not run at the same time (engine_mod_lock_rep * taken upon entry). */ void AUDIO_IO_JACK_MANAGER::stop(bool drain) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "driver stop"); #if ECA_JACK_TRANSPORT_API >= 3 if (stop_request_rep > 0) { stop_request_rep = 0; } else { if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive) { jack_transport_stop(client_repp); } } #endif if (engine_repp->is_prepared() == true) engine_repp->stop_operation(drain); } /** * Activates connection to server. * * context: E-level-1 * * @pre is_connection_active() != true */ void AUDIO_IO_JACK_MANAGER::activate_server_connection(void) { // -- DBC_REQUIRE(is_connection_active() != true); // -- if (engine_repp->is_prepared() != true) engine_repp->prepare_operation(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "jack_activate()"); if (jack_activate (client_repp)) { ECA_LOG_MSG(ECA_LOGGER::info, "Error! Cannot active client!"); activated_rep = false; } else { connect_all_nodes(); /* update port-specific latency values */ engine_repp->update_cache_latency_values(); activated_rep = true; } } /** * Disconnects all connected ports and then * deactives the client. * * context: E-level-1 * Caller must ensure that JACK process callback * does not rung at the same time. * * @pre is_connection_active() == true * @post is_connection_active() != true */ void AUDIO_IO_JACK_MANAGER::deactivate_server_connection(void) { // -- DBC_REQUIRE(is_connection_active() == true); // -- if (shutdown_request_rep != true) { /* no need to disconnect as deactivate does that for us */ // disconnect_all_nodes(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "jack_deactivate() "); if (jack_deactivate (client_repp)) { ECA_LOG_MSG(ECA_LOGGER::info, "Error! Cannot deactive client!"); } } if (engine_repp->is_prepared() == true) engine_repp->stop_operation(); activated_rep = false; signal_stop(); // -- DBC_ENSURE(is_connection_active() != true); // -- } /** * Signals that driver should stop operation * and return from its exec() method. * * context: E-level-0/3 * Can be called at the same time with * JACK callbacks, so proper locking * must be ensured (caller must hold * lock against the callbacks). */ void AUDIO_IO_JACK_MANAGER::exit(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "driver exit"); exit_request_rep = true; if (engine_repp->is_prepared() == true) engine_repp->stop_operation(); } /** * Returns a pointer to a 'eca_jack_node_t' structure * matching client 'client_id'. * * @pre list l = get_object_list(); std::count(l.begin(), l.end(), client_id) == 1 * @return non-zero pointer */ AUDIO_IO_JACK_MANAGER::eca_jack_node_t* AUDIO_IO_JACK_MANAGER::get_node(int client_id) { // -- DBC_DECLARE(list ol = get_object_list()); DBC_REQUIRE(std::count(ol.begin(), ol.end(), client_id) == 1); // -- eca_jack_node_t* node = 0; list::iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { if ((*p)->client_id == client_id) { node = *p; break; } ++p; } // -- DBC_ENSURE(node != 0); // -- return node; } /** * Sets up automatic port connection for client_id's port * 'portnum'. When jack client is activated, this port * is automatically connected to port 'portname'. The * direction of the connection is based on audio objects I/O mode * (@see AUDIO_IO::io_mode()). * * @pre list l = get_object_list(); std::count(l.begin(), l.end(), client_id) == 1 * @pre is_open() == true @ @pre portnum > 0 */ void AUDIO_IO_JACK_MANAGER::auto_connect_jack_port(int client_id, int portnum, const string& portname) { // --- DBC_DECLARE(list ol = get_object_list()); DBC_REQUIRE(std::count(ol.begin(), ol.end(), client_id) == 1); DBC_REQUIRE(is_open() == true); DBC_REQUIRE(portnum > 0); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "auto-connect jack ports for client " + kvu_numtostr(client_id)); eca_jack_node_t* node = get_node(client_id); list::const_iterator p = node->ports.begin(); int n = 1; while(p != node->ports.end()) { if (n == portnum) { (*p)->autoconnect_string = portname; break; } ++n; ++p; } } static std::string eca_get_jack_port_item(const char **ports, int item) { int n = 0; while(ports != 0 && ports[n] != 0) { if (n + 1 == item) return string(ports[n]); n++; } return string(""); } /** * Sets up automatic port connections to matching ports of * client 'dst'. * * @pre list l = get_object_list(); std::count(l.begin(), l.end(), client_id) == 1 * @pre is_open() == true @ @pre portnum > 0 */ void AUDIO_IO_JACK_MANAGER::auto_connect_jack_port_client(int client_id, const string& dst, int channels) { // --- DBC_DECLARE(list ol = get_object_list()); DBC_REQUIRE(std::count(ol.begin(), ol.end(), client_id) == 1); DBC_REQUIRE(is_open() == true); DBC_REQUIRE(channels > 0); // --- const char** ports; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Making autoconnection to ports matching: " + dst); eca_jack_node_t* node = get_node(client_id); list::const_iterator p = node->ports.begin(); int n = 1; while(p != node->ports.end()) { if (n <= channels) { ports = 0; if (node->aobj->io_mode() == AUDIO_IO::io_read) { ports = jack_get_ports (client_repp, dst.c_str(), NULL, JackPortIsOutput); } else { ports = jack_get_ports (client_repp, dst.c_str(), NULL, JackPortIsInput); } (*p)->autoconnect_string = eca_get_jack_port_item(ports, n); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Making autoconnection to terminal port: " + (*p)->autoconnect_string + ", channel " + kvu_numtostr(n)); if (ports != NULL) free(ports); } else { break; } ++n; ++p; } } /** * Returns the total latency for ports of client * 'client_id'. If client ports have different latency * values, the worst-case latency is reported. */ long int AUDIO_IO_JACK_MANAGER::client_latency(int client_id) { eca_jack_node_t* node = get_node(client_id); long int latency = -1; list::const_iterator p = node->ports.begin(); while(p != node->ports.end()) { if (latency == -1) { latency = (*p)->total_latency; } else { if (static_cast((*p)->total_latency) > latency) { ECA_LOG_MSG(ECA_LOGGER::info, "warning! port latencies don't match for client " + kvu_numtostr(client_id)); latency = (*p)->total_latency; } } ++p; } return latency; } /** * Registers new JACK port for client 'client_id'. The direction of * the port is based on audio objects I/O mode (@see * AUDIO_IO::io_mode()). If 'portname' is a non-empty string, * the port will be automatically connected to the 'portname' * port once JACK client is activated. * * The final port names are of the form 'clientname:portprefix_N', * where N is 1...max_port. * * @pre list l = get_object_list(); std::count(l.begin(), l.end(), client_id) == 1 * @pre is_open() == true */ void AUDIO_IO_JACK_MANAGER::register_jack_ports(int client_id, int ports, const string& portprefix) { // --- DBC_DECLARE(list ol = get_object_list()); DBC_REQUIRE(std::count(ol.begin(), ol.end(), client_id) == 1); DBC_REQUIRE(is_open() == true); DBC_DECLARE(unsigned int old_port_count_vectors = inports_rep.size() + outports_rep.size()); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "register jack ports for client " + kvu_numtostr(client_id)); eca_jack_node_t* node = get_node(client_id); for(int n = 0; n < ports; n++) { eca_jack_port_data_t* portdata = new eca_jack_port_data_t; portdata->jackport = 0; portdata->autoconnect_string = ""; portdata->total_latency = 0; portdata->cb_buffer = new jack_default_audio_sample_t [cb_allocated_frames_rep]; std::map::iterator it = port_numbers_rep.find(portprefix); if (it == port_numbers_rep.end()) { it = port_numbers_rep.insert(std::make_pair(portprefix, 0)).first; } string tport = portprefix + "_" + kvu_numtostr(++it->second); if (node->aobj->io_mode() == AUDIO_IO::io_read) { portdata->jackport = jack_port_register(client_repp, tport.c_str(), JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); inports_rep.push_back(portdata); } else { portdata->jackport = jack_port_register(client_repp, tport.c_str(), JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); outports_rep.push_back(portdata); } node->ports.push_back(portdata); } // --- DBC_ENSURE(inports_rep.size() + outports_rep.size() == old_port_count_vectors + ports); // --- } /** * Unregisters all JACK ports for client 'client_id'. * * @pre list l = get_object_list(); std::count(l.begin(), l.end(), client_id) == 1 * @pre is_open() == true * @post node->in_ports == 0 && node->out_ports == 0 */ void AUDIO_IO_JACK_MANAGER::unregister_jack_ports(int client_id) { // --- DBC_DECLARE(list ol = get_object_list()); DBC_REQUIRE(std::count(ol.begin(), ol.end(), client_id) == 1); DBC_REQUIRE(is_open() == true); DBC_DECLARE(unsigned int old_node_port_count = get_node(client_id)->ports.size()); DBC_DECLARE(unsigned int old_port_count_vectors = inports_rep.size() + outports_rep.size()); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "unregister all jack ports for client " + kvu_numtostr(client_id)); eca_jack_node_t* node = get_node(client_id); list::iterator p = node->ports.begin(); while(p != node->ports.end()) { /* 1. unregister port from JACK */ if (open_rep == true && (*p)->jackport != 0) { jack_port_unregister(client_repp, (*p)->jackport); } /* 2. delete the port from inports and outports vectors */ vector::iterator q = inports_rep.begin(); while(q != inports_rep.end()) { if (*p == *q) { inports_rep.erase(q); break; } ++q; } q = outports_rep.begin(); while(q != outports_rep.end()) { if (*p == *q) { outports_rep.erase(q); break; } ++q; } /* 3. delete sub-structures */ delete[] (*p)->cb_buffer; (*p)->cb_buffer = 0; /* 4. delete the actual port_data object */ delete *p; ++p; } /* 5. clear the whole node port list */ node->ports.clear(); // --- DBC_ENSURE(node->ports.size() == 0); DBC_ENSURE(inports_rep.size() + outports_rep.size() == old_port_count_vectors - old_node_port_count); // --- } void AUDIO_IO_JACK_MANAGER::open(int client_id) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "open for client " + kvu_numtostr(client_id)); DBC_CHECK(shutdown_request_rep != true); /* only for the first client */ if (is_open() != true) { open_server_connection(); } ++open_clients_rep; } void AUDIO_IO_JACK_MANAGER::close(int client_id) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "close for client " + kvu_numtostr(client_id)); DBC_CHECK(open_clients_rep > 0); /* only for the last client */ if (open_clients_rep == 1) { if (is_open() == true) close_server_connection(); } else ECA_LOG_MSG(ECA_LOGGER::user_objects, "Not yet closing JACK server connection as there are " + kvu_numtostr(open_clients_rep - 1) + " clients still active."); --open_clients_rep; } /** * Returns current buffersize in sample frames. * Always returns 0 if manager is not connected. */ long int AUDIO_IO_JACK_MANAGER::buffersize(void) const { if (is_open() != true) return 0; return buffersize_rep; } bool AUDIO_IO_JACK_MANAGER::is_running(void) const { if (engine_repp != 0) { return engine_repp->is_running(); } return false; } /** * Returns the current JACK engine sample rate. * Always returns 0 if manager is not connected. */ SAMPLE_SPECS::sample_rate_t AUDIO_IO_JACK_MANAGER::samples_per_second(void) const { if (is_open() != true) return 0; return srate_rep; } /** * context: J-E-C-level-3 */ long int AUDIO_IO_JACK_MANAGER::read_samples(int client_id, void* target_buffer, long int samples) { // DEBUG_CFLOW_STATEMENT(cerr << endl << "read_samples:" << client_id); jack_default_audio_sample_t* ptr = static_cast(target_buffer); eca_jack_node_t* node = get_node(client_id); list::const_iterator p = node->ports.begin(); while(p != node->ports.end()) { if ((*p)->cb_buffer != 0) { memcpy(ptr, (*p)->cb_buffer, buffersize_rep * sizeof(jack_default_audio_sample_t)); ptr += buffersize_rep; } ++p; } return buffersize_rep; } /** * context: J-E-C-level-3 */ void AUDIO_IO_JACK_MANAGER::write_samples(int client_id, void* target_buffer, long int samples) { // DEBUG_CFLOW_STATEMENT(cerr << endl << "write_samples:" << client_id); size_t sample_size = sizeof(jack_default_audio_sample_t); long int writesamples = (samples <= buffersize_rep) ? samples : buffersize_rep; jack_default_audio_sample_t* ptr = static_cast(target_buffer); eca_jack_node_t* node = get_node(client_id); list::const_iterator p = node->ports.begin(); while(p != node->ports.end()) { if ((*p)->cb_buffer != 0) { /* note: cb_buffer points to jack_default_audio_sample_t* */ memcpy((*p)->cb_buffer, ptr, writesamples * sample_size); ptr += writesamples; memset((*p)->cb_buffer + writesamples, 0, (buffersize_rep - writesamples) * sample_size); } ++p; } } /** * Opens connection to the JACK server. Sets * is_open() to 'true' if connection is * successfully opened. * * @pre is_open() != true * * context: C-level-1 */ void AUDIO_IO_JACK_MANAGER::open_server_connection(void) { // -- DBC_REQUIRE(is_open() != true); // -- string client_name (jackname_rep); int n; for(n = 0; n < AUDIO_IO_JACK_MANAGER::instance_limit; n++) { client_repp = jack_client_open (client_name.c_str(), JackNullOption, NULL); if (client_repp != 0) break; client_name = jackname_rep + "_" + kvu_numtostr(n + 2); } if (n != AUDIO_IO_JACK_MANAGER::instance_limit) { srate_rep = static_cast(jack_get_sample_rate(client_repp)); /* FIXME: add better control of allocated memory */ cb_allocated_frames_rep = buffersize_rep = static_cast(jack_get_buffer_size(client_repp)); shutdown_request_rep = false; jackslave_seekahead_rep = 4096 / buffersize_rep + 1; /* set callbacks */ jack_set_process_callback(client_repp, eca_jack_process_callback, static_cast(this)); jack_set_sample_rate_callback(client_repp, eca_jack_srate_cb, static_cast(this)); jack_set_buffer_size_callback(client_repp, eca_jack_bsize_cb, static_cast(this)); jack_on_shutdown(client_repp, eca_jack_shutdown_cb, static_cast(this)); #if ECA_JACK_TRANSPORT_API >= 3 if (mode_rep == AUDIO_IO_JACK_MANAGER::Transport_receive || mode_rep == AUDIO_IO_JACK_MANAGER::Transport_send_receive) { jack_set_sync_callback(client_repp, eca_jack_sync_callback, static_cast(this)); } #endif open_rep = true; #ifdef PROFILE_CALLBACK_EXECUTION profile_callback_timer.set_lower_bound_seconds(0.001f); profile_callback_timer.set_upper_bound_seconds(0.005f); #endif ECA_LOG_MSG(ECA_LOGGER::user_objects, "Successfully opened JACK server connection."); } else { ECA_LOG_MSG(ECA_LOGGER::info, "Error! Cannot connect to JACK server!"); open_rep = false; } } /** * Closes connection to the JACK server. * * @pre is_open() == true * @post is_open() != true * * context: C-level-1 */ void AUDIO_IO_JACK_MANAGER::close_server_connection(void) { // -- DBC_REQUIRE(is_open() == true); // -- // FIXME: add proper unregistration // iterate over cids: unregister_jack_ports() jack_client_close (client_repp); shutdown_request_rep = false; open_rep = false; port_numbers_rep.clear(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Successfully closed JACK server connection."); #ifdef PROFILE_CALLBACK_EXECUTION cerr << profile_callback_timer.to_string() << endl; #endif // -- DBC_ENSURE(is_open() != true); DBC_REQUIRE(shutdown_request_rep != true); // -- } /** * Fetches total port latency information. * * context: E-level-5 */ void AUDIO_IO_JACK_MANAGER::get_total_port_latency(jack_client_t* client, eca_jack_port_data_t* port, int iomode) { jack_nframes_t latency = 0; #if ECA_JACK_FEATSET >= 1 jack_latency_range_t range; jack_port_get_latency_range(port->jackport, iomode == AUDIO_IO::io_read ? JackCaptureLatency : JackPlaybackLatency, &range); if (range.min != range.max) ECA_LOG_MSG(ECA_LOGGER::user_objects, "jack_port_get_latency_range mix=" + kvu_numtostr(range.min) + ", max=" + kvu_numtostr(range.max)); latency = range.min; #else latency = jack_port_get_total_latency(client, port->jackport); #endif port->total_latency = latency; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Total latency for port '" + string(jack_port_name(port->jackport)) + "' is " + kvu_numtostr(port->total_latency) + "."); } /** * Connects ports of node 'node'. * * @param node pointers to a node object * @param connect whether to connect (true) or disconnect (false) * * context: E-level-4 */ void AUDIO_IO_JACK_MANAGER::set_node_connection(eca_jack_node_t* node, bool connect) { list::iterator p = node->ports.begin(); while(p != node->ports.end()) { if ((*p)->cb_buffer != 0) { string ecaport = (*p)->autoconnect_string; if (ecaport.size() > 0) { string jackport (jack_port_name((*p)->jackport)); const string* fromport = &ecaport; const string* toport = &jackport; if (node->aobj->io_mode() != AUDIO_IO::io_read) { /* output object -> switch direction */ fromport = &jackport; toport = &ecaport; } if (connect == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Connecting JACK port " + *fromport + " to " + *toport); if (jack_connect (client_repp, fromport->c_str(), toport->c_str())) { ECA_LOG_MSG(ECA_LOGGER::info, "Error! Cannot make connection " + *fromport + " -> " + *toport + "."); } else { AUDIO_IO_JACK_MANAGER::get_total_port_latency(client_repp, *p, node->aobj->io_mode()); } } else { ECA_LOG_MSG(ECA_LOGGER::system_objects, "jack_port_disconnect()"); /* don't call jack_disconnect() if engine has shut down */ if (jack_disconnect(client_repp, fromport->c_str(), toport->c_str())) { ECA_LOG_MSG(ECA_LOGGER::info, "Error! Cannot disconnect " + *fromport + " -> " + *toport + "."); } } } } ++p; } } /** * Connects ports of all registered nodes. * * @see set_node_connection() * * context: E-level-3 */ void AUDIO_IO_JACK_MANAGER::connect_all_nodes(void) { if (shutdown_request_rep != true) { list::iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { set_node_connection(*p, true); ++p; } } else { if (is_open() == true) close_server_connection(); } } /** * Disconnects all ports of registered nodes. * * @see set_node_connection() * * context: E-level-3 */ void AUDIO_IO_JACK_MANAGER::disconnect_all_nodes(void) { list::iterator p = node_list_rep.begin(); while(p != node_list_rep.end()) { set_node_connection(*p, false); ++p; } } /** * Signals that exec() has exited. * * @see wait_for_exit(); * * context: E-level-1 */ void AUDIO_IO_JACK_MANAGER::signal_exit(void) { pthread_mutex_lock(&exit_mutex_rep); pthread_cond_signal(&exit_cond_rep); pthread_mutex_unlock(&exit_mutex_rep); } /** * Waits until exec() has exited. * * context: not in use */ void AUDIO_IO_JACK_MANAGER::wait_for_exit(void) { int ret = kvu_pthread_timed_wait(&exit_mutex_rep, &exit_cond_rep, 5); ECA_LOG_MSG(ECA_LOGGER::info, kvu_pthread_timed_wait_result(ret, "(audioio_jack_manager) wait_for_exit")); } /** * Signals that client has stopped. * * @see wait_for_stop() * * context: E-level-2 */ void AUDIO_IO_JACK_MANAGER::signal_stop(void) { pthread_mutex_lock(&exit_mutex_rep); pthread_cond_signal(&exit_cond_rep); pthread_mutex_unlock(&exit_mutex_rep); } /** * Waits until client has stopped (no more callbacks). * * context: not in use */ void AUDIO_IO_JACK_MANAGER::wait_for_stop(void) { int ret = kvu_pthread_timed_wait(&stop_mutex_rep, &stop_cond_rep, 5); ECA_LOG_MSG(ECA_LOGGER::info, kvu_pthread_timed_wait_result(ret, "(audioio_jack_manager) wait_for_stop")); } ecasound-2.9.3/libecasound/plugins/audioio_alsa.cpp0000644000076400007640000005701113501261125017365 00000000000000// ------------------------------------------------------------------------ // audioio-alsa.cpp: ALSA PCM input and output // Copyright (C) 1999-2004,2008,2019 Kai Vehmanen // Copyright (C) 2001,2002 Jeremy Hall // // Attributes: // eca-style-version: 3 // // References: // http://alsa-project.org/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #define MY_SND_LIB_VERSION(maj,min,sub) \ ((maj<<16)| (min<<8)| sub) /* error if alsa-lib older than 0.9.0, use old API if 0.9.0->0.9.8, otherwise do nothing */ #if SND_LIB_MAJOR < 1 && SND_LIB_MINOR == 9 #if SND_LIB_SUBMINOR > 0 || SND_LIB_EXTRAVER >= 100004 #define ALSA_PCM_NEW_HW_PARAMS_API #define ALSA_PCM_NEW_SW_PARAMS_API #else #error "Unable to compile ALSA-support. Alsa-lib version 0.9.0rc4 or newer is required!" #endif #endif #include /* Linux-kernel specific errnos */ #ifndef ESTRPIPE #define ESTRPIPE 86 #endif #include #include #include #include #include #include "samplebuffer.h" #include "audioio-device.h" #include "audioio_alsa.h" #include "eca-version.h" #include "eca-error.h" #include "eca-logger.h" using std::cerr; using std::endl; #ifndef timersub #define timersub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ if ((result)->tv_usec < 0) { \ --(result)->tv_sec; \ (result)->tv_usec += 1000000; \ } \ } while (0) #endif #ifndef timermsub #define timermsub(a, b, result) \ do { \ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ (result)->tv_nsec = (a)->tv_nsec - (b)->tv_nsec; \ if ((result)->tv_nsec < 0) { \ --(result)->tv_sec; \ (result)->tv_nsec += 1000000000; \ } \ } while (0) #endif const string AUDIO_IO_ALSA_PCM::default_pcm_device_rep = "default"; AUDIO_IO_ALSA_PCM::AUDIO_IO_ALSA_PCM (int card, int device, int subdevice) : AUDIO_IO_DEVICE() { // ECA_LOG_MSG(ECA_LOGGER::system_objects, "construct"); card_number_rep = card; device_number_rep = device; subdevice_number_rep = subdevice; trigger_request_rep = false; overruns_rep = underruns_rep = 0; nbufs_repp = 0; allocate_structs(); } AUDIO_IO_ALSA_PCM::~AUDIO_IO_ALSA_PCM(void) { if (is_open() == true && is_running()) stop(); if (is_open() == true) { close(); } if (io_mode() != io_read) { if (underruns_rep != 0) { cerr << "WARNING! While writing to ALSA-pcm device "; cerr << "C" << card_number_rep << "D" << device_number_rep; cerr << ", there were " << underruns_rep << " underruns.\n"; } } else { if (overruns_rep != 0) { cerr << "WARNING! While reading from ALSA-pcm device "; cerr << "C" << card_number_rep << "D" << device_number_rep; cerr << ", there were " << overruns_rep << " overruns.\n"; } } if (nbufs_repp != 0) delete nbufs_repp; deallocate_structs(); } AUDIO_IO_ALSA_PCM* AUDIO_IO_ALSA_PCM::clone(void) const { AUDIO_IO_ALSA_PCM* target = new AUDIO_IO_ALSA_PCM(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIO_IO_ALSA_PCM::allocate_structs(void) { int err = snd_pcm_hw_params_malloc(&pcm_hw_params_repp); DBC_CHECK(!err); err = snd_pcm_sw_params_malloc(&pcm_sw_params_repp); DBC_CHECK(!err); } void AUDIO_IO_ALSA_PCM::deallocate_structs(void) { snd_pcm_hw_params_free(pcm_hw_params_repp); snd_pcm_sw_params_free(pcm_sw_params_repp); } void AUDIO_IO_ALSA_PCM::open_device(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "open"); // ------------------------------------------------------------------- // Device name initialization string device_name = pcm_device_name(); // ------------------------------------------------------------------- // Open devices int err; if (io_mode() == io_read) { pcm_stream_rep = SND_PCM_STREAM_CAPTURE; err = snd_pcm_open(&audio_fd_repp, (char*)device_name.c_str(), pcm_stream_rep, SND_PCM_NONBLOCK); if (err < 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-ALSA: Unable to open ALSA--device for capture; error: " + string(snd_strerror(err)))); } } else if (io_mode() == io_write) { pcm_stream_rep = SND_PCM_STREAM_PLAYBACK; err = snd_pcm_open(&audio_fd_repp, (char*)device_name.c_str(), pcm_stream_rep, SND_PCM_NONBLOCK); if (err < 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-ALSA: Unable to open ALSA-device for playback; error: " + string(snd_strerror(err)))); } } else if (io_mode() == io_readwrite) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-ALSA: Simultaneous input/output not supported.")); } // ------------------------------------------------------------------- // enables blocking mode snd_pcm_nonblock(audio_fd_repp, 0); } void AUDIO_IO_ALSA_PCM::set_audio_format_params(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "set_audio_format_params"); format_rep = SND_PCM_FORMAT_LAST; switch(sample_format()) { case ECA_AUDIO_FORMAT::sfmt_u8: { format_rep = SND_PCM_FORMAT_U8; break; } case ECA_AUDIO_FORMAT::sfmt_s8: { format_rep = SND_PCM_FORMAT_S8; break; } case ECA_AUDIO_FORMAT::sfmt_s16_le: { format_rep = SND_PCM_FORMAT_S16_LE; break; } case ECA_AUDIO_FORMAT::sfmt_s16_be: { format_rep = SND_PCM_FORMAT_S16_BE; break; } case ECA_AUDIO_FORMAT::sfmt_s24_le: { format_rep = SND_PCM_FORMAT_S24_3LE; break; } case ECA_AUDIO_FORMAT::sfmt_s24_be: { format_rep = SND_PCM_FORMAT_S24_3BE; break; } case ECA_AUDIO_FORMAT::sfmt_s32_le: { format_rep = SND_PCM_FORMAT_S32_LE; break; } case ECA_AUDIO_FORMAT::sfmt_s32_be: { format_rep = SND_PCM_FORMAT_S32_BE; break; } default: { throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-ALSA: Error when setting audio format not supported (1)")); } } } void AUDIO_IO_ALSA_PCM::print_pcm_info(void) { } void AUDIO_IO_ALSA_PCM::fill_and_set_hw_params(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "fill_and_set_hw_params"); /* 1. create one param combination */ int err = snd_pcm_hw_params_any(audio_fd_repp, pcm_hw_params_repp); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up hwparams/any: " + string(snd_strerror(err)))); /* 2. set interleaving mode */ if (interleaved_channels() == true) ECA_LOG_MSG(ECA_LOGGER::user_objects, "Using interleaved stream format."); else ECA_LOG_MSG(ECA_LOGGER::user_objects, "Using noninterleaved stream format."); if (interleaved_channels() == true) err = snd_pcm_hw_params_set_access(audio_fd_repp, pcm_hw_params_repp, SND_PCM_ACCESS_RW_INTERLEAVED); else err = snd_pcm_hw_params_set_access(audio_fd_repp, pcm_hw_params_repp, SND_PCM_ACCESS_RW_NONINTERLEAVED); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up hwparams/access: " + string(snd_strerror(err)))); /* 3. set sample format */ err = snd_pcm_hw_params_set_format(audio_fd_repp, pcm_hw_params_repp, format_rep); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-ALSA: Audio format not supported.")); /* 4. set channel count */ err = snd_pcm_hw_params_set_channels(audio_fd_repp, pcm_hw_params_repp, channels()); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::channels, "AUDIOIO-ALSA: Channel count " + kvu_numtostr(channels()) + " is out of range!")); /* 5. set sampling rate */ unsigned int uivalue = samples_per_second(); err = snd_pcm_hw_params_set_rate_near(audio_fd_repp, pcm_hw_params_repp, &uivalue, 0); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::sample_rate, "AUDIOIO-ALSA: Sample rate " + kvu_numtostr(samples_per_second()) + " is out of range!")); if (static_cast(uivalue) != samples_per_second()) { ECA_LOG_MSG(ECA_LOGGER::info, "exact sampling rate not supported, adjust from " + kvu_numtostr(samples_per_second()) + " to " + kvu_numtostr(uivalue)); set_samples_per_second(uivalue); } /* 6. create buffers for noninterleaved i/o */ if (interleaved_channels() != true) { if (nbufs_repp == 0) nbufs_repp = new unsigned char* [channels()]; } snd_pcm_uframes_t fvalue = buffersize(); /* 7. sets period size (period = one fragment) */ err = snd_pcm_hw_params_set_period_size_near(audio_fd_repp, pcm_hw_params_repp, &fvalue, 0); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::buffersize, "AUDIOIO-ALSA: buffersize " + kvu_numtostr(buffersize()) + " is out of range!")); /* 8. sets buffer size */ if (max_buffers() == true) { snd_pcm_uframes_t bufferreq = buffersize() * 1024; err = snd_pcm_hw_params_set_buffer_size_near(audio_fd_repp, pcm_hw_params_repp, &bufferreq); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up hwparams/btime (1): " + string(snd_strerror(err)))); } else { snd_pcm_uframes_t bufferreq = buffersize() * 3; err = snd_pcm_hw_params_set_buffer_size_near(audio_fd_repp, pcm_hw_params_repp, &bufferreq); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up hwparams/btime (2): " + string(snd_strerror(err)))); } /* 9. print debug information */ snd_pcm_hw_params_get_period_time(pcm_hw_params_repp, &uivalue, 0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "period time set to " + kvu_numtostr(uivalue) + " usecs."); snd_pcm_hw_params_get_period_size(pcm_hw_params_repp, &period_size_rep, 0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "period time set to " + kvu_numtostr(period_size_rep) + " frames."); if (period_size_rep != static_cast(buffersize())) { ECA_LOG_MSG(ECA_LOGGER::info, "Warning! Period-size differs from current client buffersize."); } snd_pcm_hw_params_get_buffer_time(pcm_hw_params_repp, &uivalue, 0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "buffer time set to " + kvu_numtostr(uivalue) + " usecs."); snd_pcm_hw_params_get_buffer_size(pcm_hw_params_repp, &buffer_size_rep); ECA_LOG_MSG(ECA_LOGGER::system_objects, "buffer time set to " + kvu_numtostr(buffer_size_rep) + " frames."); ECA_LOG_MSG(ECA_LOGGER::system_objects, "total latency is " + kvu_numtostr(latency()) + " frames."); /* 9. all set, now active hw params */ err = snd_pcm_hw_params(audio_fd_repp, pcm_hw_params_repp); if (err < 0) { throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up hwparams: " + string(snd_strerror(err)))); } } void AUDIO_IO_ALSA_PCM::fill_and_set_sw_params(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "fill_and_set_sw_params"); /* 1. get current params */ snd_pcm_sw_params_current(audio_fd_repp, pcm_sw_params_repp); /* 2. set start threshold (should be big enough so that processing won't start until a explicit snd_pcm_start() is issued */ int err = snd_pcm_sw_params_set_start_threshold(audio_fd_repp, pcm_sw_params_repp, buffer_size_rep * 2); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up pcm_sw_params/start_threshold: " + string(snd_strerror(err)))); #if SND_LIB_VERSION <= MY_SND_LIB_VERSION(1,0,15) /* note: deprecated in alsa-lib-1.0.16 (2008/Feb) */ /* 3. set align to one frame (like the OSS-emulation layer) */ err = snd_pcm_sw_params_set_xfer_align(audio_fd_repp, pcm_sw_params_repp, 1); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up pcm_sw_params_repp/xfer_align: " + string(snd_strerror(err)))); #endif /* 4. set tstamp mode */ err = snd_pcm_sw_params_set_tstamp_mode(audio_fd_repp, pcm_sw_params_repp, SND_PCM_TSTAMP_ENABLE); if (err < 0) { ECA_LOG_MSG(ECA_LOGGER::info, "audio device does not support timestamp mode, unable to report accurate xrun duration info"); } #ifdef HAVE_SND_PCM_SW_PARAMS_SET_TSTAMP_TYPE else { err = snd_pcm_sw_params_set_tstamp_type(audio_fd_repp, pcm_sw_params_repp, SND_PCM_TSTAMP_TYPE_MONOTONIC); } #endif /* 5. activate params */ err = snd_pcm_sw_params(audio_fd_repp, pcm_sw_params_repp); if (err < 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ALSA: Error when setting up pcm_sw_params_repp: " + string(snd_strerror(err)))); } void AUDIO_IO_ALSA_PCM::open(void) throw(AUDIO_IO::SETUP_ERROR&) { open_device(); set_audio_format_params(); fill_and_set_hw_params(); print_pcm_info(); fill_and_set_sw_params(); AUDIO_IO_DEVICE::open(); } void AUDIO_IO_ALSA_PCM::stop(bool drain) { if (drain == true && io_mode() != io_read) { /* * The sw-params combination: * "silence-threshold==0 && silence-size>=boundary" * ... is a API special case to request silencing all * processed frames. This will ensure no stale data is * played out at the end of drain. */ snd_pcm_uframes_t boundary; snd_pcm_sw_params_get_boundary(pcm_sw_params_repp, &boundary); snd_pcm_sw_params_set_silence_threshold(audio_fd_repp, pcm_sw_params_repp, 0); snd_pcm_sw_params_set_silence_size(audio_fd_repp, pcm_sw_params_repp, boundary); snd_pcm_sw_params(audio_fd_repp, pcm_sw_params_repp); ECA_LOG_MSG(ECA_LOGGER::user_objects, "drain - start / " + label()); snd_pcm_drain(audio_fd_repp); /* blocking */ ECA_LOG_MSG(ECA_LOGGER::user_objects, "drain complete / " + label()); } else { snd_pcm_drop(audio_fd_repp); /* non-blocking */ } ECA_LOG_MSG(ECA_LOGGER::user_objects, "stop - " + label() + "."); AUDIO_IO_DEVICE::stop(); } void AUDIO_IO_ALSA_PCM::close(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "close - " + label() + "."); if (is_prepared() == true && is_running() == true) stop(); snd_pcm_close(audio_fd_repp); AUDIO_IO_DEVICE::close(); } void AUDIO_IO_ALSA_PCM::prepare(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "prepare - " + label() + "."); int err = snd_pcm_prepare(audio_fd_repp); if (err < 0) ECA_LOG_MSG(ECA_LOGGER::info, "Error when preparing stream: " + string(snd_strerror(err))); AUDIO_IO_DEVICE::prepare(); } void AUDIO_IO_ALSA_PCM::start(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "start - " + label() + "."); snd_pcm_start(audio_fd_repp); AUDIO_IO_DEVICE::start(); } long int AUDIO_IO_ALSA_PCM::read_samples(void* target_buffer, long int samples) { // -- DBC_REQUIRE(samples <= buffersize()); // -- long int realsamples = 0; if (interleaved_channels() == true) { realsamples = snd_pcm_readi(audio_fd_repp, target_buffer, buffersize()); if (realsamples < 0) { /* Note! ALSA versions <=0.9.1 sometimes return -EIO in xrun-state; * EPIPE=xrun, ESTRPIPE=xrun) */ if (realsamples == -EPIPE || realsamples == -ESTRPIPE || realsamples == -EIO) { if (ignore_xruns() == true) { handle_xrun_capture(); realsamples = snd_pcm_readi(audio_fd_repp, target_buffer, buffersize()); if (realsamples < 0) realsamples = 0; } else { cerr << "ALSA: Overrun! Stopping operation!" << endl; stop(); close(); } } else { cerr << "ALSA: Read error (" << realsamples << ")! Stopping operation." << endl; stop(); close(); } } } else { unsigned char* ptr_to_channel = reinterpret_cast(target_buffer); for (int channel = 0; channel < channels(); channel++) { nbufs_repp[channel] = ptr_to_channel; ptr_to_channel += samples * sample_size(); } realsamples = snd_pcm_readn(audio_fd_repp, reinterpret_cast(target_buffer), buffersize()); if (realsamples < 0) { /* Note! ALSA versions <=0.9.1 sometimes return -EIO in xrun-state; * EPIPE=xrun, ESTRPIPE=xrun) */ if (realsamples == -EPIPE || realsamples == -ESTRPIPE || realsamples == -EIO) { if (ignore_xruns() == true) { handle_xrun_capture(); realsamples = snd_pcm_readn(audio_fd_repp, reinterpret_cast(target_buffer), buffersize()); if (realsamples < 0) realsamples = 0; } else { cerr << "ALSA: Overrun! Stopping operation!" << endl; stop(); close(); } } else { cerr << "ALSA: Read error! Stopping operation." << endl; stop(); close(); } } } return realsamples; } void AUDIO_IO_ALSA_PCM::handle_xrun_capture(void) { snd_pcm_status_t *status; snd_pcm_status_alloca(&status); int res = snd_pcm_status(audio_fd_repp, status); if (res >= 0) { snd_pcm_state_t state = snd_pcm_status_get_state(status); if (state == SND_PCM_STATE_XRUN) { cerr << "WARNING: ALSA recording overrun, some audio samples were lost!"; handle_xrun_print_gap_duration(status); overruns_rep++; stop(); prepare(); start(); } else if (state == SND_PCM_STATE_SUSPENDED) { cerr << "ALSA: Device suspended! Stopping operation!" << endl; stop(); close(); } else { cerr << "ALSA: Unknown device state '" << static_cast(state) << "'" << endl; } } else { ECA_LOG_MSG(ECA_LOGGER::info, "snd_pcm_status() failed!"); } } void AUDIO_IO_ALSA_PCM::write_samples(void* target_buffer, long int samples) { if (trigger_request_rep == true) { trigger_request_rep = false; start(); } if (interleaved_channels() == true) { long int count = snd_pcm_writei(audio_fd_repp, target_buffer, samples); if (count < 0) { /* Note! ALSA versions <=0.9.1 sometimes return -EIO in xrun-state; * EPIPE=xrun, ESTRPIPE=xrun) */ DBC_CHECK(count != -EINTR); if (count == -EPIPE || count == -EIO || count == -ESTRPIPE) { if (ignore_xruns() == true) { handle_xrun_playback(); if (snd_pcm_writei(audio_fd_repp, target_buffer, samples) < 0) cerr << "ALSA: playback xrun handling failed!" << endl; trigger_request_rep = true; } else { cerr << "ALSA: Overrun! Stopping operation!" << endl; stop(); close(); } } else { cerr << "ALSA: Write error! Stopping operation (" << count << ")." << endl; stop(); close(); } } } else { unsigned char* ptr_to_channel = reinterpret_cast(target_buffer); for (int channel = 0; channel < channels(); channel++) { nbufs_repp[channel] = ptr_to_channel; // cerr << "Pointer to channel " << channel << ": " << reinterpret_cast(nbufs_repp[channel]) << endl; ptr_to_channel += samples * sample_size(); // cerr << "Advancing pointer count by " << samples * sample_size() << " to " << reinterpret_cast(ptr_to_channel) << endl; } long int count = snd_pcm_writen(audio_fd_repp, reinterpret_cast(nbufs_repp), samples); if (count < 0) { /* Note! ALSA versions <=0.9.1 sometimes return -EIO in xrun-state; * EPIPE=xrun, ESTRPIPE=xrun) */ DBC_CHECK(count != -EINTR); if (count == -EPIPE || count == -EIO || count == -ESTRPIPE) { if (ignore_xruns() == true) { handle_xrun_playback(); snd_pcm_writen(audio_fd_repp, reinterpret_cast(nbufs_repp), samples); trigger_request_rep = true; } else { cerr << "ALSA: Overrun! Stopping operation!" << endl; stop(); close(); } } else { cerr << "ALSA: Write error! Stopping operation." << endl; stop(); close(); } } } } void AUDIO_IO_ALSA_PCM::handle_xrun_print_gap_duration(snd_pcm_status_t *status) { snd_pcm_tstamp_t tstamp_type = SND_PCM_TSTAMP_NONE; snd_timestamp_t tstamp; double seconds = 0; snd_pcm_sw_params_get_tstamp_mode(pcm_sw_params_repp, &tstamp_type); if (tstamp_type == SND_PCM_TSTAMP_ENABLE) { snd_pcm_status_get_trigger_tstamp(status, &tstamp); #ifdef HAVE_CLOCK_GETTIME int monotonic = snd_pcm_hw_params_is_monotonic(pcm_hw_params_repp); if (monotonic) { struct timespec now, diff; struct timespec *tstamp_ptr = reinterpret_cast(&tstamp); clock_gettime(CLOCK_MONOTONIC, &now); timermsub(&now, tstamp_ptr, &diff); seconds = diff.tv_sec * 1000 + diff.tv_nsec / 1000000.0; } else #endif { struct timeval now, diff; struct timeval *tstamp_ptr = static_cast(&tstamp); gettimeofday(&now, 0); timersub(&now, tstamp_ptr, &diff); seconds = diff.tv_sec * 1000 + diff.tv_usec / 1000.0; } cerr << " Break was at least " << kvu_numtostr(seconds) << " ms long." << endl; } } void AUDIO_IO_ALSA_PCM::handle_xrun_playback(void) { snd_pcm_status_t *status; snd_pcm_status_alloca(&status); int res = snd_pcm_status(audio_fd_repp, status); if (res >= 0) { snd_pcm_state_t state = snd_pcm_status_get_state(status); if (state == SND_PCM_STATE_XRUN) { cerr << "WARNING: ALSA playback underrun, glitches in audio playback possible!"; handle_xrun_print_gap_duration(status); underruns_rep++; stop(); prepare(); trigger_request_rep = true; } else if (state == SND_PCM_STATE_SUSPENDED) { cerr << "ALSA: Device suspended! Stopping operation!" << endl; stop(); close(); } else { cerr << "ALSA: Unknown device state '" << static_cast(state) << "'" << endl; } } else { ECA_LOG_MSG(ECA_LOGGER::info, "snd_pcm_status() failed!"); } } long int AUDIO_IO_ALSA_PCM::delay(void) const { snd_pcm_sframes_t delay = 0; if (is_running() == true) { if (snd_pcm_delay(audio_fd_repp, &delay) != 0) { delay = 0; } } return static_cast(delay); } void AUDIO_IO_ALSA_PCM::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); if (label().find("alsaplugin") != string::npos) { using_plugin_rep = true; } break; case 2: card_number_rep = atoi(value.c_str()); break; case 3: device_number_rep = atoi(value.c_str()); break; case 4: subdevice_number_rep = atoi(value.c_str()); break; } if (using_plugin_rep) pcm_device_name_rep = string("plughw:") + kvu_numtostr(card_number_rep) + "," + kvu_numtostr(device_number_rep) + "," + kvu_numtostr(subdevice_number_rep); else pcm_device_name_rep = string("hw:") + kvu_numtostr(card_number_rep) + "," + kvu_numtostr(device_number_rep) + "," + kvu_numtostr(subdevice_number_rep); } string AUDIO_IO_ALSA_PCM::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return kvu_numtostr(card_number_rep); case 3: return kvu_numtostr(device_number_rep); case 4: return kvu_numtostr(subdevice_number_rep); } return ""; } void AUDIO_IO_ALSA_PCM::set_pcm_device_name(const string& n) { if (n.size() > 0) pcm_device_name_rep = n; else pcm_device_name_rep = default_pcm_device_rep; } ecasound-2.9.3/libecasound/plugins/audioio_alsa_named.h0000644000076400007640000000212210664032032020167 00000000000000#ifndef INCLUDED_AUDIO_IO_ALSA_PCM_NAMED_H #define INCLUDED_AUDIO_IO_ALSA_PCM_NAMED_H #include "audioio_alsa.h" /** * Class for handling named ALSA pcm-devices (Advanced Linux * Sound Architecture). */ class AUDIO_IO_ALSA_PCM_NAMED : public AUDIO_IO_ALSA_PCM { public: virtual string name(void) const { return("ALSA named PCM device"); } virtual string description(void) const { return("ALSA named PCM device. Library versions 0.6.x and newer."); } virtual string parameter_names(void) const { return("label,pcm_name"); } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; AUDIO_IO_ALSA_PCM_NAMED (void); virtual ~AUDIO_IO_ALSA_PCM_NAMED(void); AUDIO_IO_ALSA_PCM_NAMED* clone(void) const; AUDIO_IO_ALSA_PCM_NAMED* new_expr(void) const { return new AUDIO_IO_ALSA_PCM_NAMED(); } private: void print_status_debug(void); AUDIO_IO_ALSA_PCM_NAMED (const AUDIO_IO_ALSA_PCM_NAMED& x) { } AUDIO_IO_ALSA_PCM_NAMED& operator=(const AUDIO_IO_ALSA_PCM_NAMED& x) { return *this; } }; #endif /* INCLUDED_AUDIO_IO_ALSA_PCM_NAMED */ ecasound-2.9.3/libecasound/plugins/audioio_jack.cpp0000644000076400007640000002252611742532454017373 00000000000000// ------------------------------------------------------------------------ // audioio-jack.cpp: Interface to JACK audio framework // Copyright (C) 2001-2003,2008,2009,2011,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "audioio.h" #include "eca-version.h" #include "eca-logger.h" #include "samplebuffer.h" #include "audioio_jack.h" #include "audioio_jack_manager.h" #ifdef ECA_ENABLE_AUDIOIO_PLUGINS /* see eca-static-object-maps.cpp */ static const char* audio_io_keyword_const = "jack"; static const char* audio_io_keyword_regex_const = "(^jack$)|(^jack_alsa$)|(^jack_auto$)|(^jack_generic$)"; AUDIO_IO* audio_io_descriptor(void) { return new AUDIO_IO_JACK(); } const char* audio_io_keyword(void) {return audio_io_keyword_const; } const char* audio_io_keyword_regex(void){return audio_io_keyword_regex_const; } int audio_io_interface_version(void) { return ecasound_library_version_current; } #endif AUDIO_IO_JACK::AUDIO_IO_JACK (void) : jackmgr_rep(0), myid_rep(0), error_flag_rep(false) { ECA_LOG_MSG(ECA_LOGGER::functions, "constructor"); } AUDIO_IO_JACK::~AUDIO_IO_JACK(void) { if (is_open() == true && is_running()) stop(); if (is_open() == true) { close(); } } AUDIO_IO_MANAGER* AUDIO_IO_JACK::create_object_manager(void) const { return new AUDIO_IO_JACK_MANAGER(); } void AUDIO_IO_JACK::set_manager(AUDIO_IO_JACK_MANAGER* mgr, int id) { string mgrname = (mgr != 0 ? mgr->name() : "null"); ECA_LOG_MSG(ECA_LOGGER::system_objects, "setting manager to " + mgrname); jackmgr_rep = mgr; myid_rep = id; } void AUDIO_IO_JACK::open(void) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "open"); #ifdef WORDS_BIGENDIAN set_sample_format(ECA_AUDIO_FORMAT::sfmt_f32_be); #else set_sample_format(ECA_AUDIO_FORMAT::sfmt_f32_le); #endif toggle_interleaved_channels(false); if (jackmgr_rep != 0) { string my_in_portname ("in"), my_out_portname ("out"); if (label() == "jack" && params_rep.size() > 2 && params_rep[2].size() > 0) { my_in_portname = my_out_portname = params_rep[2]; } /* note: deprecated interface */ else if (label() == "jack_generic" && params_rep.size() > 1) { my_in_portname = my_out_portname = params_rep[1]; } jackmgr_rep->open(myid_rep); if (jackmgr_rep->is_open() != true) { /* unable to open connection to jackd, exit */ throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-JACK: Unable to open JACK-client")); } if (samples_per_second() != jackmgr_rep->samples_per_second()) { set_samples_per_second(jackmgr_rep->samples_per_second()); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Note! Locking to jackd samplerate " + kvu_numtostr(samples_per_second())); } if (buffersize() != jackmgr_rep->buffersize()) { long int jackd_bsize = jackmgr_rep->buffersize(); jackmgr_rep->close(myid_rep); throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-JACK: Cannot connect open connection! Buffersize " + kvu_numtostr(buffersize()) + " differs from JACK server's buffersize of " + kvu_numtostr(jackd_bsize) + ".")); } /* - check whether channel count needs to be adjusted * (must be done before registering to manager) */ if (label() == "jack_multi") { /* if user has enumerated N JACK ports to connect to, make the ecasound * visible channel count at least N */ int jack_ports = static_cast(params_rep.size() - 1); if (channels() < jack_ports) set_channels(jack_ports); } if (io_mode() == AUDIO_IO::io_read) { jackmgr_rep->register_jack_ports(myid_rep, channels(), my_in_portname); } else { jackmgr_rep->register_jack_ports(myid_rep, channels(), my_out_portname); } /* - make automatic connections */ if (label() == "jack" && params_rep.size() > 1 && params_rep[1].size() > 0) { /* note: if 2nd param given, use it as the client to autoconnect to */ jackmgr_rep->auto_connect_jack_port_client(myid_rep, params_rep[1], channels()); } else if (label() == "jack_multi") { int i; for(i = 0; i < channels(); i++) { if (static_cast(params_rep.size()) > i + 1 && params_rep[i + 1].size() > 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "adding auto connection from " + my_out_portname + "_" + kvu_numtostr(i + 1) + " to " + params_rep[i + 1]); jackmgr_rep->auto_connect_jack_port(myid_rep, i + 1, params_rep[i + 1]); } } } else if (label() == "jack_alsa") { /* note: deprecated feature: 'alsa_pcm' is hidden in the port list returned by jack_get_ports(), but as you can still connect with the direct backend names, we have to keep this code around to be backward compatible */ string in_aconn_portprefix, out_aconn_portprefix; in_aconn_portprefix = "alsa_pcm:capture_"; out_aconn_portprefix = "alsa_pcm:playback_"; for(int n = 0; n < channels(); n++) { if (io_mode() == AUDIO_IO::io_read) { jackmgr_rep->auto_connect_jack_port(myid_rep, n + 1, in_aconn_portprefix + kvu_numtostr(n + 1)); } else { jackmgr_rep->auto_connect_jack_port(myid_rep, n + 1, out_aconn_portprefix + kvu_numtostr(n + 1)); } } } /* note: deprecated interface, plain "jack" should be used now */ else if (label() == "jack_auto" && params_rep.size() > 1 && params_rep[1].size() > 0) { jackmgr_rep->auto_connect_jack_port_client(myid_rep, params_rep[1], channels()); } } AUDIO_IO_DEVICE::open(); } void AUDIO_IO_JACK::close(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "close"); if (jackmgr_rep != 0) { jackmgr_rep->unregister_jack_ports(myid_rep); jackmgr_rep->close(myid_rep); } AUDIO_IO_DEVICE::close(); } bool AUDIO_IO_JACK::finished(void) const { if (is_open() != true || jackmgr_rep == 0 || jackmgr_rep->is_open() != true || error_flag_rep == true) return true; return false; } long int AUDIO_IO_JACK::read_samples(void* target_buffer, long int samples) { if (jackmgr_rep != 0) { DBC_CHECK(samples == jackmgr_rep->buffersize()); long int res = jackmgr_rep->read_samples(myid_rep, target_buffer, samples); return res; } return 0; } void AUDIO_IO_JACK::write_buffer(SAMPLE_BUFFER* sbuf) { /* note: this is reimplemented only to catch errors with unsupported * input streams (e.g. one produces by 'resample' object' */ if (sbuf->length_in_samples() > 0 && sbuf->length_in_samples() != jackmgr_rep->buffersize() && sbuf->event_tag_test(SAMPLE_BUFFER::tag_end_of_stream) != true) { error_flag_rep = true; ECA_LOG_MSG(ECA_LOGGER::errors, "ERROR: Variable size input buffers detected at JACK output, stopping processing. " "This can happen e.g. with a 'resample' input object."); } AUDIO_IO_DEVICE::write_buffer(sbuf); } void AUDIO_IO_JACK::write_samples(void* target_buffer, long int samples) { DBC_CHECK(samples <= jackmgr_rep->buffersize()); if (jackmgr_rep != 0) { jackmgr_rep->write_samples(myid_rep, target_buffer, samples); } } void AUDIO_IO_JACK::prepare(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "prepare / " + label()); error_flag_rep = false; AUDIO_IO_DEVICE::prepare(); } void AUDIO_IO_JACK::start(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "start / " + label()); AUDIO_IO_DEVICE::start(); } void AUDIO_IO_JACK::stop(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "stop / " + label()); AUDIO_IO_DEVICE::stop(); } long int AUDIO_IO_JACK::latency(void) const { return jackmgr_rep == 0 ? 0 : jackmgr_rep->client_latency(myid_rep); } std::string AUDIO_IO_JACK::parameter_names(void) const { if (label() == "jack_generic") return "label,portname"; else if (label() == "jack_auto") return "label,client"; else if (label() == "jack_multi") { string paramlist = "label"; int i; for(i = 0; i < channels(); i++) { paramlist += ",dstport" + kvu_numtostr(i + 1); } return paramlist; } /* jack */ return "jack,client,portprefix"; } void AUDIO_IO_JACK::set_parameter(int param, std::string value) { if (param > static_cast(params_rep.size())) params_rep.resize(param); params_rep[param - 1] = value; if (param == 1) { set_label(value); } } std::string AUDIO_IO_JACK::get_parameter(int param) const { if (param > 0 && param <= static_cast(params_rep.size())) return params_rep[param - 1]; return AUDIO_IO::get_parameter(param); } ecasound-2.9.3/libecasound/plugins/Makefile.am0000644000076400007640000000657612303075645016307 00000000000000# ---------------------------------------------------------------------- # File: ecasound/libecasound/plugins/Makefile.am # Description: Audio I/O implementations that depend on external # libraries # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- AUTOMAKE_OPTIONS = foreign # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- #common_clags = -DECA_ENABLE_AUDIOIO_PLUGINS all_arts_src = audioio_arts.cpp if ECA_AM_COMPILE_ARTS arts_src = $(all_arts_src) arts_target = libaudioio_arts.la else arts_target = endif all_alsa_src = audioio_alsa.cpp audioio_alsa_named.cpp if ECA_AM_COMPILE_ALSA alsa_src = $(all_alsa_src) alsa_target = libaudioio_alsa.la \ libaudioio_alsa_named.la else alsa_target = endif all_af_src = audioio_af.cpp if ECA_AM_COMPILE_AUDIOFILE af_src = $(all_af_src) af_target = libaudioio_af.la else af_target = endif all_sndfile_src = audioio_sndfile.cpp if ECA_AM_COMPILE_SNDFILE sndfile_src = $(all_sndfile_src) sndfile_target = libaudioio_sndfile.la else sndfile_target = endif all_jack_src = audioio_jack.cpp audioio_jack_manager.cpp if ECA_AM_COMPILE_JACK jack_src = $(all_jack_src) jack_target = libaudioio_jack.la else jack_target = endif AM_CPPFLAGS = -I$(srcdir) \ -I$(top_srcdir) \ -I$(top_srcdir)/libecasound \ -I$(top_srcdir)/kvutils \ $(ECA_S_EXTRA_CPPFLAGS) #libdir = $(exec_prefix)/lib/libecasound@LIBECASOUND_VERSION@-plugins # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- plugin_includes = \ audioio_af.h \ audioio_alsa.h \ audioio_alsa_named.h \ audioio_arts.h \ audioio_jack.h \ audioio_jack_manager.h \ audioio_sndfile.h noinst_HEADERS = $(plugin_includes) # ---------------------------------------------------------------------- # build targets and compiler options target defines # ---------------------------------------------------------------------- if ECA_AM_DEBUG_MODE noinst_LTLIBRARIES = libecasound_plugins_debug.la else noinst_LTLIBRARIES = libecasound_plugins.la endif plugin_cond_sources = $(af_src) \ $(alsa_src) \ $(arts_src) \ $(jack_src) \ $(sndfile_src) plugin_all_sources = $(all_af_src) \ $(all_alsa_src) \ $(all_arts_src) \ $(all_jack_src) \ $(all_sndfile_src) # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- libecasound_plugins_la_SOURCES = audioio_dummy.cpp $(plugin_cond_sources) EXTRA_libecasound_plugins_la_SOURCES = $(plugin_all_sources) libecasound_plugins_la_LIBADD = $(ECA_S_EXTRA_LIBS) libecasound_plugins_la_LDFLAGS = -static libecasound_plugins_debug_la_SOURCES = $(libecasound_plugins_la_SOURCES) EXTRA_libecasound_plugins_debug_la_SOURCES = $(EXTRA_libecasound_plugins_la_SOURCES) libecasound_plugins_debug_la_LIBADD = $(libecasound_plugins_la_LIBADD) libecasound_plugins_debug_la_LDFLAGS = $(libecasound_plugins_la_LDFLAGS) # ---------------------------------------------------------------------- # separate rules for compiling non-libtool plugins # ---------------------------------------------------------------------- ecasound-2.9.3/libecasound/plugins/audioio_alsa.h0000644000076400007640000000652513501144621017037 00000000000000#ifndef INCLUDED_AUDIO_IO_ALSA_PCM_H #define INCLUDED_AUDIO_IO_ALSA_PCM_H #include #include #include #include #include #include #include #include "sample-specs.h" #include "samplebuffer.h" #include "audioio-device.h" #include using namespace std; /** * Class for handling ALSA pcm-devices (Advanced Linux Sound Architecture). */ class AUDIO_IO_ALSA_PCM : public AUDIO_IO_DEVICE { public: AUDIO_IO_ALSA_PCM (int card = 0, int device = 0, int subdevice = -1); virtual ~AUDIO_IO_ALSA_PCM(void); AUDIO_IO_ALSA_PCM* clone(void) const; AUDIO_IO_ALSA_PCM* new_expr(void) const { return new AUDIO_IO_ALSA_PCM(); } virtual string name(void) const { return("ALSA PCM device"); } virtual string description(void) const { return("ALSA PCM devices. Alsa-lib versions 0.9.0 and newer."); } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; /** @name Function reimplemented from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return(io_read | io_write); } virtual string parameter_names(void) const { return("label,card,device,subdevice"); } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); /*@}*/ /** @name Function reimplemented from AUDIO_IO_DEVICE */ /*@{*/ virtual void prepare(void); virtual void start(void); virtual void stop(bool drain = false); virtual long int delay(void) const; virtual long int latency(void) const { return(buffersize()); } virtual long int prefill_space(void) const { if (io_mode() != io_read) return(buffer_size_rep); else return(0); } /*@}*/ private: void open_device(void); void allocate_structs(void); void deallocate_structs(void); void set_audio_format_params(void); void fill_and_set_hw_params(void); void fill_and_set_sw_params(void); void print_pcm_info(void); void handle_xrun_print_gap_duration(snd_pcm_status_t *status); void handle_xrun_capture(void); void handle_xrun_playback(void); private: snd_pcm_t *audio_fd_repp; snd_pcm_stream_t pcm_stream_rep; snd_pcm_format_t format_rep; snd_pcm_hw_params_t* pcm_hw_params_repp; snd_pcm_sw_params_t* pcm_sw_params_repp; snd_pcm_uframes_t period_size_rep; /**< current period size return by alsa-lib */ snd_pcm_uframes_t buffer_size_rep; /**< current buffer size return by alsa-lib */ int card_number_rep, device_number_rep, subdevice_number_rep; long underruns_rep, overruns_rep; unsigned char **nbufs_repp; string pcm_device_name_rep; static const string default_pcm_device_rep; bool using_plugin_rep; bool trigger_request_rep; protected: void set_pcm_device_name(const string& n); const string& pcm_device_name(void) const { return(pcm_device_name_rep); } private: AUDIO_IO_ALSA_PCM (const AUDIO_IO_ALSA_PCM& x) { } AUDIO_IO_ALSA_PCM& operator=(const AUDIO_IO_ALSA_PCM& x) { return *this; } }; #ifdef ECA_ENABLE_AUDIOIO_PLUGINS extern "C" { AUDIO_IO* audio_io_descriptor(void); int audio_io_interface_version(void); const char* audio_io_keyword(void); const char* audio_io_keyword_regex(void); }; #endif #endif /* INCLUDED_AUDIO_IO_ALSA_PCM_H */ ecasound-2.9.3/libecasound/plugins/audioio_dummy.cpp0000644000076400007640000000174610664032032017604 00000000000000// ------------------------------------------------------------------------ // audioio_dummy.cpp: Place-holder for libecasound_plugins. // Copyright (C) 2002,2007 Kai Vehmanen // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ int audioio_dummy_integer = 0; ecasound-2.9.3/libecasound/plugins/audioio_jack_manager.h0000644000076400007640000001470311560614025020521 00000000000000#ifndef INCLUDED_AUDIOIO_JACK_MANAGER_H #define INCLUDED_AUDIOIO_JACK_MANAGER_H #include #include #include #include #include #include #include "sample-specs.h" #include "dynamic-object.h" #include "audioio-manager.h" #include "eca-engine-driver.h" #include "audioio_jack.h" class AUDIO_IO; using std::list; using std::string; using std::vector; /** * Manager class for JACK client objects. * * Related design patterns: * - Mediator (GoF273) * * @author Kai Vehmanen */ class AUDIO_IO_JACK_MANAGER : public AUDIO_IO_MANAGER, public ECA_ENGINE_DRIVER { public: friend int eca_jack_process_callback(jack_nframes_t nframes, void *arg); #if ECA_JACK_TRANSPORT_API >= 3 friend int eca_jack_sync_callback(jack_transport_state_t state, jack_position_t *pos, void *arg); friend void eca_jack_sync_start_seek_to(jack_transport_state_t state, jack_position_t *pos, void *arg); friend void eca_jack_sync_start_live_seek_to(jack_transport_state_t state, jack_position_t *pos, void *arg); #endif friend void eca_jack_process_engine_iteration(jack_nframes_t nframes, void *arg); friend void eca_jack_process_mute(jack_nframes_t nframes, void *arg); friend void eca_jack_process_timebase_slave(jack_nframes_t nframes, void *arg); friend int eca_jack_bsize_cb(jack_nframes_t nframes, void *arg); friend int eca_jack_srate_cb(jack_nframes_t nframes, void *arg); friend void eca_jack_shutdown_cb(void *arg); static const int instance_limit; public: typedef struct eca_jack_port_data { jack_port_t* jackport; string autoconnect_string; jack_nframes_t total_latency; jack_default_audio_sample_t* cb_buffer; } eca_jack_port_data_t; typedef struct eca_jack_node { AUDIO_IO_JACK* aobj; AUDIO_IO* origptr; list ports; int client_id; } eca_jack_node_t; private: typedef enum Operation_mode { Transport_none, Transport_receive, Transport_send, Transport_send_receive, Transport_invalid } Operation_mode_t; public: /** @name Constructors */ /*@{*/ AUDIO_IO_JACK_MANAGER(void); virtual ~AUDIO_IO_JACK_MANAGER(void); /*@}*/ /** @name Functions reimplemented from AUDIO_IO_MANAGER */ /*@{*/ virtual bool is_managed_type(const AUDIO_IO* aobj) const; virtual void register_object(AUDIO_IO* aobj); virtual int get_object_id(const AUDIO_IO* aobj) const; virtual list get_object_list(void) const; virtual void unregister_object(int id); /*@}*/ /** @name Functions reimplemented from ECA_OBJECT */ /*@{*/ virtual string name(void) const { return("jack"); } virtual string description(void) const { return("JACK object manager"); } /*@}*/ /** @name Function reimplemented from DYNAMIC_PARAMETERS */ /*@{*/ virtual std::string parameter_names(void) const { return("clientname,mode"); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Function reimplemented from DYNAMIC_OBJECT */ /*@{*/ AUDIO_IO_JACK_MANAGER* clone(void) const { return new_expr(); } AUDIO_IO_JACK_MANAGER* new_expr(void) const { return new AUDIO_IO_JACK_MANAGER(); } /*@}*/ /** @name Functions reimplemented from ECA_ENGINE_DRIVER */ /*@{*/ virtual int exec(ECA_ENGINE* engine, ECA_CHAINSETUP* csetup); virtual void start(void); virtual void stop(bool drain); virtual void exit(void); /*@}*/ /** @name Public API for JACK clients */ /*@{*/ void register_jack_ports(int client_id, int ports, const string& portprefix); void unregister_jack_ports(int client_id); void auto_connect_jack_port(int client_id, int portnum, const string& portname); void auto_connect_jack_port_client(int client_id, const string& dst, int channels); long int client_latency(int client_id); void open(int client_id); void close(int client_id); long int read_samples(int client_id, void* target_buffer, long int samples); void write_samples(int client_id, void* target_buffer, long int samples); bool is_open(void) const { return(open_rep); } bool is_connection_active(void) const { return(activated_rep); } bool is_running(void) const; long int buffersize(void) const; SAMPLE_SPECS::sample_rate_t samples_per_second(void) const; /*@}*/ private: static void get_total_port_latency(jack_client_t* client, eca_jack_port_data_t* ports, int mode); void open_server_connection(void); void close_server_connection(void); void initial_seek(void); void exec_helper_setup_transport(void); void exec_helper_clean_transport(void); void set_transport_mode(enum Operation_mode mode, bool print_trace); void helper_print_transport_state(const std::string& when) const; void activate_server_connection(void); void deactivate_server_connection(void); void set_node_connection(eca_jack_node_t* node, bool connect); void connect_all_nodes(void); void disconnect_all_nodes(void); eca_jack_node_t* get_node(int client_id); void wait_for_exit(void); void signal_exit(void); void wait_for_stop(void); void signal_stop(void); pthread_cond_t exit_cond_rep; pthread_mutex_t exit_mutex_rep; pthread_cond_t stop_cond_rep; pthread_mutex_t stop_mutex_rep; pthread_mutex_t engine_mod_lock_rep; Operation_mode_t mode_rep; bool open_rep; /**< connection established to the JACK server */ bool activated_rep; /**< JACK connection activated */ bool shutdown_request_rep; /**< jack->engine pending shutdown request */ bool exit_request_rep; /**< engine->engine exit request */ int open_clients_rep; /** number of active client nodes */ int last_node_id_rep; int start_request_rep; /**< number of jack->engine start requests pending */ int stop_request_rep; /**< number of jack->engine stop requests pending */ int j_stopped_rounds_rep; /**< number of iterations that JACK state has been stopped; accessed only from proces thread */ list node_list_rep; vector inports_rep; vector outports_rep; std::map port_numbers_rep; /** highest port number used for each prefix */ int jackslave_seekahead_rep; long int jackslave_seekahead_target_rep; ECA_ENGINE* engine_repp; jack_client_t *client_repp; string jackname_rep; /**< client name */ SAMPLE_SPECS::sample_rate_t srate_rep; long int buffersize_rep; long int cb_allocated_frames_rep; }; #endif ecasound-2.9.3/libecasound/plugins/audioio_alsa_named.cpp0000644000076400007640000000465710664032032020541 00000000000000// ------------------------------------------------------------------------ // audioio_alsa_named.cpp: ALSA 0.9.x named PCM-device input/output. // Copyright (C) 2001-2002 Kai Vehmanen // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "audioio_alsa_named.h" #include "eca-error.h" #include "eca-logger.h" #include "eca-version.h" #ifdef ECA_ENABLE_AUDIOIO_PLUGINS static const char* audio_io_keyword_const = "alsa_09"; static const char* audio_io_keyword_regex_const = "^alsa_09$"; const char* audio_io_keyword(void){return(audio_io_keyword_const); } const char* audio_io_keyword_regex(void){return(audio_io_keyword_regex_const); } AUDIO_IO* audio_io_descriptor(void) { return(new AUDIO_IO_ALSA_PCM_NAMED()); } int audio_io_interface_version(void) { return(ecasound_library_version_current); } #endif AUDIO_IO_ALSA_PCM_NAMED::AUDIO_IO_ALSA_PCM_NAMED (void) { set_pcm_device_name(""); } AUDIO_IO_ALSA_PCM_NAMED::~AUDIO_IO_ALSA_PCM_NAMED(void) { } AUDIO_IO_ALSA_PCM_NAMED* AUDIO_IO_ALSA_PCM_NAMED::clone(void) const { AUDIO_IO_ALSA_PCM_NAMED* target = new AUDIO_IO_ALSA_PCM_NAMED(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return(target); } void AUDIO_IO_ALSA_PCM_NAMED::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: set_pcm_device_name(value); break; } } string AUDIO_IO_ALSA_PCM_NAMED::get_parameter(int param) const { switch (param) { case 1: return(label()); case 2: return(pcm_device_name()); } return(""); } ecasound-2.9.3/libecasound/plugins/Makefile.in0000644000076400007640000005533613606336177016325 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/libecasound/plugins/Makefile.am # Description: Audio I/O implementations that depend on external # libraries # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = libecasound/plugins DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libecasound_plugins_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am__libecasound_plugins_la_SOURCES_DIST = audioio_dummy.cpp \ audioio_af.cpp audioio_alsa.cpp audioio_alsa_named.cpp \ audioio_arts.cpp audioio_jack.cpp audioio_jack_manager.cpp \ audioio_sndfile.cpp am__objects_1 = audioio_af.lo @ECA_AM_COMPILE_AUDIOFILE_TRUE@am__objects_2 = $(am__objects_1) am__objects_3 = audioio_alsa.lo audioio_alsa_named.lo @ECA_AM_COMPILE_ALSA_TRUE@am__objects_4 = $(am__objects_3) am__objects_5 = audioio_arts.lo @ECA_AM_COMPILE_ARTS_TRUE@am__objects_6 = $(am__objects_5) am__objects_7 = audioio_jack.lo audioio_jack_manager.lo @ECA_AM_COMPILE_JACK_TRUE@am__objects_8 = $(am__objects_7) am__objects_9 = audioio_sndfile.lo @ECA_AM_COMPILE_SNDFILE_TRUE@am__objects_10 = $(am__objects_9) am__objects_11 = $(am__objects_2) $(am__objects_4) $(am__objects_6) \ $(am__objects_8) $(am__objects_10) am_libecasound_plugins_la_OBJECTS = audioio_dummy.lo $(am__objects_11) libecasound_plugins_la_OBJECTS = $(am_libecasound_plugins_la_OBJECTS) @ECA_AM_DEBUG_MODE_FALSE@am_libecasound_plugins_la_rpath = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) libecasound_plugins_debug_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__libecasound_plugins_debug_la_SOURCES_DIST = audioio_dummy.cpp \ audioio_af.cpp audioio_alsa.cpp audioio_alsa_named.cpp \ audioio_arts.cpp audioio_jack.cpp audioio_jack_manager.cpp \ audioio_sndfile.cpp am__objects_13 = audioio_dummy.lo $(am__objects_11) am_libecasound_plugins_debug_la_OBJECTS = $(am__objects_13) libecasound_plugins_debug_la_OBJECTS = \ $(am_libecasound_plugins_debug_la_OBJECTS) @ECA_AM_DEBUG_MODE_TRUE@am_libecasound_plugins_debug_la_rpath = DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libecasound_plugins_la_SOURCES) \ $(EXTRA_libecasound_plugins_la_SOURCES) \ $(libecasound_plugins_debug_la_SOURCES) \ $(EXTRA_libecasound_plugins_debug_la_SOURCES) DIST_SOURCES = $(am__libecasound_plugins_la_SOURCES_DIST) \ $(EXTRA_libecasound_plugins_la_SOURCES) \ $(am__libecasound_plugins_debug_la_SOURCES_DIST) \ $(EXTRA_libecasound_plugins_debug_la_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = -I$(srcdir) \ -I$(top_srcdir) \ -I$(top_srcdir)/libecasound \ -I$(top_srcdir)/kvutils \ $(ECA_S_EXTRA_CPPFLAGS) AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- #common_clags = -DECA_ENABLE_AUDIOIO_PLUGINS all_arts_src = audioio_arts.cpp @ECA_AM_COMPILE_ARTS_TRUE@arts_src = $(all_arts_src) @ECA_AM_COMPILE_ARTS_FALSE@arts_target = @ECA_AM_COMPILE_ARTS_TRUE@arts_target = libaudioio_arts.la all_alsa_src = audioio_alsa.cpp audioio_alsa_named.cpp @ECA_AM_COMPILE_ALSA_TRUE@alsa_src = $(all_alsa_src) @ECA_AM_COMPILE_ALSA_FALSE@alsa_target = @ECA_AM_COMPILE_ALSA_TRUE@alsa_target = libaudioio_alsa.la \ @ECA_AM_COMPILE_ALSA_TRUE@ libaudioio_alsa_named.la all_af_src = audioio_af.cpp @ECA_AM_COMPILE_AUDIOFILE_TRUE@af_src = $(all_af_src) @ECA_AM_COMPILE_AUDIOFILE_FALSE@af_target = @ECA_AM_COMPILE_AUDIOFILE_TRUE@af_target = libaudioio_af.la all_sndfile_src = audioio_sndfile.cpp @ECA_AM_COMPILE_SNDFILE_TRUE@sndfile_src = $(all_sndfile_src) @ECA_AM_COMPILE_SNDFILE_FALSE@sndfile_target = @ECA_AM_COMPILE_SNDFILE_TRUE@sndfile_target = libaudioio_sndfile.la all_jack_src = audioio_jack.cpp audioio_jack_manager.cpp @ECA_AM_COMPILE_JACK_TRUE@jack_src = $(all_jack_src) @ECA_AM_COMPILE_JACK_FALSE@jack_target = @ECA_AM_COMPILE_JACK_TRUE@jack_target = libaudioio_jack.la #libdir = $(exec_prefix)/lib/libecasound@LIBECASOUND_VERSION@-plugins # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- plugin_includes = \ audioio_af.h \ audioio_alsa.h \ audioio_alsa_named.h \ audioio_arts.h \ audioio_jack.h \ audioio_jack_manager.h \ audioio_sndfile.h noinst_HEADERS = $(plugin_includes) @ECA_AM_DEBUG_MODE_FALSE@noinst_LTLIBRARIES = libecasound_plugins.la # ---------------------------------------------------------------------- # build targets and compiler options target defines # ---------------------------------------------------------------------- @ECA_AM_DEBUG_MODE_TRUE@noinst_LTLIBRARIES = libecasound_plugins_debug.la plugin_cond_sources = $(af_src) \ $(alsa_src) \ $(arts_src) \ $(jack_src) \ $(sndfile_src) plugin_all_sources = $(all_af_src) \ $(all_alsa_src) \ $(all_arts_src) \ $(all_jack_src) \ $(all_sndfile_src) # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- libecasound_plugins_la_SOURCES = audioio_dummy.cpp $(plugin_cond_sources) EXTRA_libecasound_plugins_la_SOURCES = $(plugin_all_sources) libecasound_plugins_la_LIBADD = $(ECA_S_EXTRA_LIBS) libecasound_plugins_la_LDFLAGS = -static libecasound_plugins_debug_la_SOURCES = $(libecasound_plugins_la_SOURCES) EXTRA_libecasound_plugins_debug_la_SOURCES = $(EXTRA_libecasound_plugins_la_SOURCES) libecasound_plugins_debug_la_LIBADD = $(libecasound_plugins_la_LIBADD) libecasound_plugins_debug_la_LDFLAGS = $(libecasound_plugins_la_LDFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libecasound/plugins/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libecasound/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 clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libecasound_plugins.la: $(libecasound_plugins_la_OBJECTS) $(libecasound_plugins_la_DEPENDENCIES) $(CXXLINK) $(am_libecasound_plugins_la_rpath) $(libecasound_plugins_la_LDFLAGS) $(libecasound_plugins_la_OBJECTS) $(libecasound_plugins_la_LIBADD) $(LIBS) libecasound_plugins_debug.la: $(libecasound_plugins_debug_la_OBJECTS) $(libecasound_plugins_debug_la_DEPENDENCIES) $(CXXLINK) $(am_libecasound_plugins_debug_la_rpath) $(libecasound_plugins_debug_la_LDFLAGS) $(libecasound_plugins_debug_la_OBJECTS) $(libecasound_plugins_debug_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_af.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_alsa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_alsa_named.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_arts.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_dummy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_jack.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_jack_manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio_sndfile.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && 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)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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) $(HEADERS) installdirs: 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) 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-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: 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-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-exec \ install-exec-am install-info install-info-am install-man \ 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-info-am # ---------------------------------------------------------------------- # separate rules for compiling non-libtool plugins # ---------------------------------------------------------------------- # 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: ecasound-2.9.3/libecasound/plugins/audioio_arts.h0000644000076400007640000000363610664032032017067 00000000000000#ifndef INCLUDED_AUDIOIO_ARTS_H #define INCLUDED_AUDIOIO_ARTS_H #include #include #include "sample-specs.h" #include "eca-version.h" typedef void *arts_stream_t; /** * Interface for communicating with aRts/MCOP. * @author Kai Vehmanen */ class ARTS_INTERFACE : public AUDIO_IO_DEVICE { public: string name(void) const { return("aRts client"); } string description(void) const { return("aRts client. Audio input and output using aRts server."); } /** @name Function reimplemented from AUDIO_IO */ /*@{*/ virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual int supported_io_modes(void) const { return(io_read | io_write); } virtual bool supports_nonblocking_mode(void) const { return(false); } virtual bool supports_seeking(void) const { return(false); } virtual bool locked_audio_format(void) const { return(false); } /*@}*/ /** @name Function reimplemented from AUDIO_IO_DEVICE */ /*@{*/ virtual void start(void); virtual void stop(void); virtual long int latency(void) const { return(latency_rep); } /*@}*/ ARTS_INTERFACE (const string& name = "arts"); ~ARTS_INTERFACE(void); ARTS_INTERFACE* clone(void) const; ARTS_INTERFACE* new_expr(void) const { return new ARTS_INTERFACE(); } private: ARTS_INTERFACE(const ARTS_INTERFACE& x) { } ARTS_INTERFACE& operator=(const ARTS_INTERFACE& x) { return *this; } arts_stream_t stream_rep; SAMPLE_SPECS::sample_pos_t samples_rep; long int latency_rep; static int ref_rep; }; #ifdef ECA_ENABLE_AUDIOIO_PLUGINS extern "C" { AUDIO_IO* audio_io_descriptor(void) { return(new ARTS_INTERFACE()); } int audio_io_interface_version(void); const char* audio_io_keyword(void); const char* audio_io_keyword_regex(void); }; #endif #endif ecasound-2.9.3/libecasound/plugins/audioio_af.cpp0000644000076400007640000002063411141326077017042 00000000000000// ------------------------------------------------------------------------ // audioio-af.cpp: Interface to SGI audiofile library. // Copyright (C) 1999-2001,2004,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // References: // http://www.68k.org/~michael/audiofile/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include #include "audioio_af.h" #include "samplebuffer.h" #include "eca-version.h" #include "eca-error.h" #include "eca-logger.h" #ifdef ECA_ENABLE_AUDIOIO_PLUGINS static const char* audio_io_keyword_const = "audiofile_aiff_au_snd"; static const char* audio_io_keyword_regex_const = "(aif*$)|(au$)|(snd$)"; const char* audio_io_keyword(void){return audio_io_keyword_const; } const char* audio_io_keyword_regex(void){return audio_io_keyword_regex_const; } int audio_io_interface_version(void) { return ecasound_library_version_current; } #endif using namespace std; AUDIOFILE_INTERFACE::AUDIOFILE_INTERFACE (const string& name) { finished_rep = false; set_label(name); } AUDIOFILE_INTERFACE::~AUDIOFILE_INTERFACE(void) { if (is_open() == true) { close(); } } AUDIOFILE_INTERFACE* AUDIOFILE_INTERFACE::clone(void) const { AUDIOFILE_INTERFACE* target = new AUDIOFILE_INTERFACE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIOFILE_INTERFACE::open(void) throw(AUDIO_IO::SETUP_ERROR&) { string real_filename = label(); if (real_filename == "audiofile") { real_filename = opt_filename_rep; } switch(io_mode()) { case io_read: { ECA_LOG_MSG(ECA_LOGGER::info, "Using audiofile library to open file \"" + real_filename + "\" for reading."); afhandle = ::afOpenFile(real_filename.c_str(), "r", NULL); if (afhandle == AF_NULL_FILEHANDLE) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-AF: Can't open file \"" + real_filename + "\" using libaudiofile.")); } else { set_samples_per_second((long int)::afGetRate(afhandle, AF_DEFAULT_TRACK)); set_channels(::afGetChannels(afhandle, AF_DEFAULT_TRACK)); int sample_format, sample_width; ::afGetSampleFormat(afhandle, AF_DEFAULT_TRACK, &sample_format, &sample_width); string format; switch(sample_format) { case AF_SAMPFMT_TWOSCOMP: { format = "s"; break; } case AF_SAMPFMT_UNSIGNED: { format = "u"; break; } case AF_SAMPFMT_FLOAT: { format = "f"; break; } case AF_SAMPFMT_DOUBLE: { format = "f"; break; } } format += kvu_numtostr(sample_width); // if (afGetByteOrder(afhandle, AF_DEFAULT_TRACK) == AF_BYTEORDER_BIGENDIAN) // format += "_be"; // else // format += "_le"; set_sample_format_string(format); set_length_in_samples(::afGetFrameCount(afhandle, AF_DEFAULT_TRACK)); } break; } case io_write: { ECA_LOG_MSG(ECA_LOGGER::info, "Using audiofile library to open file \"" + real_filename + "\" for writing."); AFfilesetup fsetup; fsetup = afNewFileSetup(); int file_format = -1; string teksti = real_filename; kvu_to_lowercase(teksti); if (strstr(teksti.c_str(),".aiffc") != 0) { file_format = AF_FILE_AIFFC; } else if (strstr(teksti.c_str(),".aifc") != 0) { file_format = AF_FILE_AIFFC; } else if (strstr(teksti.c_str(),".aiff") != 0) { file_format = AF_FILE_AIFF; } else if (strstr(teksti.c_str(),".aif") != 0) { file_format = AF_FILE_AIFF; } else if (strstr(teksti.c_str(),".au") != 0) { file_format = AF_FILE_NEXTSND; } else if (strstr(teksti.c_str(),".snd") != 0) { file_format = AF_FILE_NEXTSND; } else if (strstr(teksti.c_str(),".wav") != 0) { file_format = AF_FILE_WAVE; } else if (strstr(teksti.c_str(),".avr") != 0) { file_format = AF_FILE_AVR; } else { ECA_LOG_MSG(ECA_LOGGER::info, "Warning! Unknown audio format, using raw format instead."); file_format = AF_FILE_RAWDATA; } ::afInitFileFormat(fsetup, file_format); ::afInitChannels(fsetup, AF_DEFAULT_TRACK, channels()); if (format_string()[0] == 'u') ::afInitSampleFormat(fsetup, AF_DEFAULT_TRACK, AF_SAMPFMT_UNSIGNED, bits()); else if (format_string()[0] == 's') ::afInitSampleFormat(fsetup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, bits()); else if (format_string()[0] == 'f') { if (bits() == 32) ::afInitSampleFormat(fsetup, AF_DEFAULT_TRACK, AF_SAMPFMT_FLOAT, bits()); else ::afInitSampleFormat(fsetup, AF_DEFAULT_TRACK, AF_SAMPFMT_DOUBLE, bits()); } ::afInitRate(fsetup, AF_DEFAULT_TRACK, static_cast(samples_per_second())); afhandle = ::afOpenFile(real_filename.c_str(), "w", fsetup); if (afhandle == AF_NULL_FILEHANDLE) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-AF: Can't open file \"" + real_filename + "\" using libaudiofile.")); /* note: as seeking is not supported for outputs, we also reset * position to 0 at open() */ set_position_in_samples(0); break; } case io_readwrite: { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-AF: Simultaneous intput/ouput not supported.")); } } // -- // Get byteorder // -- // if (SAMPLE_BUFFER::is_system_littleendian) // afSetVirtualByteOrder(afhandle, AF_DEFAULT_TRACK, AF_BYTEORDER_LITTLEENDIAN); // else // afSetVirtualByteOrder(afhandle, AF_DEFAULT_TRACK, AF_BYTEORDER_BIGENDIAN); debug_print_type(); AUDIO_IO::open(); } void AUDIOFILE_INTERFACE::close(void) { AUDIO_IO::close(); ::afCloseFile(afhandle); } void AUDIOFILE_INTERFACE::debug_print_type(void) { int temp = ::afGetFileFormat(afhandle, 0); ECA_LOG_MSG(ECA_LOGGER::user_objects, "afFileformat: " + kvu_numtostr(temp) + "."); } bool AUDIOFILE_INTERFACE::finished(void) const { if (finished_rep == true || (io_mode() == io_read && out_position())) return true; return false; } long int AUDIOFILE_INTERFACE::read_samples(void* target_buffer, long int samples) { samples_read = ::afReadFrames(afhandle, AF_DEFAULT_TRACK, target_buffer, samples); finished_rep = (samples_read < samples) ? true : false; return samples_read; } void AUDIOFILE_INTERFACE::write_samples(void* target_buffer, long int samples) { ::afWriteFrames(afhandle, AF_DEFAULT_TRACK, target_buffer, samples); } SAMPLE_SPECS::sample_pos_t AUDIOFILE_INTERFACE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { AFframecount res; if (io_mode() == io_read) { finished_rep = false; res = ::afSeekFrame(afhandle, AF_DEFAULT_TRACK, pos); if (res != pos) { ECA_LOG_MSG(ECA_LOGGER::info, "invalid seek for file " + opt_filename_rep + " req was to " + kvu_numtostr(pos) + " result was " + kvu_numtostr(res)); if (res < 0) { res = afTellFrame(afhandle, AF_DEFAULT_TRACK); if (res >= 0) pos = res; else pos = position_in_samples(); } } } else { /* note: seeking is not supported for outputs by * libaudiofile */ if (pos != position_in_samples()) { ECA_LOG_MSG(ECA_LOGGER::errors, "libaudiofile does not support seeking for output files (" + opt_filename_rep + ")"); finished_rep = true; pos = 0; } } return pos; } void AUDIOFILE_INTERFACE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: opt_filename_rep = value; break; } } string AUDIOFILE_INTERFACE::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return opt_filename_rep; } return ""; } ecasound-2.9.3/libecasound/eca-audio-position.h0000644000076400007640000000705311032773265016424 00000000000000#ifndef INCLUDED_ECA_AUDIO_POSITION_H #define INCLUDED_ECA_AUDIO_POSITION_H #include "sample-specs.h" #include "eca-samplerate-aware.h" /** * Position cursor for a finite length audio stream */ class ECA_AUDIO_POSITION : public ECA_SAMPLERATE_AWARE { public: /** @name Constructors and destructors */ /*@{*/ ECA_AUDIO_POSITION(void); virtual ~ECA_AUDIO_POSITION(void); /*@}*/ /** @name Public functions for getting length information */ /*@{*/ SAMPLE_SPECS::sample_pos_t length_in_samples(void) const; int length_in_seconds(void) const; double length_in_seconds_exact(void) const; bool length_set(void) const { return(length_set_rep); } /*@}*/ protected: /** @name Protected functions for setting length */ /*@{*/ void set_length_in_samples(SAMPLE_SPECS::sample_pos_t pos); void set_length_in_seconds(int pos_in_seconds); void set_length_in_seconds(double pos_in_seconds); /** * If current position is beyond the current total * length, sets length according to the current position. * * ensure: * position_in_samples() == length_in_samples() */ void extend_position(void) { length_in_samples_rep = (position_in_samples_rep > length_in_samples_rep) ? position_in_samples_rep : length_in_samples_rep; } /*@}*/ public: /** @name Public functions for getting position information */ /*@{*/ SAMPLE_SPECS::sample_pos_t position_in_samples(void) const; int position_in_seconds(void) const; double position_in_seconds_exact(void) const; /*@}*/ protected: /** @name Protected functions for setting position (without action) */ /*@{*/ void set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos); void set_position_in_seconds(int pos_in_seconds); void set_position_in_seconds(double pos_in_seconds); void change_position_in_samples(SAMPLE_SPECS::sample_pos_t pos); void change_position_in_seconds(double pos_in_seconds); /*@}*/ public: /** @name Public functions for setting position (with action) */ /*@{*/ void seek_position_in_samples(SAMPLE_SPECS::sample_pos_t pos_in_samples); void seek_position_in_samples_advance(SAMPLE_SPECS::sample_pos_t pos_in_samples); void seek_position_in_seconds(double pos_in_seconds); void seek_first(void); void seek_last(void); public: virtual bool supports_seeking(void) const = 0; virtual bool supports_seeking_sample_accurate(void) const = 0; protected: /** * Seeks to the current position. * * If the seek is succesful, seek_position() should return * position given as argument 'pos'. * * If the seek is unsuccesful (seeking not supported at all, * or not with sample accuracy), the current actual position * in samples should be returned. * * @param pos new position in samples * @return pos on success, actual current position otherwise */ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos) = 0; /*@}*/ public: /** @name Public utility functions */ /*@{*/ /** * True if current position is beyond the end position or * smaller than zero. */ inline bool out_position(void) const { return((( position_in_samples_rep < 0) && (position_in_samples_rep > length_in_samples_rep)) ? true : false); } /*@}*/ public: /** @name Functions reimplemented from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value); /*@}*/ private: SAMPLE_SPECS::sample_pos_t position_in_samples_rep; SAMPLE_SPECS::sample_pos_t length_in_samples_rep; bool length_set_rep; }; #endif ecasound-2.9.3/libecasound/eca-chainsetup_impl.h0000644000076400007640000000137310664032032016632 00000000000000#ifndef INCLUDED_ECA_CHAINSETUP_IMPL_H #define INCLUDED_ECA_CHAINSETUP_IMPL_H #include "eca-chainsetup-bufparams.h" #include "audio-stamp.h" #include "midi-server.h" #include "audioio-db-client.h" class ECA_CHAINSETUP_impl { public: friend class ECA_CHAINSETUP; private: /** @name Aggregate objects */ /*@{*/ ECA_AUDIO_FORMAT default_audio_format_rep; AUDIO_STAMP_SERVER stamp_server_rep; AUDIO_IO_DB_SERVER pserver_rep; MIDI_SERVER midi_server_rep; ECA_CHAINSETUP_BUFPARAMS bmode_active_rep; ECA_CHAINSETUP_BUFPARAMS bmode_override_rep; ECA_CHAINSETUP_BUFPARAMS bmode_nonrt_rep; ECA_CHAINSETUP_BUFPARAMS bmode_rt_rep; ECA_CHAINSETUP_BUFPARAMS bmode_rtlowlatency_rep; /*@}*/ }; #endif /* INCLUDED_ECA_CHAINSETUP_IMPL_H */ ecasound-2.9.3/libecasound/midi-server.cpp0000644000076400007640000003267610664032032015513 00000000000000// ------------------------------------------------------------------------ // midi-server.cpp: MIDI i/o engine serving generic clients. // Copyright (C) 2001-2002,2005,2007 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "midi-parser.h" #include "midi-server.h" #include "eca-logger.h" const unsigned int MIDI_SERVER::max_queue_size_rep = 32768; /** * Helper function for starting the slave thread. */ void* start_midi_server_io_thread(void *ptr) { sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGINT); sigprocmask(SIG_BLOCK, &sigset, 0); MIDI_SERVER* mserver = static_cast(ptr); if (mserver->schedrealtime_rep == true) { if (kvu_set_thread_scheduling(SCHED_FIFO, mserver->schedpriority_rep) != 0) ECA_LOG_MSG(ECA_LOGGER::system_objects, "Unable to change scheduling policy!"); else ECA_LOG_MSG(ECA_LOGGER::info, std::string("Using realtime-scheduling (SCHED_FIFO:") + kvu_numtostr(mserver->schedpriority_rep) + ")."); } /* launch the worker thread */ mserver->io_thread(); return 0; } /** * Slave thread. */ void MIDI_SERVER::io_thread(void) { fd_set fds; unsigned char buf[16]; struct timeval tv; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Hey, in the I/O loop!"); while(true) { if (running_rep.get() == 0 || clients_rep[0]->is_open() != true) { usleep(50000); if (exit_request_rep.get() == 1) break; continue; } DBC_CHECK(clients_rep.size() > 0); DBC_CHECK(clients_rep[0]->supports_nonblocking_mode() == true); // FIXME: add support for multiple clients; gather poll // descriptors from all clients and create the 'fds' set int fd = clients_rep[0]->poll_descriptor(); FD_ZERO(&fds); FD_SET(fd, &fds); tv.tv_sec = 1; tv.tv_usec = 0; int retval = select(fd + 1 , &fds, NULL, NULL, &tv); // FIXME: add multiple client support, go through // all the fds int read_bytes = 0; if (retval) { if (FD_ISSET(fd, &fds) == true) { read_bytes = clients_rep[0]->read_bytes(buf, 16); //std::cerr << "TRACE: Read from MIDI-device (bytes): " << read_bytes << "." << std::endl; } } if (read_bytes < 0) { std::cerr << "ERROR: Can't read from MIDI-device: " << clients_rep[0]->label() << "." << std::endl; break; } else { // cerr << "(midi-server) read bytes: " << read_bytes << endl; for(int n = 0; n < read_bytes; n++) { buffer_rep.push_back(buf[n]); while(buffer_rep.size() > max_queue_size_rep) { std::cerr << "(eca-midi) dropping midi bytes" << std::endl; buffer_rep.pop_front(); } for(unsigned int m = 0; m < handlers_rep.size(); m++) { MIDI_HANDLER* p = handlers_rep[m]; if (p != 0) p->insert(buf[n]); } } parse_receive_queue(); } if (stop_request_rep.get() == 1) { stop_request_rep.set(0); running_rep.set(0); } } ECA_LOG_MSG(ECA_LOGGER::system_objects, "exiting MIDI-server thread"); } /** * Constructor. */ MIDI_SERVER::MIDI_SERVER (void) { running_status_rep = 0; current_ctrl_channel_rep = -1; current_ctrl_number = -1; thread_running_rep = false; running_rep.set(0); stop_request_rep.set(0); exit_request_rep.set(0); } /** * Destructor. Doesn't delete any client objects. */ MIDI_SERVER::~MIDI_SERVER(void) { if (is_enabled() == true) disable(); } /** * Starts the MIDI server. * * ensure * is_running() == true */ void MIDI_SERVER::start(void) { stop_request_rep.set(0); running_rep.set(1); ECA_LOG_MSG(ECA_LOGGER::user_objects, "starting processing"); send_mmc_start(); if (is_midi_sync_send_enabled() == true) send_midi_start(); // -------- DBC_ENSURE(is_running() == true); // -------- } /** * Stops the MIDI-server. Note that this routine only * initializes the stop procedure. Processing will * stop once the i/o-thread acknowledges the stop request. */ void MIDI_SERVER::stop(void) { stop_request_rep.set(1); ECA_LOG_MSG(ECA_LOGGER::user_objects, "stopping processing"); send_mmc_stop(); if (is_midi_sync_send_enabled() == true) send_midi_stop(); } /** * Initializes the MIDI-server by resetting * all MIDI-related state info. */ void MIDI_SERVER::init(void) { running_status_rep = 0; current_ctrl_channel_rep = -1; current_ctrl_number = -1; } /** * Enables the MIDI-server subsystems and prepared them for * processing. * * Use the set_schedrealtime() and set_schedpriority() functions * to set the MIDI subsystem scheduling priority. These settings * are set at enable(). * * ensure: * is_enabled() == true */ void MIDI_SERVER::enable(void) { init(); running_rep.set(0); stop_request_rep.set(0); exit_request_rep.set(0); if (thread_running_rep != true) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "enabling"); int ret = pthread_create(&io_thread_rep, 0, start_midi_server_io_thread, static_cast(this)); if (ret != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "pthread_create failed, exiting"); exit(1); } thread_running_rep = true; } // -------- DBC_ENSURE(is_enabled() == true); // -------- } /** * Whether MIDI-server is enabled? */ bool MIDI_SERVER::is_enabled(void) const { return thread_running_rep; } /** * Disables the MIDI-server subsystems. * * require: * is_enabled() == true * * ensure: * is_running() != true * is_enabled() != true */ void MIDI_SERVER::disable(void) { // -------- DBC_REQUIRE(is_enabled() == true); // -------- ECA_LOG_MSG(ECA_LOGGER::user_objects, "disabling"); stop_request_rep.set(1); exit_request_rep.set(1); if (thread_running_rep == true) { ::pthread_join(io_thread_rep, 0); } thread_running_rep = false; // -------- DBC_ENSURE(is_running() != true); DBC_ENSURE(is_enabled() != true); // -------- } /** * Whether the MIDI server has been started? */ bool MIDI_SERVER::is_running(void) const { if (running_rep.get() == 0) return false; return true; } /** * Registers a new client object. Midi server doesn't * handle initializing and opening of client objects. */ void MIDI_SERVER::register_client(MIDI_IO* mobject) { clients_rep.push_back(mobject); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Registering client " + kvu_numtostr(clients_rep.size() - 1) + "."); } /** * Unregisters the client object given as the argument. No * resources are freed during this call. */ void MIDI_SERVER::unregister_client(MIDI_IO* mobject) { for(unsigned int n = 0; n < clients_rep.size(); n++) { if (clients_rep[n] == mobject) { clients_rep[n] = 0; break; } } } /** * Registers a new MIDI-handler. The server will send * all received MIDI-data to the handler. */ void MIDI_SERVER::register_handler(MIDI_HANDLER* object) { handlers_rep.push_back(object); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Registering handler " + kvu_numtostr(handlers_rep.size() - 1) + "."); } /** * Unregisters the handler object given as the argument. No * resources are freed during this call. */ void MIDI_SERVER::unregister_handler(MIDI_HANDLER* object) { for(unsigned int n = 0; n < handlers_rep.size(); n++) { if (handlers_rep[n] == object) { handlers_rep[n] = 0; break; } } } /** * Adds a new client to which MMC-messages are sent * during processing. * * Note! Id '127' is specified as the all-device * id-number in the MMC-spec. */ void MIDI_SERVER::add_mmc_send_id(int id) { mmc_send_ids_rep.push_back(id); } /** * Removes a MMC-message client. */ void MIDI_SERVER::remove_mmc_send_id(int id) { mmc_send_ids_rep.remove(id); } /** * Sends MMC-start to all MMC-send client device ids. * * require: * is_enabled() == true */ void MIDI_SERVER::send_midi_bytes(int dev_id, unsigned char* buf, int bytes) { // -------- DBC_REQUIRE(is_enabled() == true); // -------- if (clients_rep[dev_id - 1]->is_open() == true) { DBC_CHECK(static_cast(clients_rep.size()) >= dev_id); DBC_CHECK(clients_rep[dev_id - 1]->supports_nonblocking_mode() == true); int err = clients_rep[dev_id - 1]->write_bytes(buf, bytes); DBC_CHECK(err == bytes); } } /** * Sends an MMC-command to all MMC-send client device ids. */ void MIDI_SERVER::send_mmc_command(unsigned int cmd) { unsigned char buf[6]; buf[0] = 0xf0; buf[1] = 0x7f; buf[2] = 0x00; /* dev-id */ buf[3] = 0x06; buf[4] = cmd; buf[5] = 0xf7; std::list::const_iterator p = mmc_send_ids_rep.begin(); while(p != mmc_send_ids_rep.end()) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Sending MMC message " + kvu_numtostr(cmd) + " to device-id " + kvu_numtostr(*p) + "."); buf[2] = static_cast(*p); send_midi_bytes(1, buf, 6); ++p; } } /** * Sends MMC-start to all MMC-send client device ids. */ void MIDI_SERVER::send_mmc_start(void) { /* FIXME: should this be 0x03 (deferred play)? */ // send_mmc_command(0x02); send_mmc_command(0x03); } /** * Sends MMC-stop to all MMC-send client device ids. */ void MIDI_SERVER::send_mmc_stop(void) { send_mmc_command(0x01); } /** * Sends a MIDI-start message. */ void MIDI_SERVER::send_midi_start(void) { unsigned char byte[1] = { 0xfa }; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Sending MIDI-start message."); send_midi_bytes(1, byte, 1); } /** * Sends a MIDI-continue message. */ void MIDI_SERVER::send_midi_continue(void) { unsigned char byte[1] = { 0xfb }; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Sending MIDI-continue message."); send_midi_bytes(1, byte, 1); } /** * Sends a MIDI-stop message. */ void MIDI_SERVER::send_midi_stop(void) { unsigned char byte[1] = { 0xfc }; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Sending MIDI-stop message."); send_midi_bytes(1, byte, 1); } /** * Requests that server will follow the latest value of * controller 'ctrl' on channel 'channel'. */ void MIDI_SERVER::add_controller_trace(int channel, int ctrl, int initial_value) { controller_values_rep[std::pair(channel,ctrl)] = initial_value; } /** * Requests that server stops following the latest value of * controller 'ctrl' on channel 'channel'. */ void MIDI_SERVER::remove_controller_trace(int channel, int controller) { std::map,int>::iterator p = controller_values_rep.find(std::pair(channel,controller)); if (p != controller_values_rep.end()) { controller_values_rep.erase(p); } } /** * Returns the latest traced value of controller 'ctrl' on * channel 'channel'. * * @return -1 is returned on error */ int MIDI_SERVER::last_controller_value(int channel, int ctrl) const { std::map,int>::iterator p = controller_values_rep.find(std::pair(channel,ctrl)); if (p != controller_values_rep.end()) { return controller_values_rep[std::pair(channel,ctrl)]; } return -1; } /** * Parses the received MIDI date. */ void MIDI_SERVER::parse_receive_queue(void) { while(buffer_rep.size() > 0) { unsigned char byte = buffer_rep.front(); buffer_rep.pop_front(); if (MIDI_PARSER::is_status_byte(byte) == true) { if (MIDI_PARSER::is_voice_category_status_byte(byte) == true) { running_status_rep = byte; if ((running_status_rep & 0xb0) == 0xb0) current_ctrl_channel_rep = static_cast((byte & 15)); } else if (MIDI_PARSER::is_system_common_category_status_byte(byte) == true) { current_ctrl_channel_rep = -1; running_status_rep = 0; } } else { /* non-status bytes */ /** * Any data bytes are ignored if no running status */ if (running_status_rep != 0) { /** * Check for 'controller messages' (status 0xb0 to 0xbf and * two data bytes) */ if (current_ctrl_channel_rep != -1) { if (current_ctrl_number == -1) { current_ctrl_number = static_cast(byte); // cerr << endl << "C:" << current_ctrl_number << "."; } else { if (controller_values_rep.find(std::pair(current_ctrl_channel_rep,current_ctrl_number)) != controller_values_rep.end()) { controller_values_rep[std::pair(current_ctrl_channel_rep,current_ctrl_number)] = static_cast(byte); // std::cerr << std::endl << "(midi-server) Value:" // << controller_values_rep[std::pair(current_ctrl_channel_rep,current_ctrl_number)] // << ", ch:" << current_ctrl_channel_rep << ", ctrl:" << current_ctrl_number << "."; } // else { // cerr << endl << "E:" << " found an entry we are not following..." << endl; // } current_ctrl_number = -1; } } } } } } ecasound-2.9.3/libecasound/midi-client.h0000644000076400007640000000066010664032032015114 00000000000000#ifndef INCLUDED_MIDI_CLIENT_H #define INCLUDED_MIDI_CLIENT_H class MIDI_SERVER; /** * Top-level interface for MIDI-clients */ class MIDI_CLIENT { public: int id(void) const; void register_server(MIDI_SERVER* server); MIDI_CLIENT(void); protected: void set_id(int n); MIDI_SERVER* server(void) const { return(server_repp); } private: int id_rep; bool id_set_rep; MIDI_SERVER* server_repp; }; #endif ecasound-2.9.3/libecasound/eca-operator.cpp0000644000076400007640000000303410664032032015630 00000000000000// ------------------------------------------------------------------------ // eca-operator.cpp: Operators are ecasound objects which can be used // as targets for dynamic control. // Copyright (C) 2000 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "eca-operator.h" OPERATOR::~OPERATOR (void) { } void OPERATOR::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { DBC_REQUIRE(param > 0); DBC_REQUIRE(param <= number_of_params()); pd->default_value = get_parameter(param); pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = false; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; } ecasound-2.9.3/libecasound/eca-engine.cpp0000644000076400007640000014741213604161211015252 00000000000000// ------------------------------------------------------------------------ // eca-engine.cpp: Main processing engine // Copyright (C) 1999-2009,2012,2015,2020 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include #include /* gettimeofday() */ #include #include #include #include #include #include "samplebuffer.h" #include "audioio.h" #include "audioio-buffered.h" #include "audioio-device.h" #include "audioio-db-client.h" #include "audioio-loop.h" #include "audioio-barrier.h" #include "audioio-mp3.h" #include "midi-server.h" #include "eca-chain.h" #include "eca-chainop.h" #include "eca-error.h" #include "eca-logger.h" #include "eca-chainsetup-edit.h" #include "eca-engine.h" #include "eca-engine_impl.h" using std::cerr; using std::endl; using std::vector; /** * Enable and disable features */ /* Profile callback execution */ // #define PROFILE_ENGINE /** * Local macro definitions */ #ifdef PROFILE_ENGINE_EXECUTION #define PROFILE_ENGINE_STATEMENT(x) (x) #else #define PROFILE_ENGINE_STATEMENT(x) ((void)0) #endif /** * Prototypes of static functions */ static void mix_to_outputs_divide_helper(const SAMPLE_BUFFER *from, SAMPLE_BUFFER *to, int divide_by, bool first_time); static void mix_to_outputs_sum_helper(const SAMPLE_BUFFER *from, SAMPLE_BUFFER *to, bool first_time); /** * Implementations of non-static functions */ /********************************************************************** * Driver implementation **********************************************************************/ int ECA_ENGINE_DEFAULT_DRIVER::exec(ECA_ENGINE* engine, ECA_CHAINSETUP* csetup) { bool drain_at_end = false; engine_repp = engine; exit_request_rep = false; engine->init_engine_state(); while(true) { engine_repp->check_command_queue(); /* case 1: external exit request */ if (exit_request_rep == true) break; /* case 2: engine running, execute one loop iteration */ if (engine_repp->status() == ECA_ENGINE::engine_status_running) { engine_repp->engine_iteration(); } else { /* case 3a-i: engine finished and in batch mode -> exit */ if (engine_repp->status() == ECA_ENGINE::engine_status_finished && engine_repp->batch_mode() == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "batch finished in exec, exit"); drain_at_end = true; break; } /* case 3a-ii: engine error occured -> exit */ else if (engine_repp->status() == ECA_ENGINE::engine_status_error) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "engine error, exit"); break; } /* case 3b: engine not running, wait for commands */ engine_repp->wait_for_commands(); } engine_repp->update_engine_state(); } if (engine_repp->is_prepared() == true) engine_repp->stop_operation(drain_at_end); return 0; } void ECA_ENGINE_DEFAULT_DRIVER::start(void) { if (engine_repp->is_prepared() != true) engine_repp->prepare_operation(); engine_repp->start_operation(); } void ECA_ENGINE_DEFAULT_DRIVER::stop(bool drain) { if (engine_repp->is_prepared() == true) engine_repp->stop_operation(drain); } void ECA_ENGINE_DEFAULT_DRIVER::exit(void) { if (engine_repp->is_prepared() == true) engine_repp->stop_operation(); exit_request_rep = true; /* no need to block here as the next * function will be exec() */ } /********************************************************************** * Engine implementation - Public functions **********************************************************************/ /** * Context help: * J = originates from driver callback * E = ----- " ------- engine thread (exec()) * C = ----- " ------- control thread (external) * * X-level-Y -> Y = steps from originating functions */ /** * Class constructor. A pointer to an enabled * ECA_CHAINSETUP object must be given as argument. * * @pre csetup != 0 * @pre csetup->is_enabled() == true * @post status() == ECA_ENGINE::engine_status_stopped */ ECA_ENGINE::ECA_ENGINE(ECA_CHAINSETUP* csetup) : prepared_rep(false), running_rep(false), finished_rep(false), outputs_finished_rep(0), driver_errors_rep(0), csetup_repp(csetup), mixslot_repp(0) { // -- DBC_REQUIRE(csetup != 0); DBC_REQUIRE(csetup->is_enabled() == true); // -- ECA_LOG_MSG(ECA_LOGGER::system_objects, "ECA_ENGINE constructor"); csetup_repp->toggle_locked_state(true); impl_repp = new ECA_ENGINE_impl; mixslot_repp = new SAMPLE_BUFFER(buffersize(), 0); init_variables(); init_connection_to_chainsetup(); PROFILE_ENGINE_STATEMENT(init_profiling()); csetup_repp->toggle_locked_state(false); // -- DBC_ENSURE(status() == ECA_ENGINE::engine_status_stopped); // -- } /** * Class destructor. */ ECA_ENGINE::~ECA_ENGINE(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "ECA_ENGINE destructor"); if (csetup_repp != 0) { command(ECA_ENGINE::ep_exit, 0.0f); wait_for_exit(5); if (csetup_repp != 0) { cleanup(); } } PROFILE_ENGINE_STATEMENT(dump_profile_info()); if (driver_local == true) { delete driver_repp; driver_repp = 0; } for(size_t n = 0; n < cslots_rep.size(); n++) { delete cslots_rep[n]; } delete mixslot_repp; delete impl_repp; ECA_LOG_MSG(ECA_LOGGER::subsystems, "Engine exiting"); } /** * Launches the engine. This function will block * until processing is finished. * * Note that a exec() is a one-shot function. * It's not possible to call it multiple times. * * @param batch_mode if true, once engine is started * it will continue processing until * 'status() == engine_status_finished' * condition is reached and then exit; * if false, engine will react to * commands until explicit 'exit' is * given * * @see command() * @see status() * * @pre is_valid() == true * @post status() == ECA_ENGINE::engine_status_notready * @post is_valid() != true */ int ECA_ENGINE::exec(bool batch_mode) { // -- DBC_REQUIRE(csetup_repp != 0); DBC_REQUIRE(csetup_repp->is_enabled() == true); // -- int result = 0; csetup_repp->toggle_locked_state(true); batchmode_enabled_rep = batch_mode; ECA_LOG_MSG(ECA_LOGGER::subsystems, "Engine - Driver start"); int res = driver_repp->exec(this, csetup_repp); if (res < 0) { ++driver_errors_rep; ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Engine has raised an error! " "Possible causes: connection lost to system services, unable to adapt " "to changes in operating environment, etc."); } csetup_repp->toggle_locked_state(false); signal_exit(); if (outputs_finished_rep > 0) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: An output object has raised an error! " "Possible causes: Out of disk space, permission denied, unable to launch external " "applications needed in processing, etc."); } DBC_CHECK(status() == ECA_ENGINE::engine_status_stopped || status() == ECA_ENGINE::engine_status_finished || status() == ECA_ENGINE::engine_status_error); if (status() == ECA_ENGINE::engine_status_error) { result = -1; } cleanup(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Engine state when finishing: " + kvu_numtostr(static_cast(status()))); // -- DBC_ENSURE(status() == ECA_ENGINE::engine_status_notready); // -- return result; } /** * Sends 'cmd' to engines command queue. Commands are * processed in the server's main loop. * * context: C-level-0 * must no be called from exec() context */ void ECA_ENGINE::command(Engine_command_t cmd, double arg) { ECA_ENGINE::complex_command_t item; item.type = cmd; item.m.legacy.value = arg; impl_repp->command_queue_rep.push_back(item); } /** * Sends 'ccmd' to engines command queue. Commands are * processed in the server's main loop. Passing a complex * command allows to address objects regardless of * the state of ECA_CHAINSETUP iterators (i.e. currently * selected objects). * * context: C-level-0 * must no be called from exec() context */ void ECA_ENGINE::command(complex_command_t ccmd) { impl_repp->command_queue_rep.push_back(ccmd); } /** * Wait for a stop signal. Functions blocks until * the signal is received or 'timeout' seconds * has elapsed. * * context: C-level-0 * must not be run from the engine * driver context * * @see signal_stop() */ void ECA_ENGINE::wait_for_stop(int timeout) { struct timespec timeoutspec; // FIXME: start to use MONOTONIC, needs pthread_condattr_setclock int ret = kvu_pthread_cond_timeout(timeout, &timeoutspec, false); DBC_CHECK(ret == 0); pthread_mutex_lock(&impl_repp->ecasound_stop_mutex_repp); while(running_rep == true) { ret = pthread_cond_timedwait(&impl_repp->ecasound_stop_cond_repp, &impl_repp->ecasound_stop_mutex_repp, &timeoutspec); ECA_LOG_MSG(ECA_LOGGER::system_objects, kvu_pthread_timed_wait_result(ret, "wait_for_stop")); } pthread_mutex_unlock(&impl_repp->ecasound_stop_mutex_repp); } /** * Wait for an exit signal. Function blocks until * the signal is received or 'timeout' seconds * has elapsed. * * context: C-level-0 * * @see signal_exit() */ void ECA_ENGINE::wait_for_exit(int timeout) { int ret = kvu_pthread_timed_wait(&impl_repp->ecasound_exit_mutex_repp, &impl_repp->ecasound_exit_cond_repp, timeout); ECA_LOG_MSG(ECA_LOGGER::info, kvu_pthread_timed_wait_result(ret, "(eca_main) wait_for_exit")); } /********************************************************************** * Engine implementation - Public functions for observing engine * status information **********************************************************************/ /** * Returns true engine's internal * state is valid for processing. * * context: C-level-0 * no limitations */ bool ECA_ENGINE::is_valid(void) const { if (csetup_repp == 0 || csetup_repp->is_enabled() != true || csetup_repp->is_valid() != true || chains_repp == 0 || chains_repp->size() == 0 || inputs_repp == 0 || inputs_repp->size() == 0 || outputs_repp == 0 || outputs_repp->size() == 0) { return false; } return true; } /** * Whether current setup has finite length. * * context: C-level-0 */ bool ECA_ENGINE::is_finite_length(void) const { DBC_CHECK(csetup_repp != 0); if (csetup_repp->max_length_set() == true || csetup_repp->number_of_realtime_inputs() == 0) { return true; } return false; } /** * Returns engine's current status. * * context: C-level-0 * no limitations */ ECA_ENGINE::Engine_status_t ECA_ENGINE::status(void) const { if (csetup_repp == 0) return ECA_ENGINE::engine_status_notready; /* calculated in update_engine_status() */ if (finished_rep == true) return ECA_ENGINE::engine_status_finished; if (outputs_finished_rep > 0 || driver_errors_rep > 0) return ECA_ENGINE::engine_status_error; if (is_running() == true) return ECA_ENGINE::engine_status_running; if (is_prepared() == true) return ECA_ENGINE::engine_status_stopped; return ECA_ENGINE::engine_status_stopped; } /********************************************************************** * Engine implementation - API for engine driver objects **********************************************************************/ /** * Processes available new commands. If no * messages are available, function will return * immediately without blocking. * * context: E-level-1 * can be run at the same time as engine_iteration(); * note! this is called with the engine lock held * so no long operations allowed! */ void ECA_ENGINE::check_command_queue(void) { while(impl_repp->command_queue_rep.is_empty() != true) { ECA_ENGINE::complex_command_t item; int popres = impl_repp->command_queue_rep.pop_front(&item); if (popres <= 0) { /* queue is empty or temporarily unavailable, unable to continue * processing messages without blocking */ break; } switch(item.type) { // --- // Basic commands. // --- case ep_exit: { // FIXME: is clear the right thing or should remaining cmds // be still processed? OTOH, client app should know... impl_repp->command_queue_rep.clear(); ECA_LOG_MSG(ECA_LOGGER::system_objects,"ecasound_queue: exit!"); driver_repp->exit(); return; } // --- // Chain operators (stateless addressing) // --- case ep_exec_edit: { csetup_repp->execute_edit(item.cs); if (item.cs.need_chain_reinit) { reinit_chains(true); } break; } case ep_prepare: { if (is_prepared() != true) prepare_operation(); break; } case ep_start: { if (status() != engine_status_running) request_start(); break; } case ep_stop: { if (status() == engine_status_running || status() == engine_status_finished) request_stop(false); break; } case ep_stop_with_drain: { if (status() == engine_status_running || status() == engine_status_finished) request_stop(true); break; } // --- // Global position // --- case ep_rewind: { change_position(- item.m.legacy.value); break; } case ep_forward: { change_position(item.m.legacy.value); break; } case ep_setpos: { set_position(item.m.legacy.value); break; } case ep_setpos_samples: { set_position_samples(static_cast(item.m.legacy.value)); break; } case ep_setpos_live_samples: { set_position_samples_live(static_cast(item.m.legacy.value)); break; } case ep_debug: break; } /* switch */ } } /** * Waits for new commands to arrive. Function * will block until at least one new message * is available or until a timeout occurs. * * context: E-level-1 * can be run at the same time as * engine_iteration() */ void ECA_ENGINE::wait_for_commands(void) { impl_repp->command_queue_rep.poll(5, 0); } /** * Intializes internal state variables. * * context: E-level-1 * must not be run at the same * time as engine_iteration() * * @see update_engine_state() */ void ECA_ENGINE::init_engine_state(void) { finished_rep = false; inputs_not_finished_rep = 1; // for the 1st iteration outputs_finished_rep = 0; mixslot_repp->event_tag_set(SAMPLE_BUFFER::tag_end_of_stream, false); for(size_t n = 0; n < cslots_rep.size(); n++) { cslots_rep[n]->event_tag_set(SAMPLE_BUFFER::tag_end_of_stream, false); } } /** * Updates engine state to match current * situation. * * context: J-level-0 * must not be run at the same * time as engine_iteration() * * @see init_engine_state() */ void ECA_ENGINE::update_engine_state(void) { // -- // Check whether all inputs have finished // (note: as update_engine_state() is // guaranteed to not to be called at the same // time as engine_iteration(), this is the // only safe place to calculate finished state if (inputs_not_finished_rep == 0 && outputs_finished_rep == 0 && finished_rep != true) { if (is_running() == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects,"all inputs finished - stop"); // FIXME: this is still wrong, command() is not fully rt-safe // we are not allowed to call request_stop here command(ECA_ENGINE::ep_stop_with_drain, 0.0f); } state_change_to_finished(); } // -- // Check whether some output has raised an error if (status() == ECA_ENGINE::engine_status_error) { if (is_running() == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects,"output error - stop"); // FIXME: this is still wrong, command() is not fully rt-safe // we are not allowed to call request_stop here command(ECA_ENGINE::ep_stop, 0.0f); } } } /** * Executes one engine loop iteration. It is critical * that this function is only called when engine is * running. * * @pre is_running() == true * * context: J-level-0 */ void ECA_ENGINE::engine_iteration(void) { DBC_CHECK(is_running() == true); PROFILE_ENGINE_STATEMENT(impl_repp->looptimer_rep.start(); impl_repp->looptimer_range_rep.start()); inputs_not_finished_rep = 0; prehandle_control_position(); inputs_to_chains(); process_chains(); // FIXME: add support for sub-buffersize offsets if (preroll_samples_rep >= recording_offset_rep) { /* record material to non-real-time outputs */ mix_to_outputs(false); } else { /* skip slave targets */ mix_to_outputs(true); preroll_samples_rep += buffersize(); } posthandle_control_position(); PROFILE_ENGINE_STATEMENT(impl_repp->looptimer_rep.stop(); impl_repp->looptimer_range_rep.stop()); } /** * Reinitialize chains * * Flush any existing state from the chain operators (e.g. * old audio data in buffers, changes in configuration, and * so forth). * * @arg force force reinitialization even if chain itself * reports it is properly initialized */ void ECA_ENGINE::reinit_chains(bool force) { for(size_t i = 0; i != chains_repp->size(); i++) { if (force == true || (*chains_repp)[i]->is_initialized() != true) { (*chains_repp)[i]->init(0, 0, 0); } } } /** * Prepares engine for operation. Prepares all * realtime devices and starts servers. * * This function should be called by the * driver before it starts iterating the * engine's main loop. * * context: E-level-1/3 * must not be run at the same time * as engine_iteration() * * @pre is_running() != true * @pre is_prepared() != true * @post is_prepared() == true * @post status() == ECA_ENGINE::engine_status_running */ void ECA_ENGINE::prepare_operation(void) { // --- DBC_REQUIRE(is_running() != true); DBC_REQUIRE(is_prepared() != true); // --- /* 1. acquire rt-lock for chainsetup and samplebuffers */ csetup_repp->toggle_locked_state(true); for(size_t n = 0; n < cslots_rep.size(); n++) { cslots_rep[n]->set_rt_lock(true); } mixslot_repp->set_rt_lock(true); /* 2. reinitialize chains if necessary */ reinit_chains(true); /* 3. start subsystem servers and forked audio objects */ start_forked_objects(); start_servers(); /* 4. prepare rt objects */ prepare_realtime_objects(); /* ... initial offset is needed because preroll is * incremented only after checking whether we are * still in preroll mode */ preroll_samples_rep = buffersize(); /* 6. enable rt-scheduling */ if (csetup_repp->raised_priority() == true) { if (kvu_set_thread_scheduling(SCHED_FIFO, csetup_repp->get_sched_priority()) != 0) ECA_LOG_MSG(ECA_LOGGER::system_objects, "Unable to change scheduling policy!"); else ECA_LOG_MSG(ECA_LOGGER::user_objects, std::string("Using realtime-scheduling (SCHED_FIFO:") + kvu_numtostr(csetup_repp->get_sched_priority()) + ")."); } /* 7. change engine to active and running */ prepared_rep = true; init_engine_state(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "engine prepared"); // --- DBC_ENSURE(is_prepared() == true); DBC_ENSURE(status() == ECA_ENGINE::engine_status_stopped); // --- } /** * Starts engine operation. * * This function should be called by the * driver just before it starts iterating the * engine's main loop. * * context: E-level-1/3 * must not be run at the same time * as engine_iteration() * * @pre is_prepared() == true * @pre is_running() != true * @post is_running() == true * @post status() == ECA_ENGINE::engine_status_running */ void ECA_ENGINE::start_operation(void) { // --- DBC_REQUIRE(is_prepared() == true); DBC_REQUIRE(is_running() != true); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "starting engine operation!"); start_realtime_objects(); running_rep = true; // --- DBC_ENSURE(is_running() == true); DBC_ENSURE(status() == ECA_ENGINE::engine_status_running); // --- } /** * Stops all realtime devices and servers. * * This function should be called by the * driver when it stops iterating the * engine's main loop. * * context: E-level-1/3 * must not be run at the same time * as engine_iteration() * * @param drain whether to block until all queued data is processed * by realtime devices before stopping * * @pre is_running() == true * @post is_running() != true * @post is_prepared() != true */ void ECA_ENGINE::stop_operation(bool drain) { // --- DBC_REQUIRE(is_prepared() == true); // --- ECA_LOG_MSG(ECA_LOGGER::system_objects, "stopping engine operation!"); /* stop realtime devices */ for (unsigned int adev_sizet = 0; adev_sizet != realtime_objects_rep.size(); adev_sizet++) { if (realtime_objects_rep[adev_sizet]->is_running() == true) realtime_objects_rep[adev_sizet]->stop(drain); } prepared_rep = false; /* release samplebuffer rt-locks */ for(size_t n = 0; n < cslots_rep.size(); n++) { cslots_rep[n]->set_rt_lock(false); } mixslot_repp->set_rt_lock(false); stop_servers(); stop_forked_objects(); /* lower priority back to normal */ if (csetup_repp->raised_priority() == true) { if (kvu_set_thread_scheduling(SCHED_OTHER, 0) != 0) ECA_LOG_MSG(ECA_LOGGER::info, "Unable to change scheduling back to SCHED_OTHER!"); else ECA_LOG_MSG(ECA_LOGGER::system_objects, "Changed back to non-realtime scheduling SCHED_OTHER."); } /* release chainsetup lock */ csetup_repp->toggle_locked_state(false); /* signals wait_for_stop() that engine operation has stopped */ signal_stop(); // --- DBC_ENSURE(is_running() != true); DBC_ENSURE(is_prepared() != true); // --- } /** * Whether engine has been actived * with prepare_operation(). * * context: no limitations */ bool ECA_ENGINE::is_prepared(void) const { return prepared_rep; } /** * Whether engine has been started * with start_operation(). * * context: no limitations */ bool ECA_ENGINE::is_running(void) const { return running_rep; } /********************************************************************** * Engine implementation - Attribute functions **********************************************************************/ long int ECA_ENGINE::buffersize(void) const { DBC_CHECK(csetup_repp != 0); return csetup_repp->buffersize(); } int ECA_ENGINE::max_channels(void) const { int result = 0; for(unsigned int n = 0; n < csetup_repp->inputs.size(); n++) { if (csetup_repp->inputs[n]->channels() > result) result = csetup_repp->inputs[n]->channels(); } for(unsigned int n = 0; n < csetup_repp->outputs.size(); n++) { if (csetup_repp->outputs[n]->channels() > result) result = csetup_repp->outputs[n]->channels(); } return result; } /********************************************************************** * Engine implementation - Private functions for transport control **********************************************************************/ /** * Requests the engine driver to start operation. * * This function should only be called from * check_command_queue(). * * @pre status() != engine_status_running * * context: E-level-2 */ void ECA_ENGINE::request_start(void) { // --- DBC_REQUIRE(status() != engine_status_running); // --- ECA_LOG_MSG(ECA_LOGGER::user_objects, "Request start"); // -- // start the driver driver_repp->start(); } /** * Requests the engine driver to stop operation. * * This function should only be called from * check_command_queue(). * * @pre status() == ECA_ENGINE::engine_status_running || * status() == ECA_ENGINE::engine_status_finished * * context: E-level-2 */ void ECA_ENGINE::request_stop(bool drain) { // --- DBC_REQUIRE(status() == engine_status_running || status() == engine_status_finished); // --- ECA_LOG_MSG(ECA_LOGGER::user_objects, std::string("Request stop (") + (drain ? std::string("drain") : std::string("no-drain")) + ")"); driver_repp->stop(drain); } /** * Sends a stop signal indicating that engine * state has changed to stopped. * * context: E-level-1/4 * * @see wait_for_stop() */ void ECA_ENGINE::signal_stop(void) { pthread_mutex_lock(&impl_repp->ecasound_stop_mutex_repp); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Signaling stop"); running_rep = false; pthread_cond_broadcast(&impl_repp->ecasound_stop_cond_repp); pthread_mutex_unlock(&impl_repp->ecasound_stop_mutex_repp); } /** * Sends an exit signal indicating that engine * driver has exited. * * context: E-level-1/4 * * @see wait_for_exit() */ void ECA_ENGINE::signal_exit(void) { pthread_mutex_lock(&impl_repp->ecasound_exit_mutex_repp); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Signaling exit"); pthread_cond_broadcast(&impl_repp->ecasound_exit_cond_repp); pthread_mutex_unlock(&impl_repp->ecasound_exit_mutex_repp); } /** * Processing is start If and only if processing * previously stopped with conditional_stop(). * * context: E-level-3 */ void ECA_ENGINE::conditional_start(void) { if (was_running_rep == true) { // don't call request_start(), as it would signal that we are // starting from completely halted state if (is_prepared() != true) prepare_operation(); start_operation(); } } /** * Processing is stopped. * * context: E-level-3 * * @see conditional_stop() * @see request_stop() */ void ECA_ENGINE::conditional_stop(void) { if (status() == ECA_ENGINE::engine_status_running) { ECA_LOG_MSG(ECA_LOGGER::system_objects,"conditional stop"); was_running_rep = true; // don't call request_stop(), as it would signal that we are // stopping completely (JACK transport stop will be sent to all) if (is_prepared() == true) stop_operation(false); } else was_running_rep = false; } void ECA_ENGINE::start_servers(void) { if (csetup_repp->double_buffering() == true) { csetup_repp->pserver_repp->start(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "prefilling i/o buffers."); csetup_repp->pserver_repp->wait_for_full(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "i/o buffers prefilled."); } if (use_midi_rep == true) { csetup_repp->midi_server_repp->start(); } } void ECA_ENGINE::stop_servers(void) { if (csetup_repp->double_buffering() == true) { csetup_repp->pserver_repp->stop(); csetup_repp->pserver_repp->wait_for_stop(); } if (use_midi_rep == true) { csetup_repp->midi_server_repp->stop(); } } /** * Goes through all input/outputs in 'vec', checks whether they * implement the AUDIO_IO_BARRIER interface, and if yes, * issues either 'start_io()' or 'stop_io()' on them. */ static void priv_toggle_forked_objects(bool start, std::vector* vec) { unsigned int n; for(n = 0; n < vec->size(); n++) { AUDIO_IO_BARRIER *barrier = dynamic_cast((*vec)[n]); if (barrier) { if (start) barrier->start_io(); else barrier->stop_io(); } } } void ECA_ENGINE::start_forked_objects(void) { priv_toggle_forked_objects(true, inputs_repp); priv_toggle_forked_objects(true, outputs_repp); } void ECA_ENGINE::stop_forked_objects(void) { priv_toggle_forked_objects(false, inputs_repp); priv_toggle_forked_objects(false, outputs_repp); } void ECA_ENGINE::state_change_to_finished(void) { if (finished_rep != true) { ECA_LOG_MSG_NOPREFIX(ECA_LOGGER::info, ""); ECA_LOG_MSG(ECA_LOGGER::subsystems, "Engine - Processing finished"); } finished_rep = true; } void ECA_ENGINE::prepare_realtime_objects(void) { /* 1. prepare objects */ for (unsigned int n = 0; n < realtime_objects_rep.size(); n++) { realtime_objects_rep[n]->prepare(); } /* 2. prefill rt output objects with silence */ mixslot_repp->make_silent(); for (unsigned int n = 0; n < realtime_outputs_rep.size(); n++) { if (realtime_outputs_rep[n]->prefill_space() > 0) { if (realtime_outputs_rep[n]->prefill_space() < prefill_threshold_rep * buffersize()) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "audio output '" + realtime_outputs_rep[n]->name() + "' only offers " + kvu_numtostr(realtime_outputs_rep[n]->prefill_space()) + " frames of prefill space. Decreasing amount of prefill."); prefill_threshold_rep = realtime_outputs_rep[n]->prefill_space() / buffersize(); } ECA_LOG_MSG(ECA_LOGGER::user_objects, "prefilling rt-outputs with " + kvu_numtostr(prefill_threshold_rep) + " blocks."); for (int m = 0; m < prefill_threshold_rep; m++) { realtime_outputs_rep[n]->write_buffer(mixslot_repp); } } } } void ECA_ENGINE::start_realtime_objects(void) { /* 1. start all realtime devices */ for (unsigned int n = 0; n < realtime_objects_rep.size(); n++) realtime_objects_rep[n]->start(); } /** * Performs a close-open cycle for all realtime * devices. */ void ECA_ENGINE::reset_realtime_devices(void) { for (size_t n = 0; n < realtime_objects_rep.size(); n++) { if (realtime_objects_rep[n]->is_open() == true) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Reseting rt-object " + realtime_objects_rep[n]->label()); realtime_objects_rep[n]->close(); } } for (size_t n = 0; n < realtime_objects_rep.size(); n++) { realtime_objects_rep[n]->open(); } } /********************************************************************** * Engine implementation - Private functions for observing and * modifying position **********************************************************************/ SAMPLE_SPECS::sample_pos_t ECA_ENGINE::current_position_in_samples(void) const { return csetup_repp->position_in_samples(); } double ECA_ENGINE::current_position_in_seconds_exact(void) const { return csetup_repp->position_in_seconds_exact(); } // FIXME: remove #if 0 double ECA_ENGINE::current_position_chain(void) const { AUDIO_IO* ptr = (*inputs_repp)[(*chains_repp)[csetup_repp->active_chain_index_rep]->connected_input()]; return ptr->position_in_seconds_exact(); return 0.0f; } #endif /** * Seeks to position 'seconds'. Affects all input and * outputs objects, and the chainsetup object position. * * context: E-level-2 */ void ECA_ENGINE::set_position(double seconds) { conditional_stop(); csetup_repp->seek_position_in_seconds(seconds); // reinit chains to flush out any stale audio data related // to the old position reinit_chains(true); // FIXME: calling init_engine_state() may lead to races init_engine_state(); conditional_start(); } /** * Seeks to position 'samples'. Affects all input and * outputs objects, and the chainsetup object position. * * context: E-level-2 */ void ECA_ENGINE::set_position_samples(SAMPLE_SPECS::sample_pos_t samples) { conditional_stop(); csetup_repp->seek_position_in_samples(samples); // reinit chains to flush out any stale audio data related // to the old position reinit_chains(true); // FIXME: calling init_engine_state() may lead to races init_engine_state(); conditional_start(); } /** * Seeks to position 'samples' without stopping the engine. * Affects all input and outputs objects, and the chainsetup * object position. * * context: E-level-2 */ void ECA_ENGINE::set_position_samples_live(SAMPLE_SPECS::sample_pos_t samples) { csetup_repp->seek_position_in_samples(samples); // FIXME: calling init_engine_state() may lead to races init_engine_state(); } /** * Seeks to position 'current+seconds'. Affects all input and * outputs objects, and the chainsetup object position. * * context: E-level-2 */ void ECA_ENGINE::change_position(double seconds) { double curpos = csetup_repp->position_in_seconds_exact(); conditional_stop(); csetup_repp->seek_position_in_seconds(curpos + seconds); conditional_start(); } /** * Calculates how much data we need to process and sets the * buffersize accordingly for all non-real-time inputs. * * context: J-level-1 */ void ECA_ENGINE::prehandle_control_position(void) { csetup_repp->change_position_in_samples(buffersize()); if (csetup_repp->max_length_set() == true && csetup_repp->is_over_max_length() == true) { int extra_tail = csetup_repp->position_in_samples() - csetup_repp->max_length_in_samples(); int buffer_remain = buffersize() - extra_tail; if (buffer_remain < 0) buffer_remain = 0; else if (buffer_remain > buffersize()) buffer_remain = buffersize(); for(unsigned int adev_sizet = 0; adev_sizet < non_realtime_inputs_rep.size(); adev_sizet++) { non_realtime_inputs_rep[adev_sizet]->set_buffersize(buffer_remain); } } } /** * If we've processed all the data that was requested, stop or rewind. * Also resets buffersize to its default value. If finished * state is reached, engine status is set to * 'ECA_ENGINE::engine_status_finished'. */ void ECA_ENGINE::posthandle_control_position(void) { if (csetup_repp->max_length_set() == true && csetup_repp->is_over_max_length() == true) { if (csetup_repp->looping_enabled() == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects,"loop point reached"); inputs_not_finished_rep = 1; csetup_repp->seek_position_in_samples(0); for(unsigned int adev_sizet = 0; adev_sizet < non_realtime_inputs_rep.size(); adev_sizet++) { non_realtime_inputs_rep[adev_sizet]->set_buffersize(buffersize()); } } else { ECA_LOG_MSG(ECA_LOGGER::system_objects,"posthandle_c_p over_max - stop"); if (status() == ECA_ENGINE::engine_status_running || status() == ECA_ENGINE::engine_status_finished) { command(ECA_ENGINE::ep_stop_with_drain, 0.0f); } state_change_to_finished(); } } } /********************************************************************** * Engine implementation - Private functions for setup and cleanup **********************************************************************/ /** * Called only from class constructor. */ void ECA_ENGINE::init_variables(void) { use_midi_rep = false; batchmode_enabled_rep = false; driver_local = false; pthread_cond_init(&impl_repp->ecasound_stop_cond_repp, NULL); pthread_mutex_init(&impl_repp->ecasound_stop_mutex_repp, NULL); pthread_cond_init(&impl_repp->ecasound_exit_cond_repp, NULL); pthread_mutex_init(&impl_repp->ecasound_exit_mutex_repp, NULL); } /** * Called only from class constructor. */ void ECA_ENGINE::init_connection_to_chainsetup(void) { inputs_repp = &(csetup_repp->inputs); outputs_repp = &(csetup_repp->outputs); chains_repp = &(csetup_repp->chains); init_engine_state(); init_driver(); init_prefill(); init_servers(); init_chains(); create_cache_object_lists(); update_cache_chain_connections(); update_cache_latency_values(); } /** * Initializes the engine driver object. */ void ECA_ENGINE::init_driver(void) { if (csetup_repp->engine_driver_repp != 0) { driver_repp = csetup_repp->engine_driver_repp; driver_local = false; } else { driver_repp = new ECA_ENGINE_DEFAULT_DRIVER(); driver_local = true; } } /** * Initializes prefill variables. */ void ECA_ENGINE::init_prefill(void) { int channels = (max_channels() > 0 ? max_channels() : 1); prefill_threshold_rep = 0; if (csetup_repp->max_buffers() == true) prefill_threshold_rep = ECA_ENGINE::prefill_threshold_constant / buffersize() / channels; if (prefill_threshold_rep < ECA_ENGINE::prefill_blocks_constant) prefill_threshold_rep = ECA_ENGINE::prefill_blocks_constant; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Prefill loops: " + kvu_numtostr(prefill_threshold_rep) + " (blocksize " + kvu_numtostr(buffersize()) + ")."); } /** * * Called only from init_connection_to_chainsetup(). */ void ECA_ENGINE::init_servers(void) { if (csetup_repp->midi_devices.size() > 0) { use_midi_rep = true; ECA_LOG_MSG(ECA_LOGGER::info, "Initializing MIDI-server."); csetup_repp->midi_server_repp->init(); } } /** * Called only from init_connection_to_chainsetup(). */ void ECA_ENGINE::init_chains(void) { mixslot_repp->number_of_channels(max_channels()); mixslot_repp->event_tag_set(SAMPLE_BUFFER::tag_mixed_content); mixslot_repp->event_tag_set(SAMPLE_BUFFER::tag_var_length, false); cslots_rep.resize(chains_repp->size()); for(size_t n = 0; n < cslots_rep.size(); n++) { cslots_rep[n] = new SAMPLE_BUFFER(buffersize(), max_channels()); cslots_rep[n]->event_tag_set(SAMPLE_BUFFER::tag_var_length, false); } for (unsigned int c = 0; c != chains_repp->size(); c++) { int inch = (*inputs_repp)[(*chains_repp)[c]->connected_input()]->channels(); int outch = (*outputs_repp)[(*chains_repp)[c]->connected_output()]->channels(); (*chains_repp)[c]->init(cslots_rep[c], inch, outch); } } /** * Frees all reserved resources. * * @post status() == ECA_ENGINE::engine_status_notready * @post is_valid() != true */ void ECA_ENGINE::cleanup(void) { if (csetup_repp != 0) { csetup_repp->toggle_locked_state(true); vector::iterator q = csetup_repp->chains.begin(); while(q != csetup_repp->chains.end()) { if (*q != 0) { (*q)->disconnect_buffer(); } ++q; } csetup_repp->toggle_locked_state(false); } csetup_repp = 0; // -- DBC_ENSURE(status() == ECA_ENGINE::engine_status_notready); DBC_ENSURE(is_valid() != true); // -- } /** * Updates 'input_chain_count_rep' and * 'output_chain_count_rep'. */ void ECA_ENGINE::update_cache_chain_connections(void) { input_chain_count_rep.resize(inputs_repp->size()); for(unsigned int n = 0; n < inputs_repp->size(); n++) { input_chain_count_rep[n] = csetup_repp->number_of_attached_chains_to_input(csetup_repp->inputs[n]); } output_chain_count_rep.resize(outputs_repp->size()); for(unsigned int n = 0; n < outputs_repp->size(); n++) { output_chain_count_rep[n] = csetup_repp->number_of_attached_chains_to_output(csetup_repp->outputs[n]); } } /** * Update system latency values for multitrack * recording. */ void ECA_ENGINE::update_cache_latency_values(void) { if (csetup_repp->multitrack_mode() == true && csetup_repp->multitrack_mode_offset() == -1) { long int in_latency = -1; for(unsigned int n = 0; n < realtime_inputs_rep.size(); n++) { if (in_latency == -1) { in_latency = realtime_inputs_rep[n]->latency(); } else { if (in_latency != realtime_inputs_rep[n]->latency()) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Latency mismatch between input objects!"); } } ECA_LOG_MSG(ECA_LOGGER::user_objects, "Input latency for '" + realtime_inputs_rep[n]->name() + "' is " + kvu_numtostr(in_latency) + "."); } long int out_latency = -1; for(unsigned int n = 0; n < realtime_outputs_rep.size(); n++) { if (out_latency == -1) { if (realtime_outputs_rep[n]->prefill_space() > 0) { long int max_prefill = prefill_threshold_rep * buffersize(); if (max_prefill > realtime_outputs_rep[n]->prefill_space()) { max_prefill = realtime_outputs_rep[n]->prefill_space(); } out_latency = max_prefill + realtime_outputs_rep[n]->latency(); } else out_latency = realtime_outputs_rep[n]->latency(); } else { if ((realtime_outputs_rep[n]->prefill_space() > 0 && out_latency != (prefill_threshold_rep * buffersize()) + realtime_outputs_rep[n]->latency()) || (realtime_outputs_rep[n]->prefill_space() == 0 && out_latency != realtime_outputs_rep[n]->latency())) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Latency mismatch between output objects!"); } } ECA_LOG_MSG(ECA_LOGGER::user_objects, "Output latency for '" + realtime_outputs_rep[n]->name() + "' is " + kvu_numtostr(out_latency) + "."); } recording_offset_rep = (out_latency > in_latency ? out_latency : in_latency); if (recording_offset_rep % buffersize()) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Recording offset not divisible with chainsetup buffersize."); } ECA_LOG_MSG(ECA_LOGGER::user_objects, "recording offset is " + kvu_numtostr(recording_offset_rep) + " samples."); } else if (csetup_repp->multitrack_mode() == true) { /* multitrack_mode_offset() explicitly given (not -1) */ recording_offset_rep = csetup_repp->multitrack_mode_offset(); } else { recording_offset_rep = 0; } } /** * Assigns input and output objects in lists of realtime * and nonrealtime objects. */ void ECA_ENGINE::create_cache_object_lists(void) { for(unsigned int n = 0; n < inputs_repp->size(); n++) { if (AUDIO_IO_DEVICE::is_realtime_object((*inputs_repp)[n]) == true) { realtime_inputs_rep.push_back(static_cast((*inputs_repp)[n])); realtime_objects_rep.push_back(static_cast((*inputs_repp)[n])); } else { non_realtime_inputs_rep.push_back((*inputs_repp)[n]); non_realtime_objects_rep.push_back((*inputs_repp)[n]); } } DBC_CHECK(static_cast(realtime_inputs_rep.size()) == csetup_repp->number_of_realtime_inputs()); for(unsigned int n = 0; n < outputs_repp->size(); n++) { if (AUDIO_IO_DEVICE::is_realtime_object((*outputs_repp)[n]) == true) { realtime_outputs_rep.push_back(static_cast((*outputs_repp)[n])); realtime_objects_rep.push_back(static_cast((*outputs_repp)[n])); } else { non_realtime_outputs_rep.push_back((*outputs_repp)[n]); non_realtime_objects_rep.push_back((*outputs_repp)[n]); } } DBC_CHECK(static_cast(realtime_outputs_rep.size()) == csetup_repp->number_of_realtime_outputs()); } /** * Called only from class constructor. */ void ECA_ENGINE::init_profiling(void) { impl_repp->looptimer_low_rep = static_cast(buffersize()) / csetup_repp->samples_per_second(); impl_repp->looptimer_mid_rep = static_cast(buffersize() * 2) / csetup_repp->samples_per_second(); impl_repp->looptimer_high_rep = static_cast(buffersize()) * prefill_threshold_rep / csetup_repp->samples_per_second(); impl_repp->looptimer_rep.set_lower_bound_seconds(impl_repp->looptimer_low_rep); impl_repp->looptimer_rep.set_upper_bound_seconds(impl_repp->looptimer_high_rep); impl_repp->looptimer_range_rep.set_lower_bound_seconds(impl_repp->looptimer_mid_rep); impl_repp->looptimer_range_rep.set_upper_bound_seconds(impl_repp->looptimer_mid_rep); } /** * Prints profiling information to stderr. */ void ECA_ENGINE::dump_profile_info(void) { long int slower_than_rt = impl_repp->looptimer_rep.event_count() - impl_repp->looptimer_rep.events_under_lower_bound() - impl_repp->looptimer_rep.events_over_upper_bound(); cerr << "*** profile begin ***" << endl; cerr << "Loops faster than realtime: " << kvu_numtostr(impl_repp->looptimer_rep.events_under_lower_bound()); cerr << " (<" << kvu_numtostr(impl_repp->looptimer_low_rep * 1000, 1) << " msec)" << endl; cerr << "Loops slower than realtime: " << kvu_numtostr(slower_than_rt); cerr << " (>=" << kvu_numtostr(impl_repp->looptimer_low_rep * 1000, 1) << " msec)" << endl; cerr << "Loops slower than realtime: " << kvu_numtostr(impl_repp->looptimer_range_rep.events_over_upper_bound()); cerr << " (>" << kvu_numtostr(impl_repp->looptimer_mid_rep * 1000, 1) << " msec)" << endl; cerr << "Loops exceeding all buffering: " << kvu_numtostr(impl_repp->looptimer_rep.events_over_upper_bound()); cerr << " (>" << kvu_numtostr(impl_repp->looptimer_high_rep * 1000, 1) << " msec)" << endl; cerr << "Total loops: " << kvu_numtostr(impl_repp->looptimer_rep.event_count()) << endl; cerr << "Fastest/slowest/average loop time: "; cerr << kvu_numtostr(impl_repp->looptimer_rep.min_duration_seconds() * 1000, 1); cerr << "/"; cerr << kvu_numtostr(impl_repp->looptimer_rep.max_duration_seconds() * 1000, 1); cerr << "/"; cerr << kvu_numtostr(impl_repp->looptimer_rep.average_duration_seconds() * 1000, 1); cerr << " msec." << endl; cerr << "*** profile end ***" << endl; } /********************************************************************** * Engine implementation - Private functions for signal routing **********************************************************************/ /** * Reads audio data from input objects. * * context: J-level-1 (see */ void ECA_ENGINE::inputs_to_chains(void) { /** * - go through all inputs * - depending on connectivity, read either to a mixdown slot, or * directly to a per-chain slot */ for(size_t inputnum = 0; inputnum < inputs_repp->size(); inputnum++) { if (input_chain_count_rep[inputnum] > 1) { /* case-1a: read buffer from input 'inputnum' to 'mixslot'; * later (1b) the data is copied to each per-chain slow * to which input is connected to */ mixslot_repp->length_in_samples(buffersize()); if ((*inputs_repp)[inputnum]->finished() != true) { (*inputs_repp)[inputnum]->read_buffer(mixslot_repp); if ((*inputs_repp)[inputnum]->finished() != true) { inputs_not_finished_rep++; } } else { /* note: no more input data for this change (N:1 input-chain case) */ mixslot_repp->make_empty(); } } for (size_t c = 0; c != chains_repp->size(); c++) { if ((*chains_repp)[c]->connected_input() == static_cast(inputnum)) { if (input_chain_count_rep[inputnum] == 1) { /* case-2: read buffer from input 'inputnum' to chain 'c' */ cslots_rep[c]->length_in_samples(buffersize()); if ((*inputs_repp)[inputnum]->finished() != true) { (*inputs_repp)[inputnum]->read_buffer(cslots_rep[c]); if ((*inputs_repp)[inputnum]->finished() != true) { inputs_not_finished_rep++; } } else { /* note: no more input data for this change (1:1 input-chain case) */ cslots_rep[c]->make_empty(); } /* note: input connected to only one chain, so no need to iterate through the other chains */ break; } else { /* case-1b: input connected to chain 'n', copy 'mixslot' to * the matching per-chain slot */ cslots_rep[c]->copy_all_content(*mixslot_repp); } } } } } /** * context: J-level-1 */ void ECA_ENGINE::process_chains(void) { vector::const_iterator p = chains_repp->begin(); while(p != chains_repp->end()) { (*p)->process(); ++p; } } void mix_to_outputs_divide_helper(const SAMPLE_BUFFER *from, SAMPLE_BUFFER *to, int divide_by, bool first_time) { if (first_time == true) { // this is the first output connected to this chain if (from->number_of_channels() < to->number_of_channels()) { to->make_silent(); } to->copy_matching_channels(*from); to->divide_by(divide_by); } else { to->add_with_weight(*from, divide_by); } } void mix_to_outputs_sum_helper(const SAMPLE_BUFFER *from, SAMPLE_BUFFER *to, bool first_time) { if (first_time == true) { // this is the first output connected to this chain if (from->number_of_channels() < to->number_of_channels()) { to->make_silent(); } to->copy_matching_channels(*from); } else { to->add_matching_channels(*from); } } /** * context: J-level-1 */ void ECA_ENGINE::mix_to_outputs(bool skip_realtime_target_outputs) { for(size_t outputnum = 0; outputnum < outputs_repp->size(); outputnum++) { if (skip_realtime_target_outputs == true) { if (csetup_repp->is_realtime_target_output(outputnum) == true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Skipping rt-target output " + (*outputs_repp)[outputnum]->label() + "."); continue; } } int count = 0; /* FIXME: number_of_channels() may end up allocating memory! */ mixslot_repp->number_of_channels((*outputs_repp)[outputnum]->channels()); for(size_t n = 0; n != chains_repp->size(); n++) { // -- // if chain is already released, skip // -- if ((*chains_repp)[n]->connected_output() == -1) { // -- // skip, if chain is not connected // -- continue; } if ((*chains_repp)[n]->connected_output() == static_cast(outputnum)) { // -- // output is connected to this chain // -- if (output_chain_count_rep[outputnum] == 1) { // -- // there's only one output connected to this chain, // so we don't need to mix anything // -- (*outputs_repp)[outputnum]->write_buffer(cslots_rep[n]); if ((*outputs_repp)[outputnum]->finished() == true) /* note: loop devices always connected both as inputs as * outputs, so their finished status must not be * counted as an error (like for other output types) */ if (dynamic_cast((*outputs_repp)[outputnum]) == 0) outputs_finished_rep++; break; } else { ++count; if (csetup_repp->mix_mode() == ECA_CHAINSETUP::cs_mmode_avg) mix_to_outputs_divide_helper(cslots_rep[n], mixslot_repp, output_chain_count_rep[outputnum], (count == 1)); else mix_to_outputs_sum_helper(cslots_rep[n], mixslot_repp, (count == 1)); mixslot_repp->event_tags_add(*cslots_rep[n]); if (count == output_chain_count_rep[outputnum]) { (*outputs_repp)[outputnum]->write_buffer(mixslot_repp); if ((*outputs_repp)[outputnum]->finished() == true) /* note: loop devices always connected both as inputs as * outputs, so their finished status must not be * counted as an error (like for other output types) */ if (dynamic_cast((*outputs_repp)[outputnum]) == 0) outputs_finished_rep++; } } } } } } /********************************************************************** * Engine implementation - Obsolete functions **********************************************************************/ ecasound-2.9.3/libecasound/linear-envelope.cpp0000644000076400007640000000405311034535034016340 00000000000000// ------------------------------------------------------------------------ // linear-envelope.cpp: Linear envelope // Copyright (C) 1999-2002,2005,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "linear-envelope.h" #include "eca-logger.h" LINEAR_ENVELOPE::LINEAR_ENVELOPE(void) { } LINEAR_ENVELOPE::~LINEAR_ENVELOPE(void) { } CONTROLLER_SOURCE::parameter_t LINEAR_ENVELOPE::value(double pos) { parameter_t retval; /* note: position may go beyond stages_len_rep */ if (pos < stages_len_rep) { retval = (pos / stages_len_rep); } else retval = 1.0f; return retval; } void LINEAR_ENVELOPE::init(void) { MESSAGE_ITEM otemp; otemp << "Linear enveloped initialized; length "; otemp.setprecision(3); otemp << stages_len_rep; otemp << " seconds."; ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } void LINEAR_ENVELOPE::set_parameter(int param, CONTROLLER_SOURCE::parameter_t value) { switch (param) { case 1: stages_len_rep = value; break; } } CONTROLLER_SOURCE::parameter_t LINEAR_ENVELOPE::get_parameter(int param) const { switch (param) { case 1: return stages_len_rep; } return 0.0; } ecasound-2.9.3/libecasound/generic-linear-envelope_test.h0000644000076400007640000000627612501330734020467 00000000000000// ------------------------------------------------------------------------ // generic-linear-envelope_tests.h: Unit test // Copyright (C) 2011 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "generic-linear-envelope.h" #include "eca-logger.h" #include "eca-test-case.h" using namespace std; /** * Unit test for GENERIC_LINEAR_ENVELOPE class. */ class GENERIC_LINEAR_ENVELOPE_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("GENERIC_LINEAR_ENVELOPE"); } virtual void do_run(void); public: virtual ~GENERIC_LINEAR_ENVELOPE_TEST(void) { } private: bool roughly_same(float a, float b); }; bool GENERIC_LINEAR_ENVELOPE_TEST::roughly_same(float a, float b) { const int significant_bits = 24; const double diff_threshold = 1.0 / ((1 << significant_bits) - 1); double diff = std::fabs(a - b); if (diff > diff_threshold) return false; return true; } void GENERIC_LINEAR_ENVELOPE_TEST::do_run(void) { GENERIC_LINEAR_ENVELOPE f; f.set_parameter(1, 4); f.set_parameter(2, 40.0);// point1 f.set_parameter(3, 0.1); f.set_parameter(4, 100); // point2 f.set_parameter(5, 0.5); f.set_parameter(6, 200); // point3 f.set_parameter(7, 1); f.set_parameter(8, 500); // point4 f.set_parameter(9, 0.9); f.set_parameter(10, 0); // invalid param f.set_parameter(11, 0); // invalid param f.init(); if (roughly_same(f.value(-10.0), 0.1) != true) ECA_TEST_FAILURE("at pos -10.0s (invalid)"); if (roughly_same(f.value(0.0), 0.1) != true) ECA_TEST_FAILURE("at pos 0.0s (start)"); if (roughly_same(f.value(10.0), 0.1) != true) ECA_TEST_FAILURE("at pos 10.0s"); if (roughly_same(f.value(40.0), 0.1) != true) ECA_TEST_FAILURE("at pos 40.0s"); if (f.value(250) <= 0.9 || f.value(250) >= 1.0) ECA_TEST_FAILURE("at pos 250.0s"); if (f.value(251) <= 0.9 || f.value(251) >= 1.0) ECA_TEST_FAILURE("at pos 251.0s"); if (f.value(60) <= 0.1 || f.value(60) >= 0.5) ECA_TEST_FAILURE("at pos 60.0s"); if (f.value(250) <= 0.9 || f.value(250) >= 1.0) ECA_TEST_FAILURE("at pos 250.0s"); if (f.value(60) <= 0.1 || f.value(60) >= 0.5) ECA_TEST_FAILURE("at pos 60.0s"); if (roughly_same(f.value(10.0), 0.1) != true) ECA_TEST_FAILURE("retest pos 10.0s"); if (f.value(60) <= 0.1 || f.value(60) >= 0.5) ECA_TEST_FAILURE("retest pos 60.0s"); if (roughly_same(f.value(2000.0), 0.9) != true) ECA_TEST_FAILURE("at pos 2000.0s (end)"); } ecasound-2.9.3/libecasound/audioio-mikmod.cpp0000644000076400007640000001166611137153267016202 00000000000000// ------------------------------------------------------------------------ // audioio-mikmod.cpp: Interface class for MikMod input. Uses FIFO pipes. // Copyright (C) 1999-2000,2004-2006,2008,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* stat() */ #include /* stat() */ #include #include "audioio-mikmod.h" #include "eca-logger.h" using namespace std; string MIKMOD_INTERFACE::default_mikmod_cmd = "mikmod -d stdout -o 16s -q -f %s -p 0 --noloops %f"; void MIKMOD_INTERFACE::set_mikmod_cmd(const std::string& value) { MIKMOD_INTERFACE::default_mikmod_cmd = value; } MIKMOD_INTERFACE::MIKMOD_INTERFACE(const std::string& name) : triggered_rep(false), finished_rep(false) { } MIKMOD_INTERFACE::~MIKMOD_INTERFACE(void) { clean_child(true); if (is_open() == true) { close(); } } void MIKMOD_INTERFACE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { std::string urlprefix; triggered_rep = false; finished_rep = false; string real_filename = label(); if (real_filename == "mikmod") { real_filename = opt_filename_rep; } struct stat buf; int ret = ::stat(real_filename.c_str(), &buf); if (ret != 0) { size_t offset = real_filename.find_first_of("://"); if (offset == std::string::npos) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-MIKMOD: Can't open file " + real_filename + ".")); } else { urlprefix = std::string(real_filename, 0, offset); ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audioio-mikmod) Found url; protocol '" + urlprefix + "'."); } } /* decoder supports: s16 samples, 2 channels, srate configurable no support for: endianess (use native) */ set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16); set_channels(2); AUDIO_IO::open(); } void MIKMOD_INTERFACE::close(void) { if (pid_of_child() > 0) { if (io_mode() == io_read) { kill_mikmod(); } } AUDIO_IO::close(); } long int MIKMOD_INTERFACE::read_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_mikmod(); } bytes_read_rep = ::fread(target_buffer, 1, frame_size() * samples, f1_rep); if (bytes_read_rep < samples * frame_size() || bytes_read_rep == 0) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::info, "(audioio-mikmod) Can't start process \"" + MIKMOD_INTERFACE::default_mikmod_cmd + "\". Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; } else finished_rep = false; return(bytes_read_rep / frame_size()); } void MIKMOD_INTERFACE::kill_mikmod(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audioio-mikmod) Cleaning mikmod-child with pid " + kvu_numtostr(pid_of_child()) + "."); clean_child(); triggered_rep = false; } void MIKMOD_INTERFACE::fork_mikmod(void) { string real_filename = label(); if (real_filename == "mikmod") { real_filename = opt_filename_rep; } set_fork_command(MIKMOD_INTERFACE::default_mikmod_cmd); set_fork_file_name(real_filename); set_fork_sample_rate(samples_per_second()); fork_child_for_read(); if (child_fork_succeeded() == true) { /* NOTE: the file description will be closed by * AUDIO_IO_FORKED_STREAM::clean_child() */ filedes_rep = file_descriptor(); f1_rep = fdopen(filedes_rep, "r"); /* not part of */ if (f1_rep == 0) { finished_rep = true; triggered_rep = false; } } } void MIKMOD_INTERFACE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: opt_filename_rep = value; break; } } string MIKMOD_INTERFACE::get_parameter(int param) const { switch (param) { case 1: return(label()); case 2: return(opt_filename_rep); } return(""); } void MIKMOD_INTERFACE::start_io(void) { if (triggered_rep != true) { if (io_mode() == io_read) fork_mikmod(); triggered_rep = true; } } void MIKMOD_INTERFACE::stop_io(void) { if (triggered_rep == true) { if (io_mode() == io_read) clean_child(true); triggered_rep = false; } } ecasound-2.9.3/libecasound/audioio-mp3.h0000644000076400007640000000556711161425433015063 00000000000000#ifndef INCLUDED_AUDIOIO_MP3_H #define INCLUDED_AUDIOIO_MP3_H #include #include #include "audioio-buffered.h" #include "audioio-forked-stream.h" #include "sample-specs.h" /** * Interface for mp3 decoders and encoders that support * input/output using standard streams. Defaults to * mpg123 and lame. * @author Kai Vehmanen */ class MP3FILE : public AUDIO_IO_BUFFERED, public AUDIO_IO_FORKED_STREAM { private: static std::string conf_input_cmd; static std::string conf_output_cmd; static long int conf_default_output_bitrate; public: static void set_input_cmd(const std::string& value); static void set_output_cmd(const std::string& value); public: MP3FILE (const std::string& name = ""); virtual ~MP3FILE(void); virtual MP3FILE* clone(void) const { return new MP3FILE(*this); } virtual MP3FILE* new_expr(void) const { return new MP3FILE(*this); } virtual std::string name(void) const { return("Mp3 stream"); } virtual std::string description(void) const { return("Interface for mp3 decoders and encoders that support input/output using standard streams."); } virtual std::string parameter_names(void) const { return("label,bitrate"); } virtual bool locked_audio_format(void) const { return(true); } virtual int supported_io_modes(void) const { return(io_read | io_write); } virtual bool supports_seeking(void) const { return io_mode() == io_read; } virtual bool supports_seeking_sample_accurate(void) const { return false; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const { return finished_rep; } virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; virtual void start_io(void); virtual void stop_io(void); protected: /* functions called by AUDIO_IO_FORKED_STREAM that require * the use of AUDIO_IO methods */ virtual bool do_supports_seeking(void) const { return supports_seeking(); } virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { set_position_in_samples(pos); } private: bool finished_rep; bool triggered_rep; int pid_of_child_rep; long pcm_rep; long int bytes_rep; long int bitrate_rep; SAMPLE_SPECS::sample_pos_t last_position_rep; int filedes_rep; FILE* filehandle_rep; bool mono_input_rep; void process_mono_fix(char* target_buffer, long int bytes_rep); void get_mp3_params(const std::string& fname) throw(AUDIO_IO::SETUP_ERROR&); // MP3FILE(const MP3FILE& x) { } MP3FILE& operator=(const MP3FILE& x) { return *this; } void fork_input_process(void); void fork_output_process(void); }; #endif ecasound-2.9.3/libecasound/midiio-raw.h0000644000076400007640000000243610664032032014762 00000000000000#ifndef INCLUDED_MIDIIO_RAW_H #define INCLUDED_MIDIIO_RAW_H #include #include "midiio.h" /** * Input and output of raw MIDI streams using standard * UNIX file operations. * * @author Kai Vehmanen */ class MIDI_IO_RAW : public MIDI_IO { public: MIDI_IO_RAW (const std::string& name = ""); virtual ~MIDI_IO_RAW(void); virtual MIDI_IO_RAW* clone(void) const { return(new MIDI_IO_RAW(*this)); } virtual MIDI_IO_RAW* new_expr(void) const { return new MIDI_IO_RAW(); } virtual std::string name(void) const { return("Raw MIDI"); } virtual int supported_io_modes(void) const { return(io_read | io_write | io_readwrite); } virtual bool supports_nonblocking_mode(void) const { return(true); } virtual int poll_descriptor(void) const { return(fd_rep); } virtual std::string parameter_names(void) const { return("label,device_name"); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; virtual void open(void); virtual void close(void); virtual long int read_bytes(void* target_buffer, long int bytes); virtual long int write_bytes(void* target_buffer, long int bytes); virtual bool finished(void) const; private: int fd_rep; bool finished_rep; std::string device_name_rep; }; #endif ecasound-2.9.3/libecasound/eca-control.h0000644000076400007640000003376611762503450015150 00000000000000// ------------------------------------------------------------------------ // eca-control.h: ECA_CONTROL class // Copyright (C) 2009,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_CONTROL_H #define INCLUDED_ECA_CONTROL_H #include #include #include #include "kvu_locks.h" #include "ctrl-source.h" #include "eca-audio-format.h" #include "eca-chainop.h" #include "eca-chainsetup-edit.h" #include "eca-control-dump.h" #include "eca-control-main.h" #include "eca-iamode-parser.h" #include "sample-specs.h" class AUDIO_IO; class CHAIN_OPERATOR; class GENERIC_CONTROLLER; class ECA_CHAINSETUP; class ECA_ENGINE; class ECA_OBJECT_MAP; class ECA_SESSION; /** * High-level interface to libecasound functionality * * @see ECA_CONTROL_MAIN, ECA_CONTROL_MT * * Related design patters: Facade (GoF185) * * @author Kai Vehmanen */ class ECA_CONTROL : public ECA_IAMODE_PARSER, public ECA_CONTROL_MAIN { public: /** @name Constructors and dtors */ /*@{*/ ECA_CONTROL (ECA_SESSION* psession); ~ECA_CONTROL (void); /*@}*/ // ------------------------------------------------------------------- /** @name ECA_CONTROL_MAIN subset */ virtual bool is_running(void) const; virtual bool is_connected(void) const; virtual bool is_selected(void) const; virtual bool is_finished(void) const; virtual bool is_valid(void) const; virtual bool is_engine_created(void) const; virtual bool is_engine_ready_for_commands(void) const; virtual void engine_start(void); virtual int start(void); virtual void stop(void); virtual void stop_on_condition(void); virtual int run(bool batchmode = true); virtual void quit(void); virtual void quit_async(void); virtual void connect_chainsetup(struct eci_return_value *retval); virtual void disconnect_chainsetup(void); virtual const ECA_CHAINSETUP* get_connected_chainsetup(void) const; virtual bool execute_edit_on_connected(const ECA::chainsetup_edit_t& edit); virtual bool execute_edit_on_selected(const ECA::chainsetup_edit_t& edit, int index = -1); virtual void print_last_value(struct eci_return_value *retval) const; virtual void command(const std::string& cmd_and_args, struct eci_return_value *retval); virtual void command_float_arg(const std::string& cmd, double arg, struct eci_return_value *retval); /*@}*/ // ------------------------------------------------------------------- /** @name Public functions for observing status * (note: implemented in eca-control-base.cpp) */ /*@{*/ std::string engine_status(void) const; SAMPLE_SPECS::sample_pos_t length_in_samples(void) const; double length_in_seconds_exact(void) const; SAMPLE_SPECS::sample_pos_t position_in_samples(void) const; double position_in_seconds_exact(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Public functions for resource file access */ /*@{*/ /** * Get resource values from ~/.ecasoundrc */ std::string resource_value(const std::string& key) const; /*@}*/ // ------------------------------------------------------------------- /** @name Public functions for chainsetup setup * (note: implementated in eca-control-objects.cpp) */ /*@{*/ void add_chainsetup(const std::string& name); void remove_chainsetup(void); void load_chainsetup(const std::string& filename); void save_chainsetup(const std::string& filename); void select_chainsetup(const std::string& name); void select_chainsetup_by_index(int index); void edit_chainsetup(void); std::string selected_chainsetup(void) const; std::string connected_chainsetup(void) const; void change_chainsetup_position(double seconds); void change_chainsetup_position_samples(SAMPLE_SPECS::sample_pos_t samples); void set_chainsetup_position(double seconds); void set_chainsetup_position_samples(SAMPLE_SPECS::sample_pos_t samples); double chainsetup_position(double seconds) const; const ECA_CHAINSETUP* get_chainsetup(void) const; const ECA_CHAINSETUP* get_chainsetup_filename(const std::string& filename) const; std::vector chainsetup_names(void) const; const std::string& chainsetup_filename(void) const; int chainsetup_buffersize(void) const; void set_chainsetup_filename(const std::string& name); void set_chainsetup_parameter(const std::string& name); void set_chainsetup_sample_format(const std::string& name); void set_chainsetup_processing_length_in_seconds(double value); void set_chainsetup_processing_length_in_samples(SAMPLE_SPECS::sample_pos_t value); void set_chainsetup_output_mode(int output_mode); void toggle_chainsetup_looping(void); void set_chainsetup_buffersize(int bsize); /*@}*/ // ------------------------------------------------------------------- /** @name Public functions for chain setup * (note: implemented in eca-control-objects.cpp) */ /*@{*/ void add_chain(const std::string& names); void add_chains(const std::string& names); void add_chains(const std::vector& names); void remove_chains(void); void select_chains_by_index(const std::vector& index_numbers); void select_chain(const std::string& chain); void select_chains(const std::vector& chains); void deselect_chains(const std::vector& chains); void select_all_chains(void); const std::vector& selected_chains(void) const; std::vector chain_names(void) const; const CHAIN* get_chain(void) const; bool chain_is_bypassed(void) const; bool chain_is_muted(void) const; void clear_chains(void); void rename_chain(const std::string& name); void set_chain_muting(const string &arg); void set_chain_bypass(const string &arg); /*@}*/ // ------------------------------------------------------------------- /** @name Managing chain operators and controllers * (note: implemented in eca-control-objects.cpp) */ /*@{*/ void add_audio_input(const std::string& filename); void remove_audio_input(void); void attach_audio_input(void); void select_audio_input(const std::string& name); void select_audio_input_by_index(int index); void add_audio_output(const std::string& filename); void add_default_output(void); void remove_audio_output(void); void attach_audio_output(void); void select_audio_output(const std::string& name); void select_audio_output_by_index(int index); void set_default_audio_format(const std::string& sfrm, int channels, long int srate, bool interleaving); void set_default_audio_format(const ECA_AUDIO_FORMAT& format); void set_default_audio_format_to_selected_input(void); void set_default_audio_format_to_selected_output(void); std::string attached_chains_input(AUDIO_IO* aiod) const; std::string attached_chains_output(AUDIO_IO* aiod) const; std::vector attached_chains(const std::string& name) const; const AUDIO_IO* get_audio_input(void); std::vector audio_input_names(void) const; const AUDIO_IO* get_audio_output(void); std::vector audio_output_names(void) const; const ECA_AUDIO_FORMAT& default_audio_format(void) const; ECA_AUDIO_FORMAT get_audio_format(AUDIO_IO* aobj) const; /*@}*/ // ------------------------------------------------------------------- /** @name Managing chain operators and controllers * (note: implemented in eca-control-objects.cpp) */ /*@{*/ void add_chain_operator(const std::string& chainop_params); void add_chain_operator(CHAIN_OPERATOR* cotmp); void bypass_chain_operator(const string& arg); bool chain_operator_is_bypassed(void) const; void remove_chain_operator(void); void select_chain_operator(int chainop_id); void select_chain_operator_parameter(int param); void set_chain_operator_parameter(CHAIN_OPERATOR::parameter_t value); void set_chain_operator_parameter(int chain, int op, int param, CHAIN_OPERATOR::parameter_t value); int selected_chain_operator(void) const; int selected_chain_operator_parameter(void) const; const CHAIN_OPERATOR* get_chain_operator(void) const; CHAIN_OPERATOR::parameter_t get_chain_operator_parameter(void) const; std::vector chain_operator_names(void) const; std::vector chain_operator_parameter_names(void) const; void add_controller(const std::string& gcontrol_params); void select_controller(int ctrl_id); void select_controller_parameter(int param); void set_controller_parameter(CHAIN_OPERATOR::parameter_t value); void remove_controller(void); int selected_controller(void) const; int selected_controller_parameter(void) const; int selected_controller_target(void) const; const GENERIC_CONTROLLER* get_controller(void) const; CONTROLLER_SOURCE::parameter_t get_controller_parameter(void) const; std::vector controller_names(void) const; std::vector controller_parameter_names(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Public functions for executing ECI commands */ /*@{*/ /** * See ECA_IAMODE_PARSER for detailed decsription of 'action_id'. * * Result of the command can be queried with last_value_to_string(). */ void action(int action_id, const std::vector& args); std::string last_error(void) const; /*@}*/ // ------------------------------------------------------------------- /** @name Implemenetations of ECI status commands */ /*@{*/ /** * Return info about chainsetups */ std::string chainsetup_status(void) const; /** * Return info about current chain status * * require: * is_selected() == true * selected_chains().size() > 0 */ std::string chain_status(void) const; /** * Return info about inputs and outputs */ std::string aio_status(void) const; /** * Return info about chain operators (selected chainsetup) * * require: * is_selected() == true */ std::string chain_operator_status(void) const; /** * Return info about controllers (selected chainsetup) * * require: * is_selected() == true */ std::string controller_status(void) const; void aio_register(void); void cop_register(void); void preset_register(void); void ladspa_register(void); void lv2_register(void); void ctrl_register(void); void operator_descriptions_helper(const ECA_OBJECT_MAP& arg, std::string* result); void cop_descriptions(void); void preset_descriptions(void); void ladspa_descriptions(bool use_id); void lv2_descriptions(void); void ctrl_descriptions(void); /*@}*/ // ------------------------------------------------------------------- /** @name Helper functions */ /*@{*/ int float_to_string_precision(void) const { return(float_to_string_precision_rep); } /*@}*/ // ------------------------------------------------------------------- protected: void set_float_to_string_precision(int precision); std::string float_to_string(double n) const; private: void set_last_string_list(const std::vector& s); void set_last_string(const std::list& s); void set_last_string(const std::string& s); void set_last_float(double v); void set_last_integer(int v); void set_last_long_integer(long int v); void set_last_error(const std::string& s); void clear_last_values(void); static void* start_normal_thread(void *ptr); void start_engine_sub(bool batchmode); void close_engine(void); void run_engine(void); std::string chainsetup_details_to_string(const ECA_CHAINSETUP* cs) const; void audio_input_as_selected(void); void audio_output_as_selected(void); void rewind_audio_object(double seconds); void forward_audio_object(double seconds); void set_audio_object_position(double seconds); void set_audio_object_position_samples(SAMPLE_SPECS::sample_pos_t samples); void wave_edit_audio_object(void); CHAIN* get_chain_priv(void) const; void action(int action_id); void check_action_preconditions(int action_id); void chainsetup_option(const std::string& cmd); void set_action_argument(const std::string& s); void set_action_argument(const std::vector& s); void set_action_argument(double v); void clear_action_arguments(void); double first_action_argument_as_float(void) const; std::string first_action_argument_as_string(void) const; int first_action_argument_as_int(void) const; long int first_action_argument_as_long_int(void) const; SAMPLE_SPECS::sample_pos_t first_action_argument_as_samples(void) const; const std::vector& action_arguments_as_vector(void) const; void fill_command_retval(struct eci_return_value *retval) const; bool action_helper_check_cop_op_args(int copid, int coppid); ECA_ENGINE* engine_repp; ECA_SESSION* session_repp; ECA_CHAINSETUP* selected_chainsetup_repp; ECA_CONTROL_DUMP ctrl_dump_rep; bool req_batchmode_rep; pthread_t th_cqueue_rep; ATOMIC_INTEGER engine_exited_rep; int engine_pid_rep; int last_exec_res_rep; bool joining_rep; int float_to_string_precision_rep; AUDIO_IO* selected_audio_object_repp; AUDIO_IO* selected_audio_input_repp; AUDIO_IO* selected_audio_output_repp; struct eci_return_value last_retval_rep; bool wellformed_mode_rep; std::vector action_args_rep; double action_arg_f_rep; bool action_arg_f_set_rep; bool action_ok; bool action_reconnect; bool action_restart; }; #endif ecasound-2.9.3/libecasound/midi-parser.cpp0000644000076400007640000000357610664032032015476 00000000000000// ------------------------------------------------------------------------ // midi-parser.cpp: Collection of static functions and small stateful // machines for parsing MIDI messages. // Copyright (C) 2001 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "midi-parser.h" /** * Whether 'byte' belong to Voice Category status messages * (ie. 0x80 to 0xef)? */ bool MIDI_PARSER::is_voice_category_status_byte(unsigned char byte) { if (byte >= 0x80 && byte < 0xf0) return(true); return(false); } /** * Whether 'byte' belong to System Common Category status messages * (ie. 0xf0 to 0xf7)? */ bool MIDI_PARSER::is_system_common_category_status_byte(unsigned char byte) { if (byte >= 0xf0 && byte < 0xf8) return(true); return(false); } /** * Whether 'byte' belongs to Realtime Category status messages * (ie. 0xf8 to 0xff)? */ bool MIDI_PARSER::is_realtime_category_status_byte(unsigned char byte) { if (byte > 0xf7) return(true); return(false); } /** * Whether 'byte' is a status byte (0x80 to 0xff)? */ bool MIDI_PARSER::is_status_byte(unsigned char byte) { if (byte & 0x80) return(true); return(false); } ecasound-2.9.3/libecasound/audioio-rtnull.h0000644000076400007640000000276310664032032015673 00000000000000#ifndef INCLUDED_AUDIOIO_RTNULL_H #define INCLUDED_AUDIOIO_RTNULL_H #include #include "audioio-device.h" /** * Null audio object with realtime behaviour */ class REALTIME_NULL : public AUDIO_IO_DEVICE { public: virtual std::string name(void) const { return("Realtime null device"); } /** @name Function reimplemented from AUDIO_IO */ /*@{*/ virtual void open(void) throw (AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); /*@}*/ /** @name Function reimplemented from AUDIO_IO_DEVICE */ /*@{*/ virtual void prepare(void); virtual void stop(void); virtual void start(void); virtual long int delay(void) const; virtual long int prefill_space(void) const; /*@}*/ REALTIME_NULL(const std::string& name = "realtime null"); virtual ~REALTIME_NULL(void); REALTIME_NULL* clone(void) const { return new REALTIME_NULL(*this); } REALTIME_NULL* new_expr(void) const { return new REALTIME_NULL(); } private: void calculate_device_position(void); void calculate_available_data(void) const; void block_until_data_available(void); int total_buffers_rep; mutable int xruns_rep; struct timeval start_time_rep; struct timeval time_since_start_rep; struct timeval buffer_length_rep; struct timeval total_buffer_length_rep; struct timeval data_processed_rep; mutable struct timeval avail_data_rep; }; #endif ecasound-2.9.3/libecasound/audiofx_lv2_world.h0000644000076400007640000000177411740524567016375 00000000000000#ifndef ECA_LV2_WORLD_H #define ECA_LV2_WORLD_H #if ECA_USE_LIBLILV #include class ECA_LV2_WORLD { static ECA_LV2_WORLD i; public: static LilvWorld* World(); static LilvNode* AudioClassNode(); static LilvNode* ControlClassNode(); static LilvNode* InputClassNode(); static LilvNode* OutputClassNode(); static LilvNode* InPlaceBrokenNode(); static LilvNode* PortToggledNode(); static LilvNode* PortIntegerNode(); static LilvNode* PortLogarithmicNode(); static LilvNode* PortSamplerateDependentNode(); static LilvNode* PortConnectionOptionalNode(); private: ECA_LV2_WORLD(); ~ECA_LV2_WORLD(); LilvWorld* lilvworld; LilvNode* audioclassnode; LilvNode* controlclassnode; LilvNode* inputclassnode; LilvNode* outputclassnode; LilvNode* inplacebrokennode; LilvNode* porttogglednode; LilvNode* portintegernode; LilvNode* portlogarithmicnode; LilvNode* portsampleratedependentnode; LilvNode* portconnectionoptionalnode; }; #endif /* ECA_USE_LIBLILV */ #endif // ECA_LV2_WORLD_H ecasound-2.9.3/libecasound/eca-version.h0000644000076400007640000000150710664032032015132 00000000000000#ifndef INCLUDED_ECA_VERSION_H #define INCLUDED_ECA_VERSION_H /** * Ecasound library version as a formatted std::string. * * "vX.Y[.Z[.R]][-extraT]" : * * X = major version - the overall development status * * Y = minor version - represents a set of planned features (see TODO) * * Z = micro version - small changes to major.minor version * * R = revision - urgent fixes to normal releases (optional) * * extraT - beta, pre and rc releases that are in * preparation of major releases */ extern const char* ecasound_library_version; /** * Ecasound library libtool version number (current:revision:age) */ extern const long int ecasound_library_version_current; extern const long int ecasound_library_version_revision; extern const long int ecasound_library_version_age; #endif ecasound-2.9.3/libecasound/eca-test-repository.cpp0000644000076400007640000001032111544701326017175 00000000000000// ------------------------------------------------------------------------ // eca-test-repository.cpp: A testing subsystem implemented as a // singleton class. // Copyright (C) 2002,2003,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "kvu_locks.h" #include "kvu_numtostr.h" #include "eca-logger.h" #include "eca-test-repository.h" using namespace std; ECA_TEST_REPOSITORY* ECA_TEST_REPOSITORY::interface_impl_repp = 0; pthread_mutex_t ECA_TEST_REPOSITORY::lock_rep = PTHREAD_MUTEX_INITIALIZER; ECA_TEST_REPOSITORY& ECA_TEST_REPOSITORY::instance(void) { // // Note! Below we use the Double-Checked Locking Pattern // to protect against concurrent access if (interface_impl_repp == 0) { KVU_GUARD_LOCK guard(&ECA_TEST_REPOSITORY::lock_rep); if (interface_impl_repp == 0) { interface_impl_repp = new ECA_TEST_REPOSITORY(); } } return(*interface_impl_repp); } /** * List of unit tests defined in libecasound. */ #include "audiofx_amplitude_test.h" #include "eca-audio-time_test.h" #include "eca-control_test.h" #include "eca-session_test.h" #include "eca-object-factory_test.h" #include "eca-sample-conversion_test.h" #include "eca-chainsetup_test.h" #include "eca-chainsetup-parser_test.h" #include "generic-linear-envelope_test.h" #include "samplebuffer_test.h" /** * Class constructor. * * Registers known tests in libecasound to * the repository. */ ECA_TEST_REPOSITORY::ECA_TEST_REPOSITORY(void) { test_cases_rep.push_back(new EFFECT_AMPLIFY_TEST()); test_cases_rep.push_back(new EFFECT_AMPLIFY_CHANNEL_TEST()); test_cases_rep.push_back(new ECA_AUDIO_TIME_TEST()); test_cases_rep.push_back(new ECA_SESSION_TEST()); test_cases_rep.push_back(new ECA_CONTROL_TEST()); test_cases_rep.push_back(new ECA_OBJECT_FACTORY_TEST()); test_cases_rep.push_back(new ECA_SAMPLE_CONVERSION_TEST()); test_cases_rep.push_back(new ECA_CHAINSETUP_TEST()); test_cases_rep.push_back(new ECA_CHAINSETUP_PARSER_TEST()); test_cases_rep.push_back(new GENERIC_LINEAR_ENVELOPE_TEST()); test_cases_rep.push_back(new SAMPLE_BUFFER_TEST()); } /** * Class destructor. */ ECA_TEST_REPOSITORY::~ECA_TEST_REPOSITORY(void) { } void ECA_TEST_REPOSITORY::do_run_worker(ECA_TEST_CASE* testcase) { ECA_LOG_MSG(ECA_LOGGER::info, "Running test case '" + testcase->name() + "'."); testcase->run(); if (testcase->success() != true) { string errormsg = (string("Test case ") + testcase->name() + string(" FAILED.")); ECA_LOG_MSG(ECA_LOGGER::user_objects, errormsg); ECA_TEST_FAILURE(errormsg); const list& failures = testcase->failures(); list::const_iterator q = failures.begin(); int m = 1; while(q != failures.end()) { ECA_TEST_FAILURE(testcase->name() + ":" + kvu_numtostr(m++) + ". " + *q); ++q; } } else { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Test case '" + testcase->name() + "' passed."); } } void ECA_TEST_REPOSITORY::do_run(const std::string& name) { list::const_iterator p = test_cases_rep.begin(); while(p != test_cases_rep.end()) { if ((*p)->name() == name) { do_run_worker(*p); return; } ++p; } ECA_TEST_FAILURE("Test case with name '" + name + "' not found."); } void ECA_TEST_REPOSITORY::do_run(void) { list::const_iterator p = test_cases_rep.begin(); while(p != test_cases_rep.end()) { do_run_worker(*p); ++p; } } ecasound-2.9.3/libecasound/audiofx_amplitude_test.h0000644000076400007640000000732711167617621017503 00000000000000// ------------------------------------------------------------------------ // audiofx_amplitu_test.h: Unit tests for EFFECT_AMPLIFY* classes // Copyright (C) 2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include "kvu_dbc.h" #include "kvu_inttypes.h" #include "audiofx_amplitude.h" #include "samplebuffer_functions.h" #include "eca-test-case.h" using namespace std; /** * Unit test for EFFECT_AMPLIFY */ class EFFECT_AMPLIFY_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("EFFECT_AMPLIFY"); } virtual void do_run(void); public: virtual ~EFFECT_AMPLIFY_TEST(void) { } private: }; void EFFECT_AMPLIFY_TEST::do_run(void) { const int bufsize = 1024; const int channels = 12; const SAMPLE_BUFFER::sample_t multiplier = 112.1f; std::fprintf(stdout, "%s: tests for %s class\n", name().c_str(), __FILE__); /* case: multiply_by */ { std::fprintf(stdout, "%s: EFFECT_AMPLIFY::process\n", __FILE__); SAMPLE_BUFFER sbuf_test (bufsize, channels); SAMPLE_BUFFER sbuf_ref (bufsize, channels); EFFECT_AMPLIFY amp_test; EFFECT_AMPLIFY amp_ref; SAMPLE_BUFFER_FUNCTIONS::fill_with_random_samples(&sbuf_ref); sbuf_test.copy_all_content(sbuf_ref); amp_test.init(&sbuf_test); amp_ref.init(&sbuf_ref); amp_test.set_parameter(1, multiplier); amp_ref.set_parameter(1, multiplier); amp_test.process(); amp_ref.process_ref(); if (SAMPLE_BUFFER_FUNCTIONS::is_almost_equal(sbuf_ref, sbuf_test) != true) { ECA_TEST_FAILURE("optimized EFFECT_AMPLIFY"); } } } /** * Unit test for EFFECT_AMPLIFY_CHANNEL */ class EFFECT_AMPLIFY_CHANNEL_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("EFFECT_AMPLIFY_CHANNEL"); } virtual void do_run(void); public: virtual ~EFFECT_AMPLIFY_CHANNEL_TEST(void) { } private: }; void EFFECT_AMPLIFY_CHANNEL_TEST::do_run(void) { const int bufsize = 1024; const int channels = 12; const SAMPLE_BUFFER::sample_t multiplier = 112.1f; std::fprintf(stdout, "%s: tests for %s class\n", name().c_str(), __FILE__); /* case: process() */ { std::fprintf(stdout, "%s: process()\n", __FILE__); SAMPLE_BUFFER sbuf_test (bufsize, channels); SAMPLE_BUFFER sbuf_ref (bufsize, channels); EFFECT_AMPLIFY_CHANNEL amp_test; EFFECT_AMPLIFY_CHANNEL amp_ref; SAMPLE_BUFFER_FUNCTIONS::fill_with_random_samples(&sbuf_ref); sbuf_test.copy_all_content(sbuf_ref); amp_test.init(&sbuf_test); amp_ref.init(&sbuf_ref); amp_test.set_parameter(1, multiplier); amp_test.set_parameter(2, 3); amp_ref.set_parameter(1, multiplier); amp_ref.set_parameter(2, 3); amp_test.process(); amp_ref.process_ref(); if (SAMPLE_BUFFER_FUNCTIONS::is_almost_equal(sbuf_ref, sbuf_test) != true) { ECA_TEST_FAILURE("optimized process()"); } } } ecasound-2.9.3/libecasound/audioio-manager.h0000644000076400007640000000414210765307210015763 00000000000000#ifndef INCLUDED_AUDIOIO_MANAGER_H #define INCLUDED_AUDIOIO_MANAGER_H #include #include class AUDIO_IO; /** * Virtual base class for implementing audio object managers. * * Key tasks of an object manager are to recognize * AUDIO_IO objects that are of the type it manages, * provide a communication platform for inter-object * communication, and tracking of objects. * * Related design patterns: * - Mediator (GoF273) * * @author Kai Vehmanen */ class AUDIO_IO_MANAGER : public DYNAMIC_OBJECT { public: /** @name Public API */ /*@{*/ /** * Object name used to identify the object type. In most * cases, object name is same for all class instances. * Must be implemented in all subclasses. */ virtual std::string name(void) const = 0; /** * More verbose description of the manager type. */ virtual std::string description(void) const = 0; /** * Whether 'aobj' is of the type handled by this * manager object? * * @pre aobj != 0 */ virtual bool is_managed_type(const AUDIO_IO* aobj) const = 0; /** * Registers a new managed object. * * Ownership of the object is not transfered to this * manager object. It's therefore important to release * all managed objects before they are allocated. * Otherwise the manager object could end up referencing * invalid memory regions. * * @pre aobj != 0 * @post is_managed_type(aobj) == true */ virtual void register_object(AUDIO_IO* aobj) = 0; /** * Gets an integer id of the registered object 'aobj'. * * @return -1 if not a registered object * * @pre is_managed_type(aobj) == true * @pre aobj != 0 */ virtual int get_object_id(const AUDIO_IO* aobj) const = 0; /** * Returns a list of all registered object ids. */ virtual std::list get_object_list(void) const = 0; /** * Unregisters object identified by 'id'. * * @post std::count(get_object_list().begin(), get_object_list().end(), id) == 0 */ virtual void unregister_object(int id) = 0; virtual ~AUDIO_IO_MANAGER(void) {} /*@}*/ }; #endif ecasound-2.9.3/libecasound/audiofx_lv2_world.cpp0000644000076400007640000000622311747070242016713 00000000000000// ------------------------------------------------------------------------ // audiofx_lv2_world.cpp: Utility class for LV2 plugin loading // Copyright (C) 2000-2004, 2011 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #if ECA_USE_LIBLILV #include "audiofx_lv2_world.h" #define LV2PREFIX "http://lv2plug.in/ns/lv2core#" #define IN_PLACE_BROKEN_URI LV2PREFIX "inPlaceBroken" #define SAMPLERATE_URI LV2PREFIX "sampleRate" #define TOGGLED_URI LV2PREFIX "toggled" #define INTEGER_URI LV2PREFIX "integer" #define LOGARITHMIC_URI "http://lv2plug.in/ns/dev/extportinfo#" #define CONNECTION_OPTIONAL_URI LV2PREFIX "connectionOptional" ECA_LV2_WORLD ECA_LV2_WORLD::i=ECA_LV2_WORLD(); ECA_LV2_WORLD::ECA_LV2_WORLD() { lilvworld =0; audioclassnode=0; controlclassnode=0; inputclassnode=0; outputclassnode=0; inplacebrokennode=0; porttogglednode=0; portintegernode=0; portlogarithmicnode=0; portsampleratedependentnode=0; portconnectionoptionalnode=0; } ECA_LV2_WORLD::~ECA_LV2_WORLD() { lilv_world_free(lilvworld); } #define DECLARE_ACESSOR(TYPE,METHODNAME,VARIABLENAME,VALUE) \ TYPE* ECA_LV2_WORLD::METHODNAME() { \ if(i.VARIABLENAME == 0){ \ i.VARIABLENAME = VALUE; \ } \ return i.VARIABLENAME; \ } DECLARE_ACESSOR(LilvWorld, World, lilvworld, lilv_world_new()) DECLARE_ACESSOR(LilvNode, AudioClassNode,audioclassnode,lilv_new_uri(World(),LILV_URI_AUDIO_PORT)) DECLARE_ACESSOR(LilvNode, ControlClassNode,controlclassnode,lilv_new_uri(World(),LILV_URI_CONTROL_PORT)) DECLARE_ACESSOR(LilvNode, InputClassNode,inputclassnode,lilv_new_uri(World(),LILV_URI_INPUT_PORT)) DECLARE_ACESSOR(LilvNode, OutputClassNode,outputclassnode,lilv_new_uri(World(),LILV_URI_OUTPUT_PORT)) DECLARE_ACESSOR(LilvNode, InPlaceBrokenNode,inplacebrokennode,lilv_new_uri(World(),IN_PLACE_BROKEN_URI)) DECLARE_ACESSOR(LilvNode, PortToggledNode,porttogglednode,lilv_new_uri(World(),TOGGLED_URI)) DECLARE_ACESSOR(LilvNode, PortIntegerNode,portintegernode,lilv_new_uri(World(),INTEGER_URI)) DECLARE_ACESSOR(LilvNode, PortLogarithmicNode,portlogarithmicnode,lilv_new_uri(World(),LOGARITHMIC_URI)) DECLARE_ACESSOR(LilvNode, PortSamplerateDependentNode,portsampleratedependentnode,lilv_new_uri(World(),SAMPLERATE_URI)) DECLARE_ACESSOR(LilvNode, PortConnectionOptionalNode,portconnectionoptionalnode,lilv_new_uri(World(),CONNECTION_OPTIONAL_URI)) #endif /* ECA_USE_LIBLILV */ ecasound-2.9.3/libecasound/eca-audio-format.h0000644000076400007640000001047311501252010016025 00000000000000#ifndef INCLUDED_ECA_AUDIO_FORMAT_H #define INCLUDED_ECA_AUDIO_FORMAT_H #include #include "sample-specs.h" #include "eca-samplerate-aware.h" #include "eca-error.h" /** * Class that represents audio format parameters. Audio format * is based on: * * - number of channels * * - channels interleaving * * - representation of individual sample */ class ECA_AUDIO_FORMAT : public ECA_SAMPLERATE_AWARE { public: /** @name Public type definitions and constants */ /*@{*/ /* FIXME: move the Sample* enums to sample-specs.h */ enum Sample_format { sfmt_none, sfmt_u8, sfmt_s8, sfmt_s16, sfmt_s16_le, sfmt_s16_be, sfmt_s24, sfmt_s24_le, sfmt_s24_be, sfmt_s32, sfmt_s32_le, sfmt_s32_be, sfmt_f32, sfmt_f32_le, sfmt_f32_be, sfmt_f64, sfmt_f64_le, sfmt_f64_be }; enum Sample_endianess { se_native, se_big, se_little }; enum Sample_coding { sc_signed, sc_unsigned, sc_float }; /*@}*/ public: /*@}*/ /** @name Constructors and destructors */ /*@{*/ ECA_AUDIO_FORMAT (int ch, long int srate, Sample_format format, bool ileaved = false); ECA_AUDIO_FORMAT (void); virtual ~ECA_AUDIO_FORMAT (void); /*@}*/ /** @name Public functions for getting audio format information */ /*@{*/ /** * Returns frame size in bytes (sample size * channels) */ int frame_size(void) const { return align_rep * channels_rep; } /** * Returns sample size in bytes (size of individual sample value) */ int sample_size(void) const { return align_rep; } /** * How many bits are used to represent one sample value. * Notice! This isn't necessarily sample_size() / 8. For example, * 24bit samples are represented with 32bit values. */ int bits(void) const; /** * Returns sample format specification. See @ref Sample_format */ Sample_format sample_format(void) const; /** * Returns sample coding. See @ref Sample_coding */ Sample_coding sample_coding(void) const { return sc_rep ; } /** * Returns sample endianess. See @ref Sample_endianess */ Sample_endianess sample_endianess(void) const { return se_rep; } /** * Returns sampling rate in bytes per second (data transfer * rate). */ long int bytes_per_second(void) const { return samples_per_second() * align_rep * channels_rep; } /** * Returns number of channels. */ SAMPLE_SPECS::channel_t channels(void) const { return channels_rep; } /** * Are channels interleaved? */ bool interleaved_channels(void) const { return ileaved_rep; } /** * Returns an identical audio format object */ ECA_AUDIO_FORMAT audio_format(void) const; /** * Return the current sample format as a formatted std::string. * * @see set_sample_format */ std::string format_string(void) const; /*@}*/ /** @name Public virtual functions for setting audio format information */ /*@{*/ virtual void set_channels(SAMPLE_SPECS::channel_t v); virtual void set_sample_format(Sample_format v) throw(ECA_ERROR&); virtual void set_audio_format(const ECA_AUDIO_FORMAT& f_str); virtual void toggle_interleaved_channels(bool v); /*@}*/ /** @name Public functions for setting audio format information */ /*@{*/ /** * Sets sample type based on the formatted std::string given as * argument. * * The first letter is either "u", "s" and "f" (unsigned, * signed, floating point). * * The following number specifies sample size in bits. * * If sample is little endian, "_le" is added to the end. * Similarly if big endian, "_be" is added. This postfix * can be omitted if applicable. */ void set_sample_format_string(const std::string& f_str) throw(ECA_ERROR&); /** * Sets the sample endianess to big endian. */ void set_sample_coding(Sample_coding v); /** * Sets the sample endianess to big endian. */ void set_sample_endianess(Sample_endianess v); /*@}*/ private: Sample_format string_to_sample_format(const std::string& str) const throw(ECA_ERROR&); void update_sample_endianess(Sample_endianess v); bool ileaved_rep; SAMPLE_SPECS::channel_t channels_rep; size_t align_rep; // the size of one sample value in bytes Sample_coding sc_rep; Sample_endianess se_rep; }; #endif ecasound-2.9.3/libecasound/audioio-acseq.h0000644000076400007640000000356711032517543015457 00000000000000#ifndef INCLUDED_AUDIOIO_CLIP_SEQUENCER_H #define INCLUDED_AUDIOIO_CLIP_SEQUENCER_H #include "audioio-seqbase.h" /** * Audio clip sequencer class. Allows to loop, play parts * of, and play files at a specific moment of time. * * Related design patterns: * - Proxy (GoF207 * * @author Kai Vehmanen */ class AUDIO_CLIP_SEQUENCER : public AUDIO_SEQUENCER_BASE { public: enum { cseq_none = 0, cseq_loop = 1, cseq_select = 2, cseq_play_at = 3 }; /** @name Public functions */ /*@{*/ AUDIO_CLIP_SEQUENCER (void); virtual ~AUDIO_CLIP_SEQUENCER(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return("Audio clip sequencer"); } virtual std::string description(void) const { return("Audio clip sequencer. Supports looping and slicing of audio file segments."); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual std::string parameter_names(void) const; virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_CLIP_SEQUENCER* clone(void) const; virtual AUDIO_CLIP_SEQUENCER* new_expr(void) const { return new AUDIO_CLIP_SEQUENCER(); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); /*@}*/ /** @name New functions */ /*@{*/ /*@}*/ private: mutable std::vector params_rep; int child_param_offset_rep; int cseq_mode_rep; AUDIO_CLIP_SEQUENCER& operator=(const AUDIO_CLIP_SEQUENCER& x) { return *this; } AUDIO_CLIP_SEQUENCER (const AUDIO_CLIP_SEQUENCER& x) { } }; #endif ecasound-2.9.3/libecasound/osc-gen-file.h0000644000076400007640000000202310664032032015161 00000000000000#ifndef INCLUDED_GENERIC_OSCILLATOR_FILE_H #define INCLUDED_GENERIC_OSCILLATOR_FILE_H #include "osc-gen.h" #include "eca-error.h" /** * Generic oscillator using preset envelopes. * Presets are read from an ascii configuration file. */ class GENERIC_OSCILLATOR_FILE : public GENERIC_OSCILLATOR { public: virtual std::string parameter_names(void) const { return("freq,mode,preset-number"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual std::string name(void) const { return("Generic oscillator (preset)"); } GENERIC_OSCILLATOR_FILE* clone(void) const { return new GENERIC_OSCILLATOR_FILE(*this); } GENERIC_OSCILLATOR_FILE* new_expr(void) const { return new GENERIC_OSCILLATOR_FILE(*this); } GENERIC_OSCILLATOR_FILE (double freq = 0.0, int preset_number = 0); virtual ~GENERIC_OSCILLATOR_FILE (void); protected: void parse_envelope(const std::string& str); private: int preset_rep; void get_oscillator_preset(int preset); }; #endif ecasound-2.9.3/libecasound/audioio-cdr.h0000644000076400007640000000365511033000766015124 00000000000000#ifndef INCLUDED_AUDIOIO_CDR_H #define INCLUDED_AUDIOIO_CDR_H #include #include #include #include /* off_t */ #include "sample-specs.h" #include "audioio-buffered.h" typedef struct { public: int16_t sample[2]; // signed short int } SAMPLE; /** * Class for handling CDR-files * * CDR -format is used on audio-CDs: * * - 16bit samples, 44100kHz, stereo * * - sample frame layout: (MSB-left, LSB-left, MSB-right, LSB-right) * * - files are padded sector size (2352 bytes) * * @author Kai Vehmanen */ class CDRFILE : public AUDIO_IO_BUFFERED { static const int sectorsize = 2352; long int samples_read; FILE* fobject; void pad_to_sectorsize(void); void set_length_in_bytes(void); CDRFILE(const CDRFILE& x) { } CDRFILE& operator=(const CDRFILE& x) { return *this; } void seek_position_in_samples(long pos); unsigned short swapw(unsigned short us) { return ((us >> 8) | (us << 8)) & 0xffff; } void swap_bytes(SAMPLE* t) { t->sample[SAMPLE_SPECS::ch_left] = swapw(t->sample[SAMPLE_SPECS::ch_left]); t->sample[SAMPLE_SPECS::ch_right] = swapw(t->sample[SAMPLE_SPECS::ch_right]); } public: std::string name(void) const { return("CD-R audio file"); } std::string description(void) const { return("CD-R/CDDA audio files. This format is used when mastering audio-CDs."); } virtual bool locked_audio_format(void) const { return(true); } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const; virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); CDRFILE (const std::string& name = ""); virtual ~CDRFILE(void); CDRFILE* clone(void) const; CDRFILE* new_expr(void) const { return new CDRFILE(); } }; #endif ecasound-2.9.3/libecasound/audio-stamp.cpp0000644000076400007640000000465711161515355015515 00000000000000// ------------------------------------------------------------------------ // audio-stamp.cpp: Classes for handling audio stamps and their clients // Copyright (C) 2000 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "audio-stamp.h" AUDIO_STAMP::AUDIO_STAMP(void) : id_rep(0), id_set_rep(false) { } int AUDIO_STAMP::id(void) const { return(id_rep); } void AUDIO_STAMP::set_id(int n) { id_rep = n; id_set_rep = true; } void AUDIO_STAMP::store(const SAMPLE_BUFFER* x) { buffer_rep.copy_all_content(*x); } void AUDIO_STAMP::fetch_stamp(SAMPLE_BUFFER* x) { x->copy_all_content(buffer_rep); } void AUDIO_STAMP_SERVER::register_stamp(AUDIO_STAMP* stamp) { stamp_map_rep[stamp->id()] = stamp; } void AUDIO_STAMP_SERVER::fetch_stamp(int id, SAMPLE_BUFFER* x) { if (stamp_map_rep.find(id) == stamp_map_rep.end()) { x->make_silent(); // std::cerr << "(as-server) Making silent!" << std::endl; } else { AUDIO_STAMP* p = stamp_map_rep[id]; p->fetch_stamp(x); // cerr << "(as-server) fetch stamp from id " << p->id() << "." << endl; } } AUDIO_STAMP_CLIENT::AUDIO_STAMP_CLIENT(void) : id_rep(0), id_set_rep(false), server_repp(0) { } int AUDIO_STAMP_CLIENT::id(void) const { return(id_rep); } void AUDIO_STAMP_CLIENT::set_id(int n) { id_rep = n; id_set_rep = true; } void AUDIO_STAMP_CLIENT::fetch_stamp(SAMPLE_BUFFER* x) { if (server_repp != 0) { server_repp->fetch_stamp(id(), x); // cerr << "(as-client) fetch stamp id " << id() << "." << endl; } else { // cerr << "(as-client) Making silent!" << endl; x->make_silent(); } } void AUDIO_STAMP_CLIENT::register_server(AUDIO_STAMP_SERVER* server) { server_repp = server; } ecasound-2.9.3/libecasound/eca-chain.cpp0000644000076400007640000006100712260762753015101 00000000000000// ------------------------------------------------------------------------ // eca-chain.cpp: Class representing an abstract audio signal chain. // Copyright (C) 1999-2009 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include "samplebuffer.h" #include "generic-controller.h" #include "eca-chainop.h" #include "audioio.h" #include "file-preset.h" #include "global-preset.h" #include "audiofx_ladspa.h" #include "eca-object-factory.h" #include "eca-object-map.h" #include "eca-preset-map.h" #include "eca-chain.h" #include "eca-chainop.h" #include "eca-error.h" #include "eca-logger.h" /* Debug controller source values */ // #define DEBUG_CONTROLLERS #ifdef DEBUG_CONTROLLERS #define DEBUG_CTRL_STATEMENT(x) x #else #define DEBUG_CTRL_STATEMENT(x) ((void)0) #endif CHAIN::CHAIN (void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "constructor: CHAIN"); muted_rep = false; bypass_rep = false; initialized_rep = false; input_id_rep = output_id_rep = -1; /* FIXME: remove these and only store the index */ selected_controller_repp = 0; selected_dynobj_repp = 0; selected_chainop_number_rep = 0; selected_controller_number_rep = 0; selected_chainop_parameter_rep = 0; selected_controller_parameter_rep = 0; } CHAIN::~CHAIN (void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "CHAIN destructor!"); if (is_initialized()) release(); for(std::vector::iterator p = chainops_rep.begin(); p != chainops_rep.end(); p++) { string tmp = (*p).cop->status(); if (tmp.size() > 0) { ECA_LOG_MSG(ECA_LOGGER::info, tmp); } delete (*p).cop; } for(std::vector::iterator p = gcontrollers_rep.begin(); p != gcontrollers_rep.end(); p++) { delete *p; } } /** * Whether chain is in a valid state (= ready for processing)? */ bool CHAIN::is_valid(void) const { if (input_id_rep == -1 || output_id_rep == -1) { return false; } return true; } /** * Connects input to chain */ void CHAIN::connect_input(int input) { input_id_rep = input; } /** * Connects output to chain */ void CHAIN::connect_output(int output) { output_id_rep = output; } /** * Disconnects input */ void CHAIN::disconnect_input(void) { input_id_rep = -1; initialized_rep = false; } /** * Disconnects output */ void CHAIN::disconnect_output(void) { output_id_rep = -1; initialized_rep = false; } /** * Disconnects the sample buffer */ void CHAIN::disconnect_buffer(void) { audioslot_repp = 0; initialized_rep = false; release(); } /** * Notifies chain that an input has been removed. */ void CHAIN::input_removed(int input) { // adjust input_id_rep in case position in input // array has changed if (input_id_rep > input) --input_id_rep; else if (input_id_rep == input) disconnect_input(); } /** * Notifies chain that an output has been removed. */ void CHAIN::output_removed(int output) { // adjust output_id_rep in case position in output // array has changed if (output_id_rep > output) --output_id_rep; else if (output_id_rep == output) disconnect_output(); } /** * Adds the chain operator to the end of the chain * * require: * chainop != 0 * * ensure: * selected_chain_operator() == number_of_chain_operators() * is_initialized() != true */ void CHAIN::add_chain_operator(CHAIN_OPERATOR* chainop) { // -------- DBC_REQUIRE(chainop != 0); // -------- ECA_SAMPLERATE_AWARE* srateobj = dynamic_cast(chainop); if (srateobj != 0) { srateobj->set_samples_per_second(samples_per_second()); } CHAIN::COP_CONTAINER container; container.cop = chainop; container.bypassed = false; chainops_rep.push_back(container); selected_chainop_number_rep = chainops_rep.size(); initialized_rep = false; // -------- DBC_ENSURE(selected_chain_operator() == number_of_chain_operators()); DBC_ENSURE(is_initialized() != true); // -------- } /** * Removes the selected chain operator * * @param op_index operator index (1...N), or -1 to use the selected op * * ensure: * is_initialized() != true */ void CHAIN::remove_chain_operator(int op_index) { if (op_index < 0) op_index = selected_chainop_number_rep; CHAIN_OPERATOR *to_remove = 0; if (op_index > 0 && op_index <= static_cast(chainops_rep.size())) to_remove = chainops_rep[op_index - 1].cop; if (to_remove != 0) { for(std::vector::iterator p = chainops_rep.begin(); p != chainops_rep.end(); p++) { if ((*p).cop == to_remove) { for(std::vector::iterator q = gcontrollers_rep.begin(); q != gcontrollers_rep.end();) { if ((*p).cop == (*q)->target_pointer()) { /* step: if the deleted controller is selected, unselect it */ if (selected_controller_repp == *q) selected_controller_repp = 0; /* step: remove the related controller */ delete *q; gcontrollers_rep.erase(q); /* step: in case there are multiple controllers per chainop */ q = gcontrollers_rep.begin(); } else ++q; } /* step: delete and remove from the list */ delete (*p).cop; chainops_rep.erase(p); /* step: invalidate selection if the selected cop * was affected */ if (op_index >= selected_chainop_number_rep) { selected_chainop_number_rep = -1; break; } } } initialized_rep = false; } // -------- DBC_ENSURE(is_initialized() != true || to_remove == 0); // -------- } /** * Returns the name of selected chain operator. * * require: * selected_chain_operator() != 0 */ string CHAIN::chain_operator_name(void) const { assert(selected_chainop_number_rep > 0); assert(selected_chainop_number_rep <= static_cast(chainops_rep.size())); return chainops_rep[selected_chainop_number_rep - 1].cop->name(); } /** * Returns the name of selected chain operator parameter. * * require: * selected_chain_operator() != 0 * selected_chain_operator_parameter() != 0 */ string CHAIN::chain_operator_parameter_name(void) const { assert(selected_chainop_number_rep > 0); assert(selected_chainop_number_rep <= static_cast(chainops_rep.size())); return chainops_rep[selected_chainop_number_rep - 1].cop->get_parameter_name(selected_chain_operator_parameter()); } /** * Returns the name of selected controller parameter. * * require: * selected_controller() != 0 * selected_controller_parameter() != 0 */ string CHAIN::controller_parameter_name(void) const { // -------- DBC_REQUIRE(selected_controller() > 0); DBC_REQUIRE(selected_controller_parameter() > 0); // -------- return selected_controller_repp->get_parameter_name(selected_controller_parameter()); } /** * Returns the total number of parameters for the * selected chain operator. * * require: * selected_chain_operator() != 0 */ int CHAIN::number_of_chain_operator_parameters(void) const { assert(selected_chainop_number_rep > 0); assert(selected_chainop_number_rep <= static_cast(chainops_rep.size())); return chainops_rep[selected_chainop_number_rep - 1].cop->number_of_params(); } /** * Returns the total number of parameters for the * chain operator 'index' ([1...N]). * * require: * index < number_of_chain_operators() */ int CHAIN::number_of_chain_operator_parameters(int index) const { DBC_REQUIRE(index > 0); DBC_REQUIRE(index <= number_of_chain_operators()); if (index > 0 && index <= number_of_chain_operators()) return chainops_rep[index - 1].cop->number_of_params(); return -1; } /** * Returns the total number of parameters for the selected controller. * * require: * selected_controller() != 0 */ int CHAIN::number_of_controller_parameters(void) const { // -------- DBC_REQUIRE(selected_controller() > 0); // -------- return selected_controller_repp->number_of_params(); } /** * Returns the name of selected controller. * * require: * selected_controller() != 0 */ string CHAIN::controller_name(void) const { // -------- DBC_REQUIRE(selected_controller() > 0); // -------- return selected_controller_repp->name(); } /** * Sets the parameter value (selected chain operator) * * @param op_index operator index (1...N), or -1 to use the selected op * @param param_index param index (1...N), or -1 to use the selected param * @param value new value */ void CHAIN::set_parameter(int op_index, int param_index, CHAIN_OPERATOR::parameter_t value) { CHAIN_OPERATOR *cop = 0; if (op_index < 0) { if (selected_chainop_number_rep > 0 && selected_chainop_number_rep <= static_cast(chainops_rep.size())) cop = chainops_rep[selected_chainop_number_rep - 1].cop; } else if (op_index > 0 && op_index <= static_cast(chainops_rep.size())) cop = chainops_rep[op_index - 1].cop; if (param_index < 0) param_index = selected_chainop_parameter_rep; if (cop) cop->set_parameter(param_index, value); } /** * Returns true if op_index is valid. */ bool CHAIN::is_valid_op_index(int op_index) const { if (op_index > 0 && op_index <= static_cast(chainops_rep.size())) return true; return false; } /** * Sets bypass state (selected chain operator) * * @param op_index operator index (1...N), or -1 to use the selected op * @param bypassed 1=bypass, 0=nobypass, -1=toggle (change state) */ void CHAIN::bypass_operator(int op_index, int bypassed) { if (is_valid_op_index(op_index)) { if (bypassed < 0) { // just toggle the current value chainops_rep[op_index - 1].bypassed = !(chainops_rep[op_index - 1].bypassed); } else { chainops_rep[op_index - 1].bypassed = (bypassed > 0 ? true : false); } } } /** * Sets muting state for the chain * * @param bypassed 1=mute, 0=unmute, -1=toggle (change state) */ void CHAIN::set_mute(int state) { if (state < 0) muted_rep = !muted_rep; else if (state > 0) muted_rep = true; else muted_rep = false; } /** * Sets muting state for the chain * * @param state 1=bypass, 0=nobypass, -1=toggle (change state) */ void CHAIN::set_bypass(int state) { if (state < 0) bypass_rep = !bypass_rep; else if (state > 0) bypass_rep = true; else bypass_rep = false; } bool CHAIN::is_operator_bypassed(int op_index) const { if (is_valid_op_index(op_index)) { return chainops_rep[op_index - 1].bypassed; } return false; } /** * Gets the parameter value (selected chain operator) * * @param index parameter number * * require: * selected_chain_operator_parameter() > 0 && * selected_chain_operator() != 0 */ CHAIN_OPERATOR::parameter_t CHAIN::get_parameter(void) const { DBC_CHECK(selected_chainop_number_rep > 0); DBC_CHECK(selected_chainop_number_rep <= static_cast(chainops_rep.size())); if (selected_chainop_number_rep > 0 && selected_chainop_number_rep <= static_cast(chainops_rep.size())) { return chainops_rep[selected_chainop_number_rep - 1].cop->get_parameter(selected_chainop_parameter_rep); } return 0.0f; } /** * Adds a generic controller and assign it to selected dynamic object * * require: * gcontroller != 0 * selected_dynobj != 0 */ void CHAIN::add_controller(GENERIC_CONTROLLER* gcontroller) { // -------- DBC_REQUIRE(gcontroller != 0); DBC_REQUIRE(selected_dynobj_repp != 0); // -------- #ifndef ECA_DISABLE_EFFECTS gcontroller->assign_target(selected_dynobj_repp); ECA_LOG_MSG(ECA_LOGGER::user_objects, gcontroller->status()); #endif gcontrollers_rep.push_back(gcontroller); selected_controller_repp = gcontroller; selected_controller_number_rep = gcontrollers_rep.size(); } const CHAIN_OPERATOR* CHAIN::get_selected_chain_operator(void) const { if (selected_chainop_number_rep > 0 && selected_chainop_number_rep <= static_cast(chainops_rep.size())) return chainops_rep[selected_chainop_number_rep - 1].cop; return 0; } /** * Removes the selected controller * * require: * selected_controller() <= number_of_controllers(); * selected_controller() > 0 */ void CHAIN::remove_controller(void) { // -------- DBC_REQUIRE(selected_controller() > 0); DBC_REQUIRE(selected_controller() <= number_of_controllers()); // -------- int n = 0; for(std::vector::iterator q = gcontrollers_rep.begin(); q != gcontrollers_rep.end(); q++) { if ((n + 1) == selected_controller()) { delete *q; gcontrollers_rep.erase(q); select_controller(-1); break; } ++n; } } /** * Clears chain (removes all chain operators and controllers) */ void CHAIN::clear(void) { for(std::vector::iterator p = chainops_rep.begin(); p != chainops_rep.end(); p++) { delete (*p).cop; (*p).cop = 0; } chainops_rep.resize(0); for(std::vector::iterator p = gcontrollers_rep.begin(); p != gcontrollers_rep.end(); p++) { delete *p; *p = 0; } gcontrollers_rep.resize(0); initialized_rep = false; } /** * Selects a chain operator. If no chain operators * are found with 'index', with index 'index'. * * @param index 1...N * * ensure: * index == selected_chain_operator() || * selected_chain_operator() == 0 */ void CHAIN::select_chain_operator(int index) { if (index > 0 && index <= static_cast(chainops_rep.size())) { selected_chainop_number_rep = index; selected_chain_operator_as_target(); } } /** * Selects a chain operator parameter. Index of zero clears out * current selection. * * require: * index > 0 * selected_chain_operator() != 0 || index == 0 * index <= selected_chain_operator()->number_of_params() * * ensure: * index == selected_chain_operator_parameter() */ void CHAIN::select_chain_operator_parameter(int index) { DBC_REQUIRE(index > 0); selected_chainop_parameter_rep = index; } /** * Selects a controller. Index of zero clears out * current selection. * * @param index 1...N, or negative to clear selection * * ensure: * index == selected_controller() || * selected_controller() == 0 */ void CHAIN::select_controller(int index) { DBC_REQUIRE(index != 0); selected_controller_repp = 0; selected_controller_number_rep = 0; for(int gcontroller_sizet = 0; gcontroller_sizet != static_cast(gcontrollers_rep.size()); gcontroller_sizet++) { if (gcontroller_sizet + 1 == index) { selected_controller_repp = gcontrollers_rep[gcontroller_sizet]; selected_controller_number_rep = index; } } } /** * Selects a controller parameter. Index of zero clears out * current selection. * * require: * index > 0 * selected_controller() != 0 || index == 0 * index <= selected_controller()->number_of_params() * * ensure: * index == selected_controller_parameter() */ void CHAIN::select_controller_parameter(int index) { selected_controller_parameter_rep = index; } /** * Gets the value of the currently selected controller parameter. * * require: * selected_controller() != 0 * selected_controller_parameter() != 0 */ CHAIN_OPERATOR::parameter_t CHAIN::get_controller_parameter(void) const { // -------- DBC_REQUIRE(selected_controller_parameter() > 0); DBC_REQUIRE(selected_controller() != 0); // -------- return selected_controller_repp->get_parameter(selected_controller_parameter_rep); } /** * Sets the value of the currently selected controller parameter. * * @param ctrl_index operator index (1...N), or -1 to use the selected ctrl * @param param_index param index (1...N), or -1 to use the selected param * @param value new value */ void CHAIN::set_controller_parameter(int ctrl_index, int param_index, CHAIN_OPERATOR::parameter_t value) { GENERIC_CONTROLLER *ctrl = 0; if (ctrl_index < 0) { if (selected_controller_number_rep > 0 && selected_controller_number_rep <= static_cast(gcontrollers_rep.size())) ctrl = gcontrollers_rep[selected_controller_number_rep - 1]; } else if (ctrl_index > 0 && ctrl_index <= static_cast(gcontrollers_rep.size())) ctrl = gcontrollers_rep[ctrl_index - 1]; if (param_index < 0) param_index = selected_controller_parameter_rep; DBC_CHECK(param_index > 0); if (ctrl) ctrl->set_parameter(param_index, value); } /** * Use current selected chain operator as * target for parameters control. * * require: * selected_chain_operator() != 0 * * ensure: * selected_target() == selected_chain_operator() */ void CHAIN::selected_chain_operator_as_target(void) { assert(selected_chainop_number_rep > 0); assert(selected_chainop_number_rep <= static_cast(chainops_rep.size())); selected_dynobj_repp = chainops_rep[selected_chainop_number_rep - 1].cop; // -------- DBC_ENSURE(selected_dynobj_repp == chainops_rep[selected_chainop_number_rep - 1].cop); // -------- } /** * Use current selected controller as * target for parameter control. * * require: * selected_controller() != 0 * * ensure: * selected_target() == selected_controller() */ void CHAIN::selected_controller_as_target(void) { // -------- DBC_REQUIRE(selected_controller_repp != 0); // -------- selected_dynobj_repp = selected_controller_repp; // -------- DBC_ENSURE(selected_dynobj_repp == selected_controller_repp); // -------- } /** * Prepares chain for processing. All further processing * will be done using the buffer pointer by 'sbuf'. * If all parameters are zero, previously specified * parameters are used (state re-initialization). * * require: * input_id != 0 || in_channels != 0 * output_id != 0 || out_channels != 0 * audioslot_repp != 0 || sbuf != 0 * * ensure: * is_initialized() == true */ void CHAIN::init(SAMPLE_BUFFER* sbuf, int in_channels, int out_channels) { // -------- DBC_REQUIRE(in_channels != 0 || in_channels_rep != 0); DBC_REQUIRE(out_channels != 0 || out_channels_rep != 0); DBC_REQUIRE(sbuf != 0 || audioslot_repp != 0); // -------- DBC_CHECK(samples_per_second() > 0); if (sbuf != 0) audioslot_repp = sbuf; if (in_channels != 0) in_channels_rep = in_channels; if (out_channels != 0) out_channels_rep = out_channels; int channels_next = in_channels_rep; for(size_t p = 0; p != chainops_rep.size(); p++) { /* note: buffer must have room to store both input and * output channels (processing in-place) */ int out_ch = chainops_rep[p].cop->output_channels(channels_next); if (out_ch > channels_next) channels_next = out_ch; audioslot_repp->number_of_channels(channels_next); chainops_rep[p].cop->init(audioslot_repp); /* note: for the next plugin, only 'out_ch' channels contain * valid audio */ channels_next = out_ch; } for(size_t p = 0; p != gcontrollers_rep.size(); p++) { gcontrollers_rep[p]->init(); } refresh_parameters(); initialized_rep = true; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Initialized chain " + name() + " with " + kvu_numtostr(chainops_rep.size()) + " chainops and " + kvu_numtostr(gcontrollers_rep.size()) + " gcontrollers. Sbuf points to " + kvu_numtostr(reinterpret_cast(audioslot_repp)) + "."); // -------- DBC_ENSURE(is_initialized() == true); // -------- } /** * Releases all buffers assigned to chain operators. */ void CHAIN::release(void) { for(size_t p = 0; p != chainops_rep.size(); p++) { chainops_rep[p].cop->release(); } initialized_rep = false; // --------- DBC_ENSURE(is_initialized() != true); // --------- } /** * Processes chain data with all chain operators. * * require: * is_initialized() == true */ void CHAIN::process(void) { // -------- DBC_REQUIRE(is_initialized() == true); // -------- /* step: update operator parameters */ controller_update(); /* step: run processing components */ if (muted_rep != true) { /* note: if muted, don't bother running the chainops */ if (bypass_rep != true) { /* note: processing enabled (no bypass) */ for(int p = 0; p != static_cast(chainops_rep.size()); p++) { if (chainops_rep[p].bypassed == true) continue; /* note: increase channel count if chainop needs the space */ int out_ch = chainops_rep[p].cop->output_channels(audioslot_repp->number_of_channels()); if (out_ch > audioslot_repp->number_of_channels()) audioslot_repp->number_of_channels(out_ch); chainops_rep[p].cop->process(); } } } else { audioslot_repp->make_silent(); } /* step: update chain position */ change_position_in_samples(audioslot_repp->length_in_samples()); } /** * Calculates/fetches new values for all controllers. */ void CHAIN::controller_update(void) { for(size_t n = 0; n < gcontrollers_rep.size(); n++) { DEBUG_CTRL_STATEMENT(GENERIC_CONTROLLER* ptr = gcontrollers_rep[n]); gcontrollers_rep[n]->value(position_in_seconds_exact()); DEBUG_CTRL_STATEMENT(std::cerr << "trace: " << ptr->name()); DEBUG_CTRL_STATEMENT(std::cerr << "; value " << ptr->source_pointer()->value() << "." << std::endl); } } /** * Re-initializes all effect parameters. */ void CHAIN::refresh_parameters(void) { for(int chainop_sizet = 0; chainop_sizet != static_cast(chainops_rep.size()); chainop_sizet++) { for(int n = 0; n < chainops_rep[chainop_sizet].cop->number_of_params(); n++) { chainops_rep[chainop_sizet].cop->set_parameter(n + 1, chainops_rep[chainop_sizet].cop->get_parameter(n + 1)); } } } /** * Converts chain to a formatted string. */ string CHAIN::to_string(void) const { MESSAGE_ITEM t; FILE_PRESET* fpreset; GLOBAL_PRESET* gpreset; int q = 0; while (q < static_cast(chainops_rep.size())) { #ifndef ECA_DISABLE_EFFECTS fpreset = 0; fpreset = dynamic_cast(chainops_rep[q].cop); if (fpreset != 0) { t << "-pf:" << fpreset->filename(); if (fpreset->number_of_params() > 0) t << ","; t << ECA_OBJECT_FACTORY::operator_parameters_to_eos(fpreset); t << " "; } else { gpreset = 0; gpreset = dynamic_cast(chainops_rep[q].cop); if (gpreset != 0) { t << "-pn:" << gpreset->name(); if (gpreset->number_of_params() > 0) t << ","; t << ECA_OBJECT_FACTORY::operator_parameters_to_eos(gpreset); t << " "; } else { t << ECA_OBJECT_FACTORY::chain_operator_to_eos(chainops_rep[q].cop) << " "; } } /* check if the chainop is controlled by a gcontroller */ std::vector::size_type p = 0; while (p < gcontrollers_rep.size()) { if (chainops_rep[q].cop == gcontrollers_rep[p]->target_pointer()) { t << " " << ECA_OBJECT_FACTORY::controller_to_eos(gcontrollers_rep[p]); t << " "; /* check if the gcontroller is controlled by another gcontroller */ std::vector::size_type r = 0; while (r < gcontrollers_rep.size()) { if (p != r && gcontrollers_rep[p] == gcontrollers_rep[r]->target_pointer()) { t << " -kx " << ECA_OBJECT_FACTORY::controller_to_eos(gcontrollers_rep[r]); } ++r; } } ++p; } #endif ++q; } return t.to_string(); } /** * Reimplemented from ECA_SAMPLERATE_AWARE */ void CHAIN::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { for(size_t p = 0; p != chainops_rep.size(); p++) { CHAIN_OPERATOR* temp = chainops_rep[p].cop; ECA_SAMPLERATE_AWARE* srateobj = dynamic_cast(temp); if (srateobj != 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "sample rate change, chain '" + name() + "' object '" + temp->name() + "' rate " + kvu_numtostr(v) + "."); srateobj->set_samples_per_second(v); } } ECA_SAMPLERATE_AWARE::set_samples_per_second(v); } /** * Reimplemented from ECA_AUDIO_POSITION. */ SAMPLE_SPECS::sample_pos_t CHAIN::seek_position(SAMPLE_SPECS::sample_pos_t pos) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "seek position, to pos " + kvu_numtostr(pos) + "."); return pos; } ecasound-2.9.3/libecasound/eca-control-objects.cpp0000644000076400007640000020676512272533345017136 00000000000000// ------------------------------------------------------------------------ // eca-control-objects.cpp: Class for configuring libecasound objects // Copyright (C) 2000-2004,2006,2008,2009,2012-2014 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include /* DBC_* */ #include #include #include #include /* kvu_get_argument_number() */ #include "audioio.h" #include "eca-chain.h" #include "eca-chainop.h" #include "eca-chainsetup.h" #include "eca-control.h" #include "eca-engine.h" #include "eca-object-factory.h" #include "eca-session.h" #include "generic-controller.h" #include "eca-error.h" #include "eca-logger.h" /** * Import namespaces */ using std::string; /** * Definitions for member functions */ /** * Adds a new chainsetup * * @param name chainsetup name * * require: * name != "" * * ensure: * selected_chainsetup() == name || (last_error().size() > 0 && no_errors != true) */ void ECA_CONTROL::add_chainsetup(const string& name) { // -------- DBC_REQUIRE(name != ""); // -------- bool no_errors = true; int count = static_cast(session_repp->chainsetups_rep.size()); session_repp->add_chainsetup(name); if (static_cast(session_repp->chainsetups_rep.size()) > count) { select_chainsetup(name); ECA_LOG_MSG(ECA_LOGGER::info, "Added a new chainsetup with name \"" + name + "\"."); } else { set_last_error("Unable to add chainsetup with name \"" + name + "\"."); no_errors = false; } // -------- DBC_ENSURE(selected_chainsetup() == name || (last_error().size() > 0 && no_errors != true)); // -------- } /** * Removes chainsetup * * @param name chainsetup name * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * * ensure: * selected_chainsetup.empty() == true */ void ECA_CONTROL::remove_chainsetup(void) { // -------- DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(is_selected() == true); // -------- ECA_LOG_MSG(ECA_LOGGER::info, "Removing chainsetup: \"" + selected_chainsetup() + "\"."); session_repp->remove_chainsetup(); selected_chainsetup_repp = 0; // -------- DBC_ENSURE(selected_chainsetup().empty() == true); // -------- } /** * Loads chainsetup from file 'filename'. * * @param name chainsetup filename * * require: * filename != "" * * ensure: * filename exists implies loaded chainsetup == selected_chainsetup() */ void ECA_CONTROL::load_chainsetup(const string& filename) { try { session_repp->load_chainsetup(filename); selected_chainsetup_repp = session_repp->selected_chainsetup_repp; DBC_CHECK((selected_chainsetup_repp != 0 && selected_chainsetup_repp->filename() == filename) || selected_chainsetup_repp == 0); ECA_LOG_MSG(ECA_LOGGER::info, "Loaded chainsetup from file \"" + filename + "\"."); } catch(ECA_ERROR& e) { set_last_error(e.error_section() + ": \"" + e.error_message() + "\""); } } /** * Save selected chainsetup. * * @param filename chainsetup filename (if omitted, previously used filename will be used, if any) * * require: * selected_chainsetup().empty() != true */ void ECA_CONTROL::save_chainsetup(const string& filename) { // -------- DBC_REQUIRE(selected_chainsetup().empty() != true); // -------- try { if (filename.empty() == true) session_repp->save_chainsetup(); else session_repp->save_chainsetup(filename); ECA_LOG_MSG(ECA_LOGGER::info, "Saved selected chainsetup \"" + selected_chainsetup() + "\"."); } catch(ECA_ERROR& e) { set_last_error(e.error_section() + ": \"" + e.error_message() + "\""); } } /** * Selects chainsetup * * @param name chainsetup name * * require: * name != "" * * ensure: * name == selected_chainsetup() || * selected_chainsetup_rep == 0 */ void ECA_CONTROL::select_chainsetup(const string& name) { // -------- DBC_REQUIRE(name != ""); // -------- session_repp->select_chainsetup(name); selected_chainsetup_repp = session_repp->selected_chainsetup_repp; if (selected_chainsetup_repp == 0) { ECA_LOG_MSG(ECA_LOGGER::info, "Chainsetup \"" + name + "\" doesn't exist!"); set_last_error("Chainsetup \"" + name + "\" doesn't exist!"); } // else { ECA_LOG_MSG(ECA_LOGGER::info, "Selected chainsetup: \"" + selected_chainsetup() + "\"."); } // -------- DBC_ENSURE(name == selected_chainsetup() || is_selected() == false); // -------- } /** * Selects a chainsetup by index. * * @param index_number an integer identifier * * require: * index_number > 0 */ void ECA_CONTROL::select_chainsetup_by_index(int index_number) { // -------- DBC_REQUIRE(index_number > 0); // -------- for(std::vector::size_type p = 0; p != session_repp->chainsetups_rep.size(); p++) { if (index_number == static_cast(p + 1)) { select_chainsetup(session_repp->chainsetups_rep[p]->name()); break; } } } /** * Name of currently active chainsetup */ string ECA_CONTROL::selected_chainsetup(void) const { if (selected_chainsetup_repp != 0) return selected_chainsetup_repp->name(); return ""; } /** * Spawns an external editor for editing selected chainsetup * * require: * is_selected() * connected_chainsetup() != selected_chainsetup() */ void ECA_CONTROL::edit_chainsetup(void) { // -------- DBC_REQUIRE(selected_chainsetup().empty() != true); // -------- /* 1. check which editor to use (and exit if none * defined) */ string editori = ""; string use_getenv = resource_value("ext-cmd-text-editor-use-getenv"); if (use_getenv.size() == 0 || use_getenv == "true") { /* note: as specified in ecasoundrc(5), we should * default to 'true' */ if (std::getenv("EDITOR") != 0) { editori = std::getenv("EDITOR"); } } if (editori == "") editori = resource_value("ext-cmd-text-editor"); if (editori == "") { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Cannot edit, no text editor specified/available. See ecasoundrc(5) man page and the 'ext-cmd-text-editor' configuration variable."); return; } /* 2. detect hot-swap */ bool hot_swap = false; bool restart = false; if (connected_chainsetup() == selected_chainsetup()) { hot_swap = true; if (is_running()) restart = true; } /* 3. store runtime state of the old chainsetup */ string origname = selected_chainsetup_repp->name(); string origfilename = selected_chainsetup_repp->filename(); SAMPLE_SPECS::sample_pos_t origpos = selected_chainsetup_repp->position_in_samples(); /* 4. create a safely accessible temporary filename */ TEMPORARY_FILE_DIRECTORY tempfile_dir_rep; string tmpdir ("ecasound-"); char* tmp_p = std::getenv("USER"); if (tmp_p != NULL) { tmpdir += string(tmp_p); tempfile_dir_rep.reserve_directory(tmpdir); } if (tempfile_dir_rep.is_valid() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Unable to create temporary directory \"" + tmpdir + "\"."); return; } string filename = tempfile_dir_rep.create_filename("cs-edit-tmp", ".ecs"); /* 5. save selected chainsetup to the temp file */ if (hot_swap == true) session_repp->connected_chainsetup_repp->set_name("cs-edit-temp"); save_chainsetup(filename); if (hot_swap == true) session_repp->connected_chainsetup_repp->set_name(origname); else remove_chainsetup(); /* 6. fork an external text editor */ // FIXME: we should drop priviledge-level here (at least if root)! editori += " " + filename; int res = ::system(editori.c_str()); if (res == 127 || res == -1) { ECA_LOG_MSG(ECA_LOGGER::info, "Can't edit; unable to open file in text editor \"" + string(editori.c_str()) + "\"."); } else { /* 7. reload the edited chainsetup and reset runtime state */ load_chainsetup(filename); if (is_selected() != true) { ECA_LOG_MSG(ECA_LOGGER::info, std::string("Unable to parse chainsetup, keeping the temporary file ") + filename); } else { remove(filename.c_str()); if (origfilename.empty() != true) { set_chainsetup_filename(origfilename); } if (selected_chainsetup_repp) selected_chainsetup_repp->seek_position_in_samples(origpos); if (hot_swap == true) { /* 7.1 disconnect the chainsetup to be replaced */ disconnect_chainsetup(); /* 7.2 try to connect the edited chainsetup */ select_chainsetup("cs-edit-temp"); if (is_valid() == true) { connect_chainsetup(0); /* should succeed as is_valid() is true */ DBC_CHECK(is_connected() == true); if (is_connected() == true) { if (restart == true) { DBC_CHECK(is_running() != true); start(); } } } /* 7.3 if connecting the modified chainsetup fails */ if (is_connected() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "Can't connect; edited chainsetup is not valid."); } /* 7.4 remove the old chainsetup */ select_chainsetup(origname); remove_chainsetup(); select_chainsetup("cs-edit-temp"); selected_chainsetup_repp->set_name(origname); } } } } /** * Sets processing length in seconds. * * require: * is_selected() == true * value >= 0 */ void ECA_CONTROL::set_chainsetup_processing_length_in_seconds(double value) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- /* note! here we set the _maximum_ length of the chainsetup */ selected_chainsetup_repp->set_max_length_in_seconds(value); ECA_LOG_MSG(ECA_LOGGER::info, "Set chainsetup processing length to \"" + kvu_numtostr(value) + "\" seconds."); } /** * Sets processing length in samples. If 'value' is 0, * length in unspecified. * * require: * is_selected() == true * value >= 0 */ void ECA_CONTROL::set_chainsetup_processing_length_in_samples(SAMPLE_SPECS::sample_pos_t value) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- /* note! here we set the _maximum_ length of the chainsetup */ selected_chainsetup_repp->set_max_length_in_samples(value); ECA_LOG_MSG(ECA_LOGGER::info, "Set chainsetup processing length to \"" + kvu_numtostr(selected_chainsetup_repp->max_length_in_seconds_exact()) + "\" seconds."); } /** * Sets default open mode for audio outputs. * * require: * output_mode == AUDIO_IO::io_write || output_mode == AUDIO_IO::io_readwrite */ void ECA_CONTROL::set_chainsetup_output_mode(int output_mode) { // -------- DBC_REQUIRE(output_mode == AUDIO_IO::io_write || output_mode == AUDIO_IO::io_readwrite); // -------- selected_chainsetup_repp->set_output_openmode(output_mode); } /** * Sets chainsetup buffersize (in samples). * * @pre is_selected() == true */ void ECA_CONTROL::set_chainsetup_buffersize(int bsize) { // -------- DBC_REQUIRE(is_selected() == true); // -------- selected_chainsetup_repp->set_buffersize(bsize); } /** * Toggles chainsetup looping * * require: * is_selected() == true */ void ECA_CONTROL::toggle_chainsetup_looping(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- if (selected_chainsetup_repp->looping_enabled()) { selected_chainsetup_repp->toggle_looping(false); ECA_LOG_MSG(ECA_LOGGER::info, "Disabled looping."); } else { selected_chainsetup_repp->toggle_looping(true); ECA_LOG_MSG(ECA_LOGGER::info, "Enabled looping."); } } /** * Connects selected chainsetup * * require: * is_selected() == true * is_valid() == true * * ensure: * is_connected() == true || (last_error().size() > 0 && no_errors != true) */ void ECA_CONTROL::connect_chainsetup(struct eci_return_value *retval) { // -------- DBC_REQUIRE(is_selected()); DBC_REQUIRE(selected_chainsetup_repp != 0 && selected_chainsetup_repp->is_valid() == true); // -------- bool no_errors = true; string errmsg; if (is_connected() == true) { disconnect_chainsetup(); } try { session_repp->connect_chainsetup(); ECA_LOG_MSG(ECA_LOGGER::subsystems, "Connected chainsetup: \"" + connected_chainsetup() + "\""); } catch(ECA_ERROR& e) { errmsg = e.error_message(); no_errors = false; } if (is_connected() != true) { set_last_error(" Connecting chainsetup failed: \"" + errmsg + "\""); no_errors = false; } fill_command_retval(retval); // -------- DBC_ENSURE(is_connected() || no_errors != true); // -------- } /** * Name of connected chainsetup. */ string ECA_CONTROL::connected_chainsetup(void) const { if (session_repp->connected_chainsetup_repp != 0) { return session_repp->connected_chainsetup_repp->name(); } return ""; } /** * Disconnects activate chainsetup * * require: * is_connected() == true * * ensure: * connected_chainsetup() == "" */ void ECA_CONTROL::disconnect_chainsetup(void) { // -------- DBC_REQUIRE(is_connected()); // -------- if (is_engine_ready_for_commands() == true) { stop_on_condition(); } if (is_engine_created()) { close_engine(); } ECA_LOG_MSG(ECA_LOGGER::info, "Disconnecting chainsetup: \"" + connected_chainsetup() + "\"."); session_repp->disconnect_chainsetup(); // -------- DBC_ENSURE(connected_chainsetup() == ""); // -------- } /** * Changes the chainsetup position relatively to the current position. * Behaves differently depending on whether the selected * chainsetup is connected or not. * * require: * is_selected() == true */ void ECA_CONTROL::change_chainsetup_position(double seconds) { // -------- DBC_REQUIRE(is_selected()); // -------- // FIXME: check whether all audio devices support seeking, // raise an error if not (note: see other similar FIXMEs) if (connected_chainsetup() == selected_chainsetup() && is_engine_ready_for_commands() == true) { if (seconds < 0) engine_repp->command(ECA_ENGINE::ep_rewind, -seconds); else engine_repp->command(ECA_ENGINE::ep_forward, seconds); } else { selected_chainsetup_repp->seek_position_in_seconds(selected_chainsetup_repp->position_in_seconds() + seconds ); } } /** * Changes the chainsetup position in samples relatively to the * current position. Behaves differently depending on whether * the selected chainsetup is connected or not. * * require: * is_selected() == true */ void ECA_CONTROL::change_chainsetup_position_samples(SAMPLE_SPECS::sample_pos_t samples) { // -------- DBC_REQUIRE(is_selected()); // -------- // FIXME: check whether all audio devices support seeking, // raise an error if not (note: see other similar FIXMEs) if (connected_chainsetup() == selected_chainsetup() && is_engine_ready_for_commands() == true) { change_chainsetup_position(static_cast(samples) / selected_chainsetup_repp->samples_per_second()); } else { selected_chainsetup_repp->seek_position_in_samples(selected_chainsetup_repp->position_in_samples() + samples ); } } /** * Sets the chainsetup position. Behaves differently depending on * whether the selected chainsetup is connected or not. * * require: * is_selected() == true */ void ECA_CONTROL::set_chainsetup_position(double seconds) { // -------- DBC_REQUIRE(is_selected()); // -------- // FIXME: check whether all audio devices support seeking, // raise an error if not (note: see other similar FIXMEs) if (connected_chainsetup() == selected_chainsetup() && is_engine_ready_for_commands() == true) { engine_repp->command(ECA_ENGINE::ep_setpos, seconds); } else { selected_chainsetup_repp->seek_position_in_seconds(seconds); } } /** * Sets the chainsetup position in samples.. Behaves * differently depending on whether the selected chainsetup * is connected or not. * * require: * is_selected() == true */ void ECA_CONTROL::set_chainsetup_position_samples(SAMPLE_SPECS::sample_pos_t samples) { // -------- DBC_REQUIRE(is_selected()); // -------- // FIXME: check whether all audio devices support seeking, // raise an error if not (note: see other similar FIXMEs) if (connected_chainsetup() == selected_chainsetup() && is_engine_ready_for_commands() == true) { set_chainsetup_position(static_cast(samples) / selected_chainsetup_repp->samples_per_second()); } else { selected_chainsetup_repp->seek_position_in_samples(samples); } } /** * Gets a vector of al chainsetup names. */ std::vector ECA_CONTROL::chainsetup_names(void) const { return session_repp->chainsetup_names(); } /** * Gets a pointer to selected chainsetup, or 0 if no * chainsetup is selected. */ const ECA_CHAINSETUP* ECA_CONTROL::get_chainsetup(void) const { return selected_chainsetup_repp; } /** * Gets a pointer to connected chainsetup, or 0 if no * chainsetup is selected. */ const ECA_CHAINSETUP* ECA_CONTROL::get_connected_chainsetup(void) const { return session_repp->connected_chainsetup_repp; } /** * Gets a pointer to chainsetup with filename 'filename'. */ const ECA_CHAINSETUP* ECA_CONTROL::get_chainsetup_filename(const string& filename) const { std::vector::const_iterator p = session_repp->chainsetups_rep.begin(); while(p != session_repp->chainsetups_rep.end()) { if ((*p)->filename() == filename) { return (*p); } ++p; } return 0; } /** * Returns current buffersize of selected chainsetup. * * ®pre is_selected() == true */ int ECA_CONTROL::chainsetup_buffersize(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->buffersize(); } /** * Gets chainsetup filename (used by save_chainsetup()) * * ®pre is_selected() == true */ const string& ECA_CONTROL::chainsetup_filename(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->filename(); } /** * Sets chainsetup filename (used by save_chainsetup()) * * require: * is_selected() == true && * name.empty() != true */ void ECA_CONTROL::set_chainsetup_filename(const string& name) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(name.empty() != true); // -------- selected_chainsetup_repp->set_filename(name); } /** * Sets general chainsetup chainsetup parameter * * require: * is_selected() == true && * name.empty() != true */ void ECA_CONTROL::set_chainsetup_parameter(const string& name) { // -------- DBC_REQUIRE(is_selected() == true && name.empty() != true); // -------- selected_chainsetup_repp->interpret_global_option(name); if (selected_chainsetup_repp->interpret_result() != true) { /* for instance -f:xxx options are handle by * object-specific parsing */ selected_chainsetup_repp->interpret_object_option(name); } } /** * Sets general chainsetup chainsetup parameter * * require: * is_selected() == true && * name.empty() != true */ void ECA_CONTROL::set_chainsetup_sample_format(const string& name) { // -------- DBC_REQUIRE(is_selected() == true && name.empty() != true); // -------- selected_chainsetup_repp->interpret_object_option("-f:" + name); if (selected_chainsetup_repp->interpret_result() != true) { set_last_error(selected_chainsetup_repp->interpret_result_verbose()); } } /** * Adds a new chain (selected chainsetup). Added chain is automatically * selected. * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * * ensure: * selected_chains().size() > 0 */ void ECA_CONTROL::add_chain(const string& name) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chainsetup() != connected_chainsetup()); // -------- add_chains(std::vector (1, name)); // -------- DBC_ENSURE(selected_chains().size() > 0); // -------- } /** * Adds new chains (selected chainsetup). Added chains are automatically * selected. * * @param names comma separated list of chain names * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * * ensure: * selected_chains().size() > 0 */ void ECA_CONTROL::add_chains(const string& names) { // -------- DBC_REQUIRE(is_selected() == true && (session_repp->connected_chainsetup_repp != session_repp->selected_chainsetup_repp)); // -------- add_chains(kvu_string_to_vector(names, ',')); // -------- DBC_ENSURE(selected_chains().size() > 0); // -------- } /** * Adds new chains (selected chainsetup). Added chains are automatically * selected. * * @param namess vector of chain names * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * * ensure: * selected_chains().size() == names.size() */ void ECA_CONTROL::add_chains(const std::vector& new_chains) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- selected_chainsetup_repp->add_new_chains(new_chains); selected_chainsetup_repp->select_chains(new_chains); ECA_LOG_MSG(ECA_LOGGER::info, "Added chains: " + kvu_vector_to_string(new_chains, ", ") + "."); // -------- DBC_ENSURE(selected_chains().size() == new_chains.size()); // -------- } /** * Removes currently selected chain (selected chainsetup) * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() > 0 && * * ensure: * selected_chains().size() == 0 */ void ECA_CONTROL::remove_chains(void) { // -------- DBC_REQUIRE(is_selected() == true && selected_chains().size() > 0 && (session_repp->connected_chainsetup_repp != session_repp->selected_chainsetup_repp)); // -------- selected_chainsetup_repp->remove_chains(); ECA_LOG_MSG(ECA_LOGGER::info, "(eca-controlled) Removed selected chains."); // -------- DBC_ENSURE(selected_chains().size() == 0); // -------- } /** * Selects a set of chains using index numbers. Previously * selected chains are first all deselected. * * * @param index_numbers set of integer identifiers * * require: * is_selected() == true */ void ECA_CONTROL::select_chains_by_index(const std::vector& index_numbers) { // -------- DBC_REQUIRE(is_selected() == true); // -------- std::vector selchains; for(std::vector::size_type p = 0; p != selected_chainsetup_repp->chains.size(); p++) { for(std::vector::size_type q = 0; q != index_numbers.size(); q++) { if (index_numbers[q] == static_cast(p + 1)) { selchains.push_back(selected_chainsetup_repp->chains[p]->name()); break; } } } select_chains(selchains); } /** * Selects a chains (currently selected chainsetup). Previously * selected chains are first all deselected. * * require: * is_selected() == true * * ensure: * selected_chains().size() == 1 */ void ECA_CONTROL::select_chain(const string& chain) { // -------- DBC_REQUIRE(is_selected() == true); // -------- std::vector c (1); c[0] = chain; selected_chainsetup_repp->select_chains(c); // ECA_LOG_MSG(ECA_LOGGER::user_objects, "Selected chain: " + chain + "."); // -------- DBC_ENSURE(selected_chains().size() == 1); // -------- } /** * Selects chains (currently selected chainsetup). Previously * selected chains are first all deselected. * * @param chains vector of chain names * * require: * is_selected() == true * * ensure: * selected_chains().size() > 0 */ void ECA_CONTROL::select_chains(const std::vector& chains) { // -------- DBC_REQUIRE(is_selected() == true); // -------- selected_chainsetup_repp->select_chains(chains); // ECA_LOG_MSG(ECA_LOGGER::user_objects, "Selected chains: " + // vector_to_string(chains, ", ") + "."); } /** * Deselects chains (currently selected chainsetup) * * @param chains vector of chain names * * require: * is_selected() == true */ void ECA_CONTROL::deselect_chains(const std::vector& chains) { // -------- DBC_REQUIRE(is_selected() == true); // -------- std::vector schains = selected_chainsetup_repp->selected_chains(); std::vector::const_iterator p = chains.begin(); while(p != chains.end()) { std::vector::iterator o = schains.begin(); while(o != schains.end()) { if (*p == *o) { // ECA_LOG_MSG(ECA_LOGGER::info, "(eca-controller-objects) Deselected chain " + *o + "."); schains.erase(o); } else ++o; } ++p; } selected_chainsetup_repp->select_chains(schains); } /** * Selects all chains (currently selected chainsetup) * * require: * is_selected() == true */ void ECA_CONTROL::select_all_chains(void) { // -------- DBC_REQUIRE(is_selected() == true); // -------- selected_chainsetup_repp->select_all_chains(); // ECA_LOG_MSG(ECA_LOGGER::info, "Selected chains: " + vector_to_string(selected_chains(), ", ") + "."); } /** * Returns a list of selected chains (currently selected chainsetup) * * require: * is_selected() == true */ const std::vector& ECA_CONTROL::selected_chains(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->selected_chains(); } /** * Gets a vector of all chain names. * * require: * is_selected() == true */ std::vector ECA_CONTROL::chain_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->chain_names(); } /** * Gets a pointer to selected chain, or 0 if no chain is selected. * * require: * is_selected() == true * selected_chains().size() == 1 */ const CHAIN* ECA_CONTROL::get_chain(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- return get_chain_priv(); } /** * Gets a pointer to selected chain, or 0 if no chain is selected. */ CHAIN* ECA_CONTROL::get_chain_priv(void) const { const std::vector& schains = selected_chainsetup_repp->selected_chains(); std::vector::const_iterator o = schains.begin(); while(o != schains.end()) { for(std::vector::size_type p = 0; p != selected_chainsetup_repp->chains.size(); p++) { if (selected_chainsetup_repp->chains[p]->name() == *o) return selected_chainsetup_repp->chains[p]; } ++o; } return 0; } /** * Clears all selected chains (all chain operators and controllers * are removed) * * @param name chain name * * require: * is_selected() == true * is_running() != true */ void ECA_CONTROL::clear_chains(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(is_running() != true); // -------- selected_chainsetup_repp->clear_chains(); } /** * Clears all selected chains (all chain operators and controllers * are removed) * * @param name chain name * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() == 1 */ void ECA_CONTROL::rename_chain(const string& name) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(selected_chains().size() == 1); // -------- selected_chainsetup_repp->rename_chain(name); } void ECA_CONTROL::audio_input_as_selected(void) { /* note, here we check that the pointer is still a valid one */ if (selected_chainsetup_repp->ok_audio_object(selected_audio_input_repp) != true) selected_audio_input_repp = 0; selected_audio_object_repp = selected_audio_input_repp; } void ECA_CONTROL::audio_output_as_selected(void) { /* note, here we check that the pointer is still a valid one */ if (selected_chainsetup_repp->ok_audio_object(selected_audio_output_repp) != true) selected_audio_output_repp = 0; selected_audio_object_repp = selected_audio_output_repp; } /** * Sets default audio format. This format will be used, when * adding audio inputs and outputs. * * require: * is_selected() == true */ void ECA_CONTROL::set_default_audio_format(const string& sfrm, int channels, long int srate, bool interleaving) { // -------- DBC_REQUIRE(is_selected() == true); // -------- string format; format = "-f:"; format += sfrm; format += ","; format += kvu_numtostr(channels); format += ","; format += kvu_numtostr(srate); format += ","; if (interleaving == true) format += "i"; else format += "n"; selected_chainsetup_repp->interpret_object_option(format); if (selected_chainsetup_repp->interpret_result() != true) { set_last_error(selected_chainsetup_repp->interpret_result_verbose()); } } /** * Returns the default audio format. * * @pre is_selected() == true */ const ECA_AUDIO_FORMAT& ECA_CONTROL::default_audio_format(void) const { // -- DBC_REQUIRE(is_selected() == true); // -- return selected_chainsetup_repp->default_audio_format(); } /** * Sets default audio format. This format will be used, when * adding audio inputs and outputs. * * require: * is_selected() == true */ void ECA_CONTROL::set_default_audio_format(const ECA_AUDIO_FORMAT& format) { // -------- DBC_REQUIRE(is_selected() == true); // -------- set_default_audio_format(format.format_string(), static_cast(format.channels()), static_cast(format.samples_per_second()), format.interleaved_channels()); } static AUDIO_IO* priv_select_audio_object(const std::vector& objects, const std::string& name) { AUDIO_IO* result = 0; /* NOTE: ugly, but needed to maintain compability with older 2.4.x * releases that allowed double-quoted filenames to ai/ao-select */ std::string stripped_name; if (name.size() > 0 && name[0] == '"') { stripped_name = name; kvu_string_strip_outer_quotes(&stripped_name, '"'); } std::vector::size_type p = 0; for(p = 0; p != objects.size(); p++) { if (objects[p]->label() == name || objects[p]->label() == stripped_name) { result = objects[p]; /* note: in case 'name' is not unique, the first matching * instance is selected */ break; } } return result; } /** * Selects an audio input * * require: * is_selected() == true */ void ECA_CONTROL::select_audio_input(const string& name) { // -------- DBC_REQUIRE(is_selected() == true); // -------- selected_audio_input_repp = priv_select_audio_object(selected_chainsetup_repp->inputs, name); } /** * Selects an audio output * * require: * is_selected() == true */ void ECA_CONTROL::select_audio_output(const string& name) { // -------- DBC_REQUIRE(is_selected() == true); // -------- selected_audio_output_repp = priv_select_audio_object(selected_chainsetup_repp->outputs, name); } /** * Selects an audio input by index. * * @pre is_selected() == true * @pre index_number > 0 */ void ECA_CONTROL::select_audio_input_by_index(int index_number) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(index_number > 0); // -------- selected_audio_input_repp = 0; if (index_number <= static_cast(selected_chainsetup_repp->inputs.size())) selected_audio_input_repp = selected_chainsetup_repp->inputs[index_number-1]; } /** * Selects an audio output by index. * * @pre is_selected() == true * @pre index_number > 0 */ void ECA_CONTROL::select_audio_output_by_index(int index_number) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(index_number > 0); // -------- selected_audio_output_repp = 0; if (index_number <= static_cast(selected_chainsetup_repp->outputs.size())) selected_audio_output_repp = selected_chainsetup_repp->outputs[index_number-1]; } /** * Gets audio format information of the object given as argument. * Note! To get audio format information, audio objects need * to be opened. Because of this, object argument cannot be given * as a const pointer. */ ECA_AUDIO_FORMAT ECA_CONTROL::get_audio_format(AUDIO_IO* aobj) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(aobj != 0); // -------- bool was_open = true; if (aobj->is_open() == false) { was_open = false; try { aobj->open(); } catch(AUDIO_IO::SETUP_ERROR&) { // FIXME: what to do here? } } ECA_AUDIO_FORMAT t (aobj->channels(), aobj->samples_per_second(), aobj->sample_format(), aobj->interleaved_channels()); if (was_open == false) aobj->close(); return t; } /** * Sets the default audio format to the match the currently * select audio input's audio format. * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre selected_audio_object_repp != 0 */ void ECA_CONTROL::set_default_audio_format_to_selected_input(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0); // -------- set_default_audio_format(get_audio_format(selected_audio_input_repp)); } /** * Sets the default audio format to the match the currently * select audio output's audio format. * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre selected_audio_object_repp != 0 */ void ECA_CONTROL::set_default_audio_format_to_selected_output(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_output() != 0); // -------- set_default_audio_format(get_audio_format(selected_audio_output_repp)); } /** * Adds a new audio input (file, soundcard device, etc). Input * is attached to currently selected chains (if any). If 'filename' * doesn't exist or is otherwise invalid, no input is added. * * require: * filename.empty() == false * is_selected() == true * connected_chainsetup() != selected_chainsetup() */ void ECA_CONTROL::add_audio_input(const string& filename) { // -------- DBC_REQUIRE(filename.empty() == false); DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- selected_audio_input_repp = 0; selected_chainsetup_repp->interpret_object_option("-i:" + filename); if (selected_chainsetup_repp->interpret_result() == true) { select_audio_input(kvu_get_argument_number(1, filename)); ECA_LOG_MSG(ECA_LOGGER::info, "Added audio input \"" + filename + "\"."); } else { set_last_error(selected_chainsetup_repp->interpret_result_verbose()); } } /** * Adds a new audio output (file, soundcard device, etc). Output * is attached to currently selected chains (if any). If 'filename' * doesn't exist or is otherwise invalid, no input is added. * * require: * filename.empty() == false * is_selected() == true * connected_chainsetup() != selected_chainsetup() */ void ECA_CONTROL::add_audio_output(const string& filename) { // -------- DBC_REQUIRE(filename.empty() == false); DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- selected_audio_output_repp = 0; selected_chainsetup_repp->interpret_object_option("-o:" + filename); if (selected_chainsetup_repp->interpret_result() == true) { select_audio_output(kvu_get_argument_number(1, filename)); ECA_LOG_MSG(ECA_LOGGER::info, "Added audio output \"" + filename + "\"."); } else { set_last_error(selected_chainsetup_repp->interpret_result_verbose()); } } /** * Adds a default output (as defined in ~/.ecasoundrc) and attach * it to currently selected chains. * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() */ void ECA_CONTROL::add_default_output(void) { // -------- DBC_REQUIRE(selected_chains().size() > 0); DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); // -------- add_audio_output(ECA_OBJECT_FACTORY::probe_default_output_device()); ECA_LOG_MSG(ECA_LOGGER::info, "Added default output to selected chains."); } /** * Gets a vector of all audio input names. * * require: * is_selected() == true */ std::vector ECA_CONTROL::audio_input_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->audio_input_names(); } /** * Gets a vector of all audio output names. * * require: * is_selected() == true */ std::vector ECA_CONTROL::audio_output_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->audio_output_names(); } /** * Gets a pointer to the currently selected audio input. * Returns 0 if no audio object is selected. * * require: * is_selected() == true */ const AUDIO_IO* ECA_CONTROL::get_audio_input(void) { // -------- DBC_REQUIRE(is_selected() == true); // -------- /* note, here we check that the pointer is still a valid one */ if (selected_chainsetup_repp->ok_audio_object(selected_audio_input_repp) != true) selected_audio_input_repp = 0; return selected_audio_input_repp; } /** * Gets a pointer to the currently selected audio output. * Returns 0 if no audio object is selected. * * require: * is_selected() == true */ const AUDIO_IO* ECA_CONTROL::get_audio_output(void) { // -------- DBC_REQUIRE(is_selected() == true); // -------- /* note, here we check that the pointer is still a valid one */ if (selected_chainsetup_repp->ok_audio_object(selected_audio_output_repp) != true) selected_audio_output_repp = 0; return selected_audio_output_repp; } /** * Removes the selected audio input. * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre get_audio_input() != 0 * * @post selected_audio_input_repp = 0 */ void ECA_CONTROL::remove_audio_input(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0); // -------- ECA_LOG_MSG(ECA_LOGGER::info, "Removing selected audio input \"" + selected_audio_input_repp->label() + "\" from selected chains."); selected_chainsetup_repp->remove_audio_input(selected_audio_input_repp); selected_audio_input_repp = 0; // -------- DBC_ENSURE(selected_audio_input_repp == 0); // -------- } /** * Removes the selected audio output. * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre get_audio_output() != 0 * * @post selected_audio_output_repp = 0 */ void ECA_CONTROL::remove_audio_output(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_output() != 0); // -------- ECA_LOG_MSG(ECA_LOGGER::info, "Removing selected audio output \"" + selected_audio_output_repp->label() + "\" from selected chains."); selected_chainsetup_repp->remove_audio_output(selected_audio_output_repp); selected_audio_output_repp = 0; // -------- DBC_ENSURE(selected_audio_output_repp == 0); // -------- } /** * Attaches selected audio input to selected chains * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre get_audio_input() != 0 */ void ECA_CONTROL::attach_audio_input(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0); // -------- selected_chainsetup_repp->attach_input_to_selected_chains(selected_audio_input_repp); ECA_LOG_MSG(ECA_LOGGER::info, "Attached audio input \"" + selected_audio_input_repp->label() + "\" to selected chains."); } /** * Attaches selected audio output to selected chains * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre get_audio_output() != 0 */ void ECA_CONTROL::attach_audio_output(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_output() != 0); // -------- selected_chainsetup_repp->attach_output_to_selected_chains(selected_audio_output_repp); ECA_LOG_MSG(ECA_LOGGER::info, "Attached audio output \"" + selected_audio_output_repp->label() + "\" to selected chains."); } /** * Get a string containing a comma separated list of all chains * attached to input with index 'aiod'. * * @pre is_selected() == true */ string ECA_CONTROL::attached_chains_input(AUDIO_IO* aiod) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- vector t = selected_chainsetup_repp->get_attached_chains_to_input(aiod); string out = ""; vector::const_iterator p = t.begin(); while(p != t.end()) { out += *p; ++p; if (p != t.end()) out += ","; } return out; } /** * Get a string containing a comma separated list of all chains * attached to output with index 'aiod'. * * @pre is_selected() == true */ string ECA_CONTROL::attached_chains_output(AUDIO_IO* aiod) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- vector t = selected_chainsetup_repp->get_attached_chains_to_output(aiod); string out = ""; vector::const_iterator p = t.begin(); while(p != t.end()) { out += *p; ++p; if (p != t.end()) out += ","; } return out; } /** * Get a string containing a comma separated list of all chains * attached to audio object with name 'filename'. * * @pre is_selected() == true */ vector ECA_CONTROL::attached_chains(const string& filename) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- return selected_chainsetup_repp->get_attached_chains_to_iodev(filename); } /** * Rewinds selected audio object by 'pos_in_seconds' seconds * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre selected_audio_object_repp != 0 */ void ECA_CONTROL::rewind_audio_object(double seconds) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0 || get_audio_output() != 0); // -------- selected_audio_object_repp->seek_position_in_seconds(selected_audio_object_repp->position_in_seconds_exact() - seconds); } /** * Forwards selected audio object by 'pos_in_seconds' seconds * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre selected_audio_object_repp != 0 */ void ECA_CONTROL::forward_audio_object(double seconds) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0 || get_audio_output() != 0); // -------- selected_audio_object_repp->seek_position_in_seconds(selected_audio_object_repp->position_in_seconds_exact() + seconds); } /** * Sets position of selected audio object * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_audio_object_repp != 0 */ void ECA_CONTROL::set_audio_object_position(double seconds) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0 || get_audio_output() != 0); // -------- selected_audio_object_repp->seek_position_in_seconds(seconds); } /** * Sets position of selected audio object * * @pre is_selected() == true * @pre connected_chainsetup() != selected_chainsetup() * @pre selected_audio_object_repp != 0 */ void ECA_CONTROL::set_audio_object_position_samples(SAMPLE_SPECS::sample_pos_t samples) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0 || get_audio_output() != 0); // -------- selected_audio_object_repp->seek_position_in_samples(samples); } /** * Spawns an external wave editor for editing selected audio object. * * require: * is_selected() * connected_chainsetup() != selected_chainsetup() * selected_audio_object_repp != 0 */ void ECA_CONTROL::wave_edit_audio_object(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(connected_chainsetup() != selected_chainsetup()); DBC_REQUIRE(get_audio_input() != 0 || get_audio_output() != 0); // -------- string name = selected_audio_object_repp->label(); int res = ::system(string(resource_value("ext-cmd-wave-editor") + " " + name).c_str()); if (res == 127 || res == -1) { ECA_LOG_MSG(ECA_LOGGER::info, "Can't edit; unable to open wave editor \"" + resource_value("x-wave-editor") + "\"."); } } /** * Adds a new chain operator * * @param gcontrol_params is an Ecasound option string describing * a controlled: syntax is either "-:par1,...,parN", * or just ":par1,...,parN" * * require: * is_selected() == true * selected_chains().size() == 1 */ void ECA_CONTROL::add_chain_operator(const string& chainop_params) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_cop_add; edit.cs_ptr = selected_chainsetup_repp; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { /* note: unlike all other functions, first_selected_chain() * returns 0..N */ edit.m.c_generic_param.chain = p + 1; edit.param = chainop_params; edit.need_chain_reinit = true; execute_edit_on_selected(edit); } } /** * Adds a new chain operator. Pointer given as argument * will remain to be usable, but notice that it is * _NOT_ thread-safe to use assigned/registered objects * from client programs. You must be sure that ecasound * isn't using the same object as you are. The * easiest way to assure this is to disconnect * the chainsetup to which object is attached. * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() == 1 * cotmp != 0 */ void ECA_CONTROL::add_chain_operator(CHAIN_OPERATOR* cotmp) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(cotmp != 0); // -------- selected_chainsetup_repp->add_chain_operator(cotmp); } /** * Returns a pointer to the the selected chain operator. If no chain * operator is selected, 0 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 */ const CHAIN_OPERATOR* ECA_CONTROL::get_chain_operator(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- if (is_selected() == true) { unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) return selected_chainsetup_repp->chains[p]->get_selected_chain_operator(); } return 0; } /** * Returns a list of chain operator names. * * require: * is_selected() == true * selected_chains().size() == 1 */ std::vector ECA_CONTROL::chain_operator_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- std::vector result; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { CHAIN* selected_chain = selected_chainsetup_repp->chains[p]; int save_selected_cop = selected_chain->selected_chain_operator(); for(int n = 0; n < selected_chain->number_of_chain_operators(); n++) { selected_chain->select_chain_operator(n + 1); result.push_back(selected_chain->chain_operator_name()); } selected_chain->select_chain_operator(save_selected_cop); } return result; } /** * Returns the index of the selected chain operator. If no chain * operator is selected, -1 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 */ int ECA_CONTROL::selected_chain_operator(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) return selected_chainsetup_repp->chains[p]->selected_chain_operator(); return -1; } /** * Removes the selected chain operator * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() == 1 */ void ECA_CONTROL::remove_chain_operator(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chainsetup() != connected_chainsetup()); DBC_REQUIRE(selected_chains().size() == 1); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) selected_chainsetup_repp->chains[p]->remove_chain_operator(-1); } /** * Selects chain operator 'chainop_id'. * * require: * is_selected() == true * selected_chains().size() == 1 * chainop_id > 0 */ void ECA_CONTROL::select_chain_operator(int chainop_id) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(chainop_id > 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { CHAIN *ch = selected_chainsetup_repp->chains[p]; if (chainop_id < ch->number_of_chain_operators() + 1) { ch->select_chain_operator(chainop_id); } } } /** * Returns a list of chain operator parameter names. * * require: * is_selected == true * selected_chains().size() == 1 */ std::vector ECA_CONTROL::chain_operator_parameter_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- std::vector result; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { CHAIN* selected_chain = selected_chainsetup_repp->chains[p]; if (selected_chain->selected_chain_operator() > 0) { int save_selected_copp = selected_chain->selected_chain_operator_parameter(); for(int n = 0; n < selected_chain->number_of_chain_operator_parameters(); n++) { selected_chain->select_chain_operator_parameter(n + 1); result.push_back(selected_chain->chain_operator_parameter_name()); } selected_chain->select_chain_operator_parameter(save_selected_copp); } } return result; } /** * Selects chain operator parameter 'param'. * * require: * is_selected() == true * selected_chains().size() == 1 * get_chain_operator() != 0 * param > 0 */ void ECA_CONTROL::select_chain_operator_parameter(int param) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(param > 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { selected_chainsetup_repp->chains[p]->select_chain_operator_parameter(param); } } /** * Sets chain operator parameter value * * require: * is_selected() == true * selected_chains().size() == 1 * get_chain_operator() != 0 */ void ECA_CONTROL::set_chain_operator_parameter(CHAIN_OPERATOR::parameter_t value) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_chain_operator() != 0); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_cop_set_param; edit.cs_ptr = selected_chainsetup_repp; edit.need_chain_reinit = false; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { /* note: unlike all other functions, first_selected_chain() * returns 0..N */ CHAIN *chain = selected_chainsetup_repp->chains[p]; edit.m.cop_set_param.chain = p + 1; edit.m.cop_set_param.op = chain->selected_chain_operator(); edit.m.cop_set_param.param = chain->selected_chain_operator_parameter(); edit.m.cop_set_param.value = value; execute_edit_on_selected(edit); } } /** * Parsers input parameter to bypass/mute/etc toggles. * * if (str == "on") return 1 * if (str == "off") return 0 * if (str == "toggle") return -1 * return -1 */ static int priv_onofftoggle_to_int(const string& str) { if (str == "on") return 1; if (str == "off") return 0; return -1; } /** * Toggles whether chain is muted or not * * require: * is_selected() == true * selected_chains().size() > 0 */ void ECA_CONTROL::set_chain_muting(const string &arg) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() > 0); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_c_muting; edit.cs_ptr = selected_chainsetup_repp; edit.need_chain_reinit = false; int state_arg = priv_onofftoggle_to_int(arg); unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { edit.m.c_muting.chain = p + 1; edit.m.c_muting.val = state_arg; execute_edit_on_selected(edit); } } /** * Toggles whether chain operators are enabled or disabled * * require: * is_selected() == true * selected_chains().size() > 0 */ void ECA_CONTROL::set_chain_bypass(const string& arg) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() > 0); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_c_bypass; edit.cs_ptr = selected_chainsetup_repp; edit.need_chain_reinit = false; int state_arg = priv_onofftoggle_to_int(arg); unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { edit.m.c_bypass.chain = p + 1; edit.m.c_bypass.val = state_arg; execute_edit_on_selected(edit); } } /** * Modify chain operator bypass state * * require: * is_selected() == true * selected_chains().size() == 1 * get_chain_operator() != 0 */ void ECA_CONTROL::bypass_chain_operator(const string& arg) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_chain_operator() != 0); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_cop_bypass; edit.cs_ptr = selected_chainsetup_repp; edit.need_chain_reinit = false; int bypass_arg = priv_onofftoggle_to_int(arg); unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { /* note: unlike all other functions, first_selected_chain() * returns 0..N */ CHAIN *chain = selected_chainsetup_repp->chains[p]; edit.m.cop_bypass.chain = p + 1; edit.m.cop_bypass.op = chain->selected_chain_operator(); edit.m.cop_bypass.bypass = bypass_arg; execute_edit_on_selected(edit); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Set bypass of chain " + kvu_numtostr(p) + " op " + kvu_numtostr(edit.m.cop_bypass.op) + " to " + kvu_numtostr(bypass_arg)); } } /** * Returns true if selected chain op is bypasssed * * require: * is_selected() == true * selected_chains().size() == 1 * get_chain_operator() != 0 */ bool ECA_CONTROL::chain_operator_is_bypassed(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_chain_operator() != 0); // -------- int op_index = selected_chain_operator(); CHAIN* c = get_chain_priv(); if (c != 0) { return c->is_operator_bypassed(op_index); } return false; } /** * Returns true if selected chain is bypassed */ bool ECA_CONTROL::chain_is_bypassed(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- CHAIN* c = get_chain_priv(); if (c != 0) { return c->is_bypassed(); } return false; } /** * Returns true if selected chain is bypassed */ bool ECA_CONTROL::chain_is_muted(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- CHAIN* c = get_chain_priv(); if (c != 0) { return c->is_muted(); } return false; } /** * Returns the selected chain operator parameter value * * require: * is_selected() == true * selected_chains().size() == 1 */ CHAIN_OPERATOR::parameter_t ECA_CONTROL::get_chain_operator_parameter(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { if (selected_chainsetup_repp->chains[p]->selected_chain_operator() > 0 && selected_chainsetup_repp->chains[p]->selected_chain_operator_parameter() > 0) return selected_chainsetup_repp->chains[p]->get_parameter(); } return 0.0f; } /** * Returns the index number of selected chain operator parameter. * If no parameter is selected, 0 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 * get_chain_operator() != 0 */ int ECA_CONTROL::selected_chain_operator_parameter(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_chain_operator() != 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { return selected_chainsetup_repp->chains[p]->selected_chain_operator_parameter(); } return 0; } /** * Adds a new controller * * @param gcontrol_params is an Ecasound option string describing * a controlled: syntax is either "-:par1,...,parN", * or just ":par1,...,parN" * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() > 0 */ void ECA_CONTROL::add_controller(const string& gcontrol_params) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() > 0); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_ctrl_add; edit.cs_ptr = selected_chainsetup_repp; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { /* note: unlike all other functions, first_selected_chain() * returns 0..N */ edit.m.c_generic_param.chain = p + 1; edit.param = gcontrol_params; edit.need_chain_reinit = true; execute_edit_on_selected(edit); } } /** * Selects the Nth controller. * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() == 1 * controller_id > 0 */ void ECA_CONTROL::select_controller(int controller_id) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(controller_id > 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { CHAIN *ch = selected_chainsetup_repp->chains[p]; if (controller_id < ch->number_of_controllers() + 1) { selected_chainsetup_repp->chains[p]->select_controller(controller_id); } } } /** * Removes the selected controller. * * require: * is_selected() == true * connected_chainsetup() != selected_chainsetup() * selected_chains().size() == 1 * get_controller() != 0 */ void ECA_CONTROL::remove_controller(void) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chainsetup() != connected_chainsetup()); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_controller() != 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { selected_chainsetup_repp->chains[p]->remove_controller(); } } /** * Returns a list of controller names. * * require: * is_selected() == true * selected_chains().size() == 1 */ std::vector ECA_CONTROL::controller_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- std::vector result; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { CHAIN* selected_chain = selected_chainsetup_repp->chains[p]; int save_selected_ctrl = selected_chain->selected_controller(); for(int n = 0; n < selected_chain->number_of_controllers(); n++) { selected_chain->select_controller(n + 1); result.push_back(selected_chain->controller_name()); } selected_chain->select_controller(save_selected_ctrl); } return result; } /** * Returns a pointer to the selected controller. If no controller is * selected, 0 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 */ const GENERIC_CONTROLLER* ECA_CONTROL::get_controller(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) return selected_chainsetup_repp->chains[p]->get_selected_controller(); return 0; } /** * Returns the index number of the selected controller. If no controller is * selected, 0 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 */ int ECA_CONTROL::selected_controller(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) return selected_chainsetup_repp->chains[p]->selected_controller(); return 0; } /** * Returns a list of the selected controller's parameter names * * require: * is_selected() == true * selected_chains().size() == 1 * get_controller() != 0 */ std::vector ECA_CONTROL::controller_parameter_names(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_controller() != 0); // -------- std::vector result; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { CHAIN* selected_chain = selected_chainsetup_repp->chains[p]; int save_selected_ctrlp = selected_chain->selected_controller_parameter(); for(int n = 0; n < selected_chain->number_of_controller_parameters(); n++) { selected_chain->select_controller_parameter(n + 1); result.push_back(selected_chain->controller_parameter_name()); } selected_chain->select_controller_parameter(save_selected_ctrlp); } return result; } /** * Select a particular controller parameter * * require: * is_selected() == true * selected_chains().size() == 1 * param > 0 */ void ECA_CONTROL::select_controller_parameter(int param) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(param > 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { selected_chainsetup_repp->chains[p]->select_controller_parameter(param); } } /** * Returns the index number of selected controller parameter. * If no parameter is selected, 0 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 * get_controller() != 0 */ int ECA_CONTROL::selected_controller_parameter(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_controller() != 0); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { return selected_chainsetup_repp->chains[p]->selected_controller_parameter(); } return 0; } /** * Set the currently selected controller parameter * * require: * is_selected() == true * selected_chains().size() == 1 * get_controller() != 0 */ void ECA_CONTROL::set_controller_parameter(CHAIN_OPERATOR::parameter_t value) { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_controller() != 0); // -------- ECA::chainsetup_edit_t edit; edit.type = ECA::edit_ctrl_set_param; edit.cs_ptr = selected_chainsetup_repp; edit.need_chain_reinit = false; unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { /* note: unlike all other functions, first_selected_chain() * returns 0..N */ CHAIN *chain = selected_chainsetup_repp->chains[p]; edit.m.ctrl_set_param.chain = p + 1; edit.m.ctrl_set_param.op = chain->selected_controller(); edit.m.ctrl_set_param.param = chain->selected_controller_parameter(); edit.m.ctrl_set_param.value = value; execute_edit_on_selected(edit); } } /** * Returns the value of the currently selected controller parameter * If no controller or controller parameter is selected, 0.0 is returned. * * require: * is_selected() == true * selected_chains().size() == 1 */ CONTROLLER_SOURCE::parameter_t ECA_CONTROL::get_controller_parameter(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); // -------- unsigned int p = selected_chainsetup_repp->first_selected_chain(); if (p < selected_chainsetup_repp->chains.size()) { if (selected_chainsetup_repp->chains[p]->selected_controller() > 0 && selected_chainsetup_repp->chains[p]->selected_controller_parameter() > 0) return selected_chainsetup_repp->chains[p]->get_controller_parameter(); } return 0.0f; } /** * Returns the index number of chain operator that is the target for the currently selected * controller. * * require: * is_selected() == true * selected_chains().size() == 1 * get_controller() != 0 */ int ECA_CONTROL::selected_controller_target(void) const { // -------- DBC_REQUIRE(is_selected() == true); DBC_REQUIRE(selected_chains().size() == 1); DBC_REQUIRE(get_controller() != 0); // -------- /* We find the index of the chain_op that corresponds to the the selected controller's target by looping through the chain ops and comparing the value of the chain operator (a CHAIN_OPERATOR*) with the value of the controllers "target_pointer()". */ unsigned int p = selected_chainsetup_repp->first_selected_chain(); int result = 0; if (p < selected_chainsetup_repp->chains.size()) { CHAIN* selected_chain = selected_chainsetup_repp->chains[p]; OPERATOR* target = selected_chain->get_selected_controller()->target_pointer(); for(int n = 0; n < selected_chain->number_of_chain_operators(); n++) { if (selected_chain->get_chain_operator(n) == target) { result = n+1; break; } } } return result; } ecasound-2.9.3/libecasound/eca-audio-time.cpp0000644000076400007640000001443011034137670016042 00000000000000// ------------------------------------------------------------------------ // eca-audio-time.cpp: Generic class for representing time in audio // environment. // Copyright (C) 2000,2007,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "eca-audio-time.h" /** * FIXME notes (last update 2008-03-09) * * - Add variant that allows specifying both sample position and * sampling rate to set_time_string(). E.g. "1234@44100sa" or * something similar. */ using SAMPLE_SPECS::sample_pos_t; using SAMPLE_SPECS::sample_rate_t; ECA_AUDIO_TIME::ECA_AUDIO_TIME(sample_pos_t samples, sample_rate_t sample_rate) { set_samples_per_second(sample_rate); set_samples(samples); rate_set_rep = true; } ECA_AUDIO_TIME::ECA_AUDIO_TIME(double time_in_seconds) : samples_rep(0), sample_rate_rep(ECA_AUDIO_TIME::invalid_srate), rate_set_rep(false) { set_seconds(time_in_seconds); rate_set_rep = true; } ECA_AUDIO_TIME::ECA_AUDIO_TIME(format_type type, const std::string& time) : samples_rep(0), sample_rate_rep(ECA_AUDIO_TIME::invalid_srate), rate_set_rep(false) { set(type, time); } ECA_AUDIO_TIME::ECA_AUDIO_TIME(const std::string& time) : samples_rep(0), sample_rate_rep(ECA_AUDIO_TIME::invalid_srate), rate_set_rep(false) { set_time_string(time); } ECA_AUDIO_TIME::ECA_AUDIO_TIME(void) : samples_rep(0), sample_rate_rep(ECA_AUDIO_TIME::invalid_srate), rate_set_rep(false) { } /** * Sets time based on 'type', 'time' and 'srate'. * * @param sample_rate a value of zero will be ignored. */ void ECA_AUDIO_TIME::set(format_type type, const std::string& time) { switch(type) { /* FIXME: not implemented! */ case format_hour_min_sec: { DBC_CHECK(false); break; } /* FIXME: not implemented! */ case format_min_sec: { DBC_CHECK(false); break; } case format_seconds: { double seconds = atof(time.c_str()); set_seconds(seconds); break; } case format_samples: { samples_rep = atol(time.c_str()); break; } default: { } } } /** * Sets time expressed in seconds. Additionally sample_rate is given * to express the timing accuracy. * * @param sample_rate a value of zero will be ignored. */ void ECA_AUDIO_TIME::set_seconds(double seconds) { if (sample_rate_rep == ECA_AUDIO_TIME::invalid_srate) { sample_rate_rep = ECA_AUDIO_TIME::default_srate; rate_set_rep = true; } samples_rep = static_cast(seconds * sample_rate_rep); } /** * Sets time based on string 'time'. Additionally sample_rate is given * to express the timing accuracy. * * The time string is by default interpreted as seconds (need not * be an integer but can be given as a decimal number, e.g. "1.05"). * However, if the string contains an integer number and has a postfix * of "sa" (e.g. "44100sa"), it is interpreted as time expressed as * samples (in case of a multichannel stream, time in sample frames). * * @param sample_rate a value of zero will be ignored. */ void ECA_AUDIO_TIME::set_time_string(const std::string& time) { if (time.size() > 2 && time.find("sa") != std::string::npos) ECA_AUDIO_TIME::set(format_samples, std::string(time, 0, time.size() - 2)); else ECA_AUDIO_TIME::set(format_seconds, time); } /** * Sets the sample count. * * Note, this can change the value of seconds(). */ void ECA_AUDIO_TIME::set_samples(SAMPLE_SPECS::sample_pos_t samples) { samples_rep = samples; } /** * Sets samples per second. Additionally sample_rate is given * to express the timing accuracy. * * Note, this can change the value of seconds(). */ void ECA_AUDIO_TIME::set_samples_per_second(SAMPLE_SPECS::sample_rate_t srate) { if (srate > 0) { sample_rate_rep = srate; rate_set_rep = true; } else { rate_set_rep = false; sample_rate_rep = ECA_AUDIO_TIME::invalid_srate; } } /** * Sets samples per second. * * Note, if sampling rate has been set earlier, this function * does NOT change the value of seconds() like * set_samples_per_second() potentially does. */ void ECA_AUDIO_TIME::set_samples_per_second_keeptime(sample_rate_t srate) { if (srate > 0 && sample_rate_rep != srate) { if (rate_set_rep == true) { /* only needed if sampling rate has been set */ double time_secs = seconds(); set_samples_per_second(srate); set_seconds(time_secs); } else { set_samples_per_second(srate); } } } void ECA_AUDIO_TIME::mark_as_invalid(void) { set_samples_per_second(ECA_AUDIO_TIME::invalid_srate); } std::string ECA_AUDIO_TIME::to_string(format_type type) const { /* FIXME: not implemented */ switch(type) { case format_hour_min_sec: { return ""; } case format_min_sec: { return ""; } case format_seconds: { return kvu_numtostr(seconds(), 6); } case format_samples: { return kvu_numtostr(samples_rep); } default: { } } return ""; } double ECA_AUDIO_TIME::seconds(void) const { if (rate_set_rep != true) { sample_rate_rep = ECA_AUDIO_TIME::default_srate; rate_set_rep = true; } return static_cast(samples_rep) / sample_rate_rep; } SAMPLE_SPECS::sample_rate_t ECA_AUDIO_TIME::samples_per_second(void) const { return sample_rate_rep; } SAMPLE_SPECS::sample_pos_t ECA_AUDIO_TIME::samples(void) const { return samples_rep; } bool ECA_AUDIO_TIME::valid(void) const { return rate_set_rep; } ecasound-2.9.3/libecasound/sample-specs.h0000644000076400007640000000413310664032032015311 00000000000000// ------------------------------------------------------------------------ // sample-specs.h: Sample value defaults and constants. // Copyright (C) 1999-2004 Kai Vehmanen // // Attributes: // eca-style-version: 2 // public-libecasound-API: yes // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDED_SAMPLE_SPECS_H #define INCLUDED_SAMPLE_SPECS_H /** * Sample value defaults and constants. */ namespace SAMPLE_SPECS { /** * Type used to represent one sample value; should * be a floating point value (floating-point type) */ typedef float sample_t; /** * Type used to represent position in sample * frames (signed integer). */ #if defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE || defined __GNUG__ typedef long long int sample_pos_t; #else typedef long int sample_pos_t; #endif /** * Type used to represent sample rate values (signed integer). */ typedef long int sample_rate_t; /** * Type used to identify individual channels (signed integer). */ typedef int channel_t; static const sample_t silent_value = 0.0f; // do not change! static const sample_t max_amplitude = 1.0f; static const sample_t impl_max_value = silent_value + max_amplitude; static const sample_t impl_min_value = silent_value - max_amplitude; static const channel_t ch_left = 0; static const channel_t ch_right = 1; } #endif ecasound-2.9.3/libecasound/audioio-raw.cpp0000644000076400007640000001135011033002244015460 00000000000000// ------------------------------------------------------------------------ // audioio-raw.cpp: Raw/headerless audio file format input/output // Copyright (C) 1999-2001 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include "audioio-buffered.h" #include "audioio-raw.h" #include "eca-error.h" #include "eca-logger.h" RAWFILE::RAWFILE(const std::string& name) { set_label(name); fio_repp = 0; mmaptoggle_rep = "0"; } RAWFILE::~RAWFILE(void) { if (is_open() == true) { close(); } } RAWFILE* RAWFILE::clone(void) const { RAWFILE* target = new RAWFILE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return(target); } /** * Opens the raw audio i/o device. * * Note! Cases where label() matches either "stdin", "stdout" * or "stderr" are handled as special cases. */ void RAWFILE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { switch(io_mode()) { case io_read: { if (label() == "stdin" || label().at(0) == '-') { fio_repp = new ECA_FILE_IO_STREAM(); fio_repp->open_stdin(); } else { if (mmaptoggle_rep == "1") { ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audioio-wave) using mmap() mode for file access"); fio_repp = new ECA_FILE_IO_MMAP(); } else fio_repp = new ECA_FILE_IO_STREAM(); fio_repp->open_file(label(),"rb"); if (fio_repp->is_file_ready() != true) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-RAW: Couldn't open file " + label() + " for reading.")); } } break; } case io_write: { fio_repp = new ECA_FILE_IO_STREAM(); if (label() == "stdout" || label().at(0) == '-') { std::cerr << "(audioio-raw) Outputting to standard output [w].\n"; fio_repp->open_stdout(); } else if (label() == "stderr" || label().at(0) == '-') { fio_repp->open_stderr(); } else { fio_repp->open_file(label(),"wb"); if (fio_repp->is_file_ready() != true) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-RAW: Couldn't open file " + label() + " for writing.")); } } break; } case io_readwrite: { fio_repp = new ECA_FILE_IO_STREAM(); if (label() == "stdout" || label().at(0) == '-') { std::cerr << "(audioio-raw) Outputting to standard output [rw].\n"; fio_repp->open_stdout(); } else { fio_repp->open_file(label(),"r+b"); if (fio_repp->file_mode() == "") { fio_repp->open_file(label(),"w+b"); if (fio_repp->is_file_ready() != true) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-RAW: Couldn't open file " + label() + " for read&write.")); } } } } } set_length_in_bytes(); AUDIO_IO::open(); } void RAWFILE::close(void) { if (fio_repp != 0) { fio_repp->close_file(); delete fio_repp; fio_repp = 0; } AUDIO_IO::close(); } bool RAWFILE::finished(void) const { if (fio_repp->is_file_error() || !fio_repp->is_file_ready()) return true; return false; } long int RAWFILE::read_samples(void* target_buffer, long int samples) { fio_repp->read_to_buffer(target_buffer, frame_size() * samples); return(fio_repp->file_bytes_processed() / frame_size()); } void RAWFILE::write_samples(void* target_buffer, long int samples) { fio_repp->write_from_buffer(target_buffer, frame_size() * samples); } SAMPLE_SPECS::sample_pos_t RAWFILE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { if (is_open() == true) { fio_repp->set_file_position(pos * frame_size()); } return pos; } void RAWFILE::set_length_in_bytes(void) { set_length_in_samples(fio_repp->get_file_length() / frame_size()); } void RAWFILE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: mmaptoggle_rep = value; break; } } string RAWFILE::get_parameter(int param) const { switch (param) { case 1: return(label()); case 2: return(mmaptoggle_rep); } return(""); } ecasound-2.9.3/libecasound/audioio-oss_impl.h0000644000076400007640000000021510664032032016166 00000000000000#ifndef _AUDIOIO_OSS_IMPL_H #define _AUDIOIO_OSS_IMPL_H #define DEFAULT_FRAGMENT_SIZE 0 #define DEFAULT_FRAGMENT_COUNT 0 #endif ecasound-2.9.3/libecasound/eca-test-case.cpp0000644000076400007640000000566111541135170015677 00000000000000// ------------------------------------------------------------------------ // eca-test-case.cpp: Abstract interface for implementing // test cases for component testing. // Copyright (C) 2002,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "kvu_numtostr.h" #include "kvu_dbc.h" #include "eca-test-case.h" using namespace std; ECA_TEST_CASE::ECA_TEST_CASE(void) { success_rep = false; } ECA_TEST_CASE::~ECA_TEST_CASE(void) { } void ECA_TEST_CASE::run_common_before(void) { failures_rep.clear(); success_rep = false; DBC_CHECK(failures_rep.size() == 0); } void ECA_TEST_CASE::run_common_after(void) { if (failures_rep.size() > 0) { success_rep = false; } else { success_rep = true; } } /** * Runs the test case. */ void ECA_TEST_CASE::run(void) { run_common_before(); /* actual test implemention defined in a subclass */ do_run(); run_common_after(); } /** * Runs the test cases passing a name argument. */ void ECA_TEST_CASE::run(const std::string &name) { run_common_before(); /* actual test implemention defined in a subclass */ do_run(name); run_common_after(); } /** * Returns the test case name. */ string ECA_TEST_CASE::name(void) const { return do_name(); } /** * Whether test was run successfully. */ bool ECA_TEST_CASE::success(void) const { return success_rep; } /** * Returns a list of string describing all * failed assertations that occured during * testing. */ const std::list& ECA_TEST_CASE::failures(void) const { return failures_rep; } void ECA_TEST_CASE::do_run(const std::string& name) { do_run(); } /** * Reports a failed assertions. * * @param filename filename where failure occured * @param lineno line number * @param description what kind of failure * * @see ECA_TEST_FAILURE */ void ECA_TEST_CASE::report_failure(const string& filename, int lineno, const string& description) { string failure (filename + ":" + kvu_numtostr(lineno) + " " + description); cerr << failure << endl; failures_rep.push_back(filename + ":" + kvu_numtostr(lineno) + " " + description); } ecasound-2.9.3/libecasound/midiio-aseq.h0000644000076400007640000000271410664032032015121 00000000000000#ifndef INCLUDED_MIDIIO_ASEQ_H #define INCLUDED_MIDIIO_ASEQ_H #include #include #include "midiio.h" /** * Input and output of raw MIDI streams using * ALSA sequencer * * @author Pedro Lopez-Cabanillas */ class MIDI_IO_ASEQ : public MIDI_IO { public: MIDI_IO_ASEQ (const std::string& name = ""); virtual ~MIDI_IO_ASEQ(void); virtual MIDI_IO_ASEQ* clone(void) const { return(new MIDI_IO_ASEQ(*this)); } virtual MIDI_IO_ASEQ* new_expr(void) const { return new MIDI_IO_ASEQ(); } virtual std::string name(void) const { return("ALSA Sequencer MIDI"); } virtual int supported_io_modes(void) const { return(io_read | io_write | io_readwrite); } virtual bool supports_nonblocking_mode(void) const { return(true); } virtual std::string parameter_names(void) const { return("label,device_name"); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; virtual void open(void); virtual void close(void); virtual int poll_descriptor(void) const; virtual long int read_bytes(void* target_buffer, long int bytes); virtual long int write_bytes(void* target_buffer, long int bytes); virtual bool finished(void) const; virtual bool pending_messages(unsigned long timeout) const; private: snd_seq_t* seq_handle_repp; snd_midi_event_t* coder_repp; int buffer_size_rep; int port_rep; bool finished_rep; std::string device_name_rep; }; #endif ecasound-2.9.3/libecasound/eca-osc.cpp0000644000076400007640000002205612272533326014577 00000000000000// ------------------------------------------------------------------------ // eca-osc.cpp: Class implementing the Ecasound OSC interface // Copyright (C) 2009,2012,2014 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // References: // - liblo: // http://liblo.sourceforge.net/ // http://liblo.sourceforge.net/docs/ // - Open Source Control (OSC): // http://opensoundcontrol.org/ // http://archive.cnmat.berkeley.edu/OpenSoundControl/ // http://en.wikipedia.org/wiki/OpenSound_Control // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #ifdef ECA_USE_LIBLO #include #include #include #include #include #include "eca-control-mt.h" #include "eca-chainsetup-edit.h" #include "eca-chainsetup.h" #include "eca-logger.h" #include "eca-osc.h" // #define VERBOSE_FOR_DEBUGGING 1 #undef VERBOSE_FOR_DEBUGGING using namespace std; const std::string eca_osc_interface_namespace_const ("ecasound"); static void cb_lo_err_handler(int num, const char *msg, const char *where) { std::fprintf(stderr, "lo_error: num=%d, msg=%s, where=%s.\n", num, msg, where); } int cb_lo_method_handler(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) { ECA_OSC_INTERFACE* self = reinterpret_cast(user_data); #ifdef VERBOSE_FOR_DEBUGGING std::fprintf(stdout, "lo_method: path=%s, types=%s, args=%d, userdata=%p.\n", path, types, argc, user_data); #endif int retval = self->handle_osc_message(path, types, argv, argc); #ifdef VERBOSE_FOR_DEBUGGING for(int n = 0; n < argc; n++) { switch (types[n]) { case 'i': std::fprintf(stdout, "lo_arg #%d %c=<%d>\n", n, types[n], argv[n]->i); break; case 'f': std::fprintf(stdout, "lo_arg #%d %c=<%.03f>\n", n, types[n], argv[n]->f); break; default: std::fprintf(stdout, "lo_arg #%d %c=\n", n, types[n], *(uint32_t*)argv[n]); break; } } #endif /* note: doesn't seem to work in 0.23 (at least when messages are sent with oscsend from 0.26) */ // lo_message_pp(msg); return retval; } /** * Constructor * * If any other object may use the control object, passed to * ECA_OSC_INTERFACE, at the same time, ECA_CONTROL_MT should * be used to guarantee thread-safety access to control * functions. * * @param ecacontrol if the control object is u */ ECA_OSC_INTERFACE::ECA_OSC_INTERFACE(ECA_CONTROL_MT *ecacontrol, int port) : ec_repp(ecacontrol), running_rep(false), udp_port_rep(port), lo_thr_repp(0) { } ECA_OSC_INTERFACE::~ECA_OSC_INTERFACE(void) { if (is_running() == true) { stop(); } } void ECA_OSC_INTERFACE::start(void) { const char* port_str = 0; if (udp_port_rep > 0) { port_str = kvu_numtostr(udp_port_rep).c_str(); } /* FIXME: move to after opening and acquire port * with lo_server_thread_get_port */ ECA_LOG_MSG(ECA_LOGGER::info, "started OSC interface at UDP port " + kvu_numtostr(udp_port_rep)); lo_thr_repp = lo_server_thread_new(port_str, cb_lo_err_handler); if (lo_thr_repp) { /* note: in liblo 0.23 function returns voide, but * in 0.26 in returns an int */ lo_server_thread_start(lo_thr_repp); method_all_repp = lo_server_thread_add_method(lo_thr_repp, NULL, NULL, cb_lo_method_handler, this); running_rep = true; } ECA_LOG_MSG(ECA_LOGGER::user_objects, "server thread started with status " + kvu_numtostr(running_rep)); } void ECA_OSC_INTERFACE::stop(void) { if (running_rep == true) { /* note: in liblo 0.23 function returns voide, but * in 0.26 in returns an int */ lo_server_thread_stop(lo_thr_repp); lo_server_thread_free(lo_thr_repp); method_all_repp = 0; lo_thr_repp = 0; running_rep = false; } } bool ECA_OSC_INTERFACE::is_running(void) const { return running_rep; } /** For "foo/bar/yeah", returns "foo" */ static string priv_path_get_front(const string &path) { return string (path, 0, path.find("/")); } /** For "foo/bar/yeah", returns "bar/yeah" */ static string priv_path_pop_front(const std::string &path) { size_t marker = path.find("/"); if (marker != string::npos) return string(path, marker + 1); return path; } /** * Parses path with syntax "param/X" and writes X to 'param'. * * @return 0 on success, negative error code otherwise */ int ECA_OSC_INTERFACE::parse_path_param(const std::string &path, int *param) { if (priv_path_get_front(string(path)) == "param") { string left_s = priv_path_pop_front(path); string param_s = priv_path_get_front(left_s); if (param_s.size() > 0 && param != 0) { *param = std::atoi(param_s.c_str()); return 0; } } return -1; } int ECA_OSC_INTERFACE::handle_chain_message(const std::string &path, const char *types, lo_arg **argv, int argc) { int retval = -1; string chain_s = priv_path_get_front(path); ec_repp->lock_control(); const ECA_CHAINSETUP *cs = ec_repp->get_connected_chainsetup(); int c_index = cs ? cs->get_chain_index(chain_s) : -1; if (c_index > 0) { ECA::chainsetup_edit_t edit; edit.cs_ptr = cs; string left_s = priv_path_pop_front(path); string action = priv_path_get_front(left_s); if (action == "op") { left_s = priv_path_pop_front(left_s); string op_s = priv_path_get_front(left_s); int param = -1; int p_res = parse_path_param(priv_path_pop_front(left_s), ¶m); if (argc > 0 && p_res == 0) { DBC_CHECK(types[0] == 'f'); edit.type = ECA::edit_cop_set_param; edit.need_chain_reinit = false; edit.m.cop_set_param.chain = c_index; edit.m.cop_set_param.op = std::atoi(op_s.c_str()); edit.m.cop_set_param.param = param; edit.m.cop_set_param.value = argv[0]->f; #ifdef VERBOSE_FOR_DEBUGGING std::fprintf(stdout, "chain=%s (id=%d), op=%d, param=%d to %.03f\n", chain_s.c_str(), c_index, edit.m.cop_set_param.op, edit.m.cop_set_param.param, edit.m.cop_set_param.value); #endif ec_repp->execute_edit_on_connected(edit); retval = 0; } } else if (action == "ctrl") { left_s = priv_path_pop_front(left_s); string ctrl_s = priv_path_get_front(left_s); int param = -1; int p_res = parse_path_param(priv_path_pop_front(left_s), ¶m); if (argc > 0 && p_res == 0) { DBC_CHECK(types[0] == 'f'); edit.type = ECA::edit_ctrl_set_param; edit.need_chain_reinit = false; edit.m.ctrl_set_param.chain = c_index; edit.m.ctrl_set_param.op = std::atoi(ctrl_s.c_str()); edit.m.ctrl_set_param.param = param; edit.m.ctrl_set_param.value = argv[0]->f; #ifdef VERBOSE_FOR_DEBUGGING std::fprintf(stdout, "chain=%s (id=%d), ctrl=%d, param=%d to %.03f\n", chain_s.c_str(), c_index, edit.m.ctrl_set_param.op, edit.m.ctrl_set_param.param, edit.m.ctrl_set_param.value); #endif ec_repp->execute_edit_on_connected(edit); retval = 0; } } else { DBC_NEVER_REACHED(); } } else { #ifdef VERBOSE_FOR_DEBUGGING std::fprintf(stdout, "full=%s, chain=%s (id=%d), op=-, param=- to -\n", path.c_str(),chain_s.c_str(), c_index); #endif } ec_repp->unlock_control(); if (cs == 0) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: no chainsetup connected, so ignoring OSC message \"" + path + "\""); } return retval; } int ECA_OSC_INTERFACE::handle_osc_message(const char *path, const char *types, lo_arg **argv, int argc) { int retval = -1; DBC_CHECK(path[0] == '/'); string left_s = priv_path_pop_front(string(path)); string namespace_s = priv_path_get_front(left_s); if (namespace_s == eca_osc_interface_namespace_const) { left_s = priv_path_pop_front(left_s); string component_s = priv_path_get_front(left_s); #ifdef VERBOSE_FOR_DEBUGGING std::fprintf(stdout, "full=%s, left=%s, component=%s\n", path, left_s.c_str(), component_s.c_str()); #endif if (component_s == "chain") { left_s = priv_path_pop_front(left_s); retval = handle_chain_message(left_s, types, argv, argc); } } else { #ifdef VERBOSE_FOR_DEBUGGING std::fprintf(stdout, "full=%s, left=%s, ignoring...\n", path, left_s.c_str()); #endif retval = -1; } return retval; } #endif /* ECA_USE_LIBLO */ ecasound-2.9.3/libecasound/eca-chainsetup-bufparams.h0000644000076400007640000000347210664032032017571 00000000000000#ifndef INCLUDED_ECA_CHAINSETUP_BUFPARAMS_H #define INCLUDED_ECA_CHAINSETUP_BUFPARAMS_H #include using std::string; class ECA_CHAINSETUP_BUFPARAMS { public: ECA_CHAINSETUP_BUFPARAMS(void); void set_all(const std::string& paramstring); void set_buffersize(long int value); void toggle_raised_priority(bool value); void set_sched_priority(int prio); void toggle_double_buffering(bool value); void set_double_buffer_size(long int v); void toggle_max_buffers(bool v); bool are_all_set(void) const; int number_of_set(void) const; long int buffersize(void) const { return(buffersize_rep); } bool raised_priority(void) const { return(raisedpriority_rep); } int get_sched_priority(void) const { return(sched_priority_rep); } bool double_buffering(void) const { return(double_buffering_rep); } long int double_buffer_size(void) const { return(double_buffer_size_rep); } bool max_buffers(void) const { return(max_buffers_rep); } bool is_set_buffersize(void) const { return(set_buffersize_rep); } bool is_set_raised_priority(void) const { return(set_raisedpriority_rep); } bool is_set_sched_priority(void) const { return(set_sched_priority_rep); } bool is_set_double_buffering(void) const { return(set_double_buffering_rep); } bool is_set_double_buffer_size(void) const { return(set_double_buffer_size_rep); } bool is_set_max_buffers(void) const { return(set_max_buffers_rep); } std::string to_string(void) const; private: long int buffersize_rep; bool raisedpriority_rep; int sched_priority_rep; bool double_buffering_rep; long int double_buffer_size_rep; bool max_buffers_rep; bool set_buffersize_rep; bool set_raisedpriority_rep; bool set_sched_priority_rep; bool set_double_buffering_rep; bool set_double_buffer_size_rep; bool set_max_buffers_rep; }; #endif ecasound-2.9.3/libecasound/audioio-tone.cpp0000644000076400007640000001664011260602227015654 00000000000000// ------------------------------------------------------------------------ // audioio-tone.cpp: Tone generator // // Adaptation to Ecasound: // Copyright (C) 2007-2009 Kai Vehmanen (adaptation to Ecasound) // // Sources for sine generation (cmt-src-1.15/src/sine.cpp): // // Computer Music Toolkit - a library of LADSPA plugins. Copyright (C) // 2000-2002 Richard W.E. Furse. The author may be contacted at // richard@muse.demon.co.uk. // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include /* C++'s standard does not define M_PI */ #include #include #include #include "eca-object-factory.h" #include "samplebuffer.h" #include "audioio-tone.h" #include "eca-error.h" #include "eca-logger.h" /** * FIXME notes (last update 2008-03-06) * * - define the syntax: is this 'tone', 'sinetone', * 'tone=sine', ..., or? * - add support for multichannel testing (different * frequnecies for different channels?) */ using std::cout; using std::endl; using std::atof; using std::string; /* Sine table size is given by (1 << SINE_TABLE_BITS). */ #define SINE_TABLE_BITS 14 #define SINE_TABLE_SHIFT (8 * sizeof(unsigned long) - SINE_TABLE_BITS) SAMPLE_SPECS::sample_t *g_pfSineTable = NULL; SAMPLE_SPECS::sample_t g_fPhaseStepBase = 0; static void initialise_sine_wavetable(void) { if (g_pfSineTable == NULL) { unsigned long lTableSize = (1 << SINE_TABLE_BITS); double dShift = (double(M_PI) * 2) / lTableSize; g_pfSineTable = new SAMPLE_SPECS::sample_t[lTableSize]; if (g_pfSineTable != NULL) for (unsigned long lIndex = 0; lIndex < lTableSize; lIndex++) g_pfSineTable[lIndex] = SAMPLE_SPECS::sample_t(sin(dShift * lIndex)); } if (g_fPhaseStepBase == 0) { g_fPhaseStepBase = (SAMPLE_SPECS::sample_t)pow(2, sizeof(unsigned long) * 8); } } AUDIO_IO_TONE::AUDIO_IO_TONE (const std::string& name) : m_lPhaseStep(0), m_fCachedFrequency(0), m_fLimitFrequency(0), m_fPhaseStepScalar(0) { set_label(name); initialise_sine_wavetable(); } AUDIO_IO_TONE::~AUDIO_IO_TONE(void) { } AUDIO_IO_TONE* AUDIO_IO_TONE::clone(void) const { AUDIO_IO_TONE* target = new AUDIO_IO_TONE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } target->set_position_in_samples(position_in_samples()); if (ECA_AUDIO_POSITION::length_set()) target->ECA_AUDIO_POSITION::set_length_in_samples(ECA_AUDIO_POSITION::length_in_samples()); target->buffersize_rep = buffersize_rep; target->finished_rep = finished_rep; target->m_lPhase = m_lPhase; target->m_lPhaseStep = m_lPhaseStep; DBC_CHECK(target->m_fCachedFrequency == m_fCachedFrequency); target->m_fLimitFrequency = m_fLimitFrequency; target->m_fPhaseStepScalar = m_fPhaseStepScalar; return target; } void AUDIO_IO_TONE::open(void) throw(AUDIO_IO::SETUP_ERROR &) { DBC_CHECK(samples_per_second() != 0); if (io_mode() != AUDIO_IO::io_read) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIO_IO_TONE: Writing to tone generator not allowed!")); finished_rep = false; m_fLimitFrequency = SAMPLE_SPECS::sample_t(samples_per_second() * 0.5); m_fPhaseStepScalar = SAMPLE_SPECS::sample_t(g_fPhaseStepBase / samples_per_second()); /* recalculate m_fLimitFrequency and mfPhaseStepScalar */ if (m_fCachedFrequency) setPhaseStepFromFrequency(m_fCachedFrequency, true); AUDIO_IO::open(); } void AUDIO_IO_TONE::close(void) { AUDIO_IO::close(); } bool AUDIO_IO_TONE::finite_length_stream(void) const { return ECA_AUDIO_POSITION::length_set(); } void AUDIO_IO_TONE::read_buffer(SAMPLE_BUFFER* sbuf) { /* write to sbuf->buffer[ch], similarly as the LADSPA * chainops */ sbuf->number_of_channels(channels()); /* set the length according to our buffersize */ if ((ECA_AUDIO_POSITION::length_set() == true) && ((position_in_samples() + buffersize()) >= ECA_AUDIO_POSITION::length_in_samples())) { /* over requested duration, adjust buffersize */ SAMPLE_BUFFER::buf_size_t partialbuflen = ECA_AUDIO_POSITION::length_in_samples() - position_in_samples(); if (partialbuflen < 0) partialbuflen = 0; DBC_CHECK(partialbuflen <= buffersize()); sbuf->length_in_samples(partialbuflen); sbuf->event_tag_set(SAMPLE_BUFFER::tag_end_of_stream); finished_rep = true; } else sbuf->length_in_samples(buffersize()); i.init(sbuf); i.begin(); while(!i.end()) { for(int n = 0; n < channels(); n++) { if (i.end()) break; *(i.current(n)) = g_pfSineTable[m_lPhase >> SINE_TABLE_SHIFT]; } m_lPhase += m_lPhaseStep; i.next(); } change_position_in_samples(sbuf->length_in_samples()); DBC_ENSURE(sbuf->number_of_channels() == channels()); } void AUDIO_IO_TONE::write_buffer(SAMPLE_BUFFER* sbuf) { /* NOP */ DBC_CHECK(false); } SAMPLE_SPECS::sample_pos_t AUDIO_IO_TONE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { /* note: phase must be correct after arbitrary seeks */ m_lPhase = m_lPhaseStep * pos; if (ECA_AUDIO_POSITION::length_set() == true && pos < ECA_AUDIO_POSITION::length_in_samples()) finished_rep = false; return pos; } void AUDIO_IO_TONE::setPhaseStepFromFrequency(const SAMPLE_SPECS::sample_t fFrequency, bool force) { if (fFrequency != m_fCachedFrequency || force == true) { if (fFrequency >= 0 && fFrequency < m_fLimitFrequency) m_lPhaseStep = (unsigned long)(m_fPhaseStepScalar * fFrequency); else m_lPhaseStep = 0; m_fCachedFrequency = fFrequency; } } void AUDIO_IO_TONE::set_parameter(int param, string value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, AUDIO_IO::parameter_set_to_string(param, value)); switch (param) { case 1: { AUDIO_IO::set_parameter (param, value); break; } case 2: { /* type; only "sine" supported */ break; } case 3: { setPhaseStepFromFrequency (atof(value.c_str()), false); break; } case 4: { double duration = atof(value.c_str()); if (duration > 0.0f) ECA_AUDIO_POSITION::set_length_in_seconds(duration); break; } } } string AUDIO_IO_TONE::get_parameter(int param) const { switch (param) { case 1: return AUDIO_IO::get_parameter(param); case 2: return "sine"; case 3: return kvu_numtostr(m_fCachedFrequency); case 4: { if (ECA_AUDIO_POSITION::length_set() == true) return kvu_numtostr(ECA_AUDIO_POSITION::length_in_seconds_exact()); else return kvu_numtostr(-1.0f); } default: break; } return std::string(); } ecasound-2.9.3/libecasound/eca-fileio.h0000644000076400007640000000224510664032032014714 00000000000000#ifndef INCLUDED_FILEIO_H #define INCLUDED_FILEIO_H #include #include #include /* off_t */ /** * Interface for blocking file input/output with buffering */ class ECA_FILE_IO { public: virtual ~ECA_FILE_IO(void) { } // ----- // Open/close routines virtual void open_file(const std::string& fname, const std::string& fmode) = 0; virtual void open_stdin(void) = 0; virtual void open_stdout(void) = 0; virtual void open_stderr(void) = 0; virtual void close_file(void) = 0; // ---- // Normal file operations virtual void read_to_buffer(void* obuf, off_t bytes) = 0; virtual void write_from_buffer(void* obuf, off_t bytes) = 0; virtual void set_file_position(off_t newpos) = 0; virtual void set_file_position_advance(off_t fw) = 0; virtual void set_file_position_end(void) = 0; virtual off_t get_file_position(void) const = 0; virtual off_t get_file_length(void) const = 0; // ----- // Status virtual bool is_file_ready(void) const = 0; virtual bool is_file_error(void) const = 0; virtual off_t file_bytes_processed(void) const = 0; virtual const std::string& file_mode(void) const = 0; }; #endif ecasound-2.9.3/libecasound/audiofx_rcfilter.h0000644000076400007640000000325710664032032016254 00000000000000#ifndef _AUDIOFX_RC_LOWPASS_FILTER_H #define _AUDIOFX_RC_LOWPASS_FILTER_H #include #include #include "audiofx_filter.h" #include "samplebuffer_iterators.h" /** * Simulation of an 3rd-order 36dB active RC-lowpass * * 5th of February 2000 by Stefan Fendt * * This is a quite realistic simulation of an analouge * RC-lowpass as used in many old synthesisers. You can * increase filter-resonance up to the point were the * filter starts oscillating (without any signal aplied * to it...) and this without digital clipping. Knowing * that this was a design flaw (which had technical * reasons on real RC-filters) this was implemented in * this simulation, too. I do not know any other * filter-simulation which provides this. * * @author Stefan Fendt */ class EFFECT_RC_LOWPASS_FILTER : public EFFECT_FILTER { SAMPLE_ITERATOR_CHANNELS i; SAMPLE_SPECS::sample_t output_temp; std::vector lp1_old, lp2_old, lp3_old, hp1_old, feedback; parameter_t cutoff_rep; parameter_t resonance_rep; public: virtual std::string name(void) const { return("RC-lowpass filter"); } virtual std::string parameter_names(void) const { return("cutoff-freq,resonance"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_RC_LOWPASS_FILTER* clone(void) const { return new EFFECT_RC_LOWPASS_FILTER(*this); } EFFECT_RC_LOWPASS_FILTER* new_expr(void) const { return new EFFECT_RC_LOWPASS_FILTER(); } EFFECT_RC_LOWPASS_FILTER (parameter_t cutoff = 0.25, parameter_t resonance = 1.0); }; #endif ecasound-2.9.3/libecasound/audioio-proxy.cpp0000644000076400007640000001104711607655300016071 00000000000000// ------------------------------------------------------------------------ // audioio-proxy.cpp: Generic interface for objects that act as // proxies for other objects of type AUDIO_IO. // Copyright (C) 2002,2005,2008,2011 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "samplebuffer.h" #include "audioio-null.h" #include "audioio-proxy.h" AUDIO_IO_PROXY::AUDIO_IO_PROXY(void) : buffersize_rep(0), child_initialized_rep(false) { child_repp = new NULLFILE("uninitialized proxy child"); } AUDIO_IO_PROXY::~AUDIO_IO_PROXY(void) { delete child_repp; // either null or the actual child object } /** * Sets a new proxy target object. The old * target (if any) is deleted. */ void AUDIO_IO_PROXY::set_child(AUDIO_IO* v) { if (child_repp != 0) delete child_repp; child_repp = v; child_initialized_rep = true; } /** * Releases the current child without deleting Itx. */ void AUDIO_IO_PROXY::release_child_no_delete(void) { child_repp = new NULLFILE("uninitialized proxy child"); child_initialized_rep = false; } /** * Prepares child object for opening. * * Sets the audio objects parameters, which have an effect * at open time, to those of the parent object. */ void AUDIO_IO_PROXY::pre_child_open(void) { child()->set_buffersize(buffersize()); child()->set_io_mode(io_mode()); child()->set_audio_format(audio_format()); child()->set_samples_per_second(samples_per_second()); } /** * Checks if any audio parameters were changed * during child's open(), fetches any changes and * sets the object length. */ void AUDIO_IO_PROXY::post_child_open(void) { if (child()->locked_audio_format() == true) { set_audio_format(child()->audio_format()); } set_length_in_samples(child()->length_in_samples()); } void AUDIO_IO_PROXY::set_buffersize(long int samples) { buffersize_rep = samples; child_repp->set_buffersize(samples); } void AUDIO_IO_PROXY::set_channels(SAMPLE_SPECS::channel_t v) { AUDIO_IO::set_channels(v); child_repp->set_channels(v); } void AUDIO_IO_PROXY::set_sample_format(Sample_format v) throw(ECA_ERROR&) { AUDIO_IO::set_sample_format(v); child_repp->set_sample_format(v); } void AUDIO_IO_PROXY::set_audio_format(const ECA_AUDIO_FORMAT& f_str) { AUDIO_IO::set_audio_format(f_str); child_repp->set_audio_format(f_str); } void AUDIO_IO_PROXY::toggle_interleaved_channels(bool v) { AUDIO_IO::toggle_interleaved_channels(v); child_repp->toggle_interleaved_channels(v); } void AUDIO_IO_PROXY::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { AUDIO_IO::set_samples_per_second(v); child_repp->set_samples_per_second(v); } std::string AUDIO_IO_PROXY::parameter_names(void) const { return child_repp->parameter_names(); } void AUDIO_IO_PROXY::set_parameter(int param, std::string value) { AUDIO_IO::set_parameter(param, value); child_repp->set_parameter(param, value); } std::string AUDIO_IO_PROXY::get_parameter(int param) const { return child_repp->get_parameter(param); } void AUDIO_IO_PROXY::start_io(void) { AUDIO_IO_BARRIER *barrier = dynamic_cast(child_repp); if (barrier) barrier->start_io(); } void AUDIO_IO_PROXY::stop_io(void) { AUDIO_IO_BARRIER *barrier = dynamic_cast(child_repp); if (barrier) barrier->stop_io(); } std::string AUDIO_IO_PROXY::child_params_as_string(int first, std::vector* params) { int last = params->size(); string res; for (int n = first; n <= last; n++) { std::string v = get_parameter(n); /* note: as we are passing a filename plus optional params, we * need to escape any commans in the filename */ if (v.find(",") != string::npos) v = "\"" + v + "\""; res += v; if (n != last) res += ","; } return res; } ecasound-2.9.3/libecasound/audioio-oss.cpp0000644000076400007640000002343711053111343015507 00000000000000// ------------------------------------------------------------------------ // audioio-oss.cpp: OSS (/dev/dsp) input/output. // Copyright (C) 1999-2004,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "audioio-oss_impl.h" #include "audioio-oss.h" #include "eca-error.h" #include "eca-logger.h" OSSDEVICE::OSSDEVICE(const std::string& name, bool precise_sample_rates) { set_label(name); precise_srate_mode = precise_sample_rates; } OSSDEVICE::~OSSDEVICE(void) { if (is_open() == true && is_running()) stop(); if (is_open() == true) { close(); } } OSSDEVICE* OSSDEVICE::clone(void) const { OSSDEVICE* target = new OSSDEVICE(label(), precise_srate_mode); return target; } void OSSDEVICE::open(void) throw(AUDIO_IO::SETUP_ERROR &) { if (io_mode() == io_read) { if ((audio_fd = ::open(label().c_str(), O_RDONLY, 0)) == -1) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-OSS: unable to open OSS-device to O_RDONLY (" + kvu_numtostr(errno) + ")")); } } else if (io_mode() == io_write) { if ((audio_fd = ::open(label().c_str(), O_WRONLY, 0)) == -1) { // Opening device failed perror("(eca-oss)"); throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-OSS: unable to open OSS-device to O_RWONLY (" + kvu_numtostr(errno) + ")")); } } else { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-OSS: Simultanious intput/output not supported.")); } // ------------------------------------------------------------------- // Check capabilities if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &oss_caps) == -1) { oss_caps = 0; ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: OSS-device doesn't support SNDCTL_DSP_GETCAPS."); } // ------------------------------------------------------------------- // Set triggering #ifndef ECA_DISABLE_OSS_TRIGGER if ((oss_caps & DSP_CAP_TRIGGER) == DSP_CAP_TRIGGER) { if (io_mode() == io_read) { int enable_bits = ~PCM_ENABLE_INPUT; // This disables recording if (::ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &enable_bits) == -1) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-OSS: OSS-device doesn't support SNDCTL_DSP_SETTRIGGER (" + kvu_numtostr(errno) + ")")); } else if (io_mode() == io_write) { int enable_bits = ~PCM_ENABLE_OUTPUT; // This disables playback if (::ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &enable_bits) == -1) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-OSS: OSS-device doesn't support SNDCTL_DSP_SETTRIGGER (" + kvu_numtostr(errno) + ")")); } } else { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: OSS-device doesn't support SNDCTL_DSP_SETTRIGGER!"); } #endif // ------------------------------------------------------------------- // Set fragment size. if (buffersize() == 0) throw(SETUP_ERROR(SETUP_ERROR::buffersize, "AUDIOIO-OSS: Buffersize() is 0!")); if (max_buffers() == true) fragment_count = (1 << 15) / buffersize() / frame_size(); // 0x7fff = not limited else fragment_count = 3; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Setting OSS fragment size according to " + kvu_numtostr(buffersize()) + "."); // fr_size == 4 -> the minimum fragment size: 2^4 = 16 bytes unsigned short int fr_size = 4; for(int fragtotal = 16; fragtotal < static_cast(buffersize() * frame_size()); fr_size++) fragtotal = fragtotal * 2; int fragsize = ((fragment_count << 16) | fr_size); if (::ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &fragsize)==-1) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: OSS-device doesn't support SNDCTL_DSP_SETFRAGMENT!"); ECA_LOG_MSG(ECA_LOGGER::user_objects, "set OSS fragment size to (2^x) " + kvu_numtostr(fr_size) + "."); // ------------------------------------------------------------------- // Select audio format int format; switch(sample_format()) { case ECA_AUDIO_FORMAT::sfmt_u8: { format = AFMT_U8; break; } case ECA_AUDIO_FORMAT::sfmt_s8: { format = AFMT_S8; break; } case ECA_AUDIO_FORMAT::sfmt_s16_le: { format = AFMT_S16_LE; break; } case ECA_AUDIO_FORMAT::sfmt_s16_be: { format = AFMT_S16_BE; break; } case ECA_AUDIO_FORMAT::sfmt_s32_le: { format = AFMT_S32_LE; break; } case ECA_AUDIO_FORMAT::sfmt_s32_be: { format = AFMT_S32_BE; break; } default: { throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-OSS: audio format not supported (1)")); } } int f = format; if (::ioctl(audio_fd, SNDCTL_DSP_SETFMT, &f)==-1) throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-OSS: audio format not supported (2)")); if (f != format) throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-OSS: audio format not supported (2)")); // ------------------------------------------------------------------- // Select number of channels int stereo; /* 0=mono, 1=stereo */ if (channels() > 1) stereo = 1; else stereo = 0; int t = stereo; if (::ioctl(audio_fd, SNDCTL_DSP_STEREO, &t)==-1) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Error when setting sample rate."); if (stereo != t) throw(SETUP_ERROR(SETUP_ERROR::channels, "AUDIOIO-OSS: audio format not supported SNDCTL_DSP_STEREO")); // ------------------------------------------------------------------- // Select sample rate // --- int speed = samples_per_second(); if (::ioctl(audio_fd, SNDCTL_DSP_SPEED, &speed) == -1) throw(SETUP_ERROR(SETUP_ERROR::sample_rate, "AUDIOIO-OSS: audio format not supported SNDCTL_DSP_SPEED")); if (speed != samples_per_second()) { if (precise_srate_mode) { throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-OSS: Requested sample rate is not supported. Audio device suggests sample rate of " + kvu_numtostr(speed) + ". Disable precise-sample-rate mode to ignore the difference.")); } else { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Requested sample rate is not supported. Ignoring the the difference between requested (" + kvu_numtostr(samples_per_second()) + ") and suggested (" + kvu_numtostr(speed) + ") sample rates."); } } // ------------------------------------------------------------------- // Get fragment size. if (::ioctl(audio_fd, SNDCTL_DSP_GETBLKSIZE, &fragment_size) == -1) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: SNDCTL_DSP_GETBLKSIZE ioctl failed. Might affect OSS audio input/output."); ECA_LOG_MSG(ECA_LOGGER::user_objects, "OSS set to use fragment size of " + kvu_numtostr(fragment_size) + "."); /* SNDCTL_DSP_GET[IO]PTR report offset since device was opened */ set_position_in_samples(0); AUDIO_IO_DEVICE::open(); } void OSSDEVICE::stop(void) { // FIXME: should close and re-open the device - otherwise triggering // won't work properly (see OSS adv.prog.guide) ::ioctl(audio_fd, SNDCTL_DSP_POST, 0); ECA_LOG_MSG(ECA_LOGGER::user_objects,"Audio device \"" + label() + "\" disabled."); AUDIO_IO_DEVICE::stop(); } void OSSDEVICE::close(void) { if (is_prepared() == true && is_running() == true) stop(); ::close(audio_fd); AUDIO_IO_DEVICE::close(); } void OSSDEVICE::start(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects,"Audio device \"" + label() + "\" started."); #ifndef ECA_DISABLE_OSS_TRIGGER if ((oss_caps & DSP_CAP_TRIGGER) == DSP_CAP_TRIGGER) { int enable_bits; if (io_mode() == io_read) enable_bits = PCM_ENABLE_INPUT; else if (io_mode() == io_write) enable_bits = PCM_ENABLE_OUTPUT; ::ioctl(audio_fd, SNDCTL_DSP_SETTRIGGER, &enable_bits); } #endif gettimeofday(&start_time, NULL); AUDIO_IO_DEVICE::start(); } long int OSSDEVICE::delay(void) const { long int delay = 0; if (is_running() == true) { if ((oss_caps & DSP_CAP_REALTIME) == DSP_CAP_REALTIME) { count_info info; info.bytes = 0; if (io_mode() == io_read) { ::ioctl(audio_fd, SNDCTL_DSP_GETIPTR, &info); delay = static_cast (info.bytes / frame_size()) - position_in_samples(); } else { ::ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info); delay = position_in_samples() - static_cast(info.bytes / frame_size()); } } else { struct timeval now; gettimeofday(&now, NULL); double time = now.tv_sec * 1000000.0 + now.tv_usec - start_time.tv_sec * 1000000.0 - start_time.tv_usec; if (io_mode() == io_read) delay = static_cast(time * samples_per_second() / 1000000.0) - position_in_samples(); else delay = position_in_samples() - static_cast(time * samples_per_second() / 1000000.0); } } DBC_CHECK(delay >= 0); return delay; } long int OSSDEVICE::read_samples(void* target_buffer, long int samples) { return ::read(audio_fd,target_buffer, frame_size() * samples) / frame_size(); } void OSSDEVICE::write_samples(void* target_buffer, long int samples) { ::write(audio_fd, target_buffer, frame_size() * samples); } ecasound-2.9.3/libecasound/audioio-cdr.cpp0000644000076400007640000001144211141406120015442 00000000000000// ------------------------------------------------------------------------ // audioio-cdr.cpp: CDDA/CDR audio file format input/output // Copyright (C) 1999,2001,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include /* LONG_MAX */ #include /* stat() */ #include /* stat() */ #ifdef HAVE_SYS_TYPES_H #include /* off_t */ #else typedef long int off_t; #endif #include #include "sample-specs.h" #include "audioio-cdr.h" #include "eca-logger.h" CDRFILE::CDRFILE(const std::string& name) { set_label(name); } CDRFILE::~CDRFILE(void) { if (is_open() == true) { close(); } } CDRFILE* CDRFILE::clone(void) const { CDRFILE* target = new CDRFILE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void CDRFILE::open(void) throw(AUDIO_IO::SETUP_ERROR &) { set_channels(2); set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16_be); set_samples_per_second(44100); switch(io_mode()) { case io_read: { fobject = std::fopen(label().c_str(),"rb"); if (!fobject) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-CDR: Can't open " + label() + " for reading.")); set_length_in_bytes(); break; } case io_write: { fobject = std::fopen(label().c_str(),"wb"); if (!fobject) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-CDR: Can't open " + label() + " for writing.")); break; } case io_readwrite: { fobject = std::fopen(label().c_str(),"r+b"); if (!fobject) { fobject = std::fopen(label().c_str(),"w+b"); if (!fobject) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-CDR: Can't open " + label() + " for read&write.")); } set_length_in_bytes(); break; } } AUDIO_IO::open(); } void CDRFILE::close(void) { if (io_mode() != io_read) pad_to_sectorsize(); std::fclose(fobject); AUDIO_IO::close(); } bool CDRFILE::finished(void) const { if (std::ferror(fobject) || std::feof(fobject)) return true; return false; } long int CDRFILE::read_samples(void* target_buffer, long int samples) { return std::fread(target_buffer, frame_size(), samples, fobject); } void CDRFILE::write_samples(void* target_buffer, long int samples) { std::fwrite(target_buffer, frame_size(), samples, fobject); } SAMPLE_SPECS::sample_pos_t CDRFILE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { if (is_open() == true) { off_t curpos_rep = pos * frame_size(); DBC_CHECK(curpos_rep >= 0); /* fseeko doesn't seem to work with glibc 2.1.x */ #if _FILE_OFFSET_BITS==64 off_t seekpos = 0; off_t seekstep = 0; int whence = SEEK_SET; while(curpos_rep - seekpos > 0) { if (curpos_rep - seekpos > LONG_MAX) seekstep = LONG_MAX; else seekstep = curpos_rep - seekpos; // std::cerr << "(audioio-cdr) fw-seeking from " << seekpos << " to " << seekpos+seekstep << std::endl; int res = std::fseek(fobject, seekstep, whence); if (res != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "fseek() error! (lfs)."); curpos_rep = 0; std::fseek(fobject, 0, SEEK_SET); break; } if (seekpos == 0) whence = SEEK_CUR; seekpos += seekstep; } #else DBC_CHECK(sizeof(long int) == sizeof(off_t)); std::fseek(fobject, static_cast(curpos_rep), SEEK_SET); #endif } return pos; } void CDRFILE::pad_to_sectorsize(void) { int padsamps = CDRFILE::sectorsize - ((length_in_samples() * frame_size()) % CDRFILE::sectorsize); if (padsamps == CDRFILE::sectorsize) { return; } for(int n = 0; n < padsamps; n++) ::fputc(0,fobject); DBC_DECLARE(long int endpos); DBC_DECLARE(endpos = std::ftell(fobject)); DBC_CHECK((endpos % CDRFILE::sectorsize) == 0); } void CDRFILE::set_length_in_bytes(void) { struct stat temp; stat(label().c_str(), &temp); set_length_in_samples(temp.st_size / frame_size()); } ecasound-2.9.3/libecasound/samplebuffer_functions.h0000644000076400007640000000746511262073612017477 00000000000000// ------------------------------------------------------------------------ // samplebuffer_functions.cpp: Extra functions for SAMPLE_BUFFER class // Copyright (C) 2000,2001,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDED_SAMPLEBUFFER_FUNCTIONS_H #define INCLUDED_SAMPLEBUFFER_FUNCTIONS_H #include #include "samplebuffer.h" /** * Various simple functions that operate on sample buffer data. This * class really is just an extension of class SAMPLE_BUFFER. */ class SAMPLE_BUFFER_FUNCTIONS { public: typedef SAMPLE_BUFFER::sample_t sample_t; static sample_t max_value(const SAMPLE_BUFFER& buf, SAMPLE_BUFFER::channel_size_t channel) { sample_t t = SAMPLE_SPECS::impl_min_value; for(SAMPLE_BUFFER::buf_size_t m = 0; m < buf.buffersize_rep; m++) { if (buf.buffer[channel][m] > t) t = buf.buffer[channel][m]; } return(t); } static sample_t min_value(const SAMPLE_BUFFER& buf, SAMPLE_BUFFER::channel_size_t channel) { sample_t t = SAMPLE_SPECS::impl_max_value; for(SAMPLE_BUFFER::buf_size_t m = 0; m < buf.buffersize_rep; m++) { if (buf.buffer[channel][m] < t) t = buf.buffer[channel][m]; } return(t); } static sample_t average_amplitude(const SAMPLE_BUFFER& buf) { sample_t temp_avg = 0.0; for(int n = 0; n < buf.channel_count_rep; n++) { for(SAMPLE_BUFFER::buf_size_t m = 0; m < buf.buffersize_rep; m++) { temp_avg += fabs(buf.buffer[n][m] - SAMPLE_SPECS::silent_value); } } return(temp_avg / buf.channel_count_rep / buf.buffersize_rep); } static sample_t RMS_volume(const SAMPLE_BUFFER& buf) { sample_t temp_avg = 0.0; for(int n = 0; n < buf.channel_count_rep; n++) { for(SAMPLE_BUFFER::buf_size_t m = 0; m < buf.buffersize_rep; m++) { temp_avg += buf.buffer[n][m] * buf.buffer[n][m]; } } return(sqrt(temp_avg / buf.channel_count_rep / buf.buffersize_rep)); } static sample_t average_amplitude(const SAMPLE_BUFFER& buf, SAMPLE_BUFFER::channel_size_t channel, SAMPLE_BUFFER::buf_size_t count_samples) { sample_t temp_avg = 0.0; if (count_samples == 0) count_samples = static_cast(buf.channel_count_rep); for(SAMPLE_BUFFER::buf_size_t n = 0; n < buf.buffersize_rep; n++) { temp_avg += fabs(buf.buffer[channel][n] - SAMPLE_SPECS::silent_value); } return(temp_avg / count_samples); } static sample_t RMS_volume(const SAMPLE_BUFFER& buf, SAMPLE_BUFFER::channel_size_t channel, SAMPLE_BUFFER::buf_size_t count_samples) { sample_t temp_avg = 0.0; if (count_samples == 0) count_samples = static_cast(buf.channel_count_rep); for(SAMPLE_BUFFER::buf_size_t n = 0; n < buf.buffersize_rep; n++) { temp_avg += buf.buffer[channel][n] * buf.buffer[channel][n]; } return(sqrt(temp_avg / count_samples)); } static void fill_with_random_samples(SAMPLE_BUFFER *sbuf); static bool is_almost_equal(const SAMPLE_BUFFER& a, const SAMPLE_BUFFER& b, int bitprec = 24, bool verbose_stderr = false); }; #endif ecasound-2.9.3/libecasound/audioio-mp3_impl.h0000644000076400007640000000012410664032032016060 00000000000000#ifndef _AUDIOIO_MP3_IMPL_H #define _AUDIOIO_MP3_IMPL_H #include "layer.h" #endif ecasound-2.9.3/libecasound/preset.h0000644000076400007640000000431510664032032014221 00000000000000#ifndef INCLUDED_PRESET_H #define INCLUDED_PRESET_H #include #include class PRESET_impl; class CHAIN; class SAMPLE_BUFFER; #include "eca-chainop.h" #include "eca-samplerate-aware.h" /** * Class for representing effect presets * * @author Arto Hamara * @author Kai Vehmanen */ class PRESET : public CHAIN_OPERATOR, public ECA_SAMPLERATE_AWARE { public: /** @name Public virtual functions to notify about changes * (Reimplemented from ECA_SAMPLERATE_AWARE) */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ /** @name Constructors and destructors */ /*@{*/ PRESET(void); PRESET(const std::string& formatted_string); /*@}*/ /** @name Public API functions */ /*@{*/ virtual PRESET* clone(void) const; virtual PRESET* new_expr(void) const; virtual ~PRESET (void); virtual std::string name(void) const; virtual std::string description(void) const; void set_name(const std::string& v); virtual void init(SAMPLE_BUFFER* sbuf); virtual void release(void); virtual void process(void); virtual std::string parameter_names(void) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; void parse(const std::string& formatted_string); bool is_parsed(void) const; /*@}*/ private: PRESET_impl* impl_repp; SAMPLE_BUFFER* first_buffer; std::vector buffers; std::vector chains; bool is_preset_option(const std::string& arg) const; void add_chain(void); void extend_pardesc_vector(int number); void parse_preset_option(const std::string& arg); void parse_operator_option(const std::string& arg); void set_preset_defaults(const std::vector& args); void set_preset_param_names(const std::vector& args); void set_preset_lower_bounds(const std::vector& args); void set_preset_upper_bounds(const std::vector& args); void set_preset_toggles(const std::vector& args); PRESET& operator=(const PRESET& x) { return *this; } PRESET(const PRESET& x) { } }; #endif ecasound-2.9.3/libecasound/midi-parser.h0000644000076400007640000000072610664032032015135 00000000000000#ifndef INCLUDED_MIDI_PARSER_H #define INCLUDED_MIDI_PARSER_H /** * Collection of static functions and small stateful * machines for parsing MIDI messages. */ class MIDI_PARSER { public: static bool is_voice_category_status_byte(unsigned char byte); static bool is_system_common_category_status_byte(unsigned char byte); static bool is_realtime_category_status_byte(unsigned char byte); static bool is_status_byte(unsigned char byte); }; #endif ecasound-2.9.3/libecasound/audiofx_lv2.h0000644000076400007640000000367312331251234015147 00000000000000#ifndef INCLUDED_AUDIOFX_LV2_H #define INCLUDED_AUDIOFX_LV2_H #include #include #include "audiofx.h" #if ECA_USE_LIBLILV #include class SAMPLE_BUFFER; /** * Wrapper class for LV2 plugins * @author Jeremy Salwen */ class EFFECT_LV2 : public EFFECT_BASE { public: EFFECT_LV2 (Lilv::Plugin plugin_d) throw(ECA_ERROR&); virtual ~EFFECT_LV2(void); EFFECT_LV2* clone(void) const; EFFECT_LV2* new_expr(void) const { return new EFFECT_LV2(plugin_desc); } virtual std::string name(void) const { return(name_rep); } virtual std::string description(void) const; virtual std::string parameter_names(void) const { return(param_names_rep); } /** * This identifier can be used as a unique, case-sensitive * identifier for the plugin type within the plugin file. * Labels must not contain white-space characters. */ std::string unique(void) const { return(unique_rep); } virtual int output_channels(int i_channels) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); private: EFFECT_LV2(const EFFECT_LV2& x):plugin_desc(x.plugin_desc) { } EFFECT_LV2& operator=(const EFFECT_LV2& x) { return *this; } private: SAMPLE_BUFFER* buffer_repp; Lilv::Plugin plugin_desc; std::vector plugins_rep; unsigned long port_count_rep; int in_audio_ports; int out_audio_ports; std::string name_rep, maker_rep, unique_rep, param_names_rep; std::vector params; std::vector param_descs_rep; void init_ports(void) throw(ECA_ERROR&); void parse_parameter_hint_information(const Lilv::Plugin plugin, Lilv::Port p, struct PARAM_DESCRIPTION *pd); }; #endif /* ECA_USE_LIBLILV */ #endif ecasound-2.9.3/libecasound/eca-audio-position.cpp0000644000076400007640000001164211032774503016752 00000000000000// ------------------------------------------------------------------------ // eca-audio-position.cpp: Base class for representing position and length // of a audio stream. // Copyright (C) 1999-2002,2007,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* ceil() */ #include #include "eca-audio-position.h" ECA_AUDIO_POSITION::ECA_AUDIO_POSITION(void) { length_set_rep = false; position_in_samples_rep = 0; length_in_samples_rep = 0; } ECA_AUDIO_POSITION::~ECA_AUDIO_POSITION(void) { } SAMPLE_SPECS::sample_pos_t ECA_AUDIO_POSITION::length_in_samples(void) const { return length_in_samples_rep; } int ECA_AUDIO_POSITION::length_in_seconds(void) const { DBC_CHECK(samples_per_second() != 0); return (int)ceil((double)length_in_samples() / (double)samples_per_second()); } double ECA_AUDIO_POSITION::length_in_seconds_exact(void) const { DBC_CHECK(samples_per_second() != 0); return (double)length_in_samples() / (double)samples_per_second(); } void ECA_AUDIO_POSITION::set_length_in_samples(SAMPLE_SPECS::sample_pos_t pos) { length_in_samples_rep = pos; length_set_rep = true; } void ECA_AUDIO_POSITION::set_length_in_seconds(int pos_in_seconds) { DBC_CHECK(samples_per_second() != 0); set_length_in_seconds((double)pos_in_seconds); } void ECA_AUDIO_POSITION::set_length_in_seconds(double pos_in_seconds) { DBC_CHECK(samples_per_second() != 0); set_length_in_samples(static_cast(pos_in_seconds * samples_per_second())); } SAMPLE_SPECS::sample_pos_t ECA_AUDIO_POSITION::position_in_samples(void) const { return position_in_samples_rep; } int ECA_AUDIO_POSITION::position_in_seconds(void) const { DBC_CHECK(samples_per_second() != 0); return (int)ceil((double)position_in_samples() / (double)samples_per_second()); } double ECA_AUDIO_POSITION::position_in_seconds_exact(void) const { DBC_CHECK(samples_per_second() != 0); return (double)position_in_samples() / (double)samples_per_second(); } void ECA_AUDIO_POSITION::set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { position_in_samples_rep = pos; if (position_in_samples_rep < 0) { position_in_samples_rep = 0; } } void ECA_AUDIO_POSITION::change_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { position_in_samples_rep += pos; } void ECA_AUDIO_POSITION::change_position_in_seconds(double pos_in_seconds) { DBC_CHECK(samples_per_second() != 0); change_position_in_samples(static_cast(pos_in_seconds * samples_per_second())); } void ECA_AUDIO_POSITION::set_position_in_seconds(int pos_in_seconds) { DBC_CHECK(samples_per_second() != 0); set_position_in_seconds((double)pos_in_seconds); } void ECA_AUDIO_POSITION::set_position_in_seconds(double pos_in_seconds) { DBC_CHECK(samples_per_second() != 0); set_position_in_samples(static_cast(pos_in_seconds * samples_per_second())); } void ECA_AUDIO_POSITION::seek_first(void) { seek_position_in_samples(0); } void ECA_AUDIO_POSITION::seek_last(void) { seek_position_in_samples(length_in_samples()); } void ECA_AUDIO_POSITION::seek_position_in_samples(SAMPLE_SPECS::sample_pos_t pos_in_samples) { SAMPLE_SPECS::sample_pos_t res = seek_position(pos_in_samples); set_position_in_samples(res); } void ECA_AUDIO_POSITION::seek_position_in_samples_advance(SAMPLE_SPECS::sample_pos_t pos) { seek_position_in_samples(position_in_samples() + pos); } void ECA_AUDIO_POSITION::seek_position_in_seconds(double pos_in_seconds) { DBC_CHECK(samples_per_second() != 0); seek_position_in_samples(static_cast(pos_in_seconds * samples_per_second())); } void ECA_AUDIO_POSITION::set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value) { double ratio (new_value); ratio /= samples_per_second(); set_position_in_samples(static_cast(position_in_samples() * ratio)); if (length_set() == true) { set_length_in_samples(static_cast(length_in_samples() * ratio)); } ECA_SAMPLERATE_AWARE::set_samples_per_second(new_value); } ecasound-2.9.3/libecasound/eca-fileio-mmap.cpp0000644000076400007640000001067011162771671016215 00000000000000// ------------------------------------------------------------------------ // eca-fileio-mmap.cpp: mmap based file-I/O and buffering routines. // Copyright (C) 1999-2002,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include /* memcpy */ #include #include #include #ifdef HAVE_SYS_MMAN_H #include #endif #include #include #include "eca-fileio.h" #include "eca-fileio-mmap.h" ECA_FILE_IO_MMAP::ECA_FILE_IO_MMAP(void) { } ECA_FILE_IO_MMAP::~ECA_FILE_IO_MMAP(void) { } void ECA_FILE_IO_MMAP::open_file(const std::string& fname, const std::string& fmode) { #ifdef HAVE_MMAP int openflags = O_RDWR; int mmapflags = PROT_READ | PROT_WRITE; fname_rep = fname; if (fmode == "rb") { openflags = O_RDONLY; mmapflags = PROT_READ; } else if (fmode == "wb") { openflags = O_WRONLY; mmapflags = PROT_WRITE; } fd_rep = ::open(fname.c_str(), openflags); if (!fd_rep) { file_ready_rep = false; mode_rep = ""; } else { file_ready_rep = true; file_ended_rep = false; mode_rep = fmode; fposition_rep = 0; flength_rep = get_file_length(); // cerr << fname_rep << ": mmaping region from 0 to " << // flength_rep << "." << endl; buffer_repp = (caddr_t)::mmap(0, flength_rep, mmapflags, MAP_SHARED, fd_rep, 0); if (buffer_repp == MAP_FAILED) { file_ready_rep = false; mode_rep = ""; } } #else /* HAVE_MMAP */ file_ready_rep = false; mode_rep = ""; #endif } void ECA_FILE_IO_MMAP::close_file(void) { // cerr << fname_rep << ": munmaping region." << endl; #ifdef HAVE_MMAP ::munmap(buffer_repp, flength_rep); ::close(fd_rep); #endif } void ECA_FILE_IO_MMAP::read_to_buffer(void* obuf, off_t bytes) { if (is_file_ready() == false) { bytes_rep = 0; file_ended_rep = true; return; } if (fposition_rep + bytes > flength_rep) bytes = flength_rep - fposition_rep; // cerr << fname_rep << ": mmap read " << fposition_rep << " -> "; std::memcpy(obuf, buffer_repp + fposition_rep, bytes); // cerr << fposition_rep + bytes << "." << endl; set_file_position(fposition_rep + bytes, false); bytes_rep = bytes; } void ECA_FILE_IO_MMAP::write_from_buffer(void* obuf, off_t bytes) { if (is_file_ready() == false) { bytes_rep = 0; file_ended_rep = true; return; } if (fposition_rep + bytes > flength_rep) bytes = flength_rep - fposition_rep; std::memcpy(buffer_repp + fposition_rep, obuf, bytes); set_file_position(fposition_rep + bytes, false); bytes_rep = bytes; } off_t ECA_FILE_IO_MMAP::file_bytes_processed(void) const { return(bytes_rep); } bool ECA_FILE_IO_MMAP::is_file_ready(void) const { return(file_ready_rep); } bool ECA_FILE_IO_MMAP::is_file_ended(void) const { return(file_ended_rep); } bool ECA_FILE_IO_MMAP::is_file_error(void) const { return(!file_ready_rep && !file_ended_rep); } void ECA_FILE_IO_MMAP::set_file_position(off_t newpos, bool seek) { fposition_rep = newpos; if (fposition_rep >= flength_rep) { fposition_rep = flength_rep; file_ready_rep = false; file_ended_rep = true; } else { file_ready_rep = true; file_ended_rep = false; } } void ECA_FILE_IO_MMAP::set_file_position_advance(off_t fw) { set_file_position(fposition_rep + fw, false); } void ECA_FILE_IO_MMAP::set_file_position_end(void) { fposition_rep = get_file_length(); } off_t ECA_FILE_IO_MMAP::get_file_position(void) const { return(fposition_rep); } off_t ECA_FILE_IO_MMAP::get_file_length(void) const { struct stat stattemp; fstat(fd_rep, &stattemp); return((off_t)stattemp.st_size); } ecasound-2.9.3/libecasound/eca-samplerate-aware.h0000644000076400007640000000265710664032032016706 00000000000000#ifndef INCLUDED_ECA_SAMPLERATE_AWARE_H #define INCLUDED_ECA_SAMPLERATE_AWARE_H #include "sample-specs.h" /** * Interface class implemented by all types that * require knowledge of system samplerate. Provides * funcitonality for setting and getting current * samplerate, and mechanism for notifying subclasses * of a samplerate change. * * @author Kai Vehmanen */ class ECA_SAMPLERATE_AWARE { public: /** @name Constructors and destructors */ /*@{*/ /** * Construtor. * * Note! The default is set to a very high value (8 * 48kHz) * to ensure we retain precision when using (sample-count,srate) * tuples for storing position and length information, even * in situations where the actual sample rate is not yet known. */ ECA_SAMPLERATE_AWARE (SAMPLE_SPECS::sample_rate_t srate = 384000); virtual ~ECA_SAMPLERATE_AWARE(void); /*@}*/ /** @name Public functions for getting audio format information */ /*@{*/ /** * Returns sampling rate in samples per second. * Note! Sometimes also called frames_per_second(). */ SAMPLE_SPECS::sample_rate_t samples_per_second(void) const { return(srate_rep); } /*@}*/ /** @name Public virtual functions for setting audio format information */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ private: SAMPLE_SPECS::sample_rate_t srate_rep; }; #endif /* INCLUDED_ECA_SAMPLERATE_AWARE */ ecasound-2.9.3/libecasound/audioio-wave.cpp0000644000076400007640000004415011740514653015656 00000000000000// ------------------------------------------------------------------------ // audioio-wave.cpp: RIFF WAVE audio file input/output. // Copyright (C) 1999-2003,2005,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // References: // - http://ccrma.stanford.edu/courses/422/projects/WaveFormat/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #ifdef HAVE_SYS_TYPES_H #include /* off_t */ #endif #include #include #include #include "sample-specs.h" /* for system endianess */ #include "samplebuffer.h" #include "audioio-wave.h" #include "eca-fileio-mmap.h" #include "eca-fileio-stream.h" #include "eca-logger.h" /** * Private macro definitions */ #ifndef UINT32_MAX #define UINT32_MAX 4294967295U #endif #ifdef WORDS_BIGENDIAN static const bool is_system_littleendian = false; #else static const bool is_system_littleendian = true; #endif /** * Private function declarations */ static uint16_t little_endian_uint16(uint16_t arg); static uint32_t little_endian_uint32(uint32_t arg); /** * Private function definitions */ static uint16_t little_endian_uint16(uint16_t arg) { if (is_system_littleendian != true) { return ((arg >> 8) & 0x00ff) | ((arg << 8) & 0xff00); } return arg; } static uint32_t little_endian_uint32(uint32_t arg) { if (is_system_littleendian != true) { return ((arg >> 24) & 0x000000ff) | ((arg >> 8) & 0x0000ff00) | ((arg << 8) & 0x00ff0000) | ((arg << 24) & 0xff000000); } return arg; } /** * Public definitions */ /** * Print extra debug information about RIFF header * contents to stdout when opening files. */ // #define DEBUG_WAVE_HEADER WAVEFILE::WAVEFILE (const std::string& name) { set_label(name); fio_repp = 0; mmaptoggle_rep = "0"; } WAVEFILE::~WAVEFILE(void) { if (is_open() == true) { close(); } } WAVEFILE* WAVEFILE::clone(void) const { WAVEFILE* target = new WAVEFILE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void WAVEFILE::format_query(void) throw(AUDIO_IO::SETUP_ERROR&) { // -------- DBC_REQUIRE(is_open() != true); // -------- if (io_mode() == io_write) return; fio_repp = new ECA_FILE_IO_STREAM(); if (fio_repp == 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Critical error when opening file \"" + label() + "\" for reading.")); } fio_repp->open_file(label(), "rb"); if (fio_repp->file_mode() != "") { set_length_in_bytes(); read_riff_fmt(); // also sets format() find_riff_datablock(); fio_repp->close_file(); } delete fio_repp; fio_repp = 0; // ------- DBC_ENSURE(!is_open()); DBC_ENSURE(fio_repp == 0); // ------- } void WAVEFILE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { switch(io_mode()) { case io_read: { if (mmaptoggle_rep == "1") { ECA_LOG_MSG(ECA_LOGGER::user_objects, "using mmap() mode for file access"); fio_repp = new ECA_FILE_IO_MMAP(); } else fio_repp = new ECA_FILE_IO_STREAM(); if (fio_repp == 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Critical error when opening file \"" + label() + "\" for reading.")); } fio_repp->open_file(label(), "rb"); if (fio_repp->is_file_ready() != true) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Couldn't open file \"" + label() + "\" for reading.")); } read_riff_header(); read_riff_fmt(); // also sets format() set_length_in_bytes(); find_riff_datablock(); break; } case io_write: { fio_repp = new ECA_FILE_IO_STREAM(); if (fio_repp == 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Critical error when opening file \"" + label() + "\" for writing.")); } fio_repp->open_file(label(), "w+b"); if (fio_repp->is_file_ready() != true) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Couldn't open file \"" + label() + "\" for writing.")); } write_riff_header(); write_riff_fmt(); write_riff_datablock(); break; } case io_readwrite: { fio_repp = new ECA_FILE_IO_STREAM(); if (fio_repp == 0) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Critical error when opening file \"" + label() + "\" for read&write.")); } fio_repp->open_file(label(), "r+b"); if (fio_repp->file_mode() != "") { set_length_in_bytes(); read_riff_fmt(); // also sets format() find_riff_datablock(); } else { fio_repp->open_file(label(), "w+b"); if (fio_repp->is_file_ready() != true) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Couldn't open file \"" + label() + "\" for read&write.")); write_riff_header(); write_riff_fmt(); write_riff_datablock(); } if (fio_repp->is_file_ready() != true) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-WAVE: Couldn't open file \"" + label() + "\" for read&write.")); } } } if (little_endian_uint16(riff_format_rep.bits) > 8 && format_string()[0] == 'u') throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-WAVE: unsigned sample format accepted only with 8bit.")); if (little_endian_uint16(riff_format_rep.bits) > 8 && format_string().size() > 4 && format_string()[4] == 'b') { /* force little-endian operation / affects only write-mode */ set_sample_format_string(format_string()[0] + kvu_numtostr(bits()) + "_le"); ECA_LOG_MSG(ECA_LOGGER::user_objects, "forcing little-endian operation (" + format_string() + ")"); DBC_CHECK(format_string().size() > 4 && format_string()[4] != 'b'); } AUDIO_IO::open(); } void WAVEFILE::close(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects,"Closing file " + label()); if (is_open() == true && fio_repp != 0) { update(); fio_repp->close_file(); delete fio_repp; fio_repp = 0; } AUDIO_IO::close(); } void WAVEFILE::update (void) { if (io_mode() != io_read) { update_riff_datablock(); write_riff_header(); set_length_in_bytes(); } } void WAVEFILE::find_riff_datablock (void) throw(AUDIO_IO::SETUP_ERROR&) { if (find_block("data", 0) != true) { throw(ECA_ERROR("AUDIOIO-WAVE", "no RIFF data block found", ECA_ERROR::retry)); } data_start_position_rep = fio_repp->get_file_position(); } void WAVEFILE::read_riff_header (void) throw(AUDIO_IO::SETUP_ERROR&) { // ECA_LOG_MSG(ECA_LOGGER::user_objects, "read_riff_header()"); fio_repp->read_to_buffer(&riff_header_rep, sizeof(riff_header_rep)); // fread(&riff_header_rep,1,sizeof(riff_header_rep),fobject); if ((memcmp("RIFF",riff_header_rep.id,4) == 0 && memcmp("WAVE",riff_header_rep.wname,4) == 0) != true) { throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-WAVE: invalid RIFF-header (read)")); } } void WAVEFILE::write_riff_header (void) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "write_riff_header()"); off_t savetemp = fio_repp->get_file_position(); memcpy(riff_header_rep.id,"RIFF",4); memcpy(riff_header_rep.wname,"WAVE",4); /* hack for 64bit wav files */ #if _FILE_OFFSET_BITS == 64 if (fio_repp->get_file_length() > static_cast(UINT32_MAX)) riff_header_rep.size = little_endian_uint32(UINT32_MAX); else #endif if (fio_repp->get_file_length() > static_cast(sizeof(riff_header_rep))) riff_header_rep.size = little_endian_uint32(fio_repp->get_file_length() - 8); else riff_header_rep.size = little_endian_uint32(0); fio_repp->set_file_position(0); // fseek(fobject,0,SEEK_SET); fio_repp->write_from_buffer(&riff_header_rep, sizeof(riff_header_rep)); // fwrite(&riff_header_rep,1,sizeof(riff_header_rep),fobject); if (memcmp("RIFF",riff_header_rep.id,4) != 0 || memcmp("WAVE",riff_header_rep.wname,4) != 0) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-WAVE: invalid RIFF-header (write)")); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Wave data size " + kvu_numtostr(little_endian_uint32(riff_header_rep.size))); fio_repp->set_file_position(savetemp); } void WAVEFILE::read_riff_fmt(void) throw(AUDIO_IO::SETUP_ERROR&) { // ECA_LOG_MSG(ECA_LOGGER::user_objects, "read_riff_fmt()"); off_t savetemp = fio_repp->get_file_position(); if (find_block("fmt ", 0) != true) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-WAVE: no riff fmt-block found")); else { fio_repp->read_to_buffer(&riff_format_rep, sizeof(riff_format_rep)); // fread(&riff_format_rep,1,sizeof(riff_format_rep),fobject); #ifdef DEBUG_WAVE_HEADER std::cout << "RF: format = " << little_endian_uint16(riff_format_rep.format) << std::endl; std::cout << "RF: channels = " << little_endian_uint16(riff_format_rep.channels) << std::endl; std::cout << "RF: srate = " << little_endian_uint32(riff_format_rep.srate) << std::endl; std::cout << "RF: byte_second = " << little_endian_uint32(riff_format_rep.byte_second) << std::endl; std::cout << "RF: align = " << little_endian_uint16(riff_format_rep.align) << std::endl; std::cout << "RF: bits = " << little_endian_uint16(riff_format_rep.bits) << std::endl; #endif if (little_endian_uint16(riff_format_rep.format) != 1 && little_endian_uint16(riff_format_rep.format) != 3) { throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-WAVE: Only WAVE_FORMAT_PCM and WAVE_FORMAT_IEEE_FLOAT are supported.")); } set_samples_per_second(little_endian_uint32(riff_format_rep.srate)); set_channels(little_endian_uint16(riff_format_rep.channels)); if (little_endian_uint16(riff_format_rep.bits) == 32) { if (little_endian_uint16(riff_format_rep.format) == 3) set_sample_format(ECA_AUDIO_FORMAT::sfmt_f32_le); else set_sample_format(ECA_AUDIO_FORMAT::sfmt_s32_le); } else if (little_endian_uint16(riff_format_rep.bits) == 24) { if (riff_format_rep.align == little_endian_uint16(channels() * 3)) { /* packet s24 format */ set_sample_format(ECA_AUDIO_FORMAT::sfmt_s24_le); } else if (riff_format_rep.align == little_endian_uint16(channels() * 4)) { /* unpacked s24 format */ set_sample_format(ECA_AUDIO_FORMAT::sfmt_s32_le); } else { throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-WAVE: Invalid 24bit sample format combination.")); } } else if (little_endian_uint16(riff_format_rep.bits) == 16) set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16_le); else if (little_endian_uint16(riff_format_rep.bits) == 8) set_sample_format(ECA_AUDIO_FORMAT::sfmt_u8); else throw(SETUP_ERROR(SETUP_ERROR::sample_format, "AUDIOIO-WAVE: Sample format not supported.")); } DBC_CHECK(little_endian_uint16(riff_format_rep.channels) == channels()); DBC_CHECK(little_endian_uint16(riff_format_rep.bits) == bits()); DBC_CHECK(little_endian_uint32(riff_format_rep.srate) == static_cast(samples_per_second())); DBC_CHECK(little_endian_uint32(riff_format_rep.byte_second) == static_cast(bytes_per_second())); DBC_CHECK(little_endian_uint16(riff_format_rep.align) == frame_size()); fio_repp->set_file_position(savetemp); } void WAVEFILE::write_riff_fmt(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "write_riff_fmt()"); RB fblock; fio_repp->set_file_position_end(); riff_format_rep.channels = little_endian_uint16(channels()); riff_format_rep.bits = little_endian_uint16(bits()); riff_format_rep.srate = little_endian_uint32(samples_per_second()); riff_format_rep.byte_second = little_endian_uint32(bytes_per_second()); riff_format_rep.align = little_endian_uint16(frame_size()); if (sample_coding() == ECA_AUDIO_FORMAT::sc_float) { // WAVE_FORMAT_IEEE_FLOAT 0x0003 (Microsoft IEEE754 range [-1, +1)) riff_format_rep.format = little_endian_uint16(3); } else { // WAVE_FORMAT_PCM (0x0001) Microsoft Pulse Code Modulation (PCM) format riff_format_rep.format = little_endian_uint16(1); } memcpy(fblock.sig, "fmt ", 4); fblock.bsize = little_endian_uint32(16); fio_repp->write_from_buffer(&fblock, sizeof(fblock)); fio_repp->write_from_buffer(&riff_format_rep, sizeof(riff_format_rep)); // ECA_LOG_MSG(ECA_LOGGER::user_objects, "Wrote RIFF format header."); } void WAVEFILE::write_riff_datablock(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "write_riff_datablock()"); RB fblock; // ECA_LOG_MSG(ECA_LOGGER::user_objects, "write_riff_datablock()"); fio_repp->set_file_position_end(); memcpy(fblock.sig,"data",4); fblock.bsize = little_endian_uint32(0); fio_repp->write_from_buffer(&fblock, sizeof(fblock)); data_start_position_rep = fio_repp->get_file_position(); } void WAVEFILE::update_riff_datablock(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "update_riff_datablock()"); RB fblock; memcpy(fblock.sig,"data",4); find_block("data", 0); off_t savetemp = fio_repp->get_file_position(); fio_repp->set_file_position_end(); /* hack for wav files with length over 2^32-1 bytes */ #if _FILE_OFFSET_BITS == 64 if (fio_repp->get_file_position() - savetemp > static_cast(UINT32_MAX)) fblock.bsize = little_endian_uint32(UINT32_MAX); else #endif fblock.bsize = little_endian_uint32(fio_repp->get_file_position() - savetemp); ECA_LOG_MSG(ECA_LOGGER::user_objects, "updating data block header length to " + kvu_numtostr(little_endian_uint32(fblock.bsize))); savetemp = savetemp - sizeof(fblock); if (savetemp > 0) { fio_repp->set_file_position(savetemp); fio_repp->write_from_buffer(&fblock, sizeof(fblock)); } } bool WAVEFILE::next_riff_block(RB *t, off_t *offtmp) { // ECA_LOG_MSG(ECA_LOGGER::user_objects, "next_riff_block()"); fio_repp->read_to_buffer(t, sizeof(RB)); if (fio_repp->file_bytes_processed() != sizeof(RB)) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "invalid RIFF block!"); return false; } if (!fio_repp->is_file_ready()) return false; *offtmp = little_endian_uint32(t->bsize) + fio_repp->get_file_position(); return true; } bool WAVEFILE::find_block(const char* fblock, uint32_t* blksize) { off_t offset; RB block; // ECA_LOG_MSG(ECA_LOGGER::user_objects, "find_block(): " + string(fblock,4)); fio_repp->set_file_position(sizeof(riff_header_rep)); while(next_riff_block(&block,&offset)) { // ECA_LOG_MSG(ECA_LOGGER::user_objects, "found RIFF-block "); if (memcmp(block.sig,fblock,4) == 0) { if (blksize != 0) *blksize = little_endian_uint32(block.bsize); return true; } fio_repp->set_file_position(offset); } return false; } bool WAVEFILE::finished(void) const { if (io_mode() == io_read && (length_set() == true && position_in_samples() >= length_in_samples())) { return true; } if (fio_repp->is_file_error() || !fio_repp->is_file_ready()) return true; return false; } long int WAVEFILE::read_samples(void* target_buffer, long int samples) { // -------- DBC_REQUIRE(samples >= 0); DBC_REQUIRE(target_buffer != 0); // -------- if (length_set() == true && position_in_samples() + samples >= length_in_samples()) samples = length_in_samples() - position_in_samples(); fio_repp->read_to_buffer(target_buffer, frame_size() * samples); return fio_repp->file_bytes_processed() / frame_size(); } void WAVEFILE::write_samples(void* target_buffer, long int samples) { // -------- DBC_REQUIRE(samples >= 0); DBC_REQUIRE(target_buffer != 0); // -------- /* note: When writing in write-update mode (i.e. modifying an * existing file), we do not honor the previous length value * in "data" header chunk. This may lead to overriding some * non-data chunk at the end of the file. */ fio_repp->write_from_buffer(target_buffer, frame_size() * samples); } SAMPLE_SPECS::sample_pos_t WAVEFILE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { if (is_open() == true) { fio_repp->set_file_position(data_start_position_rep + pos * frame_size()); } return pos; } void WAVEFILE::set_length_in_bytes(void) { off_t savetemp = fio_repp->get_file_position(); uint32_t blksize = 0; find_block("data", &blksize); off_t datastart = fio_repp->get_file_position(); fio_repp->set_file_position_end(); off_t datalen = fio_repp->get_file_position() - datastart; /* note: If the audio stream length defined in "data" header * block is zero (not updated), or it's set to maximum * value, set the length according to actual file length. * * This is not strictly according to the RIFF WAVE spec, * but allows to handle RIFF WAVE files with a broken * header, as well as files with size exceeding the 2GiB * limit. */ if (blksize != 0 && blksize != UINT32_MAX) { set_length_in_samples(blksize / frame_size()); } else set_length_in_samples(datalen / frame_size()); ECA_LOG_MSG(ECA_LOGGER::user_objects, "data block length in header " + kvu_numtostr(blksize) + ", file length after data block " + kvu_numtostr(datalen) + ", length set to " + kvu_numtostr(length_in_samples()) + " samples"); fio_repp->set_file_position(savetemp); } void WAVEFILE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; case 2: mmaptoggle_rep = value; break; } } string WAVEFILE::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return mmaptoggle_rep; } return ""; } ecasound-2.9.3/libecasound/samplebuffer_functions.cpp0000644000076400007640000000753211262077634020035 00000000000000// ------------------------------------------------------------------------ // samplebuffer_functions.cpp: Extra functions for SAMPLE_BUFFER class // Copyright (C) 2000,2001,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "kvu_dbc.h" #include "kvu_inttypes.h" #include "samplebuffer.h" #include "samplebuffer_functions.h" #undef NEVER_USED_CODE void SAMPLE_BUFFER_FUNCTIONS::fill_with_random_samples(SAMPLE_BUFFER *sbuf) { std::srand(std::time(0)); int ch_count = sbuf->number_of_channels(); int i_count = sbuf->length_in_samples(); for (int ch = 0; ch < ch_count; ch++) { SAMPLE_BUFFER::sample_t *buf = sbuf->buffer[ch]; for (int i = 0; i < i_count; i++) { int foo = std::rand(); assert(sizeof(SAMPLE_BUFFER::sample_t) <= sizeof(foo)); std::memcpy(buf, &foo, sizeof(SAMPLE_BUFFER::sample_t)); } } } /** * Returns true if 'a' and 'b' have the same exact signal content, * or if the two signals are sufficiently close to each * other considering the limits imposed by implementation (e.g. * precision of the floating point type used to represent * a sample). * * @param bitprec adjust precision (defaults to 24) * @param verbose_stderr whether to output comparison traces to * stderr */ bool SAMPLE_BUFFER_FUNCTIONS::is_almost_equal(const SAMPLE_BUFFER& a, const SAMPLE_BUFFER& b, int bitprec, bool verbose_stderr) { if (a.number_of_channels() != b.number_of_channels()) return false; if (a.length_in_samples() != b.length_in_samples()) return false; int ch_count = a.number_of_channels(); int i_count = a.length_in_samples(); for (int ch = 0; ch < ch_count; ch++) { for (int i = 0; i < i_count; i++) { if (a.buffer[ch][i] != b.buffer[ch][i]) { /* note: the following is intended only for comparing * audio signals with a nominal range of [-1,1] * and precision of 'bitprec' bits */ const SAMPLE_SPECS::sample_t diff_threshold = 1.0 / ((1 << bitprec) - 1); SAMPLE_SPECS::sample_t diff = std::fabs(a.buffer[ch][i] - b.buffer[ch][i]); if (verbose_stderr == true) { std::fprintf(stderr, "%s: diff for sample ch%d[%d], diff %.30f [%s], (a=%.30f to b=%.30f, thrshd %.30f)\n", __FILE__, ch, i, diff, diff > diff_threshold ? "MISMATCH" : "INRANGE", a.buffer[ch][i], b.buffer[ch][i], diff_threshold); } if (diff > diff_threshold) { return false; } { #if NEVER_USED_CODE /* integer-based comparison */ assert(sizeof(SAMPLE_BUFFER::sample_t) == sizeof(uint32_t)); /* allow diff of one in binary representation */ const int diff_threshold_ints = 1; uint32_t aint = *reinterpret_cast(&a.buffer[ch][i]); uint32_t bint = *reinterpret_cast(&b.buffer[ch][i]); uint32_t diff = std::labs(aint - bint); if (diff_total > diff_threshold_ints) { return false; } #endif } } } } return true; } ecasound-2.9.3/libecasound/audioio-mp3.cpp0000644000076400007640000004541712501263072015412 00000000000000// ------------------------------------------------------------------------ // audioio-mp3.cpp: Interface for mp3 decoders and encoders that support // input/output using standard streams. Defaults to // mpg123 and lame. // Copyright (C) 1999-2006,2008,2009,2015 Kai Vehmanen // Note! Routines for parsing mp3 header information were taken from XMMS // 1.2.5's mpg123 plugin. Improvements to parsing logic were // contributed by Julian Dobson. // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // References: // http://www.mp3-tech.org/programmer/frame_header.html // http://www.mpg123.de/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* atol() */ #include #include /* stat() */ #include /* stat() */ #include #include #include #include #include "audioio-mp3.h" #include "audioio-mp3_impl.h" #include "samplebuffer.h" #include "audioio.h" #include "eca-logger.h" const char *default_input_cmd = "mpg123 --stereo -q -s -k %o %f"; const char *default_output_cmd = "lame -b %B -s %S -r --big-endian -S - %f"; const long int default_output_bitrate = 128000; std::string MP3FILE::conf_input_cmd = std::string(default_input_cmd); std::string MP3FILE::conf_output_cmd = std::string(default_output_cmd); long int MP3FILE::conf_default_output_bitrate = default_output_bitrate; void MP3FILE::set_input_cmd(const std::string& value) { MP3FILE::conf_input_cmd = value; } void MP3FILE::set_output_cmd(const std::string& value) { MP3FILE::conf_output_cmd = value; } /*************************************************************** * Routines for parsing mp3 header information. Taken from XMMS * 1.2.5's mpg123 plugin. **************************************************************/ #define MAXFRAMESIZE 1792 #define MPG_MD_STEREO 0 #define MPG_MD_JOINT_STEREO 1 #define MPG_MD_DUAL_CHANNEL 2 #define MPG_MD_MONO 3 int tabsel_123[2][3][16] = { { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,}, {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,}, {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,}}, { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160,}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160,}} }; long mpg123_freqs[9] = {44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000}; struct frame { int stereo; int jsbound; int single; int II_sblimit; int down_sample_sblimit; int lsf; int mpeg25; int down_sample; int header_change; int lay; int error_protection; int bitrate_index; int sampling_frequency; int padding; int extension; int mode; int mode_ext; int copyright; int original; int emphasis; int framesize; /* computed framesize */ }; static bool mpg123_head_check(unsigned long head) { /* ref: http://www.mp3-tech.org/programmer/frame_header.html */ /* frame sync must be 0xffe (11bits) */ if ((head & 0xffe00000) != 0xffe00000) return false; /* layer must be non-null (2bits) */ if (!((head >> 17) & 3)) return false; /* invalid bitrate index: all-ones (4bit) */ if (((head >> 12) & 0xf) == 0xf) return false; /* invalid bitrate index: null (4bit) */ if (!((head >> 12) & 0xf)) return false; /* invalid srate index: all-ones (2bit) */ if (((head >> 10) & 0x3) == 0x3) return false; #if 0 /* invalid: mpeg2/2.5, layer I, protection bit off */ if (((head >> 19) & 1) == 1 && ((head >> 17) & 3) == 3 && ((head >> 16) & 1) == 1) return false; /* - mpeg version 1, CRC protection bit */ if ((head & 0xffff0000) == 0xfffe0000) return false; #endif return true; } static double mpg123_compute_bpf(struct frame *fr) { double bpf; switch (fr->lay) { case 1: bpf = tabsel_123[fr->lsf][0][fr->bitrate_index]; bpf *= 12000.0 * 4.0; bpf /= mpg123_freqs[fr->sampling_frequency] << (fr->lsf); break; case 2: case 3: bpf = tabsel_123[fr->lsf][fr->lay - 1][fr->bitrate_index]; bpf *= 144000; bpf /= mpg123_freqs[fr->sampling_frequency] << (fr->lsf); break; default: bpf = 1.0; } return bpf; } static double mpg123_compute_tpf(struct frame *fr) { static int bs[4] = {0, 384, 1152, 1152}; double tpf; tpf = (double) bs[fr->lay]; tpf /= mpg123_freqs[fr->sampling_frequency] << (fr->lsf); return tpf; } /* * the code a header and write the information * into the frame structure */ static bool mpg123_decode_header(struct frame *fr, unsigned long newhead) { if (newhead & (1 << 20)) { fr->lsf = (newhead & (1 << 19)) ? 0x0 : 0x1; fr->mpeg25 = 0; } else { fr->lsf = 1; fr->mpeg25 = 1; } fr->lay = 4 - ((newhead >> 17) & 3); if (fr->mpeg25) { fr->sampling_frequency = 6 + ((newhead >> 10) & 0x3); } else fr->sampling_frequency = ((newhead >> 10) & 0x3) + (fr->lsf * 3); fr->error_protection = ((newhead >> 16) & 0x1) ^ 0x1; if (fr->mpeg25) /* allow Bitrate change for 2.5 ... */ fr->bitrate_index = ((newhead >> 12) & 0xf); fr->bitrate_index = ((newhead >> 12) & 0xf); fr->padding = ((newhead >> 9) & 0x1); fr->extension = ((newhead >> 8) & 0x1); fr->mode = ((newhead >> 6) & 0x3); fr->mode_ext = ((newhead >> 4) & 0x3); fr->copyright = ((newhead >> 3) & 0x1); fr->original = ((newhead >> 2) & 0x1); fr->emphasis = newhead & 0x3; fr->stereo = (fr->mode == MPG_MD_MONO) ? 1 : 2; if (!fr->bitrate_index) { ECA_LOG_MSG(ECA_LOGGER::errors, "Invalid bitrate!"); return false; } int ssize = 0; switch (fr->lay) { case 1: // fr->do_layer = mpg123_do_layer1; // mpg123_init_layer2(); fr->framesize = (long) tabsel_123[fr->lsf][0][fr->bitrate_index] * 12000; fr->framesize /= mpg123_freqs[fr->sampling_frequency]; fr->framesize = ((fr->framesize + fr->padding) << 2) - 4; break; case 2: // fr->do_layer = mpg123_do_layer2; // mpg123_init_layer2(); fr->framesize = (long) tabsel_123[fr->lsf][1][fr->bitrate_index] * 144000; fr->framesize /= mpg123_freqs[fr->sampling_frequency]; fr->framesize += fr->padding - 4; break; case 3: // fr->do_layer = mpg123_do_layer3; if (fr->lsf) ssize = (fr->stereo == 1) ? 9 : 17; else ssize = (fr->stereo == 1) ? 17 : 32; if (fr->error_protection) ssize += 2; fr->framesize = (long) tabsel_123[fr->lsf][2][fr->bitrate_index] * 144000; fr->framesize /= mpg123_freqs[fr->sampling_frequency] << (fr->lsf); fr->framesize = fr->framesize + fr->padding - 4; break; default: return false; } if(fr->framesize > MAXFRAMESIZE) { ECA_LOG_MSG(ECA_LOGGER::errors, "Invalid framesize!"); return false; } return true; } /* not used anymore, kaiv 2005/03 */ #if 0 static uint32_t convert_to_header(uint8_t * buf) { return (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3]; } #endif static bool mpg123_detect_by_content(const char* filename, struct frame* frp) { FILE *file; uint8_t tmp[4]; /* room for the 32bit head */ uint32_t head = 0; bool data_left = true; bool header_found = false; size_t offset = 0; if((file = std::fopen(filename, "rb")) == NULL) { ECA_LOG_MSG(ECA_LOGGER::errors, string("Unable to open file ") + filename + "."); data_left = false; } /* search for headers in the first 262kB of data */ while(data_left == true && offset < (1<<18)) { /* octet-by-octet search */ if (std::fread(tmp, 1, 1, file) != 1) { ECA_LOG_MSG(ECA_LOGGER::errors, "End of mp3 file, no valid header data found."); data_left = false; break; } head <<= 8; head |= tmp[0]; offset += 1; if (offset > 3) { /* verify the header and if ok, fetch mp3 parameters and store them to 'frp' */ if (mpg123_head_check(head) && mpg123_decode_header(frp, head)) { if (header_found == true) { /* two headers found, stop searching */ data_left = false; } else { /* after the first header is found, skip to the next valid frame to verify that the first frame is not dummy frame (id3 or something similar) */ if (std::fseek(file, frp->framesize, SEEK_CUR) != 0) { data_left = false; } header_found = true; } ECA_LOG_MSG(ECA_LOGGER::user_objects, "Found mp3 header at offset " + kvu_numtostr(static_cast(offset - 4))); } } } return header_found; } /*************************************************************** * MP3FILE specific parts. **************************************************************/ MP3FILE::MP3FILE(const std::string& name) : finished_rep(false), triggered_rep(false) { set_label(name); filedes_rep = -1; filehandle_rep = 0; mono_input_rep = false; pcm_rep = 1; bitrate_rep = MP3FILE::conf_default_output_bitrate; } MP3FILE::~MP3FILE(void) { /* see notes in stop_io() */ clean_child(io_mode() == io_read ? true : false); if (is_open() == true) { close(); } } void MP3FILE::open(void) throw(AUDIO_IO::SETUP_ERROR &) { if (io_mode() == io_read) { /* decoder supports: fixed channel count and sample format, sample rate set by parsing mp3 header */ get_mp3_params(label()); } else { /* encoder supports: srate configurable, fixed channel count and sample format */ set_channels(2); set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16_le); /* note: 'lame' command-line syntax, and default related to them, * have changed slightly in lame 3.98, so we need this hack * to support both old and new versions. In the past, * Ecasound wrote little-endian samples and used lame * option "-x". Newer lame versions (3.97) introduced * "--litle-endian" and "--big-endian", but these were * buggy still in 3.97 (fixed in 3.98). And with 3.98, * additional options (e.g. "-r") need to be passed, or * otherwise lame will exit with an error. * * In addition to above problems, we also need to remember * people updating to a newer Ecasound, but who do not update * their custom 'lame' launch commands in * ~/.ecasound/ecasoundrc (ecasound must continue to output * little-endian samples by default). */ if (MP3FILE::conf_output_cmd.find("lame ") != std::string::npos && MP3FILE::conf_output_cmd.find(" --big-endian ") != std::string::npos) { set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16_be); } } triggered_rep = false; AUDIO_IO::open(); } void MP3FILE::close(void) { if (pid_of_child() > 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Cleaning child process pid=" + kvu_numtostr(pid_of_child()) + "."); /* note: mp3 input/output can handle SIGTERM */ clean_child(true); triggered_rep = false; } AUDIO_IO::close(); } void MP3FILE::process_mono_fix(char* target_buffer, long int bytes) { for(long int n = 0; n < bytes;) { target_buffer[n + 2] = target_buffer[n]; target_buffer[n + 3] = target_buffer[n + 1]; n += 4; } } long int MP3FILE::read_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_input_process(); } bytes_rep = std::fread(target_buffer, 1, frame_size() * samples, filehandle_rep); if (bytes_rep < samples * frame_size() || bytes_rep == 0) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::errors, "Can't start process \"" + MP3FILE::conf_input_cmd + "\". Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; } else finished_rep = false; last_position_rep += (bytes_rep / frame_size()); return bytes_rep / frame_size(); } void MP3FILE::write_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { triggered_rep = true; fork_output_process(); } if (wait_for_child() != true) { finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Attempt to write after child process has terminated."); } else { bytes_rep = ::write(filedes_rep, target_buffer, frame_size() * samples); if (bytes_rep < frame_size() * samples) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::errors, "Can't start process \"" + MP3FILE::conf_output_cmd + "\". Please check your ~/.ecasound/ecasoundrc."); else ECA_LOG_MSG(ECA_LOGGER::errors, "Error in writing to child process (to write " + kvu_numtostr(frame_size() * samples) + ", result " + kvu_numtostr(bytes_rep) + ")."); finished_rep = true; } else finished_rep = false; } } SAMPLE_SPECS::sample_pos_t MP3FILE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { finished_rep = false; if (triggered_rep == true && last_position_rep != pos) { if (is_open() == true) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Cleaning child process pid=" + kvu_numtostr(pid_of_child()) + "."); clean_child(true); triggered_rep = false; } } return pos; } void MP3FILE::set_parameter(int param, std::string value) { switch (param) { case 1: set_label(value); break; case 2: long int numvalue = atol(value.c_str()); if (numvalue > 0) bitrate_rep = numvalue; else bitrate_rep = MP3FILE::conf_default_output_bitrate; break; } } std::string MP3FILE::get_parameter(int param) const { switch (param) { case 1: return label(); case 2: return kvu_numtostr(bitrate_rep); } return ""; } void MP3FILE::get_mp3_params(const std::string& fname) throw(AUDIO_IO::SETUP_ERROR&) { std::string urlprefix; struct frame fr = { 0 }; if (mpg123_detect_by_content(fname.c_str(), &fr) != true) { /* not a file, next search for an URL */ size_t offset = fname.find_first_of("://"); if (offset == std::string::npos) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-MP3: Can't open " + label() + " for reading.")); } else { urlprefix = std::string(fname, 0, offset); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Found url; protocol '" + urlprefix + "'."); } } else { /* file size */ struct stat buf; ::stat(fname.c_str(), &buf); double fsize = (double)buf.st_size; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Total file size (bytes): " + kvu_numtostr(fsize)); /* bitrate */ double bitrate = tabsel_123[fr.lsf][fr.lay - 1][fr.bitrate_index] * 1000; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Bitrate (bits/s): " + kvu_numtostr(bitrate)); /* sample freq */ double sfreq = mpg123_freqs[fr.sampling_frequency]; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Sampling frequncy (Hz): " + kvu_numtostr(sfreq)); set_samples_per_second(static_cast(sfreq)); /* channels */ // notice! mpg123 always outputs 16bit samples, stereo mono_input_rep = (fr.mode == MPG_MD_MONO) ? true : false; /* temporal length */ long int numframes = static_cast((fsize / mpg123_compute_bpf(&fr))); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Total length (frames): " + kvu_numtostr(numframes)); double tpf = mpg123_compute_tpf(&fr); set_length_in_seconds(tpf * numframes); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Total length (seconds): " + kvu_numtostr(length_in_seconds())); /* set pcm per frame value */ static int bs[4] = {0, 384, 1152, 1152}; pcm_rep = bs[fr.lay]; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Pcm per mp3 frames: " + kvu_numtostr(pcm_rep)); } /* sample format (this comes from mpg123) */ set_channels(2); set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16_le); } void MP3FILE::start_io(void) { if (triggered_rep != true) { if (io_mode() == io_read) fork_input_process(); else fork_output_process(); triggered_rep = true; } } void MP3FILE::stop_io(void) { if (triggered_rep == true) { /* note: it's safe to send a SIGTERM if the client is * an input and we know its PID (otherwise * cleanup will still work but will take more time, which * is nasty if we are in a middle of a seek */ if (io_mode() == io_read) clean_child(true); else clean_child(false); triggered_rep = false; } } void MP3FILE::fork_input_process(void) { std::string cmd = MP3FILE::conf_input_cmd; if (cmd.find("%o") != std::string::npos) { cmd.replace(cmd.find("%o"), 2, kvu_numtostr((long)(position_in_samples() / pcm_rep))); } last_position_rep = position_in_samples(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "" + cmd); set_fork_command(cmd); set_fork_file_name(label()); set_fork_bits(bits()); set_fork_channels(channels()); set_fork_sample_rate(samples_per_second()); /* for old mpg123 */ fork_child_for_read(); if (child_fork_succeeded() == true) { /* NOTE: the file description will be closed by * AUDIO_IO_FORKED_STREAM::clean_child() */ filedes_rep = file_descriptor(); filehandle_rep = fdopen(filedes_rep, "r"); /* not part of */ if (filehandle_rep == 0) { finished_rep = true; triggered_rep = false; } } } void MP3FILE::fork_output_process(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Starting to encode " + label() + " with lame."); last_position_rep = position_in_samples(); std::string cmd = MP3FILE::conf_output_cmd; if (cmd.find("%B") != std::string::npos) { cmd.replace(cmd.find("%B"), 2, kvu_numtostr((long int)(bitrate_rep / 1000))); } set_fork_command(cmd); set_fork_file_name(label()); set_fork_bits(bits()); set_fork_channels(channels()); set_fork_sample_rate(samples_per_second()); fork_child_for_write(); if (child_fork_succeeded() == true) { filedes_rep = file_descriptor(); } } ecasound-2.9.3/libecasound/osc-sine.cpp0000644000076400007640000000502611744616230015002 00000000000000// ------------------------------------------------------------------------ // osc-sine.cpp: Sine oscillator // Copyright (C) 1999,2001,2008,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "oscillator.h" #include "osc-sine.h" #include "eca-logger.h" CONTROLLER_SOURCE::parameter_t SINE_OSCILLATOR::value(double pos_secs) { parameter_t retval, phase; if (period_len_rep == 0) return 1.0; phase = 2.0 * M_PI * (pos_secs / period_len_rep); retval = sin(phase + phase_offset()); /* note: scale return value to proper [0,1] range */ retval += 1.0; retval /= 2.0; return retval; } SINE_OSCILLATOR::SINE_OSCILLATOR (double freq, double initial_phase) : OSCILLATOR(freq, initial_phase) { set_parameter(1, get_parameter(1)); set_parameter(2, get_parameter(2)); } void SINE_OSCILLATOR::init(void) { MESSAGE_ITEM otemp; otemp << "Sine oscillator created; frequency "; otemp.setprecision(3); otemp << frequency(); otemp << " and initial phase of "; otemp << phase_offset() << "."; ECA_LOG_MSG(ECA_LOGGER::user_objects, otemp.to_string()); } void SINE_OSCILLATOR::set_parameter(int param, CONTROLLER_SOURCE::parameter_t v) { switch (param) { case 1: frequency(v); /* note: cache length of one period in seconds */ if (frequency() > 0) period_len_rep = 1.0 / frequency(); else period_len_rep = 0; break; case 2: phase_offset(static_cast(v * M_PI)); break; } } CONTROLLER_SOURCE::parameter_t SINE_OSCILLATOR::get_parameter(int param) const { switch (param) { case 1: return frequency(); case 2: return phase_offset() / M_PI; } return 0.0; } ecasound-2.9.3/libecasound/audiogate.cpp0000644000076400007640000001523311432774076015234 00000000000000// ------------------------------------------------------------------------ // audiogate.cpp: Signal gates. // Copyright (C) 1999-2002,2005-2008,2010 Kai Vehmanen // Copyrtigh (C) 2008 Andrew Lees // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "samplebuffer.h" #include "samplebuffer_functions.h" #include "audiogate.h" #include "eca-logger.h" GATE_BASE::~GATE_BASE(void) { } void GATE_BASE::process(void) { analyze(target); if (is_open() == false) { target->length_in_samples(0); } } void GATE_BASE::init(SAMPLE_BUFFER* sbuf) { gate_open = false; target = sbuf; } void TIME_CROP_GATE::analyze(SAMPLE_BUFFER* sbuf) { parameter_t etime = begtime_rep + durtime_rep; parameter_t curtime = static_cast(position_in_samples_rep) / samples_per_second(); if (curtime >= begtime_rep) { /* note: handle the special case where a zero open time * has been requested */ if (begtime_rep == etime) open_gate(); else if (curtime < etime) open_gate(); else close_gate(); } else close_gate(); position_in_samples_rep += sbuf->length_in_samples(); } TIME_CROP_GATE::TIME_CROP_GATE (CHAIN_OPERATOR::parameter_t open_at, CHAIN_OPERATOR::parameter_t duration) { begtime_rep = open_at; durtime_rep = duration; position_in_samples_rep = 0; ECA_LOG_MSG(ECA_LOGGER::info, "Time crop gate created; opens at " + kvu_numtostr(begtime_rep) + " seconds and stays open for " + kvu_numtostr(durtime_rep) + " seconds.\n"); } CHAIN_OPERATOR::parameter_t TIME_CROP_GATE::get_parameter(int param) const { switch (param) { case 1: return begtime_rep; case 2: return durtime_rep; } return 0.0; } void TIME_CROP_GATE::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: begtime_rep = value; position_in_samples_rep = 0; break; case 2: durtime_rep = value; break; } } void TIME_CROP_GATE::set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value) { double ratio (new_value); ratio /= samples_per_second(); /* note: as we store position as samples, changes in sampling rate * require recalculation of position */ position_in_samples_rep = static_cast(position_in_samples_rep * ratio); ECA_SAMPLERATE_AWARE::set_samples_per_second(new_value); } THRESHOLD_GATE::THRESHOLD_GATE (CHAIN_OPERATOR::parameter_t threshold_openlevel, CHAIN_OPERATOR::parameter_t threshold_closelevel, bool use_rms) { openlevel_rep = threshold_openlevel / 100.0; closelevel_rep = threshold_closelevel / 100.0; rms_rep = use_rms; reopen_count_param_rep = 0; is_opened_rep = is_closed_rep = false; if (rms_rep) { ECA_LOG_MSG(ECA_LOGGER::info, "Threshold gate created; open threshold " + kvu_numtostr(openlevel_rep * 100) + "%, close threshold " + kvu_numtostr(closelevel_rep * 100) + "%, using RMS volume."); } else { ECA_LOG_MSG(ECA_LOGGER::info, "Threshold gate created; open threshold " + kvu_numtostr(openlevel_rep * 100) + "%, close threshold " + kvu_numtostr(closelevel_rep * 100) + "%, using peak volume."); } } void THRESHOLD_GATE::init(SAMPLE_BUFFER* sbuf) { reopens_left_rep = reopen_count_param_rep; is_opened_rep = false; is_closed_rep = false; GATE_BASE::init(sbuf); } void THRESHOLD_GATE::analyze(SAMPLE_BUFFER* sbuf) { if (rms_rep == true) avolume_rep = SAMPLE_BUFFER_FUNCTIONS::RMS_volume(*sbuf) / SAMPLE_SPECS::max_amplitude; else avolume_rep = SAMPLE_BUFFER_FUNCTIONS::average_amplitude(*sbuf) / SAMPLE_SPECS::max_amplitude; if (is_opened_rep == false) { if (avolume_rep > openlevel_rep) { open_gate(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Threshold gate opened (reopen count = " + kvu_numtostr(reopens_left_rep) + ")"); is_opened_rep = true; is_closed_rep = false; } } else if (is_closed_rep == false) { if (avolume_rep < closelevel_rep) { close_gate(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Threshold gate closed (reopens left = " + kvu_numtostr(reopens_left_rep) + ")"); is_closed_rep = true; if (reopens_left_rep != 0) { is_opened_rep = false; if (reopens_left_rep > 0) --reopens_left_rep; } else { // - Could we stop the engine and exit here, maybe? -AL/2008-Jul // - Not from a chain operator, but the audio object // that writes the stream to a file could in // theory react in a special way to the 0-length // samplebuffers we generate when the gate is closed... -KV/2008-Jul } } } } CHAIN_OPERATOR::parameter_t THRESHOLD_GATE::get_parameter(int param) const { switch (param) { case 1: return openlevel_rep * 100.0; case 2: return closelevel_rep * 100.0; case 3: if (rms_rep) return 1.0; else return 0.0; case 4: return reopen_count_param_rep; } return 0.0; } void THRESHOLD_GATE::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: openlevel_rep = value / 100.0; break; case 2: closelevel_rep = value / 100.0; break; case 3: rms_rep = (value != 0); break; case 4: reopen_count_param_rep = static_cast(value); break; } } void MANUAL_GATE::analyze(SAMPLE_BUFFER* sbuf) { if (is_open() == true && open_rep != true) { close_gate(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Manual gate closed"); } else if (is_open() != true && open_rep == true) { open_gate(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Manual gate opened"); } } CHAIN_OPERATOR::parameter_t MANUAL_GATE::get_parameter(int param) const { switch (param) { case 1: return open_rep == true ? 1 : 0; } return 0.0; } void MANUAL_GATE::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: if (value > 0) open_rep = true; else open_rep = false; break; } } ecasound-2.9.3/libecasound/midi-server.h0000644000076400007640000000544510664032032015152 00000000000000#ifndef INCLUDED_MIDI_SERVER_H #define INCLUDED_MIDI_SERVER_H #include #include #include #include #include #include #include #include "midiio.h" /** * Interface class for specifying custom MIDI-handlers. */ class MIDI_HANDLER { public: virtual void insert(unsigned char byte) = 0; virtual ~MIDI_HANDLER(void) {} }; /** * MIDI i/o engine. * * @author Kai Vehmanen */ class MIDI_SERVER { friend void* start_midi_server_io_thread(void *ptr); public: static const unsigned int max_queue_size_rep; public: bool is_running(void) const; bool is_enabled(void) const; void enable(void); void disable(void); void init(void); void start(void); void stop(void); void set_schedrealtime(bool v) { schedrealtime_rep = v; } void set_schedpriority(int v) { schedpriority_rep = v; } void register_client(MIDI_IO* mobject); void unregister_client(MIDI_IO* mobject); void register_handler(MIDI_HANDLER* handler); void unregister_handler(MIDI_HANDLER* handler); void add_mmc_send_id(int id); void remove_mmc_send_id(int id); void set_mmc_receive_id(int id) { mmc_receive_id_rep = id; } int mmc_receive_id(int id) const { return(mmc_receive_id_rep); } void toggle_midi_sync_send(bool v) { midi_sync_send_rep = v; } void toggle_midi_sync_receive(bool v) { midi_sync_receive_rep = v; } bool is_midi_sync_send_enabled(void) const { return(midi_sync_send_rep); } bool is_midi_sync_receive_enabled(void) const { return(midi_sync_receive_rep); } void send_midi_bytes(int dev_id, unsigned char* buf, int bytes); void add_controller_trace(int channel, int ctrl, int initial_value = 0); void remove_controller_trace(int channel, int ctrl); int last_controller_value(int channel, int ctrl) const; MIDI_SERVER (void); ~MIDI_SERVER(void); private: std::deque buffer_rep; mutable std::map,int> controller_values_rep; unsigned char running_status_rep; int current_ctrl_channel_rep; int current_ctrl_number; std::list mmc_send_ids_rep; int mmc_receive_id_rep; std::vector clients_rep; bool midi_sync_send_rep; bool midi_sync_receive_rep; std::vector handlers_rep; pthread_t io_thread_rep; bool thread_running_rep; bool schedrealtime_rep; int schedpriority_rep; ATOMIC_INTEGER exit_request_rep; ATOMIC_INTEGER stop_request_rep; ATOMIC_INTEGER running_rep; MIDI_SERVER& operator=(const MIDI_SERVER& x) { return *this; } MIDI_SERVER (const MIDI_SERVER& x) { } void io_thread(void); void parse_receive_queue(void); void send_mmc_command(unsigned int cmd); void send_mmc_start(void); void send_mmc_stop(void); void send_midi_start(void); void send_midi_continue(void); void send_midi_stop(void); }; #endif ecasound-2.9.3/libecasound/audioio-null.h0000644000076400007640000000231411141057331015315 00000000000000#ifndef INCLUDED_AUDIOIO_NULL_H #define INCLUDED_AUDIOIO_NULL_H #include "audioio-buffered.h" /** * Audio object that endlessly consumes and produces audio data. * And is incredibly fast. :) */ class NULLFILE : public AUDIO_IO_BUFFERED { public: virtual std::string name(void) const { return("Null audio object"); } virtual void open(void) throw (AUDIO_IO::SETUP_ERROR &) { AUDIO_IO::open(); } virtual void close(void) { AUDIO_IO::close(); } virtual long int read_samples(void* target_buffer, long int samples) { for(long int n = 0; n < static_cast(samples * frame_size()); n++) ((char*)target_buffer)[n] = 0; return(samples); } virtual void write_samples(void* target_buffer, long int samples) { } virtual bool finished(void) const { return false; } virtual bool supports_seeking(void) const { return true; } virtual bool finite_length_stream(void) const { return false; } virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos) { return pos; } NULLFILE(const std::string& name = "null"); virtual ~NULLFILE(void); NULLFILE* clone(void) const { return new NULLFILE(*this); } NULLFILE* new_expr(void) const { return new NULLFILE(); } }; #endif ecasound-2.9.3/libecasound/eca-control.cpp0000644000076400007640000014506511762446716015512 00000000000000// ------------------------------------------------------------------------ // eca-control.cpp: Class for controlling the whole ecasound library // Copyright (C) 1999-2005,2008,2009,2012 Kai Vehmanen // Copyright (C) 2005 Stuart Allie // Copyright (C) 2009 Adam Linson // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #ifdef HAVE_LOCALE_H #include #endif #include /* string_to_vector(), string_to_int_vector() */ #include #include #include #include #include "audioio.h" #include "eca-chain.h" #include "eca-chainop.h" #include "eca-chainsetup.h" #include "eca-control.h" #include "eca-control-main.h" #include "eca-engine.h" #include "eca-object-factory.h" #include "eca-object-map.h" #include "eca-preset-map.h" #include "eca-session.h" #include "generic-controller.h" #include "eca-chainop.h" #include "audiofx_ladspa.h" #include "audiofx_lv2.h" #include "preset.h" #include "sample-specs.h" #include "jack-connections.h" #include "eca-version.h" #include "eca-error.h" #include "eca-logger.h" #include "eca-logger-wellformed.h" /** * Import namespaces */ using std::string; using std::list; using std::vector; using std::cerr; using std::endl; using namespace ECA; /** * Declarations for private static functions */ static string eca_aio_register_sub(ECA_OBJECT_MAP& objmap); /** * Definitions for member functions */ ECA_CONTROL::ECA_CONTROL (ECA_SESSION* psession) : ctrl_dump_rep(this), wellformed_mode_rep(false) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "ECA_CONTROL constructor"); session_repp = psession; selected_chainsetup_repp = psession->selected_chainsetup_repp; engine_repp = 0; engine_pid_rep = -1; engine_exited_rep.set(0); float_to_string_precision_rep = 3; joining_rep = false; DBC_CHECK(is_engine_created() != true); selected_audio_object_repp = 0; selected_audio_input_repp = 0; selected_audio_output_repp = 0; } ECA_CONTROL::~ECA_CONTROL(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "ECA_CONTROL destructor"); close_engine(); } void ECA_CONTROL::fill_command_retval(struct eci_return_value *retval) const { if (retval == 0) return; *retval = last_retval_rep; } void ECA_CONTROL::command(const string& cmd_and_args, struct eci_return_value *retval) { clear_last_values(); clear_action_arguments(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "processing cmd and arg: " + cmd_and_args); vector tokens = kvu_string_to_tokens_quoted(cmd_and_args); vector::iterator cmd = tokens.begin(); if (cmd != tokens.end()) { const std::map& cmdmap = ECA_IAMODE_PARSER::registered_commands(); if (cmdmap.find(*cmd) == cmdmap.end()) { // --- // *p is not recognized as a iamode command // --- if (cmd->size() > 0 && (*cmd)[0] == '-') { // std::cerr << "Note! Direct use of EOS-options (-prefix:arg1,...,argN)" << " as iactive-mode commands is considered deprecated. " << "\tUse the notation 'cs-option -prefix:a,b,x' instead." << std::endl; if (*cmd == "-i") ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: syntax variant '-i file.ext' not supported, please use 'ai-add file.ext' instead."); else if (*cmd == "-o") ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: syntax variant '-o file.ext' not supported, please use 'ai-add file.ext' instead."); else { ECA_LOG_MSG(ECA_LOGGER::user_objects, "passiong to cs-option: " + cmd_and_args); chainsetup_option(cmd_and_args); } } else { set_last_error("Unknown command!"); } } else { int action_id = ECA_IAMODE_PARSER::command_to_action_id(*cmd); if (action_id == ec_help) { show_controller_help(); } else { vector::iterator args = cmd + 1; if (args != tokens.end()) { set_action_argument(vector (args, tokens.end())); } action(action_id); } } } fill_command_retval(retval); } void ECA_CONTROL::set_action_argument(const string& s) { action_args_rep.resize(0); action_args_rep.push_back(s); action_arg_f_set_rep = false; } void ECA_CONTROL::set_action_argument(const std::vector& s) { action_args_rep = s; action_arg_f_set_rep = false; } void ECA_CONTROL::set_action_argument(double v) { action_arg_f_rep = v; action_arg_f_set_rep = true; } void ECA_CONTROL::clear_action_arguments(void) { // use resize() instead of clear(); clear() was a late // addition to C++ standard and not supported by all // compilers (for example egcs-2.91.66) action_args_rep.resize(0); action_arg_f_rep = 0.0f; action_arg_f_set_rep = false; } double ECA_CONTROL::first_action_argument_as_float(void) const { if (action_arg_f_set_rep == true) return action_arg_f_rep; if (action_args_rep.size() == 0) return 0.0f; return atof(action_args_rep[0].c_str()); } string ECA_CONTROL::first_action_argument_as_string(void) const { if (action_args_rep.size() == 0) return std::string(); return action_args_rep[0]; } const vector& ECA_CONTROL::action_arguments_as_vector(void) const { return action_args_rep; } int ECA_CONTROL::first_action_argument_as_int(void) const { if (action_args_rep.size() == 0) return 0; return atoi(action_args_rep[0].c_str()); } long int ECA_CONTROL::first_action_argument_as_long_int(void) const { if (action_args_rep.size() == 0) return 0; return atol(action_args_rep[0].c_str()); } SAMPLE_SPECS::sample_pos_t ECA_CONTROL::first_action_argument_as_samples(void) const { if (action_args_rep.size() == 0) return 0; #ifdef HAVE_ATOLL return atoll(action_args_rep[0].c_str()); #else return atol(action_args_rep[0].c_str()); #endif } void ECA_CONTROL::command_float_arg(const string& cmd, double arg, struct eci_return_value *retval) { clear_action_arguments(); set_action_argument(arg); int action_id = ec_unknown; action_id = ECA_IAMODE_PARSER::command_to_action_id(cmd); action(action_id); fill_command_retval(retval); } /** * Interprets an EOS (ecasound optiont syntax) token (prefixed with '-'). */ void ECA_CONTROL::chainsetup_option(const string& cmd) { string prefix = kvu_get_argument_prefix(cmd); if (prefix == "el" || prefix == "pn") { // --- LADSPA plugins and presets if (selected_chains().size() == 1) add_chain_operator(cmd); else set_last_error("When adding chain operators, only one chain can be selected."); } else if (ECA_OBJECT_FACTORY::chain_operator_map().object(prefix) != 0) { if (selected_chains().size() == 1) add_chain_operator(cmd); else set_last_error("When adding chain operators, only one chain can be selected."); } else if (ECA_OBJECT_FACTORY::controller_map().object(prefix) != 0) { if (selected_chains().size() == 1) add_controller(cmd); else set_last_error("When adding controllers, only one chain can be selected."); } else { set_action_argument(cmd); action(ec_cs_option); } } /** * Checks action preconditions. * * @return Sets status of private data members 'action_ok', * 'action_restart', and 'action_reconnect'. */ void ECA_CONTROL::check_action_preconditions(int action_id) { action_ok = true; action_reconnect = false; action_restart = false; /* case 1: action requiring arguments, but not arguments available */ if (action_arg_f_set_rep == false && first_action_argument_as_string().size() == 0 && action_requires_params(action_id)) { set_last_error("Can't perform requested action; argument omitted."); action_ok = false; } /* case 2: action requires an audio input, but no input available */ else if (is_selected() == true && get_audio_input() == 0 && action_requires_selected_audio_input(action_id)) { set_last_error("Can't perform requested action; no audio input selected."); action_ok = false; } /* case 3: action requires an audio output, but no output available */ else if (is_selected() == true && get_audio_output() == 0 && action_requires_selected_audio_output(action_id)) { set_last_error("Can't perform requested action; no audio output selected."); action_ok = false; } /* case 4: action requires a select chainsetup, but none selected */ else if (is_selected() == false && action_requires_selected(action_id)) { if (!is_connected()) { set_last_error("Can't perform requested action; no chainsetup selected."); action_ok = false; } else { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: No chainsetup selected. Connected chainsetup will be selected."); select_chainsetup(connected_chainsetup()); } } /* case 5: action requires a connected chainsetup, but none connected */ else if (is_connected() == false && action_requires_connected(action_id)) { if (!is_selected()) { set_last_error("Can't perform requested action; no chainsetup connected."); action_ok = false; } else { if (is_valid() == true) { ECA_LOG_MSG(ECA_LOGGER::info, "NOTE: No chainsetup connected. Trying to connect currently selected chainsetup \"" + selected_chainsetup_repp->name() + "\""); connect_chainsetup(0); } if (is_connected() != true) { /* connect_chainsetup() sets last_error() so we just add to it */ set_last_error(last_error() + " Selected chainsetup cannot be connected. Can't perform requested action. "); action_ok = false; } } } /* case 6: action can't be performed on a connected setup, * but selected chainsetup is also connected */ else if (selected_chainsetup() == connected_chainsetup() && action_requires_selected_not_connected(action_id)) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: This operation requires that chainsetup is disconnected. Temporarily disconnecting..."); if (is_running()) action_restart = true; disconnect_chainsetup(); action_reconnect = true; } } void ECA_CONTROL::action(int action_id, const vector& args) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: ECA_CONTROL::action() method is obsolete.\n"); clear_action_arguments(); set_action_argument(kvu_vector_to_string(args, " ")); action(action_id); } bool ECA_CONTROL::action_helper_check_cop_op_args(int copid, int coppid) { DBC_REQUIRE(is_selected() == true); const vector& selchains = selected_chainsetup_repp->selected_chains(); bool res = false; if (selchains.size() == 0) { set_last_error("No chain selected, unable to identify chainop"); } else if (selchains.size() > 1) { set_last_error("More than one chain selected, unable to identify chainop"); } else { const CHAIN* selch = selected_chainsetup_repp->get_chain_with_name(selchains[0]); if (copid < 1 || copid > selch->number_of_chain_operators()) { set_last_error("Invalid chainop-id, unable to identify chainop"); } else if (coppid < 1) { set_last_error("Invalid copp-id, indexing starts from 1."); } else { res = true; } } return res; } void ECA_CONTROL::action(int action_id) { clear_last_values(); check_action_preconditions(action_id); if (action_ok != true) return; switch(action_id) { case ec_unknown: { set_last_error("Unknown command!"); break; } // --- // General // --- case ec_exit: { quit(); break; } case ec_start: { if (is_running() != true) { int result = start(); if (result < 0) { set_last_error("Error, unable to start processing"); } } // ECA_LOG_MSG(ECA_LOGGER::info, "Can't perform requested action; no chainsetup connected."); break; } case ec_stop: { if (is_engine_created()) stop(); break; } case ec_stop_sync: { if (is_engine_created()) stop_on_condition(); break; } case ec_run: { int result = run(); if (result < 0) { set_last_error("Errors during processing"); } break; } case ec_debug: { int level = first_action_argument_as_int(); ECA_LOGGER::instance().set_log_level_bitmask(level); set_last_string("Debug level set to " + kvu_numtostr(level) + "."); break; } case ec_resource_file: { session_repp->interpret_general_option(string("-R:") + first_action_argument_as_string()); break; } // --- // Chainsetups // --- case ec_cs_add: { add_chainsetup(first_action_argument_as_string()); break; } case ec_cs_remove: { remove_chainsetup(); break; } case ec_cs_list: { set_last_string_list(chainsetup_names()); break; } case ec_cs_select: { select_chainsetup(first_action_argument_as_string()); break; } case ec_cs_selected: { set_last_string(selected_chainsetup()); break; } case ec_cs_index_select: { if (first_action_argument_as_string().size() > 0) { select_chainsetup_by_index(first_action_argument_as_int()); } break; } case ec_cs_edit: { edit_chainsetup(); break; } case ec_cs_load: { load_chainsetup(first_action_argument_as_string()); break; } case ec_cs_save: { save_chainsetup(""); break; } case ec_cs_save_as: { save_chainsetup(first_action_argument_as_string()); break; } case ec_cs_is_valid: { if (is_valid() == true) set_last_integer(1); else set_last_integer(0); break; } case ec_cs_connect: { if (is_valid() != false) { connect_chainsetup(0); } else { set_last_error("Can't connect; chainsetup not valid!"); } break; } case ec_cs_connected: { set_last_string(connected_chainsetup()); break; } case ec_cs_disconnect: { disconnect_chainsetup(); break; } case ec_cs_set_param: { set_chainsetup_parameter(first_action_argument_as_string()); break; } case ec_cs_set_audio_format: { set_chainsetup_sample_format(first_action_argument_as_string()); break; } case ec_cs_status: { set_last_string(chainsetup_status()); break; } case ec_cs_rewind: { change_chainsetup_position(-first_action_argument_as_float()); break; } case ec_cs_forward: { change_chainsetup_position(first_action_argument_as_float()); break; } case ec_cs_set_position: { set_chainsetup_position(first_action_argument_as_float()); break; } case ec_cs_set_position_samples: { set_chainsetup_position_samples(first_action_argument_as_samples()); break; } case ec_cs_get_position: { set_last_float(position_in_seconds_exact()); break; } case ec_cs_get_position_samples: { set_last_long_integer(selected_chainsetup_repp->position_in_samples()); break; } case ec_cs_get_length: { set_last_float(length_in_seconds_exact()); break; } case ec_cs_get_length_samples: { set_last_long_integer(length_in_samples()); break; } case ec_cs_set_length: { set_chainsetup_processing_length_in_seconds(first_action_argument_as_float()); break; } case ec_cs_set_length_samples: { set_chainsetup_processing_length_in_samples(first_action_argument_as_samples()); break; } case ec_cs_toggle_loop: { toggle_chainsetup_looping(); break; } case ec_cs_option: { selected_chainsetup_repp->interpret_options(action_arguments_as_vector()); if (selected_chainsetup_repp->interpret_result() != true) { set_last_error(selected_chainsetup_repp->interpret_result_verbose()); } break; } // --- // Chains // --- case ec_c_add: { add_chains(kvu_string_to_vector(first_action_argument_as_string(), ',')); break; } case ec_c_remove: { remove_chains(); break; } case ec_c_list: { set_last_string_list(chain_names()); break; } case ec_c_select: { select_chains(kvu_string_to_vector(first_action_argument_as_string(), ',')); break; } case ec_c_selected: { set_last_string_list(selected_chains()); break; } case ec_c_index_select: { select_chains_by_index(kvu_string_to_int_vector(first_action_argument_as_string(), ',')); break; } case ec_c_deselect: { deselect_chains(kvu_string_to_vector(first_action_argument_as_string(), ',')); break; } case ec_c_select_add: { select_chains(kvu_string_to_vector(first_action_argument_as_string() + "," + kvu_vector_to_string(selected_chains(), ","), ',')); break; } case ec_c_select_all: { select_all_chains(); break; } case ec_c_clear: { clear_chains(); break; } case ec_c_rename: { if (selected_chains().size() != 1) { set_last_error("When renaming chains, only one chain canbe selected."); } else { rename_chain(first_action_argument_as_string()); } break; } case ec_c_muting: { set_chain_muting(first_action_argument_as_string()); break; } case ec_c_bypass: { set_chain_bypass(first_action_argument_as_string()); break; } case ec_c_status: { set_last_string(chain_status()); break; } case ec_c_is_bypassed: { set_last_integer(chain_is_bypassed()); break; } case ec_c_is_muted: { set_last_integer(chain_is_muted()); break; } // --- // Actions common to audio inputs and outputs // --- case ec_aio_status: case ec_ai_status: case ec_ao_status: { set_last_string(aio_status()); break; } case ec_aio_register: { aio_register(); break; } // --- // Audio input objects // --- case ec_ai_add: { add_audio_input(first_action_argument_as_string()); break; } case ec_ai_describe: { set_last_string(ECA_OBJECT_FACTORY::audio_object_to_eos(selected_audio_input_repp, "i")); break; } case ec_ai_remove: { remove_audio_input(); break; } case ec_ai_list: { set_last_string_list(audio_input_names()); break; } case ec_ai_select: { select_audio_input(first_action_argument_as_string()); break; } case ec_ai_selected: { set_last_string(get_audio_input()->label()); break; } case ec_ai_index_select: { if (first_action_argument_as_string().size() > 0) { select_audio_input_by_index(first_action_argument_as_int()); } break; } case ec_ai_attach: { attach_audio_input(); break; } case ec_ai_forward: { audio_input_as_selected(); forward_audio_object(first_action_argument_as_float()); break; } case ec_ai_rewind: { audio_input_as_selected(); rewind_audio_object(first_action_argument_as_float()); break; } case ec_ai_set_position: { audio_input_as_selected(); set_audio_object_position(first_action_argument_as_float()); break; } case ec_ai_set_position_samples: { audio_input_as_selected(); set_audio_object_position_samples(first_action_argument_as_long_int()); break; } case ec_ai_get_position: { set_last_float(get_audio_input()->position().seconds()); break; } case ec_ai_get_position_samples: { set_last_long_integer(get_audio_input()->position().samples()); break; } case ec_ai_get_length: { set_last_float(get_audio_input()->length().seconds()); break; } case ec_ai_get_length_samples: { set_last_long_integer(get_audio_input()->length().samples()); break; } case ec_ai_get_format: { set_last_string(get_audio_input()->format_string() + "," + kvu_numtostr(get_audio_input()->channels()) + "," + kvu_numtostr(get_audio_input()->samples_per_second())); break; } case ec_ai_wave_edit: { audio_input_as_selected(); wave_edit_audio_object(); break; } // --- // Audio output objects // --- case ec_ao_add: { if (first_action_argument_as_string().size() == 0) add_default_output(); else add_audio_output(first_action_argument_as_string()); break; } case ec_ao_add_default: { add_default_output(); break; } case ec_ao_describe: { set_last_string(ECA_OBJECT_FACTORY::audio_object_to_eos(selected_audio_output_repp, "o")); break; } case ec_ao_remove: { remove_audio_output(); break; } case ec_ao_list: { set_last_string_list(audio_output_names()); break; } case ec_ao_select: { select_audio_output(first_action_argument_as_string()); break; } case ec_ao_selected: { set_last_string(get_audio_output()->label()); break; } case ec_ao_index_select: { select_audio_output_by_index(first_action_argument_as_int()); break; } case ec_ao_attach: { attach_audio_output(); break; } case ec_ao_forward: { audio_output_as_selected(); forward_audio_object(first_action_argument_as_float()); break; } case ec_ao_rewind: { audio_output_as_selected(); rewind_audio_object(first_action_argument_as_float()); break; } case ec_ao_set_position: { audio_output_as_selected(); set_audio_object_position(first_action_argument_as_float()); break; } case ec_ao_set_position_samples: { audio_output_as_selected(); set_audio_object_position_samples(first_action_argument_as_long_int()); break; } case ec_ao_get_position: { set_last_float(get_audio_output()->position().seconds()); break; } case ec_ao_get_position_samples: { set_last_long_integer(get_audio_output()->position().samples()); break; } case ec_ao_get_length: { set_last_float(get_audio_output()->length().seconds()); break; } case ec_ao_get_length_samples: { set_last_long_integer(get_audio_output()->length().samples()); break; } case ec_ao_get_format: { set_last_string(get_audio_output()->format_string() + "," + kvu_numtostr(get_audio_output()->channels()) + "," + kvu_numtostr(get_audio_output()->samples_per_second())); break; } case ec_ao_wave_edit: { audio_output_as_selected(); wave_edit_audio_object(); break; } // --- // Chain operators // --- case ec_cop_add: { add_chain_operator(first_action_argument_as_string()); break; } case ec_cop_bypass: { bypass_chain_operator(first_action_argument_as_string()); break; } case ec_cop_describe: { const CHAIN_OPERATOR *t = get_chain_operator(); set_last_string(t == 0 ? "" : ECA_OBJECT_FACTORY::chain_operator_to_eos(t)); break; } case ec_cop_remove: { remove_chain_operator(); break; } case ec_cop_list: { set_last_string_list(chain_operator_names()); break; } case ec_cop_is_bypassed: { set_last_integer(chain_operator_is_bypassed()); break; } case ec_cop_select: { select_chain_operator(first_action_argument_as_int()); break; } case ec_cop_selected: { set_last_integer(selected_chain_operator()); break; } case ec_cop_set: { vector a = kvu_string_to_vector(first_action_argument_as_string(), ','); if (a.size() < 3) { set_last_error("Not enough parameters!"); break; } int id1 = atoi(a[0].c_str()); int id2 = atoi(a[1].c_str()); CHAIN_OPERATOR::parameter_t v = atof(a[2].c_str()); bool valid = action_helper_check_cop_op_args(id1, id2); if (valid == true) { select_chain_operator(id1); select_chain_operator_parameter(id2); set_chain_operator_parameter(v); } // note: helper func sets the error string if needed break; } case ec_cop_get: { vector a = kvu_string_to_vector(first_action_argument_as_string(), ','); if (a.size() < 2) { set_last_error("Not enough parameters!"); break; } int id1 = atoi(a[0].c_str()); int id2 = atoi(a[1].c_str()); bool valid = action_helper_check_cop_op_args(id1, id2); if (valid == true) { select_chain_operator(id1); select_chain_operator_parameter(id2); set_last_float(get_chain_operator_parameter()); } // note: helper func sets the error string if needed break; } case ec_cop_status: { set_last_string(chain_operator_status()); break; } // --- // Chain operator parameters // --- case ec_copp_list: { set_last_string_list(chain_operator_parameter_names()); break; } case ec_copp_select: { select_chain_operator_parameter(first_action_argument_as_int()); break; } case ec_copp_selected: { set_last_integer(selected_chain_operator_parameter()); break; } case ec_copp_set: { set_chain_operator_parameter(first_action_argument_as_float()); break; } case ec_copp_get: { set_last_float(get_chain_operator_parameter()); break; } // --- // Controllers // --- case ec_ctrl_add: { add_controller(first_action_argument_as_string()); break; } case ec_ctrl_describe: { const GENERIC_CONTROLLER *t = get_controller(); set_last_string(t == 0 ? "" : ECA_OBJECT_FACTORY::controller_to_eos(t)); break; } case ec_ctrl_remove: { remove_controller(); break; } case ec_ctrl_list: { set_last_string_list(controller_names()); break; } case ec_ctrl_select: { select_controller(first_action_argument_as_int()); break; } case ec_ctrl_selected: { set_last_integer(selected_controller()); break; } case ec_ctrl_status: { set_last_string(controller_status()); break; } case ec_ctrl_get_target: { set_last_integer(selected_controller_target()); break; } // --- // Controller parameters // --- case ec_ctrlp_list: { set_last_string_list(controller_parameter_names()); break; } case ec_ctrlp_select: { select_controller_parameter(first_action_argument_as_int()); break; } case ec_ctrlp_selected: { set_last_integer(selected_controller_parameter()); break; } case ec_ctrlp_get: { set_last_float(get_controller_parameter()); break; } case ec_ctrlp_set: { set_controller_parameter(first_action_argument_as_float()); break; } case ec_cop_register: { cop_register(); break; } case ec_preset_register: { preset_register(); break; } case ec_ladspa_register: { ladspa_register(); break; } case ec_lv2_register: { lv2_register(); break; } case ec_ctrl_register: { ctrl_register(); break; } case ec_map_cop_list: { cop_descriptions(); break; } case ec_map_preset_list: { preset_descriptions(); break; } case ec_map_ladspa_list: { ladspa_descriptions(false); break; } case ec_map_ladspa_id_list: { ladspa_descriptions(true); break; } case ec_map_lv2_list: { lv2_descriptions(); break; } case ec_map_ctrl_list: { ctrl_descriptions(); break; } // --- // Engine commands // --- case ec_engine_launch: { if (is_engine_ready_for_commands() != true) engine_start(); else set_last_error("Engine already running, use 'engine-halt' first."); break; } case ec_engine_halt: { if (is_engine_ready_for_commands() == true) close_engine(); else set_last_error("Engine not running, use 'engine-launch' first."); break; } case ec_engine_status: { set_last_string(engine_status()); break; } // --- // Internal commands // --- case ec_int_cmd_list: { set_last_string_list(registered_commands_list()); break; } case ec_int_log_history: { set_last_string(ECA_LOGGER::instance().log_history()); break; } case ec_int_output_mode_wellformed: { ECA_LOGGER::attach_logger(new ECA_LOGGER_WELLFORMED()); wellformed_mode_rep = true; break; } case ec_int_set_float_to_string_precision: { set_float_to_string_precision(first_action_argument_as_int()); break; } case ec_int_set_log_history_length: { ECA_LOGGER::instance().set_log_history_length(first_action_argument_as_int()); break; } case ec_int_version_string: { set_last_string(ecasound_library_version); break; } case ec_int_version_lib_current: { set_last_integer(ecasound_library_version_current); break; } case ec_int_version_lib_revision: { set_last_integer(ecasound_library_version_revision); break; } case ec_int_version_lib_age: { set_last_integer(ecasound_library_version_age); break; } // --- // Dump commands // --- case ec_dump_target: { ctrl_dump_rep.set_dump_target(first_action_argument_as_string()); break; } case ec_dump_status: { ctrl_dump_rep.dump_status(); break; } case ec_dump_position: { ctrl_dump_rep.dump_position(); break; } case ec_dump_length: { ctrl_dump_rep.dump_length(); break; } case ec_dump_cs_status: { ctrl_dump_rep.dump_chainsetup_status(); break; } case ec_dump_c_selected: { ctrl_dump_rep.dump_selected_chain(); break; } case ec_dump_ai_selected: { ctrl_dump_rep.dump_selected_audio_input(); break; } case ec_dump_ai_position: { ctrl_dump_rep.dump_audio_input_position(); break; } case ec_dump_ai_length: { ctrl_dump_rep.dump_audio_input_length(); break; } case ec_dump_ai_open_state: { ctrl_dump_rep.dump_audio_input_open_state(); break; } case ec_dump_ao_selected: { ctrl_dump_rep.dump_selected_audio_output(); break; } case ec_dump_ao_position: { ctrl_dump_rep.dump_audio_output_position(); break; } case ec_dump_ao_length: { ctrl_dump_rep.dump_audio_output_length(); break; } case ec_dump_ao_open_state: { ctrl_dump_rep.dump_audio_output_open_state(); break; } case ec_dump_cop_value: { vector temp = kvu_string_to_vector(first_action_argument_as_string(), ','); if (temp.size() > 1) { ctrl_dump_rep.dump_chain_operator_value(atoi(temp[0].c_str()), atoi(temp[1].c_str())); } break; } // --- // Commands with external dependencies // --- #if ECA_COMPILE_JACK case ec_jack_connect: { const vector& params = action_arguments_as_vector(); if (params.size() >= 2) JACK_CONNECTIONS::connect(params[0].c_str(), params[1].c_str()); break; } case ec_jack_disconnect: { const vector& params = action_arguments_as_vector(); if (params.size() >= 2) JACK_CONNECTIONS::disconnect(params[0].c_str(), params[1].c_str()); break; } case ec_jack_list_connections: { string foo; if (JACK_CONNECTIONS::list_connections(&foo) == true) set_last_string(foo); else set_last_error("Unable to a list of JACK connections."); break; } #endif } // <-- switch-case if (action_reconnect == true) { if (is_selected() == false || is_valid() == false) { set_last_error("Can't reconnect chainsetup."); } else { connect_chainsetup(0); if (selected_chainsetup() != connected_chainsetup()) { set_last_error("Can't reconnect chainsetup."); } else { if (action_restart == true) { DBC_CHECK(is_running() != true); start(); } } } } } /** * Executes chainsetup edit on connect chainsetup. * * @pre is_connected() */ bool ECA_CONTROL::execute_edit_on_connected(const chainsetup_edit_t& edit) { DBC_REQUIRE(is_connected() == true); bool retval = false; if (is_engine_ready_for_commands() == true) { ECA_ENGINE::complex_command_t engine_cmd; engine_cmd.type = ECA_ENGINE::ep_exec_edit; engine_cmd.cs = edit; engine_repp->command(engine_cmd); retval = true; } else { /* note: engine not yet running, execute edit directly */ retval = session_repp->connected_chainsetup_repp->execute_edit(edit); } return retval; } /** * Executes chainsetup edit on selected chainsetup. * * @param edit object specifying the edit action * @param index if non-negative, override the chainsetup selection */ bool ECA_CONTROL::execute_edit_on_selected(const chainsetup_edit_t& edit, int index) { bool retval = false; ECA_CHAINSETUP *csetup = 0; if (index < 0) { csetup = selected_chainsetup_repp; } else { if (index >= 0 && index < static_cast(session_repp->chainsetups_rep.size())) { csetup = session_repp->chainsetups_rep[index]; } } /* note: make sure that if the selected chainsetup is * in use by the engine, the edit is performed * by the engine thread! */ if (csetup != 0) { if (csetup->is_enabled() == true && is_engine_ready_for_commands() == true) { execute_edit_on_connected(edit); } else { csetup->execute_edit(edit); } } return retval; } void ECA_CONTROL::print_last_value(struct eci_return_value *retval) const { std::string result; if (retval->type == eci_return_value::retval_error) { result += "ERROR: "; } result += ECA_CONTROL_MAIN::return_value_to_string(retval); if (wellformed_mode_rep != true) { if (result.size() > 0) ECA_LOG_MSG(ECA_LOGGER::eiam_return_values, result); } else { /* in wellformed-output-mode we always create return output */ ECA_LOG_MSG(ECA_LOGGER::eiam_return_values, std::string(return_value_type_to_string(retval)) + " " + result); } } string ECA_CONTROL::chainsetup_details_to_string(const ECA_CHAINSETUP* cs) const { string result; vector::const_iterator chain_citer; result += "\n -> Objects..: " + kvu_numtostr(cs->inputs.size()); result += " inputs, " + kvu_numtostr(cs->outputs.size()); result += " outputs, " + kvu_numtostr(cs->chains.size()); result += " chains"; // FIXME: add explanations on why the chainsetup cannot be // connected result += "\n -> State....: "; if (cs->is_locked()) { result += "connected to engine (engine status: "; result += engine_status() + ")"; } else if (cs->is_enabled() && is_engine_created() == true) { result += "connected (engine status: "; result += engine_status() + ")"; } else if (cs->is_enabled()) result += "connected (engine not yet running)"; else if (cs->is_valid()) result += "valid (can be connected)"; else result += "not valid (cannot be connected)"; result += "\n -> Position.: "; result += kvu_numtostr(cs->position_in_seconds_exact(), 3); result += " / "; if (cs->length_set()) result += kvu_numtostr(cs->length_in_seconds_exact(), 3); else result += "inf"; result += "\n -> Options..: "; result += cs->options_to_string(); for(chain_citer = cs->chains.begin(); chain_citer != cs->chains.end();) { result += "\n -> Chain \"" + (*chain_citer)->name() + "\": "; int idx = (*chain_citer)->connected_input(); if (idx >= 0) result += ECA_OBJECT_FACTORY::audio_object_to_eos(cs->inputs[idx], "i"); result += " "; result += (*chain_citer)->to_string(); idx = (*chain_citer)->connected_output(); if (idx >= 0) result += ECA_OBJECT_FACTORY::audio_object_to_eos(cs->outputs[idx], "o"); ++chain_citer; } return result; } string ECA_CONTROL::chainsetup_status(void) const { vector::const_iterator cs_citer = session_repp->chainsetups_rep.begin(); int index = 0; string result ("### Chainsetup status ###\n"); while(cs_citer != session_repp->chainsetups_rep.end()) { result += "Chainsetup (" + kvu_numtostr(++index) + ") \""; result += (*cs_citer)->name() + "\" "; if (*cs_citer == selected_chainsetup_repp) result += "[selected] "; if (*cs_citer == session_repp->connected_chainsetup_repp) result += "[connected] "; if ((*cs_citer == selected_chainsetup_repp) || (*cs_citer == session_repp->connected_chainsetup_repp)) result += chainsetup_details_to_string((*cs_citer)); else result += ": "; ++cs_citer; if (cs_citer != session_repp->chainsetups_rep.end()) result += "\n"; } return result; } string ECA_CONTROL::chain_status(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- MESSAGE_ITEM mitem; vector::const_iterator chain_citer; const vector& schains = selected_chainsetup_repp->selected_chains(); mitem << "### Chain status (chainsetup '" << selected_chainsetup() << "') ###\n"; for(chain_citer = selected_chainsetup_repp->chains.begin(); chain_citer != selected_chainsetup_repp->chains.end();) { mitem << "Chain \"" << (*chain_citer)->name() << "\" "; if ((*chain_citer)->is_muted()) mitem << "[muted] "; if ((*chain_citer)->is_bypassed()) mitem << "[bypassed] "; if (find(schains.begin(), schains.end(), (*chain_citer)->name()) != schains.end()) mitem << "[selected] "; for(int n = 0; n < (*chain_citer)->number_of_chain_operators(); n++) { mitem << "\"" << (*chain_citer)->get_chain_operator(n)->name() << "\""; if (n == (*chain_citer)->number_of_chain_operators()) mitem << " -> "; } ++chain_citer; if (chain_citer != selected_chainsetup_repp->chains.end()) mitem << "\n"; } return mitem.to_string(); } string ECA_CONTROL::chain_operator_status(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- MESSAGE_ITEM msg; string st_info_string; vector::const_iterator chain_citer = selected_chainsetup_repp->chains.begin(); msg << "### Chain operator status (chainsetup '" << selected_chainsetup() << "') ###\n"; while(chain_citer != selected_chainsetup_repp->chains.end()) { msg << "Chain \"" << (*chain_citer)->name() << "\":\n"; for(int p = 0; p < (*chain_citer)->number_of_chain_operators(); p++) { const CHAIN_OPERATOR* cop = (*chain_citer)->get_chain_operator(p); msg << "\t"; msg << p + 1 << ". "; msg << cop->name(); if ((*chain_citer)->is_operator_bypassed(p + 1)) msg << " (BYPASSED)"; for(int n = 0; n < cop->number_of_params(); n++) { if (n == 0) msg << ": "; msg << "[" << n + 1 << "] "; msg << cop->get_parameter_name(n + 1); msg << " "; msg << float_to_string(cop->get_parameter(n + 1)); if (n + 1 < cop->number_of_params()) msg << ", "; } st_info_string = cop->status(); if (st_info_string.empty() == false) { msg << "\n\tStatus info:\n" << st_info_string; } if (p + 1 < (*chain_citer)->number_of_chain_operators()) msg << "\n"; } ++chain_citer; if (chain_citer != selected_chainsetup_repp->chains.end()) msg << "\n"; } return msg.to_string(); } string ECA_CONTROL::controller_status(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- MESSAGE_ITEM mitem; string st_info_string; vector::const_iterator chain_citer; mitem << "### Controller status (chainsetup '" << selected_chainsetup() << "') ###\n"; for(chain_citer = selected_chainsetup_repp->chains.begin(); chain_citer != selected_chainsetup_repp->chains.end();) { mitem << "Chain \"" << (*chain_citer)->name() << "\":\n"; for(int p = 0; p < (*chain_citer)->number_of_controllers(); p++) { const GENERIC_CONTROLLER* gtrl = (*chain_citer)->get_controller(p); mitem << "\t" << p + 1 << ". " << gtrl->name() << ": "; for(int n = 0; n < gtrl->number_of_params(); n++) { mitem << "\n\t\t[" << n + 1 << "] "; mitem << gtrl->get_parameter_name(n + 1); mitem << " "; mitem << float_to_string(gtrl->get_parameter(n + 1)); if (n + 1 < gtrl->number_of_params()) mitem << ", "; } st_info_string = gtrl->status(); if (st_info_string.empty() == false) { mitem << "\n\t -- Status info: " << st_info_string; } if (p + 1 < (*chain_citer)->number_of_controllers()) mitem << "\n"; } ++chain_citer; if (chain_citer != selected_chainsetup_repp->chains.end()) mitem << "\n"; } return mitem.to_string(); } string ECA_CONTROL::aio_status(void) const { // -------- DBC_REQUIRE(is_selected() == true); // -------- string st_info_string; vector::size_type adev_sizet = 0; vector::const_iterator adev_citer = selected_chainsetup_repp->inputs.begin(); st_info_string += "### Audio input/output status (chainsetup '" + selected_chainsetup() + "') ###\n"; while(adev_citer != selected_chainsetup_repp->inputs.end()) { st_info_string += "Input (" + kvu_numtostr(adev_sizet + 1) + "): \""; for(int n = 0; n < (*adev_citer)->number_of_params(); n++) { st_info_string += (*adev_citer)->get_parameter(n + 1); if (n + 1 < (*adev_citer)->number_of_params()) st_info_string += ","; } st_info_string += "\" - [" + (*adev_citer)->name() + "]"; if ((*adev_citer) == selected_audio_input_repp) st_info_string += " [selected]"; st_info_string += "\n -> connected to chains \""; vector temp = selected_chainsetup_repp->get_attached_chains_to_input((selected_chainsetup_repp->inputs)[adev_sizet]); vector::const_iterator p = temp.begin(); while (p != temp.end()) { st_info_string += *p; ++p; if (p != temp.end()) st_info_string += ","; } st_info_string += "\": " + (*adev_citer)->status() + "\n"; ++adev_sizet; ++adev_citer; } adev_sizet = 0; adev_citer = selected_chainsetup_repp->outputs.begin(); while(adev_citer != selected_chainsetup_repp->outputs.end()) { st_info_string += "Output (" + kvu_numtostr(adev_sizet + 1) + "): \""; for(int n = 0; n < (*adev_citer)->number_of_params(); n++) { st_info_string += (*adev_citer)->get_parameter(n + 1); if (n + 1 < (*adev_citer)->number_of_params()) st_info_string += ","; } st_info_string += "\" - [" + (*adev_citer)->name() + "]"; if ((*adev_citer) == selected_audio_output_repp) st_info_string += " [selected]"; st_info_string += "\n -> connected to chains \""; vector temp = selected_chainsetup_repp->get_attached_chains_to_output((selected_chainsetup_repp->outputs)[adev_sizet]); vector::const_iterator p = temp.begin(); while (p != temp.end()) { st_info_string += *p; ++p; if (p != temp.end()) st_info_string += ","; } st_info_string += "\": "; st_info_string += (*adev_citer)->status(); ++adev_sizet; ++adev_citer; if (adev_sizet < selected_chainsetup_repp->outputs.size()) st_info_string += "\n"; } return st_info_string; } void ECA_CONTROL::aio_register(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Registered audio object types:\n"); string result (eca_aio_register_sub(ECA_OBJECT_FACTORY::audio_io_nonrt_map())); result += "\n"; result += eca_aio_register_sub(ECA_OBJECT_FACTORY::audio_io_rt_map()); set_last_string(result); } static string eca_aio_register_sub(ECA_OBJECT_MAP& objmap) { string result; const list& objlist = objmap.registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { string temp; const AUDIO_IO* q = dynamic_cast(objmap.object_expr(*p)); DBC_CHECK(q != 0); if (q != 0) { int params = q->number_of_params(); if (params > 0) { temp += ": "; for(int n = 0; n < params; n++) { temp += q->get_parameter_name(n + 1); if (n + 1 < params) temp += ","; } } result += kvu_numtostr(count) + ". " + q->name() + ", regex: " + objmap.keyword_to_expr(*p) + ", params" + temp; result += "\n"; ++count; } // else std::cerr << "Failed obj: " << *p << "." << std::endl; ++p; } return result; } void ECA_CONTROL::cop_register(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Registered chain operators:\n"); string result; const list& objlist = ECA_OBJECT_FACTORY::chain_operator_map().registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { string temp; const CHAIN_OPERATOR* q = dynamic_cast(ECA_OBJECT_FACTORY::chain_operator_map().object(*p)); if (q != 0) { int params = q->number_of_params(); for(int n = 0; n < params; n++) { if (n == 0) temp += ":"; temp += q->get_parameter_name(n + 1); if (n + 1 < params) temp += ","; } result += kvu_numtostr(count) + ". " + q->name() + ", -" + *p + temp; result += "\n"; ++count; } ++p; } set_last_string(result); } void ECA_CONTROL::preset_register(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Registered effect presets:\n"); string result; #ifndef ECA_DISABLE_EFFECTS const list& objlist = ECA_OBJECT_FACTORY::preset_map().registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { string temp; const PRESET* q = dynamic_cast(ECA_OBJECT_FACTORY::preset_map().object(*p)); if (q != 0) { int params = q->number_of_params(); for(int n = 0; n < params; n++) { if (n == 0) temp += ":"; temp += q->get_parameter_name(n + 1); if (n + 1 < params) temp += ","; } result += kvu_numtostr(count) + ". " + q->name() + ", -pn:" + *p + temp; result += "\n"; ++count; } ++p; } #endif set_last_string(result); } void ECA_CONTROL::ladspa_register(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Registered LADSPA plugins:\n"); string result; #ifndef ECA_DISABLE_EFFECTS const list& objlist = ECA_OBJECT_FACTORY::ladspa_plugin_map().registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { const EFFECT_LADSPA* q = dynamic_cast(ECA_OBJECT_FACTORY::ladspa_plugin_map().object(*p)); if (q != 0) { string temp = "\n\t-el:" + q->unique() + ","; int params = q->number_of_params(); for(int n = 0; n < params; n++) { temp += "'" + q->get_parameter_name(n + 1) + "'"; if (n + 1 < params) temp += ","; } result += kvu_numtostr(count) + ". " + q->name() + "" + temp; result += "\n"; ++count; } ++p; } #endif set_last_string(result); } void ECA_CONTROL::lv2_register(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Registered LV2 plugins:\n"); string result; #if !defined(ECA_DISABLE_EFFECTS) && defined(ECA_USE_LIBLILV) const list& objlist = ECA_OBJECT_FACTORY::lv2_plugin_map().registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { const EFFECT_LV2* q = dynamic_cast(ECA_OBJECT_FACTORY::lv2_plugin_map().object(*p)); if (q != 0) { string temp = "\n\t-elv2:" + q->unique() + ","; int params = q->number_of_params(); for(int n = 0; n < params; n++) { temp += "'" + q->get_parameter_name(n + 1) + "'"; if (n + 1 < params) temp += ","; } result += kvu_numtostr(count) + ". " + q->name() + "" + temp; result += "\n"; ++count; } ++p; } #endif set_last_string(result); } void ECA_CONTROL::ctrl_register(void) { ECA_LOG_MSG(ECA_LOGGER::info, "Registered controllers:\n"); string result; const list& objlist = ECA_OBJECT_FACTORY::controller_map().registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { string temp; const GENERIC_CONTROLLER* q = dynamic_cast(ECA_OBJECT_FACTORY::controller_map().object(*p)); if (q != 0) { int params = q->number_of_params(); for(int n = 0; n < params; n++) { if (n == 0) temp += ":"; temp += q->get_parameter_name(n + 1); if (n + 1 < params) temp += ","; } result += kvu_numtostr(count) + ". " + q->name() + ", -" + *p + temp; result += "\n"; ++count; } ++p; } set_last_string(result); } /** * Print description of all chain operators and * their parameters. */ void ECA_CONTROL::operator_descriptions_helper(const ECA_OBJECT_MAP& arg, string* result) { /* switch to "C" locale to avoid strange floating point * presentations that could break the output format * (for example "a,b" insteof of "a.b" */ #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) string old_locale (setlocale(LC_ALL, "C")); #endif const list& objlist = arg.registered_objects(); list::const_iterator p = objlist.begin(); int count = 1; while(p != objlist.end()) { string temp; const OPERATOR* q = dynamic_cast(arg.object(*p)); if (q != 0) { /* FIXME: prefer backslash escaped over '_' to handle commas */ /* 1. keyword */ *result += kvu_string_search_and_replace(*p, ',', '_'); /* 2. name */ *result += "," + kvu_string_search_and_replace(q->name(), ',', '_'); /* 3. description */ *result += "," + kvu_string_search_and_replace(q->description(), ',', '_'); int params = q->number_of_params(); /* 4. number of params */ *result += "," + kvu_numtostr(params); /* 5. description of params (for all params) */ for(int n = 0; n < params; n++) { struct OPERATOR::PARAM_DESCRIPTION pd; q->parameter_description(n + 1, &pd); /* 5.1 name of param */ *result += "," + kvu_string_search_and_replace(q->get_parameter_name(n + 1), ',', '_'); /* 5.2 description */ *result += "," + kvu_string_search_and_replace(pd.description, ',', '_'); /* 5.3 default value */ *result += "," + float_to_string(pd.default_value); /* 5.4 is bounded above (1=yes, 0=no) */ *result += ",above=" + kvu_numtostr(static_cast(pd.bounded_above)); /* 5.5 upper bound */ *result += ",upper=" + float_to_string(pd.upper_bound); /* 5.6 is bounded below (1=yes, 0=no) */ *result += ",below=" + kvu_numtostr(static_cast(pd.bounded_below)); /* 5.7 lower bound */ *result += ",lower=" + float_to_string(pd.lower_bound); /* 5.8. is toggled (1=yes, 0=no) */ *result += "," + kvu_numtostr(static_cast(pd.toggled)); /* 5.9. is integer value (1=yes, 0=no) */ *result += "," + kvu_numtostr(static_cast(pd.integer)); /* 5.10. is logarithmis value (1=yes, 0=no) */ *result += "," + kvu_numtostr(static_cast(pd.logarithmic)); /* 5.11. is output value (1=yes, 0=no) */ *result += ",output=" + kvu_numtostr(static_cast(pd.output)); } *result += "\n"; ++count; } ++p; } /* see above */ #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) setlocale(LC_ALL, old_locale.c_str()); #endif } /** * Print the description of all chain operators and * their parameters. */ void ECA_CONTROL::cop_descriptions(void) { string result; operator_descriptions_helper(ECA_OBJECT_FACTORY::chain_operator_map(), &result); set_last_string(result); } /** * Prints the description of all effect presets and * their parameters. */ void ECA_CONTROL::preset_descriptions(void) { string result; operator_descriptions_helper(ECA_OBJECT_FACTORY::preset_map(), &result); set_last_string(result); } /** * Prints the description of all LADSPA plugins and * their parameters. */ void ECA_CONTROL::ladspa_descriptions(bool use_id) { string result; if (use_id) { operator_descriptions_helper(ECA_OBJECT_FACTORY::ladspa_plugin_id_map(), &result); } else { operator_descriptions_helper(ECA_OBJECT_FACTORY::ladspa_plugin_map(), &result); } set_last_string(result); } /** * Prints the description of all LV2 plugins and * their parameters. */ void ECA_CONTROL::lv2_descriptions() { string result; operator_descriptions_helper(ECA_OBJECT_FACTORY::lv2_plugin_map(), &result); set_last_string(result); } /** * Print the description of all controllers and * their parameters. */ void ECA_CONTROL::ctrl_descriptions(void) { string result; operator_descriptions_helper(ECA_OBJECT_FACTORY::controller_map(), &result); set_last_string(result); } ecasound-2.9.3/libecasound/eca-chainsetup-parser.cpp0000644000076400007640000010300711740524567017452 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup-parser.cpp: Functionality for parsing chainsetup // option syntax. // Copyright (C) 2001-2006 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include /* find() */ #include /* DBC_* */ #include #include #include #include "audioio.h" #include "file-preset.h" #include "global-preset.h" #include "midiio.h" #include "midi-client.h" #include "midi-server.h" #include "generic-controller.h" #include "eca-chain.h" #include "eca-logger.h" #include "eca-object-factory.h" #include "eca-preset-map.h" #include "eca-chainsetup.h" #include "eca-chainsetup-parser.h" #include "eca-chainsetup-bufparams.h" using std::string; ECA_CHAINSETUP_PARSER::ECA_CHAINSETUP_PARSER(ECA_CHAINSETUP* csetup) : csetup_repp(csetup), last_audio_add_vector_repp(0) { } /** * Interprets one option. This is the most generic variant of * the interpretation routines; both global and object specific * options are handled. * * @pre argu.size() > 0 * @pre argu[0] == '-' * * @post (option successfully interpreted && interpret_result() == true) || * (unknown or invalid option && interpret_result() != true) */ void ECA_CHAINSETUP_PARSER::interpret_option (const string& arg) { interpret_entry(); istatus_rep = false; interpret_global_option(arg); if (istatus_rep != true) interpret_object_option(arg); interpret_exit(arg); } /** * Interprets one option. All non-global options are ignored. Global * options can be interpreted multiple times and in any order. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @post (option successfully interpreted && interpretation_result() == true) || * (unknown or invalid option && interpretation_result() == false) */ void ECA_CHAINSETUP_PARSER::interpret_global_option (const string& arg) { interpret_entry(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Interpreting global option \"" + arg + "\"."); if (istatus_rep == false) interpret_general_option(arg); if (istatus_rep == false) interpret_processing_control(arg); if (istatus_rep == false) interpret_chains(arg); interpret_exit(arg); } /** * Interprets one option. All options not directly related to * ecasound objects are ignored. * * @pre argu.size() > 0 * @pre argu[0] == '-' * * @post (option successfully interpreted && interpretation_result() == true) || * (unknown or invalid option && interpretation_result() == false) */ void ECA_CHAINSETUP_PARSER::interpret_object_option (const string& arg) { interpret_entry(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Interpreting object option \"" + arg + "\"."); interpret_chains(arg); if (istatus_rep == false) interpret_audio_format(arg); if (istatus_rep == false) interpret_audioio_device(arg); if (istatus_rep == false) interpret_audioio_manager(arg); if (istatus_rep == false) interpret_midi_device(arg); if (istatus_rep == false) interpret_chain_operator(arg); if (istatus_rep == false) interpret_controller(arg); interpret_exit(arg); } /** * Interpret a vector of options. */ void ECA_CHAINSETUP_PARSER::interpret_options(const std::vector& opts) { int optcount = static_cast(opts.size()); int global_matches = 0; int other_matches = 0; interpret_set_result(true, ""); /* if opts.size() == 0 */ /* * phase1: parse global options only */ std::vector::const_iterator p = opts.begin(); while(p != opts.end()) { interpret_global_option(*p); /* note! below we make sure we don't calculate chain * definitions twice */ if (interpret_match_found() == true && !((*p)[0] == '-' && (*p)[1] == 'a')) global_matches++; ++p; } if (csetup_repp->chains.size() == 0) csetup_repp->add_default_chain(); /* * phase2: parse all options, including processing * the global options again */ p = opts.begin(); while(p != opts.end()) { interpret_object_option(*p); if (interpret_match_found() == true) { other_matches++; if (interpret_result() != true) { /* invalid option format */ break; } } else { /* hack to avoid printing the same info multiple times */ int dlevel = ECA_LOGGER::instance().get_log_level_bitmask(); ECA_LOGGER::instance().disable(); interpret_global_option(*p); ECA_LOGGER::instance().set_log_level_bitmask(dlevel); if (interpret_match_found() != true) { interpret_set_result(false, string("Invalid argument, unable to parse: \"") + *p + "\""); break; } else { if (interpret_result() != true) { /* invalid option format */ break; } } } ++p; } if (other_matches + global_matches != optcount) { ECA_LOG_MSG(ECA_LOGGER::info, string("WARNING: Only ") + kvu_numtostr(other_matches) + "+" + kvu_numtostr(global_matches) + " of the expected " + kvu_numtostr(optcount) + " parameters were recognized successfully."); } } void ECA_CHAINSETUP_PARSER::reset_interpret_status(void) { istatus_rep = false; } /** * Preprocesses a set of options. * * Notes! See also ECA_SESSION::preprocess_options() * * @post all options valid for interpret_option() */ void ECA_CHAINSETUP_PARSER::preprocess_options(std::vector& opts) const { std::vector::iterator p = opts.begin(); while(p != opts.end()) { /* handle options not starting with an '-' sign */ if (p->size() > 0 && (*p)[0] != '-') { /* hack1: rest as "-i:file" */ ECA_LOG_MSG(ECA_LOGGER::info, "NOTE: Interpreting option " + *p + " as -i:" + *p + "."); *p = "-i:" + *p; } ++p; } } /** * Resets the interpretation logic. * * @post interpret_status() != true */ void ECA_CHAINSETUP_PARSER::interpret_entry(void) { istatus_rep = false; interpret_set_result(true, ""); DBC_ENSURE(interpret_match_found() != true); } /** * Exits the interpretation logic. * * @post interpret_result() == true && interpret_result_verbose() == "" || * interpret_result() == false && interpret_result_verbose() != "" */ void ECA_CHAINSETUP_PARSER::interpret_exit(const string& arg) { if (istatus_rep != true) { /* option 'arg' was not found */ interpret_set_result(false, string("Interpreting option \"") + arg + "\" failed."); } else { /* option 'arg' was found, but incorrect */ if (interpret_result() != true) { if (interpret_result_verbose() == "") { interpret_set_result(false, string("Interpreting option \"") + arg + "\" failed."); } /* else -> otherwise error code is already set */ } } DBC_ENSURE((interpret_result() == true && interpret_result_verbose() == "") || (interpret_result() == false && interpret_result_verbose() != "")); } /** * Handle general options. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_general_option (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); DBC_REQUIRE(csetup_repp->is_enabled() != true); // -------- bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 'b': { int bsize = atoi(kvu_get_argument_number(1, argu).c_str()); if (bsize > 0) { csetup_repp->set_buffersize(bsize); MESSAGE_ITEM mitemb; mitemb << "Setting buffersize to (samples) " << bsize << "."; ECA_LOG_MSG(ECA_LOGGER::info, mitemb.to_string()); } else { ECA_LOG_MSG(ECA_LOGGER::info, "Invalid buffersize given; using default value."); } break; } case 'B': { string temp = kvu_get_argument_number(1, argu); if (temp == "auto") { csetup_repp->set_buffering_mode(ECA_CHAINSETUP::cs_bmode_auto); ECA_LOG_MSG(ECA_LOGGER::info, "Buffering mode is selected automatically."); } else if (temp == "nonrt") { csetup_repp->set_buffering_mode(ECA_CHAINSETUP::cs_bmode_nonrt); ECA_LOG_MSG(ECA_LOGGER::info, "Buffering mode 'nonrt' selected."); } else if (temp == "rt") { csetup_repp->set_buffering_mode(ECA_CHAINSETUP::cs_bmode_rt); ECA_LOG_MSG(ECA_LOGGER::info, "Buffering mode 'rt' selected."); } else if (temp == "rtlowlatency") { csetup_repp->set_buffering_mode(ECA_CHAINSETUP::cs_bmode_rtlowlatency); ECA_LOG_MSG(ECA_LOGGER::info, "Buffering mode 'rtlowlatency' selected."); } else { csetup_repp->set_buffering_mode(ECA_CHAINSETUP::cs_bmode_auto); ECA_LOG_MSG(ECA_LOGGER::info, "Unknown buffering mode; 'auto' mode is used instead."); } break; } case 'n': { csetup_repp->set_name(kvu_get_argument_number(1, argu)); ECA_LOG_MSG(ECA_LOGGER::info, "Setting chainsetup name to \"" + csetup_repp->name() + "\"."); break; } case 'r': { int prio = ::atoi(kvu_get_argument_number(1, argu).c_str()); if (prio < 0) { ECA_LOG_MSG(ECA_LOGGER::info, "Raised-priority mode disabled."); csetup_repp->toggle_raised_priority(false); } else { if (prio == 0) prio = 50; csetup_repp->set_sched_priority(prio); ECA_LOG_MSG(ECA_LOGGER::info, "Raised-priority mode enabled. (prio:" + kvu_numtostr(prio) + ")"); csetup_repp->toggle_raised_priority(true); } break; } case 's': { if (argu.size() > 2 && argu[2] == 'r') { ECA_LOG_MSG(ECA_LOGGER::info, "Option '-sr' is obsolete. Use syntax '-f:sfmt,channels,srate,ileaving' instead."); } break; } case 'x': { ECA_LOG_MSG(ECA_LOGGER::info, "Truncating outputs (overwrite-mode)."); csetup_repp->set_output_openmode(AUDIO_IO::io_write); break; } case 'X': { ECA_LOG_MSG(ECA_LOGGER::info, "Updating outputs (rw-mode)."); csetup_repp->set_output_openmode(AUDIO_IO::io_readwrite); break; } case 'z': { string first_arg (kvu_get_argument_number(1, argu)); if (first_arg == "db") { long int bufs = atol(kvu_get_argument_number(2, argu).c_str()); if (bufs == 0) bufs = 100000; csetup_repp->set_double_buffer_size(bufs); ECA_LOG_MSG(ECA_LOGGER::info, "Using double-buffer of " + kvu_numtostr(bufs) + " sample frames."); csetup_repp->toggle_double_buffering(true); } else if (first_arg == "nodb") { ECA_LOG_MSG(ECA_LOGGER::info, "Double-buffering disabled."); csetup_repp->toggle_double_buffering(false); } else if (first_arg == "intbuf") { ECA_LOG_MSG(ECA_LOGGER::info, "Enabling extra buffering on realtime devices."); csetup_repp->toggle_max_buffers(true); } else if (first_arg == "nointbuf") { ECA_LOG_MSG(ECA_LOGGER::info, "Disabling extra buffering on realtime devices."); csetup_repp->toggle_max_buffers(false); } else if (first_arg == "multitrack") { ECA_LOG_MSG(ECA_LOGGER::info, "Enabling multitrack-mode (override)."); long int samples = -1; if (kvu_get_number_of_arguments(argu) > 1) { /* -z:multitrack,XXX */ samples = atol(kvu_get_argument_number(2, argu).c_str()); } csetup_repp->multitrack_mode_offset_rep = samples; csetup_repp->multitrack_mode_override_rep = true; csetup_repp->multitrack_mode_rep = true; } else if (first_arg == "nomultitrack") { ECA_LOG_MSG(ECA_LOGGER::info, "Disabling multitrack-mode (override)."); csetup_repp->multitrack_mode_override_rep = true; csetup_repp->multitrack_mode_offset_rep = 0; csetup_repp->multitrack_mode_rep = false; } else if (first_arg == "psr") { ECA_LOG_MSG(ECA_LOGGER::info, "Enabling precise-sample-rates with OSS audio devices."); csetup_repp->toggle_precise_sample_rates(true); } else if (first_arg == "nopsr") { ECA_LOG_MSG(ECA_LOGGER::info, "Disabling precise-sample-rates with OSS audio devices."); csetup_repp->toggle_precise_sample_rates(false); } else if (first_arg == "xruns") { ECA_LOG_MSG(ECA_LOGGER::info, "Processing is stopped if an xrun occurs."); csetup_repp->toggle_ignore_xruns(false); } else if (first_arg == "noxruns") { ECA_LOG_MSG(ECA_LOGGER::info, "Ignoring xruns during processing."); csetup_repp->toggle_ignore_xruns(true); } else if (first_arg == "mixmode") { if (kvu_get_argument_number(2, argu) == "sum") { ECA_LOG_MSG(ECA_LOGGER::info, "Enabling 'sum' mixmode."); csetup_repp->set_mix_mode(ECA_CHAINSETUP::cs_mmode_sum); } else { ECA_LOG_MSG(ECA_LOGGER::info, "Enabling 'avg' mixmode."); csetup_repp->set_mix_mode(ECA_CHAINSETUP::cs_mmode_avg); } } break; } default: { match = false; } } if (match == true) istatus_rep = true; } /** * Handle processing control * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_processing_control (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 't': { if (argu.size() < 3) return; switch(argu[2]) { case ':': { /* note! here we set the _maximum_ length of the chainsetup */ csetup_repp->set_max_length_in_seconds(atof(kvu_get_argument_number(1, argu).c_str())); ECA_LOG_MSG(ECA_LOGGER::info, "Set processing time to " + kvu_numtostr(csetup_repp->max_length_in_seconds_exact()) + "."); break; } case 'l': { csetup_repp->toggle_looping(true); if (csetup_repp->max_length_set() != true) ECA_LOG_MSG(ECA_LOGGER::info, "Looping enabled. Length of input objects will be used to set the loop point."); else ECA_LOG_MSG(ECA_LOGGER::info, "Looping enabled."); break; } } break; } default: { match = false; } } if (match == true) istatus_rep = true; } /** * Handle chain options. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_chains (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 'a': { DBC_CHECK(csetup_repp->is_enabled() != true); std::vector schains = kvu_get_arguments(argu); if (std::find(schains.begin(), schains.end(), "all") != schains.end()) { csetup_repp->select_all_chains(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Selected all chains."); } else { csetup_repp->select_chains(schains); csetup_repp->add_new_chains(schains); MESSAGE_ITEM mtempa; mtempa << "Selected chain ids: "; for (std::vector::const_iterator p = schains.begin(); p != schains.end(); p++) { mtempa << *p << " "; } ECA_LOG_MSG(ECA_LOGGER::system_objects, mtempa.to_string()); } break; } default: { match = false; } } if (match == true) istatus_rep = true; } /** * Handle chainsetup options. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_audio_format (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 'f': { ECA_AUDIO_FORMAT active_sinfo; int channels = atoi(kvu_get_argument_number(2, argu).c_str()); long int srate = atol(kvu_get_argument_number(3, argu).c_str()); string sample_fmt = kvu_get_argument_number(1, argu); /* initialize to current defaults */ active_sinfo.set_audio_format(csetup_repp->default_audio_format()); try { if (sample_fmt.size() > 0) active_sinfo.set_sample_format_string(sample_fmt); } catch(ECA_ERROR& e) { interpret_set_result(false, string("Unable to parse sample format \"") + sample_fmt + "\" passed to -f."); istatus_rep = true; return; } if (channels > 0) active_sinfo.set_channels(channels); if (srate > 0) active_sinfo.set_samples_per_second(srate); if (kvu_get_argument_number(4, argu) == "n") active_sinfo.toggle_interleaved_channels(false); else active_sinfo.toggle_interleaved_channels(true); /* modify the defaults */ csetup_repp->set_default_audio_format(active_sinfo); MESSAGE_ITEM ftemp; ftemp << "Changed active format to (bits/channels/srate/interleave): "; ftemp << csetup_repp->default_audio_format().format_string() << "/" << csetup_repp->default_audio_format().channels() << "/" << csetup_repp->default_audio_format().samples_per_second(); if (csetup_repp->default_audio_format().interleaved_channels() == true) { ftemp << "/i"; } else { ftemp << "/n"; } ECA_LOG_MSG(ECA_LOGGER::user_objects, ftemp.to_string()); break; } default: { match = false; } } if (match == true) istatus_rep = true; } /** * Handle effect preset options. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_effect_preset (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 'p': { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Interpreting preset \"" + argu + "\"."); CHAIN_OPERATOR* cop = 0; if (csetup_repp->selected_chainids.size() != 1) { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Exactly one chain should be selected when adding chain operators."); match = false; } if (argu.size() < 3) return; switch(argu[2]) { case 'f': { #ifndef ECA_DISABLE_EFFECTS cop = dynamic_cast(new FILE_PRESET(kvu_get_argument_number(1,argu))); #endif break; } case 'n': { #ifndef ECA_DISABLE_EFFECTS string name = kvu_get_argument_number(1,argu); const PRESET* preset = dynamic_cast(ECA_OBJECT_FACTORY::preset_map().object(name)); if (preset != 0) cop = dynamic_cast(preset->new_expr()); else cop = 0; #endif break; } default: { } } if (cop != 0) { for(int n = 0; n < cop->number_of_params(); n++) { cop->set_parameter(n + 1, atof(kvu_get_argument_number(n + 2, argu).c_str())); } csetup_repp->add_chain_operator(cop); } break; } default: { match = false; } } if (match == true) istatus_rep = true; } /** * Handle audio-IO-devices and files. * * @pre argu.size() > 0 * @pre argu[0] == '-' */ void ECA_CHAINSETUP_PARSER::interpret_audioio_device (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- string tname = kvu_get_argument_number(1, argu); bool match = true; bool print_error = false; if (argu.size() < 2) return; switch(argu[1]) { case 'i': { DBC_CHECK(csetup_repp->is_enabled() != true); AUDIO_IO* audio_input = ECA_OBJECT_FACTORY::create_audio_object(argu); if (audio_input == 0) audio_input = ECA_OBJECT_FACTORY::create_loop_input(argu, &csetup_repp->loop_map); if (audio_input != 0) { if ((audio_input->supported_io_modes() & AUDIO_IO::io_read) != AUDIO_IO::io_read) { interpret_set_result(false, string("Audio object \"") + tname + "\" cannot be opened for input."); } else { ECA_LOG_MSG(ECA_LOGGER::system_objects,"adding file \"" + tname + "\"."); csetup_repp->add_input(audio_input); last_audio_add_vector_repp = &csetup_repp->inputs; /* for -y parsing */ } } else { print_error = true; } break; } case 'o': { DBC_CHECK(csetup_repp->is_enabled() != true); AUDIO_IO* audio_output = ECA_OBJECT_FACTORY::create_audio_object(argu); if (audio_output == 0) audio_output = ECA_OBJECT_FACTORY::create_loop_output(argu, &csetup_repp->loop_map); if (audio_output != 0) { bool truncate = false; int mode_tmp = csetup_repp->output_openmode(); if (mode_tmp == AUDIO_IO::io_readwrite) { if ((audio_output->supported_io_modes() & AUDIO_IO::io_readwrite) != AUDIO_IO::io_readwrite) { mode_tmp = AUDIO_IO::io_write; truncate = true; } } else { truncate = true; } if (((audio_output->supported_io_modes() & mode_tmp) != mode_tmp)) { interpret_set_result(false, string("io_write/io_readwrite access modes not supported by output \"") + audio_output->name() + "\"."); } else { ECA_LOG_MSG(ECA_LOGGER::system_objects,"adding file \"" + tname + "\"."); csetup_repp->add_output(audio_output, truncate); last_audio_add_vector_repp = &csetup_repp->outputs; /* for -y parsing */ } } else { print_error = true; } break; } case 'y': { DBC_CHECK(csetup_repp->is_enabled() != true); if (last_audio_add_vector_repp == 0) { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Non-existant last audio object."); } else { AUDIO_IO* last_object = (*last_audio_add_vector_repp).back(); double newpos = atof(kvu_get_argument_number(1, argu).c_str()); if (newpos > 0.0f && last_object && last_object->supports_seeking() != true) { interpret_set_result(false, string("Audio object does not support seeking, unable to set a non-zero starting offset. Object generating the error is \"") + last_object->name() + "\"."); } else { last_object->seek_position_in_seconds(newpos); if (last_object->io_mode() == AUDIO_IO::io_read) { csetup_repp->input_start_pos[csetup_repp->input_start_pos.size() - 1] = last_object->position_in_seconds_exact(); } else { csetup_repp->output_start_pos[csetup_repp->output_start_pos.size() - 1] = last_object->position_in_seconds_exact(); } ECA_LOG_MSG(ECA_LOGGER::info, "Setting starting position for audio object \"" + last_object->label() + "\": " + kvu_numtostr(last_object->position_in_seconds_exact()) + " seconds."); } break; } } default: { match = false; } } if (match == true) istatus_rep = true; if (print_error == true) { interpret_set_result(false, string("Audio object \"") + tname + "\" does not match any of the known audio device types or " "file formats. You can check the list of supported " "audio object types by issuing the command 'aio-register' in " "ecasound's interactive mode."); } } /** * Handles audio-IO manager options. * * @pre argu.size() > 0 * @pre argu[0] == '-' */ void ECA_CHAINSETUP_PARSER::interpret_audioio_manager(const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- string tname = kvu_get_argument_number(1, argu); bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 'G': { DBC_CHECK(csetup_repp->is_enabled() != true); std::vector args = kvu_get_arguments(argu); args.erase(args.begin()); DBC_CHECK(args.size() == kvu_get_arguments(argu).size() - 1); csetup_repp->set_audio_io_manager_option(tname, kvu_vector_to_string(args, ",")); break; } default: { match = false; } } if (match == true) istatus_rep = true; } /** * Handles MIDI-IO devices. * * @pre argu.size() > 0 * @pre argu[0] == '-' */ void ECA_CHAINSETUP_PARSER::interpret_midi_device (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- bool match = true; if (argu.size() < 2) return; switch(argu[1]) { case 'M': { if (argu.size() < 3) return; switch(argu[2]) { case 'd': { string tname = kvu_get_argument_number(1, argu); ECA_LOG_MSG(ECA_LOGGER::system_objects,"MIDI-config: Adding device \"" + tname + "\"."); MIDI_IO* mdev = 0; mdev = ECA_OBJECT_FACTORY::create_midi_device(argu); if (mdev != 0) { if ((mdev->supported_io_modes() & MIDI_IO::io_readwrite) == MIDI_IO::io_readwrite) { mdev->io_mode(MIDI_IO::io_readwrite); csetup_repp->add_midi_device(mdev); csetup_repp->midi_server_needed_rep = true; } else { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: I/O-mode 'io_readwrite' not supported by MIDI-device " + mdev->name()); } } break; } case 'm': { if (argu.size() < 4) return; switch(argu[3]) { case 'r': { // FIXME: not implemented! int id = atoi(kvu_get_argument_number(1, argu).c_str()); ECA_LOG_MSG(ECA_LOGGER::info, "MIDI-config: Receiving MMC messages with id \"" + kvu_numtostr(id) + "\"."); csetup_repp->midi_server_repp->set_mmc_receive_id(id); csetup_repp->midi_server_needed_rep = true; break; } case 's': { int id = atoi(kvu_get_argument_number(1, argu).c_str()); ECA_LOG_MSG(ECA_LOGGER::info, "MIDI-config: Adding MMC-send to device id \"" + kvu_numtostr(id) + "\"."); csetup_repp->midi_server_repp->add_mmc_send_id(id); csetup_repp->midi_server_needed_rep = true; break; } } break; } case 's': { if (argu.size() < 4) return; switch(argu[3]) { case 'r': { // FIXME: not implemented ECA_LOG_MSG(ECA_LOGGER::info, "MIDI-config: Receiving MIDI-sync."); csetup_repp->midi_server_needed_rep = true; csetup_repp->midi_server_repp->toggle_midi_sync_receive(true); break; } case 's': { // FIXME: not implemented ECA_LOG_MSG(ECA_LOGGER::info, "MIDI-config: Sending MIDI-sync."); csetup_repp->midi_server_repp->toggle_midi_sync_send(true); csetup_repp->midi_server_needed_rep = true; break; } } break; } } break; } default: { match = false; } } if (match == true) istatus_rep = true; return; } /** * Handle chain operator options (chain operators, presets * and plugins) * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_chain_operator (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- CHAIN_OPERATOR* t = ECA_OBJECT_FACTORY::create_chain_operator(argu); if (t == 0) t = ECA_OBJECT_FACTORY::create_ladspa_plugin(argu); if (t == 0) t=ECA_OBJECT_FACTORY::create_lv2_plugin(argu); if (t != 0) { if (csetup_repp->selected_chainids.size() == 1) { csetup_repp->add_chain_operator(t); istatus_rep = true; } else { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Exactly one chain should be selected when adding chain operators."); delete t; } } else interpret_effect_preset(argu); } /** * Handle controller sources and general controllers. * * @pre argu.size() > 0 * @pre argu[0] == '-' * @pre istatus_rep == false */ void ECA_CHAINSETUP_PARSER::interpret_controller (const string& argu) { // -------- DBC_REQUIRE(argu.size() > 0); DBC_REQUIRE(argu[0] == '-'); DBC_REQUIRE(istatus_rep == false); // -------- string prefix = kvu_get_argument_prefix(argu); if (prefix == "kx") { csetup_repp->set_target_to_controller(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Selected controllers as parameter control targets."); istatus_rep = true; } else { GENERIC_CONTROLLER* t = ECA_OBJECT_FACTORY::create_controller(argu); if (t != 0) { if (csetup_repp->selected_chainids.size() != 1) { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Exactly one chain should be selected when adding controllers."); delete t; } else { MIDI_CLIENT* p = dynamic_cast(t->source_pointer()); if (p != 0) { csetup_repp->midi_server_needed_rep = true; p->register_server(csetup_repp->midi_server_repp); } csetup_repp->add_controller(t); istatus_rep = true; } } } } string ECA_CHAINSETUP_PARSER::general_options_to_string(void) const { MESSAGE_ITEM t; int setparams = csetup_repp->override_buffering_parameters().number_of_set(); ECA_LOG_MSG(ECA_LOGGER::system_objects, "genopts tostring - " + kvu_numtostr(setparams) + " overridden parameters."); if (setparams > 0) { t << "-b:" << csetup_repp->buffersize(); if (csetup_repp->raised_priority() == true) t << " -r:" << csetup_repp->get_sched_priority(); else t << " -r:-1"; if (csetup_repp->max_buffers() == true) t << " -z:intbuf"; else t << " -z:nointbuf"; if (csetup_repp->double_buffering() == true) t << " -z:db," << csetup_repp->double_buffer_size(); else t << " -z:nodb"; } else { ECA_CHAINSETUP::Buffering_mode_t bmode = csetup_repp->buffering_mode_rep; if (csetup_repp->active_buffering_mode_rep != ECA_CHAINSETUP::cs_bmode_none) bmode = csetup_repp->active_buffering_mode_rep; switch(bmode) { case ECA_CHAINSETUP::cs_bmode_nonrt: { t << "-B:nonrt"; break; } case ECA_CHAINSETUP::cs_bmode_rt: { t << "-B:rt"; break; } case ECA_CHAINSETUP::cs_bmode_rtlowlatency: { t << "-B:rtlowlatency"; break; } default: { t << " -B:auto"; } } } t << " -n:\"" << csetup_repp->name() << "\""; if (csetup_repp->output_openmode() == AUDIO_IO::io_write) t << " -x"; else t << " -X"; if (csetup_repp->multitrack_mode_override_rep == true) { if (csetup_repp->multitrack_mode() == true) { t << "-z:multitrack"; if (csetup_repp->multitrack_mode_offset_rep != -1) { t << "," << csetup_repp->multitrack_mode_offset_rep; } } else { t << "-z:nomultitrack"; } } if (csetup_repp->ignore_xruns() == true) t << " -z:noxruns"; else t << " -z:xruns"; if (csetup_repp->precise_sample_rates() == true) t << " -z:psr"; else t << " -z:nopsr"; if (csetup_repp->mix_mode() == ECA_CHAINSETUP::cs_mmode_avg) t << " -z:mixmode,avg"; else t << " -z:mixmode,sum"; t.setprecision(3); if (csetup_repp->max_length_set()) { t << " -t:" << csetup_repp->max_length_in_seconds_exact(); } if (csetup_repp->looping_enabled()) t << " -tl"; return t.to_string(); } string ECA_CHAINSETUP_PARSER::midi_to_string(void) const { MESSAGE_ITEM t; t.setprecision(3); std::vector::size_type p = 0; while (p < csetup_repp->midi_devices.size()) { t << "-Md:"; for(int n = 0; n < csetup_repp->midi_devices[p]->number_of_params(); n++) { // FIXME: should quote/escape possible commas and whitespace t << csetup_repp->midi_devices[p]->get_parameter(n + 1); if (n + 1 < csetup_repp->midi_devices[p]->number_of_params()) t << ","; } ++p; if (p < csetup_repp->midi_devices.size()) t << " "; } return t.to_string(); } string ECA_CHAINSETUP_PARSER::inputs_to_string(void) const { MESSAGE_ITEM t; t.setprecision(3); size_t p = 0; while (p < csetup_repp->inputs.size()) { t << "-a:"; std::vector c = csetup_repp->get_attached_chains_to_input(csetup_repp->inputs[p]); std::vector::const_iterator cp = c.begin(); while (cp != c.end()) { t << *cp; ++cp; if (cp != c.end()) t << ","; } t << " " << ECA_OBJECT_FACTORY::audio_object_format_to_eos(csetup_repp->inputs[p]) << " " << ECA_OBJECT_FACTORY::audio_object_to_eos(csetup_repp->inputs[p], "i"); if (csetup_repp->input_start_pos[p] != 0) { t << " -y:" << csetup_repp->input_start_pos[p]; } ++p; if (p < csetup_repp->inputs.size()) t << "\n"; } return t.to_string(); } string ECA_CHAINSETUP_PARSER::outputs_to_string(void) const { MESSAGE_ITEM t; t.setprecision(3); std::vector::size_type p = 0; while (p < csetup_repp->outputs.size()) { t << "-a:"; std::vector c = csetup_repp->get_attached_chains_to_output(csetup_repp->outputs[p]); std::vector::const_iterator cp = c.begin(); while (cp != c.end()) { t << *cp; ++cp; if (cp != c.end()) t << ","; } t << " " << ECA_OBJECT_FACTORY::audio_object_format_to_eos(csetup_repp->outputs[p]) << " " << ECA_OBJECT_FACTORY::audio_object_to_eos(csetup_repp->outputs[p], "o"); if (csetup_repp->output_start_pos[p] != 0) { t << " -y:" << csetup_repp->output_start_pos[p]; } ++p; if (p < csetup_repp->outputs.size()) t << "\n"; } return t.to_string(); } string ECA_CHAINSETUP_PARSER::chains_to_string(void) const { MESSAGE_ITEM t; std::vector::size_type p = 0; while (p < csetup_repp->chains.size()) { string tmpstr = csetup_repp->chains[p]->to_string(); if (tmpstr.size() > 0) { t << "-a:" << csetup_repp->chains[p]->name() << " "; t << tmpstr; if (p + 1 < csetup_repp->chains.size()) t << "\n"; } ++p; } return t.to_string(); } ecasound-2.9.3/libecasound/eca-object-map.h0000644000076400007640000000434511141420572015472 00000000000000#ifndef INCLUDED_ECA_OBJECT_MAP_H #define INCLUDED_ECA_OBJECT_MAP_H #include #include #include #include "eca-object.h" /** * A virtual base class representing generic object maps. * * Object maps are used to centralize object creation. * To add an object to the map, a prototype instance * is registered. Each object is associated with * a keyword and a regex expression that can be used * for object look up and creation. * * Most parts of the library don't require info about * object details. Object maps make it possible to * hide these details completely, and in one place. * * Related design patterns: * - Prototype (GoF117) * - Factory Method (GoF107) * * @author Kai Vehmanen */ class ECA_OBJECT_MAP { public: /** @name Constructors and destructors */ /*@{*/ ECA_OBJECT_MAP(void); virtual ~ECA_OBJECT_MAP(void); /*@}*/ /** @name Object map features */ /*@{*/ void toggle_case_sensitive_expressions(bool v); bool case_sensitive_expressions(void) const; /*@}*/ /** @name Object registration */ /*@{*/ virtual void register_object(const std::string& keyword, const std::string& expr, ECA_OBJECT* object); virtual void unregister_object(const std::string& keyword); /*@}*/ /** @name Object creation using object prototypes instances */ /*@{*/ virtual const ECA_OBJECT* object(const std::string& keyword) const; virtual const ECA_OBJECT* object_expr(const string& expr) const; /*@}*/ /** @name Query the object map */ /*@{*/ virtual const std::list& registered_objects(void) const; virtual bool has_keyword(const std::string& keyword) const; virtual bool has_object(const ECA_OBJECT* obj) const; virtual std::string expr_to_keyword(const std::string& expr) const; virtual std::string keyword_to_expr(const std::string& keyword) const; virtual std::string object_identifier(const ECA_OBJECT* object) const; /*@}*/ private: ECA_OBJECT_MAP(const ECA_OBJECT_MAP&); ECA_OBJECT_MAP& operator=(const ECA_OBJECT_MAP&); std::list object_keywords_rep; mutable std::map object_map; mutable std::map object_expr_map; bool expr_case_sensitive_rep; }; #endif ecasound-2.9.3/libecasound/audioio-timidity.h0000644000076400007640000000403211141362373016203 00000000000000#ifndef INCLUDED_AUDIOIO_TIMIDITY_H #define INCLUDED_AUDIOIO_TIMIDITY_H #include #include #include "audioio-buffered.h" #include "audioio-forked-stream.h" /** * Interface to MIDI-to-audio converters that support * UNIX pipe i/o. By default, Timidity++ is used. * * @author Kai Vehmanen */ class TIMIDITY_INTERFACE : public AUDIO_IO_BUFFERED, public AUDIO_IO_FORKED_STREAM { private: static std::string default_timidity_cmd; public: static void set_timidity_cmd(const std::string& value); public: TIMIDITY_INTERFACE (const std::string& name = ""); virtual ~TIMIDITY_INTERFACE(void); virtual TIMIDITY_INTERFACE* clone(void) const { return new TIMIDITY_INTERFACE(*this); } virtual TIMIDITY_INTERFACE* new_expr(void) const { return new TIMIDITY_INTERFACE(); } virtual std::string name(void) const { return("MIDI-to-audio stream"); } virtual std::string description(void) const { return("Interface to MIDI-to-audio converters that support UNIX pipe i/o."); } virtual int supported_io_modes(void) const { return(io_read); } virtual bool supports_seeking(void) const { return(false); } virtual void open(void) throw (AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples) { } virtual bool finished(void) const { return(finished_rep); } virtual void start_io(void); virtual void stop_io(void); protected: /* functions called by AUDIO_IO_FORKED_STREAM that require * the use of AUDIO_IO methods */ virtual bool do_supports_seeking(void) const { return supports_seeking(); } virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) { set_position_in_samples(pos); } private: bool triggered_rep; bool finished_rep; long int bytes_read_rep; int filedes_rep; FILE* f1_rep; TIMIDITY_INTERFACE& operator=(const TIMIDITY_INTERFACE& x) { return *this; } void fork_timidity(void); void kill_timidity(void); }; #endif ecasound-2.9.3/libecasound/audioio-timidity.cpp0000644000076400007640000001074611137153043016544 00000000000000// ------------------------------------------------------------------------ // audioio-timidity.cpp: Interface class for Timidity++ input. // Copyright (C) 2000,2002,2004-2006,2008,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* stat() */ #include /* stat() */ #include #include "audioio-timidity.h" #include "eca-logger.h" string TIMIDITY_INTERFACE::default_timidity_cmd = "timidity -Or1S -id -s %s -o - %f"; void TIMIDITY_INTERFACE::set_timidity_cmd(const std::string& value) { TIMIDITY_INTERFACE::default_timidity_cmd = value; } TIMIDITY_INTERFACE::TIMIDITY_INTERFACE(const std::string& name) : triggered_rep(false), finished_rep(false) { } TIMIDITY_INTERFACE::~TIMIDITY_INTERFACE(void) { clean_child(true); if (is_open() == true) { close(); } } void TIMIDITY_INTERFACE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { std::string urlprefix; struct stat buf; int ret = ::stat(label().c_str(), &buf); if (ret != 0) { size_t offset = label().find_first_of("://"); if (offset == std::string::npos) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-TIMIDITY: Can't open file " + label() + ".")); } else { urlprefix = std::string(label(), 0, offset); ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audioio-timidity) Found url; protocol '" + urlprefix + "'."); } } /* decoder supports: s16 samples, 2 channels, srate configurable no support for: endianess (use native) */ set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16); set_channels(2); triggered_rep = false; finished_rep = false; AUDIO_IO::open(); } void TIMIDITY_INTERFACE::close(void) { if (pid_of_child() > 0) { if (io_mode() == io_read) { kill_timidity(); } } AUDIO_IO::close(); } long int TIMIDITY_INTERFACE::read_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_timidity(); } bytes_read_rep = std::fread(target_buffer, 1, frame_size() * samples, f1_rep); if (bytes_read_rep < samples * frame_size() || bytes_read_rep == 0) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::info, "Can't start process \"" + TIMIDITY_INTERFACE::default_timidity_cmd + "\". Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; } else finished_rep = false; return(bytes_read_rep / frame_size()); } void TIMIDITY_INTERFACE::kill_timidity(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audioio-timidity) Cleaning Timidity++-child with pid=" + kvu_numtostr(pid_of_child()) + "."); clean_child(); triggered_rep = false; } void TIMIDITY_INTERFACE::fork_timidity(void) { set_fork_command(TIMIDITY_INTERFACE::default_timidity_cmd); set_fork_file_name(label()); set_fork_bits(bits()); set_fork_channels(channels()); set_fork_sample_rate(samples_per_second()); fork_child_for_read(); if (child_fork_succeeded() == true) { /* NOTE: the file description will be closed by * AUDIO_IO_FORKED_STREAM::clean_child() */ filedes_rep = file_descriptor(); f1_rep = fdopen(filedes_rep, "r"); /* not part of */ if (f1_rep == 0) { finished_rep = true; triggered_rep = false; } } if (wait_for_child() != true) { finished_rep = true; triggered_rep = false; } } void TIMIDITY_INTERFACE::start_io(void) { if (triggered_rep != true) { if (io_mode() == io_read) fork_timidity(); triggered_rep = true; } } void TIMIDITY_INTERFACE::stop_io(void) { if (triggered_rep == true) { if (io_mode() == io_read) clean_child(true); triggered_rep = false; } } ecasound-2.9.3/libecasound/audioio-null.cpp0000644000076400007640000000221610664032032015651 00000000000000// ------------------------------------------------------------------------ // audioio-null.cpp: Object that consumes and produces null audio data. // Copyright (C) 2005 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "audioio-null.h" NULLFILE::NULLFILE(const std::string& name) { set_label(name); } NULLFILE::~NULLFILE(void) { } ecasound-2.9.3/libecasound/audioio-typeselect.cpp0000644000076400007640000000756211143422610017067 00000000000000// ------------------------------------------------------------------------ // audioio-typeselect.cpp: A proxy class for overriding default keyword // and filename associations. // Copyright (C) 2001,2002,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "eca-logger.h" #include "eca-object-factory.h" #include "audioio-null.h" #include "audioio-typeselect.h" /** * Constructor. */ AUDIO_IO_TYPESELECT::AUDIO_IO_TYPESELECT (void) { // ECA_LOG_MSG(ECA_LOGGER::user_objects, "constructor " + label() + "."); init_rep = false; } /** * Destructor. */ AUDIO_IO_TYPESELECT::~AUDIO_IO_TYPESELECT (void) { // ECA_LOG_MSG(ECA_LOGGER::user_objects, "destructor " + label() + "."); } AUDIO_IO_TYPESELECT* AUDIO_IO_TYPESELECT::clone(void) const { AUDIO_IO_TYPESELECT* target = new AUDIO_IO_TYPESELECT(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIO_IO_TYPESELECT::open(void) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "open " + label() + "."); if (init_rep != true) { AUDIO_IO* tmp = 0; const string& objname = child_params_as_string(2, ¶ms_rep); tmp = ECA_OBJECT_FACTORY::create_audio_object(objname); if (tmp == 0) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-TYPESELECT: unable to open child object '" + objname + "'")); set_child(tmp); int numparams = child()->number_of_params(); for(int n = 0; n < numparams; n++) { child()->set_parameter(n + 1, get_parameter(n + 3)); if (child()->variable_params()) numparams = child()->number_of_params(); } init_rep = true; /* must be set after dyn. parameters */ } pre_child_open(); child()->open(); post_child_open(); /* if child changed the format during open; * fetch the changes */ if (child()->locked_audio_format() == true) { set_audio_format(child()->audio_format()); } set_label(child()->label()); set_length_in_samples(child()->length_in_samples()); AUDIO_IO_PROXY::open(); } void AUDIO_IO_TYPESELECT::close(void) { if (child()->is_open() == true) child()->close(); AUDIO_IO_PROXY::close(); } string AUDIO_IO_TYPESELECT::parameter_names(void) const { return string("typeselect,format,") + child()->parameter_names(); } void AUDIO_IO_TYPESELECT::set_parameter(int param, string value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "set_parameter " + label() + "."); if (param > static_cast(params_rep.size())) params_rep.resize(param); if (param > 0) { params_rep[param - 1] = value; } if (param > 2 && init_rep == true) { child()->set_parameter(param - 2, value); } } string AUDIO_IO_TYPESELECT::get_parameter(int param) const { ECA_LOG_MSG(ECA_LOGGER::user_objects, "get_parameter " + label() + "."); if (param > 0 && param < static_cast(params_rep.size()) + 1) { if (param > 2 && init_rep == true) { params_rep[param - 1] = child()->get_parameter(param - 2); } return params_rep[param - 1]; } return ""; } ecasound-2.9.3/libecasound/eca-audio-time_test.h0000644000076400007640000000367311172665015016557 00000000000000// ------------------------------------------------------------------------ // eca-audio-time_test.h: Unit test for ECA_AUDIO_TIME // Copyright (C) 2008 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "kvu_utils.h" /* kvu_sleep() */ #include "eca-audio-time.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_CONTROL. * * FIXME: implementation not ready */ class ECA_AUDIO_TIME_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for ECA_AUDIO_TIME"); } virtual void do_run(void); public: virtual ~ECA_AUDIO_TIME_TEST(void) { } private: }; void ECA_AUDIO_TIME_TEST::do_run(void) { cerr << "libecasound_tester: eca-audio-time" << endl; ECA_AUDIO_TIME v ("88200sa"); v.set_samples_per_second(44100); if (v.samples() != 88200) ECA_TEST_FAILURE("Incorrect sample count (from-samples)."); if (v.seconds() != 2.0f) ECA_TEST_FAILURE("Incorrect time in seconds (from-samples)."); v.set_time_string("2.0"); if (v.samples() != 88200) ECA_TEST_FAILURE("Incorrect sample count (from-secs)."); if (v.seconds() != 2.0f) ECA_TEST_FAILURE("Incorrect time in seconds (from-secs)."); } ecasound-2.9.3/libecasound/audioio.h0000644000076400007640000002411511161513242014350 00000000000000#ifndef INCLUDED_AUDIOIO_H #define INCLUDED_AUDIOIO_H #include #include "eca-audio-position.h" #include "eca-audio-time.h" #include "eca-audio-format.h" #include "dynamic-object.h" class SAMPLE_BUFFER; class AUDIO_IO_MANAGER; using std::string; /** * Virtual base class for all audio I/O objects. Different types * of audio objects include files, audio devices, sound * producing program modules, audio server clients, and so on. * * The class interface is divided into following sections: * * - type definitions * * - attributes * * - configuration (setting and getting configuration parameters) * * - functionality (control and runtime information) * * - runtime information * * - constructors and destructors * * @author Kai Vehmanen */ class AUDIO_IO : public DYNAMIC_OBJECT, public ECA_AUDIO_FORMAT, public ECA_AUDIO_POSITION { public: /** @name Public type definitions and constants */ /*@{*/ /** * Input/Output mode * * @see io_mode() * * io_read * * Device is opened for input. If opening a file, * it must exist. * * io_write * * Device is opened for output. If opening a file and * and output exists, it is first truncated. * * io_readwrite * * Device is opened for both reading and writing. If * opening a file, a new file is created if needed. * When switching from read to write or vica versa, * position should be reset before using the device. **/ enum Io_mode { io_read = 1, io_write = 2, io_readwrite = 4 }; class SETUP_ERROR { public: enum Error_type { sample_format, /* unsupported sample format */ channels, /* unsupported channel count */ sample_rate, /* unsupported sample_rate */ interleaving, /* non-interleaved or interleaved channel organization not supported */ io_mode, /* unsupported I/O mode */ buffersize, /* unsupported buffersize */ blockmode, /* non-blocking or blocking mode not supported */ dynamic_params, /* invalid dynamic parameters (for instance invalid label()) */ unexpected /* unexpected/unknown error */ }; const string& message(void) const; Error_type type(void) const; SETUP_ERROR(Error_type type, const string& message); private: Error_type type_rep; string message_rep; }; public: /*@}*/ /** @name Public functions for handling object managers */ /*@{*/ /** * Creates an object manager for this audio object type. * * @return 0 if no manager objects are not supported */ virtual AUDIO_IO_MANAGER* create_object_manager(void) const { return(0); } /*@}*/ /** @name Constructors and destructors */ /*@{*/ virtual AUDIO_IO* clone(void) const = 0; virtual AUDIO_IO* new_expr(void) const = 0; virtual ~AUDIO_IO(void); AUDIO_IO(const string& name = "uninitialized", int mode = io_read); /*@}*/ /** @name Attribute functions */ /*@{*/ virtual int supported_io_modes(void) const; virtual bool supports_nonblocking_mode(void) const; virtual bool finite_length_stream(void) const; virtual bool locked_audio_format(void) const; /*@}*/ /** @name Configuration * * For setting and getting configuration parameters. */ /*@{*/ /** * Sets the sample buffer size in sample frames. * * When reading data with read_buffer(), buffersize() * determines how many sample frames of data is * processed per call. * * Otherwise buffersize() is only used for initializing * devices and data structures. * * Device should always be able to write all sample * data passed to write_buffer(), independently from current * buffersize() value. * * @see buffersize() */ virtual void set_buffersize(long int samples) = 0; /** * Returns the current buffersize in sample frames. * * @see set_buffersize() */ virtual long int buffersize(void) const = 0; int io_mode(void) const; const string& label(void) const; string format_info(void) const; void set_io_mode(int mode); void set_label(const string& id_label); void toggle_nonblocking_mode(bool value); virtual string parameter_names(void) const { return("label"); } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; public: /*@}*/ /** @name Main functionality */ /*@{*/ /** * Reads samples and store them to buffer pointed by 'sbuf'. If * necessary, the target buffer will be resized (both length * and number of channels). * * The sample buffer event tags may also be set during * this method call (see SAMPLE_BUFFER documentation for more * details). * * It's important to note that SAMPLE_BUFFER audio format cannot be * changed during processing. This means that audio data must be converted * from audio object's internal format to that of 'sbuf' given as * argument. SAMPLE_BUFFER class provides tools for all normal conversion * operations. If you need direct access to object's data, a lower * abstraction level should be used (@see AUDIO_IO_BUFFERED). * * Note! The implementations should call set_position_in_samples() * or change_position_in_samples() in ECA_AUDIO_POSITION. * * @pre io_mode() == io_read || io_mode() == io_readwrite * @pre readable() == true * @pre sbuf != 0 * @post sbuf->length_in_samples() <= buffersize() * @post sbuf->number_of_channels() == channels() */ virtual void read_buffer(SAMPLE_BUFFER* sbuf) = 0; /** * Writes all data from sample buffer pointed by 'sbuf' to * this object. Notes concerning read_buffer() also apply to * this routine. * * Note! The implementations should call set_position_in_samples() * or change_position_in_samples() in ECA_AUDIO_POSITION. * * @pre io_mode() == io_write || io_mode() == io_readwrite * @pre writable() == true * @pre sbuf != 0 */ virtual void write_buffer(SAMPLE_BUFFER* sbuf) = 0; /** * Opens the audio object (possibly in exclusive mode). * This routine is used for initializing external connections * (opening files or devices, loading shared libraries, * opening IPC connections). As it's impossible to know in * advance what might happen, open() may throw an * exception. This way it becomes possible to provide * more verbose information about the problem that caused * open() to fail. * * At this point the various audio parameters are used * for the first time. Unless locked_audio_format() is 'true', * object tries to use the audio format parameters set prior to * this call. If object doesn't support the given parameter * combination, it can either try adjust them to closest * matching, or in the worst case, throw an SETUP_ERROR * exception (see above). * * @pre is_open() != true * @post readable() == true || writable() == true || is_open() != true */ virtual void open(void) throw (AUDIO_IO::SETUP_ERROR &); /** * Closes audio object. After calling this routine, * all resources (for instance files and devices) must * be freed so that they can be used by other processes. * * @pre is_open() == true * @post readable() != true * @post writable() != true */ virtual void close(void); /*@}*/ /** @name Runtime information */ /*@{*/ /** * Returns a file descriptor id suitable for poll() and * select() system calls. If polling is not supported, * returns value of '-1'. */ virtual int poll_descriptor(void) const { return(-1); } /** * If 'supports_nonblocking_mode() == true', this function returns * the number of samples frames that is available for reading, or * alternatively, how many sample frames can be written without * blocking. This function can be used for implementing nonblocking * input and output with devices supporting it. * * Note, you should use set_buffersize() for setting how * many sample frames read_buffer() will ask from the device. * * require: * supports_nonblocking_mode() == true */ virtual long int samples_available(void) const { return(0); } /** * Has device been opened (with open())? */ bool is_open(void) const { return(open_rep); } /** * Whether all data has been processed? If opened in mode 'io_read', * this means that end of stream has been reached. If opened in * 'io_write' or 'io_readwrite' modes, finished status usually * means that an error has occured (no space left, etc). After * finished() has returned 'true', further calls to read_buffer() * and/or write_buffer() won't process any data. * * For output for which 'finite_length_stream()' is true, when * 'finished()' returns true, that means an error has occured. * Otherwise 'finished()' just tells that further attempts to do * i/o will fail. */ virtual bool finished(void) const = 0; virtual bool nonblocking_mode(void) const; virtual bool readable(void) const; virtual bool writable(void) const; virtual string status(void) const; ECA_AUDIO_TIME length(void) const; ECA_AUDIO_TIME position(void) const; /*@}*/ /** @name Functions overridden and reimplemented from * ECA_AUDIO_POSITION and ECA_AUDIO_FORMAT */ /*@{*/ SAMPLE_SPECS::sample_rate_t samples_per_second(void) const; virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); virtual void set_audio_format(const ECA_AUDIO_FORMAT& f_str); /*@}*/ /** @name Functions implemented from ECA_AUDIO_POSITION */ /*@{*/ virtual bool supports_seeking(void) const; virtual bool supports_seeking_sample_accurate(void) const; virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ protected: /** @name Functions provided for subclasses. */ /*@{*/ void position(const ECA_AUDIO_TIME& v); void length(const ECA_AUDIO_TIME& v); std::string parameter_get_to_string(int param) const; std::string parameter_set_to_string(int param, std::string value) const; /*@{*/ private: int io_mode_rep; string id_label_rep; bool nonblocking_rep; bool open_rep; }; #endif ecasound-2.9.3/libecasound/eca-osc.h0000644000076400007640000000423511172651507014243 00000000000000// ------------------------------------------------------------------------ // eca-osc.h: Class implementing the Ecasound OSC interface // Copyright (C) 2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_OSC_H #define INCLUDED_ECA_OSC_H class ECA_CONTROL_MT; #ifdef ECA_USE_LIBLO #include /** * Ecasound Open Source Control Control (OSC) interface * * The interface is documented in Ecasound codebase: * - ecasound/Documentation/ecasound_osc_interface.txt * - http://ecasound.git.sourceforge.net/git/gitweb.cgi?p=ecasound;a=blob;f=Documentation/ecasound_osc_interface.txt;hb=HEAD */ class ECA_OSC_INTERFACE { friend int cb_lo_method_handler(const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data); public: ECA_OSC_INTERFACE(ECA_CONTROL_MT *ecacontrol, int port = -1); ~ECA_OSC_INTERFACE(void); void start(void); void stop(void); bool is_running(void) const; private: int parse_path_param(const std::string &path, int *param); int handle_chain_message(const string &path, const char *types, lo_arg **argv, int argc); int handle_osc_message(const char *path, const char *types, lo_arg **argv, int argc); ECA_CONTROL_MT* ec_repp; bool running_rep; int udp_port_rep; lo_server_thread lo_thr_repp; lo_method method_all_repp; }; #else /* !ECA_USE_LIBLO */ class ECA_OSC_INTERFACE; #endif /* ECA_USE_LIBLO */ #endif /* INCLUDED_ECA_OSC_H */ ecasound-2.9.3/libecasound/audioio-raw.h0000644000076400007640000000255611033001310015126 00000000000000#ifndef INCLUDE_AUDIOIO_RAW_H #define INCLUDE_AUDIOIO_RAW_H #include #include #include "eca-fileio.h" #include "eca-fileio-mmap.h" #include "eca-fileio-stream.h" /** * Class for handling raw/headerless audio files * * - multiple channels are interleaved, left channel first * * @author Kai Vehmanen */ class RAWFILE : public AUDIO_IO_BUFFERED { public: RAWFILE (const std::string& name = ""); virtual ~RAWFILE(void); virtual RAWFILE* clone(void) const; virtual RAWFILE* new_expr(void) const { return new RAWFILE(); } virtual std::string name(void) const { return("Raw audio file"); } virtual std::string parameter_names(void) const { return("label,toggle_mmap"); } virtual void open(void) throw (AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); virtual bool finished(void) const; virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; private: ECA_FILE_IO* fio_repp; std::string mmaptoggle_rep; RAWFILE(const RAWFILE& x) { } RAWFILE& operator=(const RAWFILE& x) { return *this; } void set_length_in_bytes(void); }; #endif ecasound-2.9.3/libecasound/audioio.cpp0000644000076400007640000003112611501245107014703 00000000000000// ------------------------------------------------------------------------ // audioio.cpp: Routines common for all audio IO-devices. // Copyright (C) 1999-2004,2008,2009,2010 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "eca-error.h" #include "audioio.h" #include "eca-logger.h" /** * FIXME notes (last update 2008-03-11) * * - Modify default implementation of set_label()/label() so * that is mapped directly to set/get_parameter(1, ...). */ const string& AUDIO_IO::SETUP_ERROR::message(void) const { return message_rep; } AUDIO_IO::SETUP_ERROR::Error_type AUDIO_IO::SETUP_ERROR::type(void) const { return type_rep; } AUDIO_IO::SETUP_ERROR::SETUP_ERROR(AUDIO_IO::SETUP_ERROR::Error_type type, const string& message) : type_rep(type), message_rep(message) { } // =================================================================== // Constructors and destructors AUDIO_IO::~AUDIO_IO(void) { if (is_open() == true) close(); } AUDIO_IO::AUDIO_IO(const string& name, int mode) { set_label(name); set_io_mode(mode); nonblocking_rep = false; open_rep = false; } // =================================================================== // Attributes /** * Returns info about supported I/O modes (bitwise-OR) * * Note that return value may change after device is * opened (some objects will refine their attributes after * external resources are acquired). * * By default, all I/O modes are supported. */ int AUDIO_IO::supported_io_modes(void) const { return (io_read | io_readwrite | io_write); } /** * Whether device supports non-blocking I/O mode. * * Note that return value may change after device is * opened (some objects will refine their attributes after * external resources are acquired). * * By default, nonblocking mode is not supported. */ bool AUDIO_IO::supports_nonblocking_mode(void) const { return false; } /** * Whether device supports seeking. * * Note that return value may change after device is * opened (some objects will refine their attributes after * external resources are acquired). * * By default, seeking is supported. * * @see supports_seeking_sample_accurate() */ bool AUDIO_IO::supports_seeking(void) const { return true; } /** * Whether device supports sample accurate seeking. * * @see supports_seeking() * * Note that return value may change after device is * opened (some objects will refine their attributes after * external resources are acquired). * * By default, sample accurate seeking is supported if * supports_seeking() returns 'true'. */ bool AUDIO_IO::supports_seeking_sample_accurate(void) const { return AUDIO_IO::supports_seeking(); } /** * Whether audio stream has a distinct length. It's important * to note the difference between this attribute and * 'supports_seeking()'. For example, a file read through * a pipe mechanism is not seekable and its length is not * known until 'finished()´ becomes true, but still, it is * of finite length. A sine oscillator on the other hand * can go on producing a signal forever, and is thus infinite. * * This attributes directly affects how 'finished()' should * to be interpreted. @see finished(). * * Note that return value may change after device is * opened (some objects will refine their attributes after * external resources are acquired). * * By default, audio streams are finite length. */ bool AUDIO_IO::finite_length_stream(void) const { return true; } /** * Whether audio format is fully or partially locked. If this is true, * audio object has a known audio format, and may not allow to * override some or all of the values. * * Example 1: When working with existing audio files (reading * or updating), the audio parameters are locked to values * specified in the file header. * * Example 2: File format (or audio subsystem interface specification) * may hardcode some of the parameters (e.g. only support * float samples). In these cases locked_audio_format() * will return true, although some of the parameters may * still be freely set. Client should check after open() * which values were set according to its wishes, and which * were limited by the audio object implementation. * * By default, audio format is not locked. */ bool AUDIO_IO::locked_audio_format(void) const { return false; } // =================================================================== // Configuration (setting and getting configuration parameters) /** * Returns info about the current I/O mode. */ int AUDIO_IO::io_mode(void) const { return io_mode_rep; } /** * Set object input/output-mode. If the requested mode isn't * supported, the nearest supported mode is used. Because * of this, it's wise to afterwards check whether the requested * mode was accepted. * * require: * is_open() != true */ void AUDIO_IO::set_io_mode(int mode) { io_mode_rep = mode; } /** * Sets the object label. Label is used to identify the object instance. * Unlike ECA_OBJECT::name(), which is typically the same for all * instances of the class, label() is instance specific. Still it * is not guaranteed to be unique for each object. Device and file * names are typical label values. * * require: * is_open() != true */ void AUDIO_IO::set_label(const string& id_label) { id_label_rep = id_label; } /** * Enable/disbale nonblocking mode. * * require: * is_open() != true */ void AUDIO_IO::toggle_nonblocking_mode(bool value) { nonblocking_rep = value; } /** * Returns the current label. See documentation for * label(const string&). */ const string& AUDIO_IO::label(void) const { return id_label_rep; } /** * Returns a string containing info about sample format parameters. */ string AUDIO_IO::format_info(void) const { MESSAGE_ITEM otemp; if (locked_audio_format() == true && is_open() != true) { otemp << "Using audio format specified in file header data (file not yet opened)."; } else { otemp << "Format: " << format_string(); otemp << ", channels " << channels(); otemp << ", srate " << samples_per_second(); if (interleaved_channels() == true) otemp << ", interleaved"; else otemp << ", noninterleaved"; if (locked_audio_format() == true) otemp << " (locked params)."; else otemp << "."; } return otemp.to_string(); } void AUDIO_IO::set_parameter(int param, string value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, AUDIO_IO::parameter_set_to_string(param, value)); if (param == 1) set_label(value); } string AUDIO_IO::get_parameter(int param) const { ECA_LOG_MSG(ECA_LOGGER::system_objects, AUDIO_IO::parameter_get_to_string(param)); if (param == 1) return label(); return ""; } /** * Returns a debugging string for a parameter value change. */ string AUDIO_IO::parameter_get_to_string(int param) const { return string("get param ") + kvu_numtostr(param) + " of \"" + label() + "\": \"" + kvu_numtostr(param) + "\""; } /** * Returns a debugging string for a parameter value change. */ string AUDIO_IO::parameter_set_to_string(int param, string value) const { return string("set param ") + kvu_numtostr(param) + " of \"" + label() + "\" to \"" + value + "\""; } // =================================================================== // Main functionality void AUDIO_IO::open(void) throw (AUDIO_IO::SETUP_ERROR &) { DBC_REQUIRE(is_open() != true); DBC_CHECK(channels() > 0); DBC_CHECK(sample_format() != ECA_AUDIO_FORMAT::sfmt_none); DBC_CHECK(samples_per_second() > 0); open_rep = true; if (supports_seeking() == true) seek_position(position_in_samples()); else /* note: if seeking is not supported, object always starts * at position 0 when opened */ set_position_in_samples(0); } void AUDIO_IO::close(void) { DBC_REQUIRE(is_open() == true); open_rep = false; } // =================================================================== // Runtime information /** * If applicable, returns total length of the audio data stored * into current audio object. In many situations it's impossible * enquire the whole length of the object. For instance, if the * object is streaming a finite length audio stream audio object * from other applications using some type of standard IPC, * the actual length won't be known until the whole stream has * been read. As a general rule, if 'supports_seeking() == true', * length can be known right after initialization. Then again, * if 'finite_length_stream() == true', the whole stream must * be processed before we know the actual length. In other * cases, length is unknown or infinite. */ ECA_AUDIO_TIME AUDIO_IO::length(void) const { return ECA_AUDIO_TIME(length_in_samples(), samples_per_second()); } /** * Returns the current position. */ ECA_AUDIO_TIME AUDIO_IO::position(void) const { return ECA_AUDIO_TIME(position_in_samples(), samples_per_second()); } /** * Is nonblocking mode is enabled? */ bool AUDIO_IO::nonblocking_mode(void) const { return nonblocking_rep; } /** * Is the audio object ready for reading? */ bool AUDIO_IO::readable(void) const { return is_open() && io_mode() != io_write; } /** * Is the audio object ready for writing? */ bool AUDIO_IO::writable(void) const { return is_open() && io_mode() != io_read; } /** * Sets the total length of audio object data. */ void AUDIO_IO::length(const ECA_AUDIO_TIME& v) { set_length_in_samples(v.samples()); } /** * Sets the current position. */ void AUDIO_IO::position(const ECA_AUDIO_TIME& v) { if (v.samples_per_second() == samples_per_second()) set_position_in_samples(v.samples()); else { ECA_AUDIO_TIME modified (v); modified.set_samples_per_second_keeptime(samples_per_second()); set_position_in_samples(modified.samples()); } } /** * Optional status string * * An unformatted text string describing the state and status of * the current object. */ string AUDIO_IO::status(void) const { MESSAGE_ITEM mitem; mitem.setprecision(3); mitem << "position (" << position_in_seconds_exact() << "/"; if (finite_length_stream() == true) mitem << length_in_seconds_exact(); else mitem << "inf"; mitem << ") seconds.\n -> "; if (is_open() == true) mitem << "open, "; else mitem << "closed"; if (locked_audio_format() == true && is_open() != true) { mitem << ", audio format not available until object is opened."; } else { mitem << ", " << format_string() << "/" << channels() << "ch/" << samples_per_second(); mitem << "Hz, buffer " << buffersize() << "."; } return mitem.to_string(); } /** * Overrides the non-virtaul function * ECA_SAMPLERATE_AWARE::samples_per_second(), that is * present (through inheritance) in both ECA_AUDIO_FORMAT * and ECA_AUDIO_POSITION. */ SAMPLE_SPECS::sample_rate_t AUDIO_IO::samples_per_second(void) const { DBC_CHECK(ECA_AUDIO_FORMAT::samples_per_second() == ECA_AUDIO_POSITION::samples_per_second()); return ECA_AUDIO_FORMAT::samples_per_second(); } void AUDIO_IO::set_samples_per_second(SAMPLE_SPECS::sample_rate_t v) { ECA_AUDIO_FORMAT::set_samples_per_second(v); ECA_AUDIO_POSITION::set_samples_per_second(v); ECA_LOG_MSG(ECA_LOGGER::system_objects, "set srate, aobj \"" + name() + ":" + label() + "\" to " + kvu_numtostr(v) + "."); } void AUDIO_IO::set_audio_format(const ECA_AUDIO_FORMAT& f_str) { ECA_AUDIO_FORMAT::set_audio_format(f_str); ECA_AUDIO_POSITION::set_samples_per_second(f_str.samples_per_second()); } SAMPLE_SPECS::sample_pos_t AUDIO_IO::seek_position(SAMPLE_SPECS::sample_pos_t pos) { if (supports_seeking() != true && pos != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: seeking not supported by audio objects of type \"" + name() + "\"."); return position_in_samples(); } return pos; } ecasound-2.9.3/libecasound/audiofx_ladspa.cpp0000644000076400007640000003145013604161211016234 00000000000000// ------------------------------------------------------------------------ // audiofx_ladspa.cpp: Wrapper class for LADSPA plugins // Copyright (C) 2000-2004,2011,2020 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // References: // http://www.ladspa.org // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "samplebuffer.h" #include "audiofx_ladspa.h" #include "eca-error.h" #include "eca-logger.h" EFFECT_LADSPA::EFFECT_LADSPA (const LADSPA_Descriptor *pdesc) throw(ECA_ERROR&) { plugin_desc = pdesc; if ((plugin_desc->Properties & LADSPA_PROPERTY_INPLACE_BROKEN) == LADSPA_PROPERTY_INPLACE_BROKEN) throw(ECA_ERROR("AUDIOFX_LADSPA", "Inplace-broken plugins not supported.")); /* FIXME: strip linefeeds and other forbidden characters; write down to * to ECA_OBJECT docs what chars are allowed and what are not... */ name_rep = string(plugin_desc->Name); unique_rep = string(plugin_desc->Label); maker_rep = string(plugin_desc->Maker); unique_number_rep = static_cast(plugin_desc->UniqueID); buffer_repp = 0; init_ports(); } EFFECT_LADSPA::~EFFECT_LADSPA (void) { release(); if (plugin_desc != 0) { for(unsigned int n = 0; n < plugins_rep.size(); n++) { if (plugin_desc->deactivate != 0) plugin_desc->deactivate(plugins_rep[n]); if (plugin_desc->cleanup != 0) plugin_desc->cleanup(plugins_rep[n]); } } } std::string EFFECT_LADSPA::description(void) const { return name_rep + " - Author: '" + maker_rep + "'"; } EFFECT_LADSPA* EFFECT_LADSPA::clone(void) const { EFFECT_LADSPA* result = new EFFECT_LADSPA(plugin_desc); for(int n = 0; n < number_of_params(); n++) { result->set_parameter(n + 1, get_parameter(n + 1)); } return result; } void EFFECT_LADSPA::init_ports(void) { // note: run from plugin constructor port_count_rep = plugin_desc->PortCount; in_audio_ports = 0; out_audio_ports = 0; for(unsigned long m = 0; m < port_count_rep; m++) { if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_AUDIO) == LADSPA_PORT_AUDIO) { if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_INPUT) == LADSPA_PORT_INPUT) ++in_audio_ports; else ++out_audio_ports; } if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_CONTROL) == LADSPA_PORT_CONTROL) { struct PARAM_DESCRIPTION pd; parse_parameter_hint_information(m, params.size() + 1, &pd); params.push_back(pd.default_value); param_descs_rep.push_back(pd); if (params.size() > 1) param_names_rep += ","; string tmp (kvu_string_search_and_replace(string(plugin_desc->PortNames[m]), ",", "\\,")); param_names_rep += kvu_string_search_and_replace(tmp, ":", "\\:"); } } } void EFFECT_LADSPA::parse_parameter_hint_information(int portnum, int paramnum, struct PARAM_DESCRIPTION *pd) { LADSPA_PortRangeHintDescriptor hintdescriptor = plugin_desc->PortRangeHints[portnum].HintDescriptor; /* if srate not set, use 44.1kHz (used only for calculating * param hint values */ SAMPLE_SPECS::sample_rate_t srate = samples_per_second(); /* FIXME: this is just ugly! */ if (srate <= 0) { srate = 44100; } /** * For LADSPA v1.1, parameter hint information is * used as advertised by the plugin. LADSPA v1.0 * API doesn't specify how to initialize control * ports to sane initial values, so we just try to * make an educated guess based on the lower and * upper bounds. * * 1) v1.1 hint information available * 2) lowb == x and upperb == n/a * a) x < 0, initval = 0 * b) x >= 0, initval = x * 3) lowb == n/a and upperb == x * a) x > 0, initval = 0 * b) x <= 0, initval = x * 4) lowb == x and upperb == y * a) x < 0 and y > 0, initval = 0 * b) x < 0 and y < 0, initval = y * c) x > 0 and y > 0, initval = x * 5) lowb == n/a and upperb == n/a, initval = 1 */ /* parameter name */ pd->description = string(plugin_desc->PortNames[portnum]); /* upper and lower bounds */ if (LADSPA_IS_HINT_BOUNDED_BELOW(hintdescriptor)) { pd->bounded_below = true; if (LADSPA_IS_HINT_SAMPLE_RATE(hintdescriptor)) pd->lower_bound = plugin_desc->PortRangeHints[portnum].LowerBound * srate; else pd->lower_bound = plugin_desc->PortRangeHints[portnum].LowerBound; } else { pd->bounded_below = false; } if (LADSPA_IS_HINT_BOUNDED_ABOVE(hintdescriptor)) { pd->bounded_above = true; if (LADSPA_IS_HINT_SAMPLE_RATE(hintdescriptor)) pd->upper_bound = plugin_desc->PortRangeHints[portnum].UpperBound * srate; else pd->upper_bound = plugin_desc->PortRangeHints[portnum].UpperBound; } else { pd->bounded_above = false; } /* defaults - case 1 */ if (LADSPA_IS_HINT_HAS_DEFAULT(hintdescriptor)) { if (LADSPA_IS_HINT_DEFAULT_MINIMUM(hintdescriptor)) { pd->default_value = pd->lower_bound; } /* FIXME: add support for logarithmic defaults */ else if (LADSPA_IS_HINT_DEFAULT_LOW(hintdescriptor)) { pd->default_value = pd->lower_bound * 0.75f + pd->upper_bound * 0.25f; } else if (LADSPA_IS_HINT_DEFAULT_MIDDLE(hintdescriptor)) { pd->default_value = pd->lower_bound * 0.50f + pd->upper_bound * 0.50f; } else if (LADSPA_IS_HINT_DEFAULT_HIGH(hintdescriptor)) { pd->default_value = pd->lower_bound * 0.25f + pd->upper_bound * 0.75f; } else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM(hintdescriptor)) { pd->default_value = pd->upper_bound; } else if (LADSPA_IS_HINT_DEFAULT_0(hintdescriptor)) { pd->default_value = 0.0f; } else if (LADSPA_IS_HINT_DEFAULT_1(hintdescriptor)) { pd->default_value = 1.0f; } else if (LADSPA_IS_HINT_DEFAULT_100(hintdescriptor)) { pd->default_value = 100.0f; } else if (LADSPA_IS_HINT_DEFAULT_440(hintdescriptor)) { pd->default_value = 440.0f; } else { ECA_LOG_MSG(ECA_LOGGER::info, "No LADSPA hint info found for plugin '" + name_rep + "'."); } } /* defaults - case 2 */ else if (LADSPA_IS_HINT_BOUNDED_BELOW(hintdescriptor) && !LADSPA_IS_HINT_BOUNDED_ABOVE(hintdescriptor)) { if (pd->lower_bound < 0) pd->default_value = 0.0f; else pd->default_value = pd->lower_bound; } /* defaults - case 3 */ else if (!LADSPA_IS_HINT_BOUNDED_BELOW(hintdescriptor) && LADSPA_IS_HINT_BOUNDED_ABOVE(hintdescriptor)) { if (pd->upper_bound > 0) pd->default_value = 0.0f; else pd->default_value = pd->upper_bound; } /* defaults - case 4 */ else if (LADSPA_IS_HINT_BOUNDED_BELOW(hintdescriptor) && LADSPA_IS_HINT_BOUNDED_ABOVE(hintdescriptor)) { if (pd->lower_bound < 0 && pd->upper_bound > 0) pd->default_value = 0.0f; else if (pd->lower_bound < 0 && pd->upper_bound < 0) pd->default_value = pd->upper_bound; else pd->default_value = pd->lower_bound; } /* defaults - case 5 */ else { DBC_CHECK(!LADSPA_IS_HINT_BOUNDED_BELOW(hintdescriptor) && !LADSPA_IS_HINT_BOUNDED_ABOVE(hintdescriptor)); if (LADSPA_IS_HINT_SAMPLE_RATE(hintdescriptor)) pd->default_value = srate; else pd->default_value = 1.0f; } if (LADSPA_IS_HINT_TOGGLED(hintdescriptor)) pd->toggled = true; else pd->toggled = false; if (LADSPA_IS_HINT_INTEGER(hintdescriptor)) pd->integer = true; else pd->integer = false; if (LADSPA_IS_HINT_LOGARITHMIC(hintdescriptor)) pd->logarithmic = true; else pd->logarithmic = false; if ((plugin_desc->PortDescriptors[portnum] & LADSPA_PORT_OUTPUT) == LADSPA_PORT_OUTPUT) pd->output = true; else pd->output = false; } void EFFECT_LADSPA::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { DBC_CHECK(param >= 0); DBC_CHECK(param <= static_cast(param_descs_rep.size())); *pd = param_descs_rep[param - 1]; } void EFFECT_LADSPA::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { if (param > 0 && (param - 1 < static_cast(params.size()))) { // cerr << "ladspa: setting param " << param << " to " << value << "." << endl; params[param - 1] = value; } } CHAIN_OPERATOR::parameter_t EFFECT_LADSPA::get_parameter(int param) const { if (param > 0 && (param - 1 < static_cast(params.size()))) { // cerr << "ladspa: getting param " << param << " with value " << params[param - 1] << "." << endl; return(params[param - 1]); } return(0.0); } int EFFECT_LADSPA::output_channels(int i_channels) const { // note: We have two separate cases: either one plugin // is instantiated for each channel, or one plugin // per chain. See EFFECT_LADSPA::init(). if (in_audio_ports > 1 || out_audio_ports > 1) { return out_audio_ports; } return i_channels; } void EFFECT_LADSPA::init(SAMPLE_BUFFER *insample) { EFFECT_BASE::init(insample); DBC_CHECK(samples_per_second() > 0); if (buffer_repp != insample) { release(); buffer_repp = insample; buffer_repp->get_pointer_reflock(); } if (plugin_desc != 0) { for(unsigned int n = 0; n < plugins_rep.size(); n++) { if (plugin_desc->deactivate != 0) plugin_desc->deactivate(plugins_rep[n]); plugin_desc->cleanup(plugins_rep[n]); } } // NOTE: the fancy definition :) // if ((in_audio_ports > 1 && // in_audio_ports <= channels() && // out_audio_ports <= channels()) || // (out_audio_ports > 1 && // in_audio_ports <= channels() && // out_audio_ports <= channels())) {} if (in_audio_ports > 1 || out_audio_ports > 1) { plugins_rep.resize(1); plugins_rep[0] = reinterpret_cast(plugin_desc->instantiate(plugin_desc, samples_per_second())); int inport = 0; int outport = 0; for(unsigned long m = 0; m < port_count_rep; m++) { if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_AUDIO) == LADSPA_PORT_AUDIO) { if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_INPUT) == LADSPA_PORT_INPUT) { if (inport < channels()) plugin_desc->connect_port(plugins_rep[0], m, buffer_repp->buffer[inport]); ++inport; } else { if (outport < channels()) plugin_desc->connect_port(plugins_rep[0], m, buffer_repp->buffer[outport]); ++outport; } } } if (inport > channels()) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: chain has less channels than plugin has input ports (" + name() + ")."); if (outport > channels()) ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: chain has less channels than plugin has output ports (" + name() + ")."); } else { plugins_rep.resize(channels()); for(unsigned int n = 0; n < plugins_rep.size(); n++) { plugins_rep[n] = reinterpret_cast(plugin_desc->instantiate(plugin_desc, samples_per_second())); for(unsigned long m = 0; m < port_count_rep; m++) { if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_AUDIO) == LADSPA_PORT_AUDIO) { plugin_desc->connect_port(plugins_rep[n], m, buffer_repp->buffer[n]); } } } } ECA_LOG_MSG(ECA_LOGGER::system_objects, "Instantiated " + kvu_numtostr(plugins_rep.size()) + " LADSPA plugin(s), each with " + kvu_numtostr(in_audio_ports) + " audio input port(s) and " + kvu_numtostr(out_audio_ports) + " output port(s), to chain with " + kvu_numtostr(channels()) + " channel(s) and srate of " + kvu_numtostr(samples_per_second()) + "."); int data_index = 0; for(unsigned long m = 0; m < port_count_rep; m++) { if ((plugin_desc->PortDescriptors[m] & LADSPA_PORT_CONTROL) == LADSPA_PORT_CONTROL) { for(unsigned int n = 0; n < plugins_rep.size(); n++) { plugin_desc->connect_port(plugins_rep[n], m, &(params[data_index])); } ++data_index; } } for(unsigned long m = 0; m < plugins_rep.size(); m++) if (plugin_desc->activate != 0) plugin_desc->activate(plugins_rep[m]); } void EFFECT_LADSPA::release(void) { if (buffer_repp != 0) { buffer_repp->release_pointer_reflock(); } buffer_repp = 0; } void EFFECT_LADSPA::process(void) { for(unsigned long m = 0; m < plugins_rep.size(); m++) plugin_desc->run(plugins_rep[m], buffer_repp->length_in_samples()); } ecasound-2.9.3/libecasound/eca-sample-conversion_test.h0000644000076400007640000001456711501140617020162 00000000000000// ------------------------------------------------------------------------ // eca-sample-conversion_test.h: Unit test for sample conversion routines // Copyright (C) 2002,2010 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "eca-sample-conversion.h" #include "kvu_numtostr.h" #include "eca-logger.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_SAMPLE-CONVERSION. */ class ECA_SAMPLE_CONVERSION_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for eca-sample-conversion"); } virtual void do_run(void); public: virtual ~ECA_SAMPLE_CONVERSION_TEST(void) { } }; void ECA_SAMPLE_CONVERSION_TEST::do_run(void) { double dmax = 1.0f; double dmin = -1.0f; double dzero = 0.0f; bool verbose = false; if (getenv("V") != NULL) verbose = true; uint8_t u8min = eca_sample_convert_float_to_u8(dmin); if (verbose) cout << "-unity to u8 =" << (int)u8min << "\n"; if (abs((int)(u8min - UINT8_MIN)) > 1) { ECA_TEST_FAILURE("abs(u8min - UINT8_MIN) > 1"); } uint8_t u8max = eca_sample_convert_float_to_u8(dmax); if (verbose) cout << "unity to u8 =" << (int)u8max << "\n"; if (abs((int)(u8max - UINT8_MAX)) > 1) { ECA_TEST_FAILURE("abs(u8max - UINT8_MAX) > 1"); } uint8_t u8zero = eca_sample_convert_float_to_u8(dzero); if (verbose) cout << "zero to u8 =" << (int)u8zero << "\n"; if (u8zero != 128) { ECA_TEST_FAILURE("u8zero != 128"); } int16_t s16min = eca_sample_convert_float_to_s16(dmin); if (verbose) cout << "-unity to s16 =" << s16min << "\n"; if (abs(s16min - INT16_MIN) > 1) { ECA_TEST_FAILURE("abs(s16min - INT16_MIN) > 1"); } int16_t s16max = eca_sample_convert_float_to_s16(dmax); if (verbose) cout << "unity to s16 =" << s16max << "\n"; if (abs(s16max - INT16_MAX) > 1) { ECA_TEST_FAILURE("abs(s16max - INT16_MAX) > 1"); } int16_t s16zero = eca_sample_convert_float_to_s16(dzero); if (verbose) cout << "zero to s16 =" << s16zero << "\n"; if (s16zero != 0) { ECA_TEST_FAILURE("s16zero != 0"); } int32_t s32min = eca_sample_convert_float_to_s32(dmin); if (verbose) cout << "-unity to s32 =" << s32min << "\n"; if (labs(s32min - INT32_MIN) > 1) { ECA_TEST_FAILURE("labs(s32min - INT32_MIN) > 1"); } int32_t s32max = eca_sample_convert_float_to_s32(dmax); if (verbose) cout << "unity to s32 =" << s32max << "\n"; if (labs(s32max - INT32_MAX) > 1) { ECA_TEST_FAILURE("labs(s32max - INT32_MAX) > 1"); } int32_t s32zero = eca_sample_convert_float_to_s32(dzero); if (verbose) cout << "zero to s32 =" << s16zero << "\n"; if (s32zero != 0) { ECA_TEST_FAILURE("s32zero != 0"); } float cur = eca_sample_convert_u8_to_float(UINT8_MIN); if (verbose) cout << "u8min to float =" << cur << "\n"; if (cur > -1.0f || cur < -1.0f) { ECA_TEST_FAILURE("to_float: u8min"); } cur = eca_sample_convert_u8_to_float(UINT8_MAX); if (verbose) cout << "u8max to float =" << cur << "\n"; if (cur > 1.0f) { ECA_TEST_FAILURE("to_float: u8max"); } cur = eca_sample_convert_s16_to_float(INT16_MIN); if (verbose) cout << "s16min to float =" << cur << "\n"; if (cur > -1.0f || cur < -1.0f) { if (verbose) cout << "s16min to float: WARNING, suspect value\n"; // ECA_TEST_FAILURE("to_float: s16min"); } cur = eca_sample_convert_s16_to_float(INT16_MIN + 1); if (verbose) cout << "s16min+1 to float =" << cur << "\n"; if (cur > -1.0f || cur < -1.0f) { if (verbose) cout << "s16min+1 to float: WARNING, suspect value\n"; // ECA_TEST_FAILURE("to_float: s16min"); } cur = eca_sample_convert_s16_to_float(INT16_MAX); if (verbose) cout << "s16max to float =" << cur << "\n"; if (cur > 1.0f) { ECA_TEST_FAILURE("to_float: s16max"); } cur = eca_sample_convert_s32_to_float(INT32_MIN + 1); if (verbose) cout << "s32min+1 to float =" << cur << "\n"; if (cur > -1.0f || cur < -1.0f) { ECA_TEST_FAILURE("to_float: s32min+1"); } cur = eca_sample_convert_s32_to_float(INT32_MIN); if (verbose) cout << "s32min to float =" << cur << "\n"; if (cur > -1.0f || cur < -1.0f) { ECA_TEST_FAILURE("to_float: s32min"); } cur = eca_sample_convert_s32_to_float(INT32_MAX); if (verbose) cout << "s32max to float =" << cur << "\n"; if (cur < 1.0f || cur > 1.0f) { ECA_TEST_FAILURE("to_float: s32max"); } #define S16INTFLOATINT(y) \ { \ float mid = eca_sample_convert_s16_to_float(y); \ int16_t res = eca_sample_convert_float_to_s16(mid); \ if (verbose) cout << "s16 ifi " << (y) << " to " << mid << " to " << res << endl; \ if (res != (y)) { \ if (verbose) cout << "s16 ifi: WARNING, suspect value\n"; \ /* report_failure(__FILE__, __LINE__, "s16 ifi" + kvu_numtostr(y)); */ \ } \ } S16INTFLOATINT(INT16_MAX); S16INTFLOATINT(-INT16_MAX); S16INTFLOATINT(INT16_MIN); S16INTFLOATINT(0); S16INTFLOATINT(1); S16INTFLOATINT(1 << 8); S16INTFLOATINT(-1); S16INTFLOATINT(-1 << 8); #define S32INTFLOATINT(y) \ { \ float mid = eca_sample_convert_s32_to_float(y); \ int32_t res = eca_sample_convert_float_to_s32(mid); \ cout << "s32 ifi " << (y) << " to " << mid << " to " << res << endl; \ if (res != (y)) { \ if (verbose) cout << "s32 ifi: WARNING, suspect value\n"; \ /*report_failure(__FILE__, __LINE__, "s32 ifi " + kvu_numtostr(y)); */ \ } \ } S32INTFLOATINT(INT32_MAX); S32INTFLOATINT(-INT32_MAX); S32INTFLOATINT(INT32_MIN); S32INTFLOATINT(0); S32INTFLOATINT(1); S32INTFLOATINT(1 << 8); S32INTFLOATINT(1 << 16); S32INTFLOATINT(-1 << 20); S32INTFLOATINT(-1); S32INTFLOATINT(-1 << 8); S32INTFLOATINT(-1 << 16); S32INTFLOATINT(-1 << 20); } ecasound-2.9.3/libecasound/eca-chainsetup_test.h0000644000076400007640000000407111141021054016637 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup_test.h: Unit test for ECA_CHAINSETUP // Copyright (C) 2002,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "eca-chainsetup.h" #include "kvu_numtostr.h" #include "eca-logger.h" #include "eca-test-case.h" using namespace std; /** * Unit test for ECA_CHAINSETUP. * * FIXME: implementation not ready */ class ECA_CHAINSETUP_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("Unit test for ECA_CHAINSETUP"); } virtual void do_run(void); public: virtual ~ECA_CHAINSETUP_TEST(void) { } private: void do_run_save_and_restore(void); }; void ECA_CHAINSETUP_TEST::do_run(void) { do_run_save_and_restore(); } void ECA_CHAINSETUP_TEST::do_run_save_and_restore(void) { /** * FIXME: * - create simple setup with multiple instance of all basic * object types and operations * - save to temp .ecs * - clear chainseup * - load saved .ecs * - verify chainsetup integrity and contents * - use -y to set offsets for audio objects; verify after reload * - save and test again (to get the whole: 'manual definition -> * save -> load -> save -> load' cycle) */ } ecasound-2.9.3/libecasound/audioio-barrier.h0000644000076400007640000000140210765306273016003 00000000000000#ifndef INCLUDED_AUDIO_IO_BARRIER_H #define INCLUDED_AUDIO_IO_BARRIER_H /** * Interface class that introduces audio i/o barriers. * The barriers are used to signal that processing * will be started or stopped. */ class AUDIO_IO_BARRIER { public: /** * Starts I/O processing. * * The read_buffer()/write_buffer() functions will not be called * before I/O started. Also, it is guaranteed that stop_io() will * be called from the same thread as start_io() was called from. */ virtual void start_io(void) = 0; /** * Stops I/O processing. * * The read_buffer()/write_buffer() functions will not be called * after I/O has been stopped. */ virtual void stop_io(void) = 0; virtual ~AUDIO_IO_BARRIER(void) {} }; #endif ecasound-2.9.3/libecasound/audioio-seqbase.h0000644000076400007640000001052011433025723015770 00000000000000#ifndef INCLUDED_AUDIOIO_SEQUENCER_BASE_H #define INCLUDED_AUDIOIO_SEQUENCER_BASE_H #include #include "audioio-proxy.h" #include "samplebuffer.h" #include "eca-audio-time.h" /** * Base class for audio sequencer objects. * * Audio sequencer objects open one or more child objects * and alter the sequence of audio that is read from them. * Common operations are changing the position (inserting * silence at start, slicing), and looping of segments. * * The child objects also implement the AUDIO_IO interface, * or one of the more specialized subclasses. * * Related design patterns: * - Proxy (GoF207) * * @author Kai Vehmanen */ class AUDIO_SEQUENCER_BASE : public AUDIO_IO_PROXY { public: /** @name Public functions */ /*@{*/ AUDIO_SEQUENCER_BASE (); virtual ~AUDIO_SEQUENCER_BASE(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ /* Pure virtual class, not implemented */ /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ /* none */ /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_SEQUENCER_BASE* clone(void) const; virtual AUDIO_SEQUENCER_BASE* new_expr(void) const { return new AUDIO_SEQUENCER_BASE(); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual bool finite_length_stream(void) const; virtual bool finished(void) const; virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); /*@}*/ /** @name New functions */ /*@{*/ /** * Sets the child object to open. Argument 'v' should * be a string suitable for passing to ECA_OBJECT_MAP::object(), * i.e. a Ecasound Option Syntax (EOS) string. */ void set_child_object_string(const std::string& v); const std::string& child_object_string(void) const { return child_object_str_rep; } /** * Sets start offset for the child object. * * At this offset, samples from the child start to * be read. * * If not set, defaults to zero offset (start * consuming child object samples from the beginning). */ void set_child_offset(const ECA_AUDIO_TIME& v); const ECA_AUDIO_TIME& child_offset(void) const { return child_offset_rep; } /** * Set start position inside child object. * * This is the position, within the child object, where * first samples will be read. * * If not set, defaults to zero (read from start of * child object). */ void set_child_start_position(const ECA_AUDIO_TIME& v); const ECA_AUDIO_TIME& child_start_position(void) const { return child_start_pos_rep; } /** * Set the child length. * * If not set, defaults to the total length of * the child object. * * @see reset_child_length(void); */ void set_child_length(const ECA_AUDIO_TIME& v); /** * Returns the child length. * * Note that in the case that child length is infinite, * the returned object may be invalid (ECA_AUDIO_TIME::valid() * returns false). So caller must check validity of * the returned value before using it. */ ECA_AUDIO_TIME child_length(void) const; /** * Toggle whether child object data is looped. */ void toggle_looping(bool v) { child_looping_rep = v; } bool child_looping(void) const { return child_looping_rep; } /*@}*/ protected: void dump_child_debug(const char *tag); void set_child_length_private(const ECA_AUDIO_TIME& v); SAMPLE_SPECS::sample_pos_t priv_public_to_child_pos(SAMPLE_SPECS::sample_pos_t pubpos) const; private: SAMPLE_BUFFER tmp_buffer; bool child_looping_rep; ECA_AUDIO_TIME child_offset_rep, child_start_pos_rep, child_length_rep; bool child_length_set_by_client_rep; std::string child_object_str_rep; long int buffersize_rep; bool child_write_started; bool init_rep; void change_child_name(const string& child_name) throw(AUDIO_IO::SETUP_ERROR &); AUDIO_SEQUENCER_BASE& operator=(const AUDIO_SEQUENCER_BASE& x) { return *this; } AUDIO_SEQUENCER_BASE (const AUDIO_SEQUENCER_BASE& x) { } }; #endif ecasound-2.9.3/libecasound/ladspa.h0000644000076400007640000006571111224162022014166 00000000000000/* ladspa.h Linux Audio Developer's Simple Plugin API Version 1.1[LGPL]. Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis, Stefan Westerfeld. 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.1 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. */ #ifndef LADSPA_INCLUDED #define LADSPA_INCLUDED #define LADSPA_VERSION "1.1" #define LADSPA_VERSION_MAJOR 1 #define LADSPA_VERSION_MINOR 1 #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. 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). For audio it is generally assumed that 1.0f is the `0dB' reference amplitude and is a `normal' signal level. */ 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 except LADSPA_HINT_DEFAULT_0 or LADSPA_HINT_DEFAULT_1. */ #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 /* The various LADSPA_HINT_HAS_DEFAULT_* hints indicate a `normal' value for the port that is sensible as a default. For instance, this value is suitable for use as an initial value in a user interface or as a value the host might assign to a control port when the user has not provided one. Defaults are encoded using a mask so only one default may be specified for a port. Some of the hints make use of lower and upper bounds, in which case the relevant bound or bounds must be available and LADSPA_HINT_SAMPLE_RATE must be applied as usual. The resulting default must be rounded if LADSPA_HINT_INTEGER is present. Default values were introduced in LADSPA v1.1. */ #define LADSPA_HINT_DEFAULT_MASK 0x3C0 /* This default values indicates that no default is provided. */ #define LADSPA_HINT_DEFAULT_NONE 0x0 /* This default hint indicates that the suggested lower bound for the port should be used. */ #define LADSPA_HINT_DEFAULT_MINIMUM 0x40 /* This default hint indicates that a low value between the suggested lower and upper bounds should be chosen. For ports with LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.75 + log(upper) * 0.25). Otherwise, this should be (lower * 0.75 + upper * 0.25). */ #define LADSPA_HINT_DEFAULT_LOW 0x80 /* This default hint indicates that a middle value between the suggested lower and upper bounds should be chosen. For ports with LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.5 + log(upper) * 0.5). Otherwise, this should be (lower * 0.5 + upper * 0.5). */ #define LADSPA_HINT_DEFAULT_MIDDLE 0xC0 /* This default hint indicates that a high value between the suggested lower and upper bounds should be chosen. For ports with LADSPA_HINT_LOGARITHMIC, this should be exp(log(lower) * 0.25 + log(upper) * 0.75). Otherwise, this should be (lower * 0.25 + upper * 0.75). */ #define LADSPA_HINT_DEFAULT_HIGH 0x100 /* This default hint indicates that the suggested upper bound for the port should be used. */ #define LADSPA_HINT_DEFAULT_MAXIMUM 0x140 /* This default hint indicates that the number 0 should be used. Note that this default may be used in conjunction with LADSPA_HINT_TOGGLED. */ #define LADSPA_HINT_DEFAULT_0 0x200 /* This default hint indicates that the number 1 should be used. Note that this default may be used in conjunction with LADSPA_HINT_TOGGLED. */ #define LADSPA_HINT_DEFAULT_1 0x240 /* This default hint indicates that the number 100 should be used. */ #define LADSPA_HINT_DEFAULT_100 0x280 /* This default hint indicates that the Hz frequency of `concert A' should be used. This will be 440 unless the host uses an unusual tuning convention, in which case it may be within a few Hz. */ #define LADSPA_HINT_DEFAULT_440 0x2C0 #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) #define LADSPA_IS_HINT_HAS_DEFAULT(x) ((x) & LADSPA_HINT_DEFAULT_MASK) #define LADSPA_IS_HINT_DEFAULT_MINIMUM(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_MINIMUM) #define LADSPA_IS_HINT_DEFAULT_LOW(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_LOW) #define LADSPA_IS_HINT_DEFAULT_MIDDLE(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_MIDDLE) #define LADSPA_IS_HINT_DEFAULT_HIGH(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_HIGH) #define LADSPA_IS_HINT_DEFAULT_MAXIMUM(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_MAXIMUM) #define LADSPA_IS_HINT_DEFAULT_0(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_0) #define LADSPA_IS_HINT_DEFAULT_1(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_1) #define LADSPA_IS_HINT_DEFAULT_100(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_100) #define LADSPA_IS_HINT_DEFAULT_440(x) (((x) & LADSPA_HINT_DEFAULT_MASK) \ == LADSPA_HINT_DEFAULT_440) 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 */ ecasound-2.9.3/libecasound/audioio-reverse.cpp0000644000076400007640000001575011161513103016355 00000000000000// ------------------------------------------------------------------------ // audioio-reverse.cpp: A proxy class that reverts the child // object's data. // Copyright (C) 2002,2005,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "audioio-reverse.h" #include "audioio-resample.h" #include "eca-logger.h" #include "eca-object-factory.h" #include "samplebuffer.h" /** * Constructor. */ AUDIO_IO_REVERSE::AUDIO_IO_REVERSE (void) { tempbuf_repp = new SAMPLE_BUFFER(); init_rep = false; finished_rep = false; } /** * Destructor. */ AUDIO_IO_REVERSE::~AUDIO_IO_REVERSE (void) { } AUDIO_IO_REVERSE* AUDIO_IO_REVERSE::clone(void) const { AUDIO_IO_REVERSE* target = new AUDIO_IO_REVERSE(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIO_IO_REVERSE::open(void) throw(AUDIO_IO::SETUP_ERROR&) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "open " + label() + "."); if (io_mode() != AUDIO_IO::io_read) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-REVERSE: Reversed writing not supported!")); } if (init_rep != true) { AUDIO_IO* tmp = 0; const string& objname = child_params_as_string(1 + AUDIO_IO_REVERSE::child_parameter_offset, ¶ms_rep); if (objname.size() > 0) tmp = ECA_OBJECT_FACTORY::create_audio_object(objname); if (tmp == 0) throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-REVERSE: unable to open child object '" + objname + "'")); set_child(tmp); int numparams = child()->number_of_params(); for(int n = 0; n < numparams; n++) { child()->set_parameter(n + 1, get_parameter(n + 1 + AUDIO_IO_REVERSE::child_parameter_offset)); if (child()->variable_params()) numparams = child()->number_of_params(); } init_rep = true; /* must be set after dyn. parameters */ } ECA_LOG_MSG(ECA_LOGGER::user_objects, "checking whether child is a finite object"); pre_child_open(); child()->open(); post_child_open(); if (child()->finite_length_stream() != true) { child()->close(); throw(SETUP_ERROR(SETUP_ERROR::dynamic_params, "AUDIOIO-REVERSE: Unable to reverse an infinite length audio object " + child()->label() + ".")); } if (dynamic_cast(child()) != 0) { child()->close(); throw(SETUP_ERROR(SETUP_ERROR::dynamic_params, "AUDIOIO-REVERSE: 'resample' objects not supported")); } if (child()->supports_seeking() != true) { child()->close(); throw(SETUP_ERROR(SETUP_ERROR::dynamic_params, "AUDIOIO-REVERSE: Unable to reverse audio object types that don't support seek (" + child()->label() + ").")); } AUDIO_IO::open(); } void AUDIO_IO_REVERSE::close(void) { if (child()->is_open() == true) child()->close(); AUDIO_IO::close(); } bool AUDIO_IO_REVERSE::finished(void) const { return finished_rep; } string AUDIO_IO_REVERSE::parameter_names(void) const { return string("reverse,") + child()->parameter_names(); } void AUDIO_IO_REVERSE::set_parameter(int param, string value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "set_parameter " + label() + "."); /* total of n+1 params, where n is number of childobj params */ if (param > static_cast(params_rep.size())) params_rep.resize(param); if (param > 0) { params_rep[param - 1] = value; } if (param > AUDIO_IO_REVERSE::child_parameter_offset && init_rep == true) { child()->set_parameter(param - AUDIO_IO_REVERSE::child_parameter_offset, value); } } string AUDIO_IO_REVERSE::get_parameter(int param) const { ECA_LOG_MSG(ECA_LOGGER::user_objects, "get_parameter " + label() + "."); if (param > 0 && param < static_cast(params_rep.size()) + 1) { if (param > AUDIO_IO_REVERSE::child_parameter_offset && init_rep == true) { params_rep[param - 1] = child()->get_parameter(param - AUDIO_IO_REVERSE::child_parameter_offset); } return params_rep[param - 1]; } return ""; } SAMPLE_SPECS::sample_pos_t AUDIO_IO_REVERSE::seek_position(SAMPLE_SPECS::sample_pos_t pos) { finished_rep = false; ECA_LOG_MSG(ECA_LOGGER::user_objects, "seek_position " + kvu_numtostr(pos) + "."); return AUDIO_IO_PROXY::seek_position(pos); } void AUDIO_IO_REVERSE::read_buffer(SAMPLE_BUFFER* sbuf) { tempbuf_repp->number_of_channels(channels()); sbuf->number_of_channels(channels()); SAMPLE_BUFFER::buf_size_t read_count = buffersize(); /* phase 1: Seek to correct position and read one buffer */ SAMPLE_SPECS::sample_pos_t curpos = position_in_samples(); SAMPLE_SPECS::sample_pos_t newpos = child()->length_in_samples() - curpos - buffersize(); if (newpos <= 0) { child()->seek_position_in_samples(0); read_count = -newpos; finished_rep = true; } else { child()->seek_position_in_samples(newpos); } /* phase 2: Copy the data in reversed order from tempbuf * to sbuf. As we cannot have any gaps between * the blocks before reversing, we try to read * multiple times until we get the full block * of data (at least buffersize() worth of samples). */ const int max_loops = 3; SAMPLE_BUFFER::buf_size_t read_sofar = 0; /* this is how much reverse samples we will produce */ sbuf->length_in_samples(read_count); for(int i = 0; i < max_loops; i++) { child()->read_buffer(tempbuf_repp); if (tempbuf_repp->length_in_samples() + read_sofar > read_count) tempbuf_repp->length_in_samples(read_count - read_sofar); for(int c = 0; c < sbuf->number_of_channels(); c++) { SAMPLE_BUFFER::buf_size_t src = 0; SAMPLE_BUFFER::buf_size_t dst = (read_count - read_sofar - tempbuf_repp->length_in_samples()); for(; src < tempbuf_repp->length_in_samples(); src++, dst++) { sbuf->buffer[c][dst] = tempbuf_repp->buffer[c][tempbuf_repp->length_in_samples() - src - 1]; } } read_sofar += tempbuf_repp->length_in_samples(); if (read_sofar >= read_count) break; } DBC_CHECK(read_sofar <= buffersize()); DBC_CHECK(sbuf->length_in_samples() == read_count); curpos += read_sofar; set_position_in_samples(curpos); DBC_ENSURE(sbuf->number_of_channels() == channels()); } ecasound-2.9.3/libecasound/audioio-reverse.h0000644000076400007640000000474411032774266016043 00000000000000#ifndef INCLUDED_AUDIOIO_REVERSE_H #define INCLUDED_AUDIOIO_REVERSE_H #include #include #include #include "audioio-proxy.h" class SAMPLE_BUFFER; /** * A proxy class that reverts the child * object's data. * * Related design patterns: * - Proxy (GoF207 * * @author Kai Vehmanen */ class AUDIO_IO_REVERSE : public AUDIO_IO_PROXY { public: /** @name Public functions */ /*@{*/ AUDIO_IO_REVERSE (void); virtual ~AUDIO_IO_REVERSE(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return(string("Reverse => ") + child()->name()); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ virtual std::string parameter_names(void) const; virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_IO_REVERSE* clone(void) const; virtual AUDIO_IO_REVERSE* new_expr(void) const { return(new AUDIO_IO_REVERSE()); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /* -- not reimplemented * virtual SAMPLE_SPECS::sample_pos_t position_in_samples(void) const { return(child_repp->position_in_samples()); } * virtual SAMPLE_SPECS::sample_pos_t length_in_samples(void) const { return(); } * virtual void set_length_in_samples(SAMPLE_SPECS::sample_pos_t pos); * virtual void set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos); */ /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return(io_read); } virtual bool supports_seeking(void) const { return(true); } virtual bool finite_length_stream(void) const { return(true); } virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf) { child()->write_buffer(sbuf); } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual bool finished(void) const; /*@}*/ private: mutable std::vector params_rep; bool init_rep; bool finished_rep; SAMPLE_BUFFER* tempbuf_repp; static const int child_parameter_offset = 1; AUDIO_IO_REVERSE& operator=(const AUDIO_IO_REVERSE& x) { return *this; } AUDIO_IO_REVERSE (const AUDIO_IO_REVERSE& x) { } }; #endif ecasound-2.9.3/libecasound/eca-sample-conversion.h0000644000076400007640000000534611501140617017116 00000000000000// ------------------------------------------------------------------------ // eca-sample-conversion.h: Routines for convering between sample formats. // Copyright (C) 2002,2003 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_SAMPLE_CONVERSION_H #define INCLUDED_ECA_SAMPLE_CONVERSION_H #include /** * Type definitions */ #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef UINT8_MIN #define UINT8_MIN (0) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif /** * Function definitions */ static inline uint8_t eca_sample_convert_float_to_u8(float inval) { const float pos_limit = ((float)0x7f) / 0x80; if (inval >= pos_limit) return UINT8_MAX; return (uint8_t)(inval * 0x80 + 0x80); } static inline int16_t eca_sample_convert_float_to_s16(float inval) { const float pos_limit = ((float)0x7fff) / 0x8000; if (inval >= pos_limit) return INT16_MAX; return (int16_t)(inval * 0x8000); } static inline int32_t eca_sample_convert_float_to_s32(float inval) { /* 32bit float precision is limited to 24bit */ const float pos_limit_24b = ((float)0x7fffff) / 0x800000; if (inval >= pos_limit_24b) return INT32_MAX; return (int32_t)(inval * 0x80000000); } static inline float eca_sample_convert_u8_to_float(uint8_t inval) { #if 0 /* NOTE: this is sub-optimal, but at least gcc-2.91.66 otherwise * compiles the test incorrectly) */ int16_t inval_b = inval; if (inval_b <= INT8_MAX) return(((((float)inval) - INT8_MAX) / INT8_MAX)); #endif return ((float)(inval - 0x80)) / 0x80; } static inline float eca_sample_convert_s16_to_float(int16_t inval) { return ((float)inval) / 0x8000; } static inline float eca_sample_convert_s32_to_float(int32_t inval) { return ((float)inval) / 0x80000000; } #endif ecasound-2.9.3/libecasound/linear-envelope.h0000644000076400007640000000150011034531716016002 00000000000000#ifndef INCLUDED_LINEAR_ENVELOPE_H #define INCLUDED_LINEAR_ENVELOPE_H #include #include "ctrl-source.h" /** * Linear envelope */ class LINEAR_ENVELOPE : public CONTROLLER_SOURCE { public: LINEAR_ENVELOPE(void); virtual ~LINEAR_ENVELOPE(void); LINEAR_ENVELOPE* clone(void) const { return new LINEAR_ENVELOPE(*this); } LINEAR_ENVELOPE* new_expr(void) const { return new LINEAR_ENVELOPE(*this); } std::string name(void) const { return("Linear envelope"); } virtual void init(void); virtual parameter_t value(double pos_secs); virtual void set_initial_value(parameter_t arg) {} std::string parameter_names(void) const { return("length-sec"); } void set_parameter(int param, parameter_t value); parameter_t get_parameter(int param) const; private: parameter_t stages_len_rep; }; #endif ecasound-2.9.3/libecasound/audioio-tone.h0000644000076400007640000000520611033002702015303 00000000000000#ifndef INCLUDED_AUDIOIO_TONE_H #define INCLUDED_AUDIOIO_TONE_H #include #include "audioio.h" #include "samplebuffer.h" #include "samplebuffer_iterators.h" #include "sample-specs.h" #include "eca-audio-time.h" /** * Sine generator * * @author Kai Vehmanen * @author Richard W.E. Furse */ class AUDIO_IO_TONE : public AUDIO_IO { public: /** @name Public functions */ /*@{*/ AUDIO_IO_TONE (const std::string& name = ""); virtual ~AUDIO_IO_TONE(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return("Tone generator"); } virtual std::string description(void) const { return("Audio input that produces sine and other basic tones for testing and other purposes."); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ /* none */ /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ virtual AUDIO_IO_TONE* clone(void) const; virtual AUDIO_IO_TONE* new_expr(void) const { return new AUDIO_IO_TONE(); } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual bool locked_audio_format(void) const { return false; } virtual bool supports_seeking(void) const { return true; } virtual bool finite_length_stream(void) const; virtual bool finished(void) const { return finished_rep; } virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual void set_buffersize(long int samples) { buffersize_rep = samples; } virtual long int buffersize(void) const { return buffersize_rep; } virtual std::string parameter_names(void) const { return("tone,type,frequency,duration"); } virtual void set_parameter(int param, string value); virtual string get_parameter(int param) const; /*@}*/ private: SAMPLE_BUFFER buffer_rep; SAMPLE_ITERATOR_INTERLEAVED i; long int buffersize_rep; bool finished_rep; unsigned long m_lPhase; unsigned long m_lPhaseStep; SAMPLE_SPECS::sample_t m_fCachedFrequency; SAMPLE_SPECS::sample_t m_fLimitFrequency; SAMPLE_SPECS::sample_t m_fPhaseStepScalar; /** @name New functions */ /*@{*/ void setPhaseStepFromFrequency(const SAMPLE_SPECS::sample_t fFrequency, bool force); /*@}*/ AUDIO_IO_TONE& operator=(const AUDIO_IO_TONE& x) { return *this; } AUDIO_IO_TONE (const AUDIO_IO_TONE& x) { } }; #endif ecasound-2.9.3/libecasound/eca-iamode-parser.h0000644000076400007640000000320611065031241016170 00000000000000#ifndef INCLUDED_ECA_IAMODE_PARSER_H #define INCLUDED_ECA_IAMODE_PARSER_H #include #include #include #include #include "eca-error.h" #include "eca-iamode-parser_impl.h" /** * Class that handles registering and querying interactive mode commands. * @author Kai Vehmanen */ class ECA_IAMODE_PARSER : protected ECA_IAMODE_PARSER_COMMANDS { public: static const std::map& registered_commands(void); static std::vector registered_commands_list(void); bool action_requires_params(int id); bool action_requires_connected(int id); bool action_requires_selected_not_connected(int id); bool action_requires_selected(int id); bool action_requires_selected_audio_input(int id); bool action_requires_selected_audio_output(int id); ECA_IAMODE_PARSER(void); virtual ~ECA_IAMODE_PARSER(void); protected: static int command_to_action_id(const std::string& cmdstring); private: static void register_commands_misc(void); static void register_commands_cs(void); static void register_commands_c(void); static void register_commands_aio(void); static void register_commands_ai(void); static void register_commands_ao(void); static void register_commands_cop(void); static void register_commands_copp(void); static void register_commands_ctrl(void); static void register_commands_ctrlp(void); static void register_commands_dump(void); static void register_commands_external(void); private: static std::map* cmd_map_repp; static pthread_mutex_t lock_rep; }; void show_controller_help(void); void show_controller_help_more(void); #endif ecasound-2.9.3/libecasound/audiogate.h0000644000076400007640000001034311432766437014700 00000000000000#ifndef INCLUDED_AUDIO_GATE_H #define INCLUDED_AUDIO_GATE_H #include #include "eca-chainop.h" #include "eca-samplerate-aware.h" class SAMPLE_BUFFER; /** * Interface to gate effects. Gate processes sample data, but * doesn't modify it. Gate is either open or closed. */ class GATE_BASE : public CHAIN_OPERATOR { private: bool gate_open; SAMPLE_BUFFER* target; protected: void close_gate(void) { gate_open = false; } void open_gate(void) { gate_open = true; } public: inline bool is_open(void) const { return(gate_open); } virtual void init(SAMPLE_BUFFER* sbuf); virtual void process(void); virtual void analyze(SAMPLE_BUFFER* sbuf) = 0; virtual GATE_BASE* clone(void) const = 0; virtual ~GATE_BASE(void); GATE_BASE(void) { close_gate(); } }; /** * A time crop gate. Initially the gate is closed, but is opened after * 'open_at' seconds has elapsed. Gate remains open for * 'duration' seconds. If 'duration' is 0, gate will stay open * forever. */ class TIME_CROP_GATE : public GATE_BASE, public ECA_SAMPLERATE_AWARE { public: // Functions returning info about effect and its parameters. // --- parameter_t get_parameter(int param) const; void set_parameter(int param, parameter_t value); std::string name(void) const { return("Time crop gate"); } std::string parameter_names(void) const { return("open-at-sec,duration-sec"); } void analyze(SAMPLE_BUFFER* insample); /** @name Functions reimplemented from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value); /*@}*/ TIME_CROP_GATE* clone(void) const { return new TIME_CROP_GATE(*this); } TIME_CROP_GATE* new_expr(void) const { return new TIME_CROP_GATE(); } TIME_CROP_GATE (parameter_t open_at, parameter_t duration); TIME_CROP_GATE (void) : position_in_samples_rep(0), begtime_rep(0.0), durtime_rep(0.0) { close_gate(); } private: SAMPLE_SPECS::sample_pos_t position_in_samples_rep; parameter_t begtime_rep, durtime_rep; }; /** * A threshold open gate. When the average volume goes * over 'threshold_openlevel', gate is opened. In the * same way, when the average volume drops below * 'threshold_closelevel', gate is closed. Either * peak or RMS level is used for calculating average * volume. The thresholds are given in percents. Unlike * noise gates, threshold gate is opened and closed * only once. */ class THRESHOLD_GATE : public GATE_BASE { public: // Functions returning info about effect and its parameters. // --- virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual void init(SAMPLE_BUFFER* sbuf); virtual std::string name(void) const { return("Threshold gate"); } virtual std::string parameter_names(void) const { return("threshold-openlevel-%,threshold-closelevel-%,rms-enabled,reopen-count"); } virtual void analyze(SAMPLE_BUFFER* insample); THRESHOLD_GATE* clone(void) const { return new THRESHOLD_GATE(*this); } THRESHOLD_GATE* new_expr(void) const { return new THRESHOLD_GATE(); } THRESHOLD_GATE (parameter_t threshold_openlevel, parameter_t threshold_closelevel, bool use_rms = false); THRESHOLD_GATE (void) : openlevel_rep(0.0), closelevel_rep(0.0), reopen_count_param_rep(0), reopens_left_rep(0), rms_rep(false), is_opened_rep(false), is_closed_rep(false) { } private: parameter_t openlevel_rep, closelevel_rep, avolume_rep; int reopen_count_param_rep, reopens_left_rep; bool rms_rep; bool is_opened_rep, is_closed_rep; }; /** * Manual gate. * * A trivial object that ly changes gate state */ class MANUAL_GATE : public GATE_BASE { public: // Functions returning info about effect and its parameters. // --- virtual parameter_t get_parameter(int param) const; virtual void set_parameter(int param, parameter_t value); virtual std::string name(void) const { return("Manual gate"); } virtual std::string parameter_names(void) const { return("state"); } virtual void analyze(SAMPLE_BUFFER* insample); MANUAL_GATE* clone(void) const { return new MANUAL_GATE(*this); } MANUAL_GATE* new_expr(void) const { return new MANUAL_GATE(); } MANUAL_GATE (void) : open_rep(true) {} private: bool open_rep; }; #endif ecasound-2.9.3/libecasound/samplebuffer.h0000644000076400007640000001466512501301277015405 00000000000000#ifndef INCLUDED_SAMPLEBUFFER_H #define INCLUDED_SAMPLEBUFFER_H #include #include "eca-audio-format.h" #include "sample-specs.h" class SAMPLE_BUFFER_FUNCTIONS; class SAMPLE_BUFFER_impl; /** * A dynamic container for storing blocks of * audio data. * * Static attributes are: * - samples of type 'sample_t' (usually 32bit float) * * Dynamic attributes are: * - number of channels * - length in samples * - event tags * * Provided services: * - copying from/to other samplebuffer objects * - basic audio operations * - importing and exporting data from/to\n * raw buffers of audio data * - changing channel count and length * - reserving space before-hand * - realtime-safety and pointer locking * - access to event tags */ class SAMPLE_BUFFER { friend class SAMPLE_BUFFER_FUNCTIONS; friend class SAMPLE_ITERATOR; friend class SAMPLE_ITERATOR_CHANNEL; friend class SAMPLE_ITERATOR_CHANNELS; friend class SAMPLE_ITERATOR_INTERLEAVED; public: /** @name Public type definitions */ /*@{*/ typedef SAMPLE_SPECS::channel_t channel_size_t; typedef long int buf_size_t; typedef SAMPLE_SPECS::sample_t sample_t; enum Tag_name { /* buffer contains last samples of a stream */ tag_end_of_stream = 1, /* buffer contains samples from multiple inputs */ tag_mixed_content = (1 << 1), /* buffer length may vary from buffer to another */ tag_var_length = (1 << 2), /* internal: placeholder */ tag_last = (1 << 30), /* internal: matches all tags */ tag_all = 0xffffffff }; /*@}*/ public: /** @name Constructors/destructors */ /*@{*/ SAMPLE_BUFFER (buf_size_t buffersize = 0, channel_size_t channels = 0); ~SAMPLE_BUFFER(void); /*@}*/ public: /** @name Copying from/to other samplebuffer objects */ /*@{*/ void add_matching_channels(const SAMPLE_BUFFER& x); void add_matching_channels_ref(const SAMPLE_BUFFER& x); void add_with_weight(const SAMPLE_BUFFER& x, int weight); void copy_matching_channels(const SAMPLE_BUFFER& x); void copy_all_content(const SAMPLE_BUFFER& x); void copy_range(const SAMPLE_BUFFER& x, buf_size_t start_pos, buf_size_t end_pos, buf_size_t to_pos); /*@}*/ /** @name Basic audio operations */ /*@{*/ void divide_by(sample_t dvalue); void divide_by_ref(sample_t dvalue); void multiply_by(sample_t factor); void multiply_by(sample_t factor, int channel); void multiply_by_ref(sample_t factor); void multiply_by_ref(sample_t factor, int channel); void limit_values(void); void limit_values_ref(void); void make_empty(void); bool is_empty(void) const { return buffersize_rep == 0; } void make_silent(void); void make_silent(int channel); void make_silent_ref(int channel); void make_silent_range(buf_size_t start_pos, buf_size_t end_pos); void make_silent_range_ref(buf_size_t start_pos, buf_size_t end_pos); void resample(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate); void resample_set_quality(int quality); int resample_get_quality(void) const; /*@}*/ /** * @name Importing and exporting data from/to raw buffers of audio data */ /*@{*/ void import_interleaved(unsigned char* source, buf_size_t samples, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t ch); void import_noninterleaved(unsigned char* source, buf_size_t samples, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t ch); void export_interleaved(unsigned char* target, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t ch); void export_noninterleaved(unsigned char* target, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t ch); /*@}*/ public: /** @name Changing channel count, length and sample-rate. */ /*@{*/ void number_of_channels(channel_size_t num); inline channel_size_t number_of_channels(void) const { return(channel_count_rep); } void length_in_samples(buf_size_t len); inline buf_size_t length_in_samples(void) const { return(buffersize_rep); } /*@}*/ /** @name Reserving space before-hand */ /*@{*/ void resample_init_memory(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate); void reserve_channels(channel_size_t num); void reserve_length_in_samples(buf_size_t len); /*@}*/ /** @name Realtime-safety and pointer locking */ /*@{*/ void set_rt_lock(bool state); void get_pointer_reflock(void); void release_pointer_reflock(void); /*@}*/ /** @name Event tags - for relaying additional info about the buffer */ /*@{*/ void event_tags_add(const SAMPLE_BUFFER& sbuf); void event_tags_set(const SAMPLE_BUFFER& sbuf); void event_tags_clear(Tag_name tagmask = tag_all); void event_tag_set(Tag_name tag, bool val = true); bool event_tag_test(Tag_name tag); /*@}*/ private: void resample_extfilter(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate); void resample_secret_rabbit_code(SAMPLE_SPECS::sample_rate_t from_srate, SAMPLE_SPECS::sample_rate_t to_srate); void resample_simplefilter(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate); void resample_nofilter(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate); void resample_with_memory(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate); static void import_helper(const unsigned char *ibuffer, buf_size_t* iptr, sample_t* obuffer, buf_size_t optr, ECA_AUDIO_FORMAT::Sample_format fmt); static void export_helper(unsigned char* obuffer, buf_size_t* optr, sample_t value, ECA_AUDIO_FORMAT::Sample_format fmt); public: /** @name Data representation */ /** * WARNING! Although 'buffer' is a public member, you should only * use it directly for a very, very good reason. All normal * input/output should be done via the SAMPLEBUFFER_ITERATORS * class. Representation of 'buffer' may change at any time, * and this will break all code using direct-access. * * If you do use direct access, then you must also * use the get_pointer_reflock() and release_pointer_reflock() * calls so that reference counting is possible. */ std::vector buffer; /*@}*/ private: /** @name Private data */ /*@{*/ channel_size_t channel_count_rep; buf_size_t buffersize_rep; buf_size_t reserved_samples_rep; /*@}*/ SAMPLE_BUFFER_impl* impl_repp; private: SAMPLE_BUFFER& operator= (const SAMPLE_BUFFER& t); SAMPLE_BUFFER (const SAMPLE_BUFFER& x); }; #endif ecasound-2.9.3/libecasound/samplebuffer.cpp0000644000076400007640000012004311755262345015740 00000000000000// ------------------------------------------------------------------------ // samplebuffer.cpp: Class representing a buffer of audio samples. // Copyright (C) 1999-2005,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // References: // - libsamplerate: // http://www.mega-nerd.com/SRC/ // - liboil: // http://liboil.freedesktop.org/ // http://library.gnome.org/devel/liboil/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include /* ceil(), floor() */ #include /* memcpy */ #include /* not cstdlib we need e.g. posix_memalign() */ #include #include #include #ifdef ECA_COMPILE_SAMPLERATE #include #endif #ifdef ECA_USE_LIBOIL extern "C" { #include } #endif #include "eca-sample-conversion.h" #include "samplebuffer.h" #include "samplebuffer_impl.h" #include "eca-logger.h" /* Debug resampling operations */ // #define DEBUG_RESAMPLING #ifdef DEBUG_RESAMPLING #define DEBUG_RESAMPLING_STATEMENT(x) x #else #define DEBUG_RESAMPLING_STATEMENT(x) ((void)0) #endif #ifdef WORDS_BIGENDIAN static const bool is_system_littleendian = false; #else static const bool is_system_littleendian = true; #endif using namespace std; static void priv_alloc_sample_buf(SAMPLE_SPECS::sample_t **memptr, size_t size) { #ifdef HAVE_POSIX_MEMALIGN /* align buffers to 128bit/16octet boundary */ posix_memalign(reinterpret_cast(memptr), 16, size); #else *memptr = reinterpret_cast(malloc(size)); #endif } /** * Constructs a new sample buffer object. */ SAMPLE_BUFFER::SAMPLE_BUFFER (buf_size_t buffersize, channel_size_t channels) : channel_count_rep(channels), buffersize_rep(buffersize), reserved_samples_rep(buffersize) { // --- DBC_REQUIRE(buffersize >= 0); DBC_REQUIRE(channels >= 0); // --- /* catch if someone changes SAMPLE_SPECS::silent_value */ DBC_DECLARE(float f = 0.0f); DBC_CHECK(static_cast(f) == 0); DBC_CHECK(sizeof(f) == 4); impl_repp = new SAMPLE_BUFFER_impl; buffer.resize(channels); for(size_t n = 0; n < buffer.size(); n++) { priv_alloc_sample_buf(&buffer[n], sizeof(sample_t) * reserved_samples_rep); } make_silent(); impl_repp->rt_lock_rep = false; impl_repp->lockref_rep = 0; impl_repp->old_buffer_repp = 0; #ifdef ECA_COMPILE_SAMPLERATE impl_repp->quality_rep = 50; impl_repp->src_state_rep.resize(channels); #else impl_repp->quality_rep = 5; #endif #ifdef ECA_USE_LIBOIL oil_init(); #endif ECA_LOG_MSG(ECA_LOGGER::functions, "Buffer created, channels: " + kvu_numtostr(buffer.size()) + ", length-samples: " + kvu_numtostr(buffersize_rep) + "."); // --- DBC_ENSURE(buffer.size() == static_cast(channel_count_rep)); // --- } /** * Destructor. */ SAMPLE_BUFFER::~SAMPLE_BUFFER (void) { DBC_CHECK(impl_repp->lockref_rep == 0); for(size_t n = 0; n < buffer.size(); n++) { if (buffer[n] != 0) { ::free(buffer[n]); buffer[n] = 0; } } if (impl_repp->old_buffer_repp != 0) { ::free(impl_repp->old_buffer_repp); impl_repp->old_buffer_repp = 0; } #ifdef ECA_COMPILE_SAMPLERATE for(size_t n = 0; n < impl_repp->src_state_rep.size(); n++) { if (impl_repp->src_state_rep[n] != 0) { src_delete(impl_repp->src_state_rep[n]); impl_repp->src_state_rep[n] = 0; } } #endif delete impl_repp; } /** * Channel-wise addition. Buffer length is increased if necessary. * Only channels, that are present in both source and destination, are * modified. * * Note: event tags are not copied! * * @post length_in_samples() >= x.length_in_samples() */ void SAMPLE_BUFFER::add_matching_channels(const SAMPLE_BUFFER& x) { #ifdef ECA_USE_LIBOIL if (x.length_in_samples() > length_in_samples()) { length_in_samples(x.length_in_samples()); } int min_c_count = (channel_count_rep <= x.channel_count_rep) ? channel_count_rep : x.channel_count_rep; for(channel_size_t q = 0; q < min_c_count; q++) { oil_add_f32(reinterpret_cast(buffer[q]), reinterpret_cast(buffer[q]), reinterpret_cast(x.buffer[q]), x.length_in_samples()); } #else add_matching_channels_ref(x); #endif } /** * Unoptimized version of add_matching_channels(). */ void SAMPLE_BUFFER::add_matching_channels_ref(const SAMPLE_BUFFER& x) { if (x.length_in_samples() > length_in_samples()) { length_in_samples(x.length_in_samples()); } int min_c_count = (channel_count_rep <= x.channel_count_rep) ? channel_count_rep : x.channel_count_rep; for(channel_size_t q = 0; q < min_c_count; q++) { for(buf_size_t t = 0; t < x.length_in_samples(); t++) { buffer[q][t] += x.buffer[q][t]; } } } /** * Channel-wise, weighted addition. Before addition every sample is * multiplied by '1/weight'. Buffer length is increased if necessary. * Only channels, that are present in both source and destination, are * modified. * * Note: event tags are not copied! * * @pre weight != 0 * @post length_in_samples() >= x.length_in_samples() */ void SAMPLE_BUFFER::add_with_weight(const SAMPLE_BUFFER& x, int weight) { // --- DBC_REQUIRE(weight != 0); // --- /* note: gcc does a suprisingly good job for this function, * so additional optimizations don't seem worthwhile */ if (x.length_in_samples() > length_in_samples()) { length_in_samples(x.length_in_samples()); } int min_c_count = (channel_count_rep <= x.channel_count_rep) ? channel_count_rep : x.channel_count_rep; for(channel_size_t q = 0; q < min_c_count; q++) { for(buf_size_t t = 0; t < x.length_in_samples(); t++) { buffer[q][t] += (x.buffer[q][t] / weight); } } } /** * Channel-wise copy. Buffer length is adjusted if necessary. * * Note: event tags are not copied! * * @post length_in_samples() == x.length_in_samples() */ void SAMPLE_BUFFER::copy_matching_channels(const SAMPLE_BUFFER& x) { length_in_samples(x.length_in_samples()); int min_c_count = (channel_count_rep <= x.channel_count_rep) ? channel_count_rep : x.channel_count_rep; for(channel_size_t q = 0; q < min_c_count; q++) { std::memcpy(buffer[q], x.buffer[q], sizeof(sample_t) * length_in_samples()); /* ref implementation: * for(buf_size_t t = 0; t < length_in_samples(); t++) { * buffer[q][t] = x.buffer[q][t]; * } */ } } /** * Copy all audio contents from 'x'. After copying, length, channel * count, and event tag set match to those of 'x'. * * @post length_in_samples() == x.length_in_samples() * @post number_of_channels() == number_of_channels() * @post for all I: event_tag_test(I) == x.event_tag_test(I) */ void SAMPLE_BUFFER::copy_all_content(const SAMPLE_BUFFER& x) { length_in_samples(x.length_in_samples()); number_of_channels(x.number_of_channels()); for(channel_size_t q = 0; q < number_of_channels(); q++) { std::memcpy(buffer[q], x.buffer[q], sizeof(sample_t) * length_in_samples()); /* ref implementation: * { * for(buf_size_t t = 0; t < length_in_samples(); t++) { * buffer[q][t] = x.buffer[q][t]; * } */ } event_tags_set(x); } /** * Ranged channel-wise copy. Copies samples in range * 'start_pos' - 'end_pos-1' from buffer 'x' to current * buffer position 'to_pos'. The 'src' object must have * equal number of channels as the current object. * * Note: event tags are not copied! * * @pre start_pos <= end_pos * @pre * @pre to_pos < length_in_samples() */ void SAMPLE_BUFFER::copy_range(const SAMPLE_BUFFER& src, buf_size_t src_start_pos, buf_size_t src_end_pos, buf_size_t dst_to_pos) { // --- DBC_REQUIRE(src_start_pos <= src_end_pos); DBC_REQUIRE(dst_to_pos < length_in_samples()); DBC_REQUIRE(number_of_channels() == src.number_of_channels()); // --- if (src_end_pos > src.length_in_samples()) src_end_pos = src.length_in_samples(); for(channel_size_t q = 0; q < channel_count_rep; q++) { buf_size_t dst_i = dst_to_pos; for(buf_size_t src_i = src_start_pos; src_i < src_end_pos && dst_i < length_in_samples(); src_i++, dst_i++) { buffer[q][dst_i] = src.buffer[q][src_i]; #ifdef SAMPLEBUFFER_COPY_RANGE_VERBOSE_DEBUG if (dst_i == 0 || src_i == 0 || src_i == src_end_pos - 1 ||dst_i == length_in_samples() - 1) { std::fprintf(stderr, "dst[%d][%ld] = src[%d][%ld]\n", q, dst_i, q, src_i); } #endif } } } void SAMPLE_BUFFER::multiply_by(SAMPLE_BUFFER::sample_t factor, int channel) { #ifdef ECA_USE_LIBOIL oil_scalarmultiply_f32_ns(reinterpret_cast(buffer[channel]), reinterpret_cast(buffer[channel]), reinterpret_cast(&factor), buffersize_rep); #else multiply_by_ref(factor, channel); #endif } void SAMPLE_BUFFER::multiply_by(SAMPLE_BUFFER::sample_t factor) { for(channel_size_t n = 0; n < channel_count_rep; n++) { multiply_by(factor, n); } } void SAMPLE_BUFFER::multiply_by_ref(SAMPLE_BUFFER::sample_t factor) { for(channel_size_t n = 0; n < channel_count_rep; n++) { for(buf_size_t m = 0; m < buffersize_rep; m++) { buffer[n][m] *= factor; } } } void SAMPLE_BUFFER::multiply_by_ref(SAMPLE_BUFFER::sample_t factor, int channel) { for(buf_size_t m = 0; m < buffersize_rep; m++) { buffer[channel][m] *= factor; } } /** * Divides all samples by 'dvalue'. */ void SAMPLE_BUFFER::divide_by(SAMPLE_BUFFER::sample_t dvalue) { multiply_by(1.0 / dvalue); } void SAMPLE_BUFFER::divide_by_ref(SAMPLE_BUFFER::sample_t dvalue) { multiply_by_ref(1.0 / dvalue); } /** * Clears the buffer to zero length. Note that this is * different from a silent buffer. */ void SAMPLE_BUFFER::make_empty(void) { SAMPLE_BUFFER::length_in_samples(0); } /** * Mutes one channel of the buffer. * * @pre channel >= 0 * @pre channel < number_of_channels() */ void SAMPLE_BUFFER::make_silent(int channel) { DBC_REQUIRE(channel >= 0); DBC_REQUIRE(channel < number_of_channels()); std::memset(buffer[channel], 0, buffersize_rep * sizeof(SAMPLE_SPECS::silent_value)); /* - the generic version: */ /* for(buf_size_t s = 0; s < buffersize_rep; s++) { buffer[n][s] = SAMPLE_SPECS::silent_value; } */ } /** * Unoptimized version of make_silent(int). */ void SAMPLE_BUFFER::make_silent_ref(int channel) { for(buf_size_t s = 0; s < buffersize_rep; s++) { buffer[channel][s] = SAMPLE_SPECS::silent_value; } } /** * Mutes the whole buffer. */ void SAMPLE_BUFFER::make_silent(void) { for(channel_size_t n = 0; n < channel_count_rep; n++) { make_silent(n); } } /** * Mute a range of samples. * * @pre start_pos >= 0 * @pre end_pos >= 0 */ void SAMPLE_BUFFER::make_silent_range(buf_size_t start_pos, buf_size_t end_pos) { // -- DBC_REQUIRE(start_pos >= 0); DBC_REQUIRE(end_pos >= 0); // -- for(channel_size_t n = 0; n < channel_count_rep; n++) { std::memset(buffer[n] + start_pos, 0, sizeof(sample_t) * (end_pos < buffersize_rep ? end_pos : buffersize_rep)); } } /** * Unoptimized version of make_silent_range() */ void SAMPLE_BUFFER::make_silent_range_ref(buf_size_t start_pos, buf_size_t end_pos) { // -- DBC_REQUIRE(start_pos >= 0); DBC_REQUIRE(end_pos >= 0); // -- for(channel_size_t n = 0; n < channel_count_rep; n++) { for(buf_size_t s = start_pos; s < end_pos && s < buffersize_rep; s++) { buffer[n][s] = SAMPLE_SPECS::silent_value; } } } /** * Limits all samples to valid values. */ void SAMPLE_BUFFER::limit_values(void) { for(channel_size_t n = 0; n < channel_count_rep; n++) { for(buf_size_t m = 0; m < buffersize_rep; m++) { if (buffer[n][m] > SAMPLE_SPECS::impl_max_value) buffer[n][m] = SAMPLE_SPECS::impl_max_value; else if (buffer[n][m] < SAMPLE_SPECS::impl_min_value) buffer[n][m] = SAMPLE_SPECS::impl_min_value; } } #if 0 /* slower than the naive implementation */ { float min = SAMPLE_SPECS::impl_min_value; float max = SAMPLE_SPECS::impl_max_value; for(channel_size_t n = 0; n < channel_count_rep; n++) { oil_clip_f32(reinterpret_cast(buffer[n]), sizeof(float), reinterpret_cast(buffer[n]), sizeof(float), buffersize_rep, &min, &max); } } #endif } /** Unoptimized version of limit_values() */ void SAMPLE_BUFFER::limit_values_ref(void) { limit_values(); } /** * Resamples samplebuffer contents. Resampling * changes buffer length by 'to_rate/from_rate'. * * @post to_rate / from_rate * old_length_in_samples - length_in_samples() >= -1 */ void SAMPLE_BUFFER::resample(SAMPLE_SPECS::sample_rate_t from_rate, SAMPLE_SPECS::sample_rate_t to_rate) { #ifndef ECA_COMPILE_SAMPLERATE DBC_DECLARE(buf_size_t old_length_in_samples = length_in_samples()); #endif #ifdef ECA_COMPILE_SAMPLERATE if (impl_repp->quality_rep > 5) { resample_secret_rabbit_code(from_rate, to_rate); } else #endif { DBC_CHECK(impl_repp->quality_rep <= 5); resample_with_memory(from_rate, to_rate); } #ifndef ECA_COMPILE_SAMPLERATE /* with libsamplerate, the output sample count can vary from call to call */ DBC_CHECK((static_cast(to_rate) / from_rate * old_length_in_samples - length_in_samples()) >= -1); #endif } /** * Set resampling quality. * * Depending on build options, not all quality levels * are necessarily supported. If the requested quality level * exceeds the available resamplers, the quality setting * is set to the highest available algorithm. You can use * the get_resample_quality() function to query the current level. * * @param quality value between 0 (lowest) to 100 (highest) */ void SAMPLE_BUFFER::resample_set_quality(int quality) { #ifdef ECA_COMPILE_SAMPLERATE impl_repp->quality_rep = quality; #else if (quality > 10) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Libsamplerate is required for high-quality resampling. " "Using the internal resampler instead."); impl_repp->quality_rep = 5; } #endif } /** * Returns current resampling quality. * * @param value between 0 (lowest) to 100 (highest) */ int SAMPLE_BUFFER::resample_get_quality(void) const { return impl_repp->quality_rep; } void SAMPLE_BUFFER::export_helper(unsigned char* obuffer, buf_size_t* optr, sample_t value, ECA_AUDIO_FORMAT::Sample_format fmt) { switch (fmt) { case ECA_AUDIO_FORMAT::sfmt_u8: { obuffer[(*optr)++] = eca_sample_convert_float_to_u8(value); break; } case ECA_AUDIO_FORMAT::sfmt_s16_le: { int16_t s16temp = eca_sample_convert_float_to_s16(value); // little endian: (LSB, MSB) (Intel). obuffer[(*optr)++] = (unsigned char)(s16temp & 0xff); obuffer[(*optr)++] = (unsigned char)((s16temp >> 8) & 0xff); break; } case ECA_AUDIO_FORMAT::sfmt_s16_be: { int16_t s16temp = eca_sample_convert_float_to_s16(value); // big endian: (MSB, LSB) (Motorola). obuffer[(*optr)++] = (unsigned char)((s16temp >> 8) & 0xff); obuffer[(*optr)++] = (unsigned char)(s16temp & 0xff); break; } case ECA_AUDIO_FORMAT::sfmt_s24_le: { int32_t s32temp = eca_sample_convert_float_to_s32(value); /* skip the LSB-byte of s32temp (s32temp & 0xff) */ obuffer[(*optr)++] = (unsigned char)((s32temp >> 8) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 16) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 24) & 0xff); break; } case ECA_AUDIO_FORMAT::sfmt_s24_be: { int32_t s32temp = eca_sample_convert_float_to_s32(value); obuffer[(*optr)++] = (unsigned char)((s32temp >> 24) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 16) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 8) & 0xff); /* skip the LSB-byte of s32temp (s32temp & 0xff) */ break; } case ECA_AUDIO_FORMAT::sfmt_s32_le: { int32_t s32temp = eca_sample_convert_float_to_s32(value); obuffer[(*optr)++] = (unsigned char)(s32temp & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 8) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 16) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 24) & 0xff); break; } case ECA_AUDIO_FORMAT::sfmt_s32_be: { int32_t s32temp = eca_sample_convert_float_to_s32(value); obuffer[(*optr)++] = (unsigned char)((s32temp >> 24) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 16) & 0xff); obuffer[(*optr)++] = (unsigned char)((s32temp >> 8) & 0xff); obuffer[(*optr)++] = (unsigned char)(s32temp & 0xff); break; } case ECA_AUDIO_FORMAT::sfmt_f32_le: { union { int32_t i; float f; } f32temp; f32temp.f = (float)value; obuffer[(*optr)++] = (unsigned char)(f32temp.i & 0xff); obuffer[(*optr)++] = (unsigned char)((f32temp.i >> 8) & 0xff); obuffer[(*optr)++] = (unsigned char)((f32temp.i >> 16) & 0xff); obuffer[(*optr)++] = (unsigned char)((f32temp.i >> 24) & 0xff); break; } case ECA_AUDIO_FORMAT::sfmt_f32_be: { union { int32_t i; float f; } f32temp; f32temp.f = (float)value; obuffer[(*optr)++] = (unsigned char)((f32temp.i >> 24) & 0xff); obuffer[(*optr)++] = (unsigned char)((f32temp.i >> 16) & 0xff); obuffer[(*optr)++] = (unsigned char)((f32temp.i >> 8) & 0xff); obuffer[(*optr)++] = (unsigned char)(f32temp.i & 0xff); break; } default: { ECA_LOG_MSG(ECA_LOGGER::info, "Unknown sample format! [1]."); } } } /** * Exports contents of sample buffer to 'target'. Sample data * will be converted according to the given arguments * (sample format and endianess). If 'chcount > 1', channels * will be written interleaved. * * Note! If chcount > number_of_channels(), empty * channels will be automatically added. * * @pre target != 0 * @pre chcount > 0 * @ensure number_of_channels() >= chcount */ void SAMPLE_BUFFER::export_interleaved(unsigned char* target, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t chcount) { // -------- DBC_REQUIRE(target != 0); DBC_REQUIRE(chcount > 0); // -------- if (chcount > channel_count_rep) number_of_channels(chcount); buf_size_t osize = 0; for(buf_size_t isize = 0; isize < buffersize_rep; isize++) { for(channel_size_t c = 0; c < chcount; c++) { sample_t stemp = buffer[c][isize]; if (stemp > SAMPLE_SPECS::impl_max_value) stemp = SAMPLE_SPECS::impl_max_value; else if (stemp < SAMPLE_SPECS::impl_min_value) stemp = SAMPLE_SPECS::impl_min_value; SAMPLE_BUFFER::export_helper(target, &osize, stemp, fmt); } } // ------- DBC_ENSURE(number_of_channels() >= chcount); // ------- } /** * Same as 'export_data()', but 'target' data is * written in non-interleaved format. * * Note! If chcount > number_of_channels(), empty * channels will be automatically added. * * @pre target != 0 * @pre chcount > 0 * @ensure number_of_channels() >= chcount */ void SAMPLE_BUFFER::export_noninterleaved(unsigned char* target, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t chcount) { // -------- DBC_REQUIRE(target != 0); DBC_REQUIRE(chcount > 0); // -------- if (chcount > channel_count_rep) number_of_channels(chcount); buf_size_t osize = 0; for(channel_size_t c = 0; c < chcount; c++) { for(buf_size_t isize = 0; isize < buffersize_rep; isize++) { sample_t stemp = buffer[c][isize]; if (stemp > SAMPLE_SPECS::impl_max_value) stemp = SAMPLE_SPECS::impl_max_value; else if (stemp < SAMPLE_SPECS::impl_min_value) stemp = SAMPLE_SPECS::impl_min_value; SAMPLE_BUFFER::export_helper(target, &osize, stemp, fmt); } } // ------- DBC_ENSURE(number_of_channels() >= chcount); // ------- } void SAMPLE_BUFFER::import_helper(const unsigned char *ibuffer, buf_size_t* iptr, sample_t* obuffer, buf_size_t optr, ECA_AUDIO_FORMAT::Sample_format fmt) { unsigned char a[2]; unsigned char b[4]; switch (fmt) { case ECA_AUDIO_FORMAT::sfmt_u8: { obuffer[optr] = eca_sample_convert_u8_to_float(ibuffer[(*iptr)++]); } break; case ECA_AUDIO_FORMAT::sfmt_s16_le: { // little endian: (LSB, MSB) (Intel) // big endian: (MSB, LSB) (Motorola) if (is_system_littleendian) { a[0] = ibuffer[(*iptr)++]; a[1] = ibuffer[(*iptr)++]; } else { a[1] = ibuffer[(*iptr)++]; a[0] = ibuffer[(*iptr)++]; } int16_t tmp; memcpy(&tmp, a, sizeof(tmp)); obuffer[optr] = eca_sample_convert_s16_to_float(tmp); } break; case ECA_AUDIO_FORMAT::sfmt_s16_be: { if (!is_system_littleendian) { a[0] = ibuffer[(*iptr)++]; a[1] = ibuffer[(*iptr)++]; } else { a[1] = ibuffer[(*iptr)++]; a[0] = ibuffer[(*iptr)++]; } int16_t tmp; memcpy(&tmp, a, sizeof(tmp)); obuffer[optr] = eca_sample_convert_s16_to_float(tmp); } break; case ECA_AUDIO_FORMAT::sfmt_s24_le: { if (is_system_littleendian) { b[0] = 0; /* LSB */ b[1] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[3] = ibuffer[(*iptr)++]; } else { b[3] = 0; /* LSB */ b[2] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[0] = ibuffer[(*iptr)++]; } int32_t tmp; memcpy(&tmp, b, sizeof(tmp)); obuffer[optr] = eca_sample_convert_s32_to_float(tmp); } break; case ECA_AUDIO_FORMAT::sfmt_s24_be: { if (is_system_littleendian) { b[3] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[0] = 0; /* LSB */ } else { b[0] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[3] = 0; /* LSB */ } int32_t tmp; memcpy(&tmp, b, sizeof(tmp)); obuffer[optr] = eca_sample_convert_s32_to_float(tmp); } break; case ECA_AUDIO_FORMAT::sfmt_s32_le: { if (is_system_littleendian) { b[0] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[3] = ibuffer[(*iptr)++]; } else { b[3] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[0] = ibuffer[(*iptr)++]; } int32_t tmp; memcpy(&tmp, b, sizeof(tmp)); obuffer[optr] = eca_sample_convert_s32_to_float(tmp); } break; case ECA_AUDIO_FORMAT::sfmt_s32_be: { if (is_system_littleendian) { b[3] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[0] = ibuffer[(*iptr)++]; } else { b[0] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[3] = ibuffer[(*iptr)++]; } int32_t tmp; memcpy(&tmp, b, sizeof(tmp)); obuffer[optr] = eca_sample_convert_s32_to_float(tmp); } break; case ECA_AUDIO_FORMAT::sfmt_f32_le: { if (is_system_littleendian) { b[0] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[3] = ibuffer[(*iptr)++]; } else { b[3] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[0] = ibuffer[(*iptr)++]; } memcpy(&obuffer[optr], b, sizeof(obuffer[optr])); } break; case ECA_AUDIO_FORMAT::sfmt_f32_be: { if (is_system_littleendian) { b[3] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[0] = ibuffer[(*iptr)++]; } else { b[0] = ibuffer[(*iptr)++]; b[1] = ibuffer[(*iptr)++]; b[2] = ibuffer[(*iptr)++]; b[3] = ibuffer[(*iptr)++]; } memcpy(&obuffer[optr], b, sizeof(obuffer[optr])); } break; default: { ECA_LOG_MSG(ECA_LOGGER::info, "Unknown sample format! [4]."); } } } /** * Import audio from external raw buffer. Sample data * will be converted to internal sample format using the * given arguments (sample format and endianess). * Channels will be read interleaved. * * @pre source != 0 * @pre samples_read >= 0 */ void SAMPLE_BUFFER::import_interleaved(unsigned char* source, buf_size_t samples_read, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t chcount) { // -------- DBC_REQUIRE(source != 0); DBC_REQUIRE(samples_read >= 0); // -------- if (channel_count_rep != chcount) number_of_channels(chcount); if (buffersize_rep != samples_read) length_in_samples(samples_read); buf_size_t isize = 0; for(buf_size_t osize = 0; osize < buffersize_rep; osize++) { for(channel_size_t c = 0; c < chcount; c++) { import_helper(source, &isize, buffer[c], osize, fmt); } } } /** * Same as 'import_interleaved()', but 'source' data is * assumed to be in non-interleaved format. * * @pre source != 0 * @pre samples_read >= 0 */ void SAMPLE_BUFFER::import_noninterleaved(unsigned char* source, buf_size_t samples_read, ECA_AUDIO_FORMAT::Sample_format fmt, channel_size_t chcount) { // -------- DBC_REQUIRE(source != 0); DBC_REQUIRE(samples_read >= 0); // -------- if (channel_count_rep != chcount) number_of_channels(chcount); if (buffersize_rep != samples_read) length_in_samples(samples_read); buf_size_t isize = 0; for(channel_size_t c = 0; c < chcount; c++) { for(buf_size_t osize = 0; osize < buffersize_rep; osize++) { import_helper(source, &isize, buffer[c], osize, fmt); } } } /** * Sets the number of audio channels. */ void SAMPLE_BUFFER::number_of_channels(channel_size_t len) { // std::cerr << "(samplebuffer_impl) ch-count changes from " << channel_count_rep << " to " << len << ".\n"; if (len > static_cast(buffer.size())) { DBC_CHECK(impl_repp->rt_lock_rep != true); size_t old_size = buffer.size(); buffer.resize(len); for(channel_size_t n = old_size; n < len; n++) { priv_alloc_sample_buf(&buffer[n], sizeof(sample_t) * reserved_samples_rep); } ECA_LOG_MSG(ECA_LOGGER::functions, "Increasing channel-count (1)."); } /* note! channel_count_rep and buffer.size() necessarily * weren't the same before this call, so we need * to double check for old data */ if (len > channel_count_rep) { for(channel_size_t n = channel_count_rep; n < len; n++) { for(buf_size_t m = 0; m < reserved_samples_rep; m++) { buffer[n][m] = SAMPLE_SPECS::silent_value; } } // ECA_LOG_MSG(ECA_LOGGER::system_objects, "Increasing channel-count (2)."); } channel_count_rep = len; } /** * Sets the length of buffer in samples. * * Note: if length is increased, the added samples * are muted. */ void SAMPLE_BUFFER::length_in_samples(buf_size_t len) { DBC_REQUIRE(len >= 0); DBC_CHECK(buffersize_rep <= reserved_samples_rep); if (len > reserved_samples_rep) { DBC_CHECK(impl_repp->rt_lock_rep != true); DBC_CHECK(impl_repp->lockref_rep == 0); reserved_samples_rep = len * 2; for(size_t n = 0; n < buffer.size(); n++) { sample_t *prev_buffer = buffer[n]; priv_alloc_sample_buf(&buffer[n], sizeof(sample_t) * reserved_samples_rep); for (buf_size_t m = 0; m < buffersize_rep; m++) buffer[n][m] = prev_buffer[m]; ::free(prev_buffer); } if (impl_repp->old_buffer_repp != 0) { ::free(impl_repp->old_buffer_repp); priv_alloc_sample_buf(&impl_repp->old_buffer_repp, sizeof(sample_t) * reserved_samples_rep); } } if (len > buffersize_rep) { for(size_t n = 0; n < buffer.size(); n++) { /* note: mute starting from 'buffersize_rep' */ for(buf_size_t m = buffersize_rep; m < reserved_samples_rep; m++) { buffer[n][m] = SAMPLE_SPECS::silent_value; } } } buffersize_rep = len; } /** * Prepares sample buffer object for resampling * operations with params 'from_srate' and * 'to_srate'. This functions is meant for * doing memory allocations and other similar * operations which cannot be performed * with realtime guarantees. */ void SAMPLE_BUFFER::resample_init_memory(SAMPLE_SPECS::sample_rate_t from_srate, SAMPLE_SPECS::sample_rate_t to_srate) { #ifdef ECA_COMPILE_SAMPLERATE ECA_LOG_MSG(ECA_LOGGER::system_objects, "Resampler selected: libsamplerate (Secret Rabbit Code)."); #else ECA_LOG_MSG(ECA_LOGGER::system_objects, "Resampler selected: internal resampler."); #endif double step = 1.0; if (from_srate != 0) { step = static_cast(to_srate) / from_srate; } /* add at least one word of extra space */ buf_size_t new_buffer_size = static_cast((step * buffersize_rep)) + sizeof(buf_size_t); if (new_buffer_size > reserved_samples_rep) { reserved_samples_rep = new_buffer_size * 2; #ifdef ECA_DEBUG_MODE DBC_CHECK(impl_repp->rt_lock_rep != true); DBC_CHECK(impl_repp->lockref_rep == 0); #endif for(int c = 0; c < channel_count_rep; c++) { ::free(buffer[c]); priv_alloc_sample_buf(&buffer[c], sizeof(sample_t) * reserved_samples_rep); } } #ifdef ECA_COMPILE_SAMPLERATE impl_repp->src_state_rep.resize(channel_count_rep); for(int c = 0; c < channel_count_rep; c++) { if (impl_repp->src_state_rep[c] == 0) { int error; impl_repp->src_state_rep[c] = src_new((impl_repp->quality_rep > 75) ? SRC_SINC_BEST_QUALITY : SRC_SINC_MEDIUM_QUALITY, 1, &error); DBC_CHECK(impl_repp->src_state_rep[c] != 0); } } #endif if (impl_repp->old_buffer_repp == 0) { #ifdef ECA_DEBUG_MODE DBC_CHECK(impl_repp->rt_lock_rep != true); #endif priv_alloc_sample_buf(&impl_repp->old_buffer_repp, sizeof(sample_t) * reserved_samples_rep); } if (impl_repp->resample_memory_rep.size() < static_cast(channel_count_rep)) { #ifdef ECA_DEBUG_MODE DBC_CHECK(impl_repp->rt_lock_rep != true); #endif impl_repp->resample_memory_rep.resize(channel_count_rep, 0.0f); } } void SAMPLE_BUFFER::reserve_channels(channel_size_t num) { channel_size_t oldcount = number_of_channels(); number_of_channels(num); number_of_channels(oldcount); } void SAMPLE_BUFFER::reserve_length_in_samples(buf_size_t len) { buf_size_t oldlen = length_in_samples(); length_in_samples(len); length_in_samples(oldlen); } /** * Sets the realtime-lock state. When realtime-lock * is enabled, all non-rt-safe operations * like for instance memory allocations are * blocked. * * @param state true=lock, false=unlock */ void SAMPLE_BUFFER::set_rt_lock(bool state) { impl_repp->rt_lock_rep = state; } /** * Increases reference count of 'buffer' data * area. * * This should be issued when an object uses * direct access to the samplebuffer's * audio data buffer. * * Note! release_pointer_reflock() must be * called after caller stops accessing * 'buffer'. */ void SAMPLE_BUFFER::get_pointer_reflock(void) { impl_repp->lockref_rep++; } /** * Increases reference count of 'buffer' data * area. * * @see get_pointer_reflock() */ void SAMPLE_BUFFER::release_pointer_reflock(void) { impl_repp->lockref_rep--; DBC_ENSURE(impl_repp->lockref_rep >= 0); } /** * Adds all event tags that are set for 'sbuf' (bitwise-OR). */ void SAMPLE_BUFFER::event_tags_add(const SAMPLE_BUFFER& sbuf) { impl_repp->event_tags_rep |= sbuf.impl_repp->event_tags_rep; } /** * Sets only those event flags that are set for 'sbuf'. */ void SAMPLE_BUFFER::event_tags_set(const SAMPLE_BUFFER& sbuf) { impl_repp->event_tags_rep = sbuf.impl_repp->event_tags_rep; } /** * Clears all tags matching 'tagmask' */ void SAMPLE_BUFFER::event_tags_clear(Tag_name tagmask) { event_tag_set(tagmask, false); } /** * Set/clears the event tag 'tag'. */ void SAMPLE_BUFFER::event_tag_set(Tag_name tag, bool val) { if (val) impl_repp->event_tags_rep |= tag; else impl_repp->event_tags_rep &= ~tag; } bool SAMPLE_BUFFER::event_tag_test(Tag_name tag) { return (impl_repp->event_tags_rep & tag) ? true : false; } /** * Resamples samplebuffer contents. * * Note! 'resample_init_memory()' must be called before * before calling this function. */ void SAMPLE_BUFFER::resample_nofilter(SAMPLE_SPECS::sample_rate_t from, SAMPLE_SPECS::sample_rate_t to) { double step = static_cast(to) / from; buf_size_t old_buffer_size = buffersize_rep; // truncate, not round, to integer length_in_samples(static_cast(std::floor(step * buffersize_rep))); DEBUG_RESAMPLING_STATEMENT(std::cerr << "resample_no_f from " << from << " to " << to << "." << std::endl); DBC_CHECK(impl_repp->old_buffer_repp != 0); for(int c = 0; c < channel_count_rep; c++) { std::memcpy(impl_repp->old_buffer_repp, buffer[c], old_buffer_size * sizeof(sample_t)); DBC_CHECK(buffersize_rep <= reserved_samples_rep); double counter = 0.0; buf_size_t new_buffer_index = 0; buf_size_t interpolate_index = 0; buffer[c][0] = impl_repp->old_buffer_repp[0]; for(buf_size_t old_buffer_index = 1; old_buffer_index < old_buffer_size; old_buffer_index++) { counter += step; if (step <= 1) { if (counter >= new_buffer_index + 1) { new_buffer_index++; if (new_buffer_index >= buffersize_rep) break; buffer[c][new_buffer_index] = impl_repp->old_buffer_repp[old_buffer_index]; } } else { new_buffer_index = static_cast(std::ceil(counter)); if (new_buffer_index >= buffersize_rep) new_buffer_index = buffersize_rep - 1; for(buf_size_t t = interpolate_index + 1; t < new_buffer_index; t++) { buffer[c][t] = impl_repp->old_buffer_repp[old_buffer_index - 1] + ((impl_repp->old_buffer_repp[old_buffer_index] - impl_repp->old_buffer_repp[old_buffer_index-1]) * static_cast(t - interpolate_index) / (new_buffer_index - interpolate_index)); } buffer[c][new_buffer_index] = impl_repp->old_buffer_repp[old_buffer_index]; } interpolate_index = new_buffer_index; } } } /** * Resamples samplebuffer contents. * * Note! 'resample_init_memory()' must be called before * before calling this function. */ void SAMPLE_BUFFER::resample_with_memory(SAMPLE_SPECS::sample_rate_t from, SAMPLE_SPECS::sample_rate_t to) { double step = (double)to / from; buf_size_t old_buffer_size = buffersize_rep; // truncate, not round, to integer length_in_samples(static_cast(std::floor(step * buffersize_rep))); DBC_CHECK(impl_repp->old_buffer_repp != 0); DEBUG_RESAMPLING_STATEMENT(std::cerr << "(samplebuffer) resample_w_m from " << from << " to " << to << "." << std::endl); if (impl_repp->resample_memory_rep.size() < static_cast(channel_count_rep)) { DBC_CHECK(impl_repp->rt_lock_rep != true); impl_repp->resample_memory_rep.resize(channel_count_rep, 0.0f); } length_in_samples(buffersize_rep); for(int c = 0; c < channel_count_rep; c++) { std::memcpy(impl_repp->old_buffer_repp, buffer[c], old_buffer_size * sizeof(sample_t)); DBC_CHECK(buffersize_rep <= reserved_samples_rep); double counter = 0.0; buf_size_t new_buffer_index = 0; buf_size_t interpolate_index = -1; sample_t from_point; for(buf_size_t old_buffer_index = 0; old_buffer_index < old_buffer_size; old_buffer_index++) { counter += step; if (step <= 1) { if (counter >= new_buffer_index + 1) { new_buffer_index++; if (new_buffer_index >= buffersize_rep) break; buffer[c][new_buffer_index] = impl_repp->old_buffer_repp[old_buffer_index]; } } else { new_buffer_index = static_cast(std::ceil(counter)); if (old_buffer_index == 0) from_point = impl_repp->resample_memory_rep[c]; else from_point = impl_repp->old_buffer_repp[old_buffer_index-1]; if (new_buffer_index >= buffersize_rep) new_buffer_index = buffersize_rep - 1; for(buf_size_t t = interpolate_index + 1; t < new_buffer_index; t++) { buffer[c][t] = from_point + ((impl_repp->old_buffer_repp[old_buffer_index] - from_point) * static_cast(t - interpolate_index) / (new_buffer_index - interpolate_index)); } buffer[c][new_buffer_index] = impl_repp->old_buffer_repp[old_buffer_index]; } interpolate_index = new_buffer_index; } impl_repp->resample_memory_rep[c] = impl_repp->old_buffer_repp[old_buffer_size - 1]; } } void SAMPLE_BUFFER::resample_secret_rabbit_code(SAMPLE_SPECS::sample_rate_t from_srate, SAMPLE_SPECS::sample_rate_t to_srate) { #ifdef ECA_COMPILE_SAMPLERATE SRC_DATA params; long ch_out_count = -1; double step = static_cast(to_srate) / from_srate; buf_size_t old_buffer_size = buffersize_rep; /* modify buffersize_rep (size of dst buffer) */ length_in_samples(static_cast(std::floor(step * buffersize_rep))); DBC_CHECK(impl_repp->old_buffer_repp != 0); DEBUG_RESAMPLING_STATEMENT(std::cerr << "(samplebuffer) resample_s_r_c from " << from_srate << " to " << to_srate << "." << std::endl); for(int c = 0; c < channel_count_rep; c++) { std::memcpy(impl_repp->old_buffer_repp, buffer[c], old_buffer_size * sizeof(sample_t)); DBC_CHECK(buffersize_rep <= reserved_samples_rep); // A pointer to the input data samples. params.data_in = impl_repp->old_buffer_repp; // The number of frames of data pointed to by data_in. params.input_frames = old_buffer_size; // A pointer to the output data samples. params.data_out = buffer[c]; // Maximum number of frames pointer to by data_out. // note: was 'reserved_samples_rep' but this led // to corrupted output params.output_frames = reserved_samples_rep; /* buffersize_rep; */ // Equal to output_sample_rate / input_sample_rate. params.src_ratio = step; params.end_of_input = 0; // update the step int ret = src_set_ratio(impl_repp->src_state_rep[c], step); DBC_CHECK(ret == 0); // Perform the sample rate conversion ret = src_process(impl_repp->src_state_rep[c], ¶ms); DBC_CHECK(ret == 0); if (ret) { /* make sure we avoid segfault in all cases */ params.output_frames_gen = 0; params.input_frames_used = old_buffer_size; } DBC_CHECK(::labs(params.input_frames_used - old_buffer_size) == 0); #ifdef ECA_DEBUG_MODE /* make sure all input samples have been used */ if (old_buffer_size != params.input_frames_used) { std::cerr << "input_frames_over=" << old_buffer_size - params.input_frames_used << ".\n"; } /* check that all channels are processed in the same way */ if (c == 0) ch_out_count = params.output_frames_gen; DBC_CHECK(ch_out_count == params.output_frames_gen); #endif /* ECA_DEBUG_MODE */ } DEBUG_RESAMPLING_STATEMENT(std::cerr << "(samplebuffer) src_src input=" << old_buffer_size << ", target=" << buffersize_rep << ", processed=" << params.input_frames_used << ", space_for=" << reserved_samples_rep << ", out=" << params.output_frames_gen << std::endl); #ifdef ECA_DEBUG_MODE if ((params.output_frames_gen - buffersize_rep) > 1) { std::cerr << "(samplebuffer) src_src input=" << old_buffer_size << ", target=" << buffersize_rep << ", processed=" << params.input_frames_used << ", space_for=" << reserved_samples_rep << ", out=" << params.output_frames_gen << std::endl; } #endif if (params.output_frames_gen != buffersize_rep) { /* note: we set buffersize_rep directly and bypass * length_in_samples(), but in this case it is safe as * we have used 'reserved_samples_rep' as the upper limit */ buffersize_rep = params.output_frames_gen; } #endif /* ECA_COMPILE_SAMPLERATE */ } void SAMPLE_BUFFER::resample_extfilter(SAMPLE_SPECS::sample_rate_t from_srate, SAMPLE_SPECS::sample_rate_t to_srate) { } void SAMPLE_BUFFER::resample_simplefilter(SAMPLE_SPECS::sample_rate_t from_srate, SAMPLE_SPECS::sample_rate_t to_srate) { } ecasound-2.9.3/libecasound/audiofx_amplitude.h0000644000076400007640000002131711167663416016442 00000000000000#ifndef INCLUDED_AUDIOFX_AMPLITUDE_H #define INCLUDED_AUDIOFX_AMPLITUDE_H #include #include #include "samplebuffer_iterators.h" #include "audiofx.h" /** * Virtual base for amplitude effects and dynamic processors. * @author Kai Vehmanen */ class EFFECT_AMPLITUDE : public EFFECT_BASE { public: static parameter_t db_to_linear(parameter_t value); virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual ~EFFECT_AMPLITUDE(void); protected: SAMPLE_BUFFER *cur_sbuf_repp; }; #include "audiofx_compressor.h" /** * Amplifier for adjusting signal level (linear) * @author Kai Vehmanen */ class EFFECT_AMPLIFY: public EFFECT_AMPLITUDE { parameter_t gain_rep; SAMPLE_ITERATOR i; SAMPLE_BUFFER* sbuf_repp; public: virtual std::string name(void) const { return("Amplify"); } virtual std::string parameter_names(void) const { return("amp-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); virtual void process_ref(void); EFFECT_AMPLIFY (parameter_t multiplier_percent = 100.0); virtual ~EFFECT_AMPLIFY(void); EFFECT_AMPLIFY* clone(void) const { return new EFFECT_AMPLIFY(*this); } EFFECT_AMPLIFY* new_expr(void) const { return new EFFECT_AMPLIFY(); } }; /** * Amplifier for adjusting signal level (dB) * @author Kai Vehmanen */ class EFFECT_AMPLIFY_DB: public EFFECT_AMPLITUDE { private: parameter_t gain_rep; parameter_t gain_db_rep; int channel_rep; SAMPLE_BUFFER *sbuf_repp; SAMPLE_ITERATOR_CHANNEL i_ch; SAMPLE_ITERATOR i_all; public: virtual std::string name(void) const { return("Amplify (dB)"); } virtual std::string parameter_names(void) const { return("gain-db,channel"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void release(void); virtual void process(void); virtual void process_ref(void); virtual int output_channels(int i_channels) const; EFFECT_AMPLIFY_DB(parameter_t gain = 0.0f, int channel = 0); virtual ~EFFECT_AMPLIFY_DB(void); EFFECT_AMPLIFY_DB* clone(void) const { return new EFFECT_AMPLIFY_DB(*this); } EFFECT_AMPLIFY_DB* new_expr(void) const { return new EFFECT_AMPLIFY_DB(); } }; /** * Amplifier with clip control. * @author Kai Vehmanen */ class EFFECT_AMPLIFY_CLIPCOUNT : public EFFECT_AMPLITUDE { parameter_t gain; int nm, num_of_clipped, maxnum_of_clipped; SAMPLE_ITERATOR i; public: virtual std::string name(void) const { return("Amplify with clipping control"); } virtual std::string parameter_names(void) const { return("amp-%,max-clipped-samples"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_AMPLIFY_CLIPCOUNT* new_expr(void) const { return new EFFECT_AMPLIFY_CLIPCOUNT(); } EFFECT_AMPLIFY_CLIPCOUNT* clone(void) const { return new EFFECT_AMPLIFY_CLIPCOUNT(*this); } EFFECT_AMPLIFY_CLIPCOUNT (parameter_t multiplier_percent = 100.0, int max_clipped = 0); }; /** * Channel amplifier * @author Kai Vehmanen */ class EFFECT_AMPLIFY_CHANNEL: public EFFECT_AMPLITUDE { parameter_t gain; int channel_rep; SAMPLE_ITERATOR_CHANNEL i; public: virtual std::string name(void) const { return("Channel amplify"); } virtual std::string parameter_names(void) const { return("amp-%,channel"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual int output_channels(int i_channels) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual void process_ref(void); EFFECT_AMPLIFY_CHANNEL* clone(void) const { return new EFFECT_AMPLIFY_CHANNEL(*this); } EFFECT_AMPLIFY_CHANNEL* new_expr(void) const { return new EFFECT_AMPLIFY_CHANNEL(); } EFFECT_AMPLIFY_CHANNEL (parameter_t multiplier_percent = 100.0, int channel = 1); }; /** * Limiter effect * @author Kai Vehmanen */ class EFFECT_LIMITER: public EFFECT_AMPLITUDE { parameter_t limit_rep; SAMPLE_ITERATOR i; public: virtual std::string name(void) const { return("Limiter"); } virtual std::string parameter_names(void) const { return("limit-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_LIMITER (parameter_t multiplier_percent = 100.0); virtual ~EFFECT_LIMITER(void); EFFECT_LIMITER* clone(void) const { return new EFFECT_LIMITER(*this); } EFFECT_LIMITER* new_expr(void) const { return new EFFECT_LIMITER(); } }; /** * Dynamic compressor. * @author Kai Vehmanen */ class EFFECT_COMPRESS : public EFFECT_AMPLITUDE { parameter_t crate; parameter_t threshold; SAMPLE_ITERATOR_CHANNELS i; parameter_t delta, ratio, new_value; bool first_time; std::vector lastin, lastout; public: virtual std::string name(void) const { return("Compressor"); } virtual std::string parameter_names(void) const { return("compression-rate-dB,threshold-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_COMPRESS* clone(void) const { return new EFFECT_COMPRESS(*this); } EFFECT_COMPRESS* new_expr(void) const { return new EFFECT_COMPRESS(); } EFFECT_COMPRESS (const EFFECT_COMPRESS& x); EFFECT_COMPRESS (parameter_t compress_rate = 1.0, parameter_t thold = 10.0); }; /** * Noise gate with attack and release * @author Kai Vehmanen */ class EFFECT_NOISEGATE : public EFFECT_AMPLITUDE { SAMPLE_ITERATOR_CHANNELS i; parameter_t th_level; parameter_t th_time; parameter_t atime, htime, rtime; std::vector th_time_lask; std::vector attack_lask; std::vector hold_lask; std::vector release_lask; std::vector gain; enum { ng_waiting, ng_attacking, ng_active, ng_holding, ng_releasing }; std::vector ng_status; public: virtual std::string name(void) const { return("Noisegate"); } virtual std::string description(void) const { return("Noise gate with attack and release."); } virtual std::string parameter_names(void) const { return("threshold-level-%,pre-hold-time-msec,attack-time-msec,post-hold-time-msec,release-time-msec"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_NOISEGATE* clone(void) const { return new EFFECT_NOISEGATE(*this); } EFFECT_NOISEGATE* new_expr(void) const { return new EFFECT_NOISEGATE(); } EFFECT_NOISEGATE (parameter_t thlevel_percent = 100.0, parameter_t thtime = 50.0, parameter_t atime = 50.0, parameter_t htime = 50.0, parameter_t rtime = 50.0); }; /** * Panning effect for controlling the stereo image. * @author Kai Vehmanen */ class EFFECT_NORMAL_PAN : public EFFECT_AMPLITUDE { private: SAMPLE_ITERATOR_CHANNEL i; parameter_t right_percent_rep; parameter_t l_gain, r_gain; public: virtual std::string name(void) const { return("Normal pan"); } virtual std::string description(void) const { return("Panning effect for controlling the stereo image."); } virtual std::string parameter_names(void) const { return("right-%"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual int output_channels(int i_channels) const { return(2); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual void process_ref(void); EFFECT_NORMAL_PAN* clone(void) const { return new EFFECT_NORMAL_PAN(*this); } EFFECT_NORMAL_PAN* new_expr(void) const { return new EFFECT_NORMAL_PAN(); } EFFECT_NORMAL_PAN(parameter_t right_percent = 50.0); }; #endif ecasound-2.9.3/libecasound/eca-chainsetup-edit.h0000644000076400007640000000637211762477213016556 00000000000000// ------------------------------------------------------------------------ // eca-chainsetup-edit.h: Chainsetup edit object // Copyright (C) 2009,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_CHAINSETUP_EDIT_H #define INCLUDED_ECA_CHAINSETUP_EDIT_H class CHAIN; class ECA_CHAINSETUP; namespace ECA { enum Chainsetup_edit_type { edit_c_bypass = 0, edit_c_muting, edit_cop_add, edit_cop_bypass, edit_cop_set_param, edit_ctrl_add, edit_ctrl_set_param, }; /* * Chainsetup edit objects are defined for all operations * that can be performed either from the real-time engine * (if modifying chainsetup that is currently run), or * from the non-real-time control thread (modifying * selected but not running chainsetup). * * Using edit objects avoids duplicated code to describe * and parse the needed actions in both ECA_ENGINE and * ECA_CONTROL. */ struct chainsetup_edit { Chainsetup_edit_type type; const ECA_CHAINSETUP *cs_ptr; /* FIXME: should a version tag be added as way to invalidate * edit objects in case chainsetup is modified */ union { struct { int chain; /**< @see ECA_CHAINSETUP::get_chain_index() */ int val; } c_bypass; struct { int chain; /**< @see ECA_CHAINSETUP::get_chain_index() */ int val; } c_muting; struct { int chain; /**< @see ECA_CHAINSETUP::get_chain_index() */ int op; /**< @see CHAIN::set_parameter() */ int param; /**< @see CHAIN::set_parameter() */ double value; /**< @see CHAIN::set_parameter() */ } cop_set_param; struct { int chain; /**< @see ECA_CHAINSETUP::get_chain_index() */ int op; /**< @see CHAIN::bypass_operator() */ int bypass; /**< @see CHAIN::bypass_operator() */ } cop_bypass; struct { int chain; /**< @see ECA_CHAINSETUP::get_chain_index() */ } c_generic_param; struct { int chain; /**< @see ECA_CHAINSETUP::get_chain_index() */ int op; /**< @see CHAIN::set_controller_parameter() */ int param; /**< @see CHAIN::set_controller_parameter() */ double value; /**< @see CHAIN::set_controller_parameter() */ } ctrl_set_param; } m; bool need_chain_reinit; std::string param; /**< arbitrary string parameter, semantics depend on 'type' */ }; typedef struct chainsetup_edit chainsetup_edit_t; } #endif /* INCLUDED_ECA_CHAINSETUP_EDIT_H */ ecasound-2.9.3/libecasound/eca-test-repository.h0000644000076400007640000000314311141027232016634 00000000000000#ifndef INCLUDE_ECA_TEST_REPOSITORY_H #define INCLUDE_ECA_TEST_REPOSITORY_H #include #include #include #include "eca-test-case.h" /** * A testing subsystem implemented as a * singleton class. * * Note! Also the non-static part of this class * implements the ECA_TEST_CASE interface. * This means you can use the repository * just like a single test case (Composite * design pattern). * * Related design patterns: * - Singleton (GoF127) * - Composite (GoF163) * * @author Kai Vehmanen */ class ECA_TEST_REPOSITORY : public ECA_TEST_CASE { public: /** * Returns a reference to a unit testing object. * * Note! Return value is a reference to * avoid accidental deletion of * the singleton object. */ static ECA_TEST_REPOSITORY& instance(void); protected: virtual void do_run(void); virtual void do_run(const std::string& name); virtual std::string do_name(void) const { return("ECA_TEST_REPOSITORY"); } private: void do_run_worker(ECA_TEST_CASE* testcase); static ECA_TEST_REPOSITORY* interface_impl_repp; static pthread_mutex_t lock_rep; std::list test_cases_rep; /** * @name Constructors and destructors * * To prevent accidental use, located in private scope and * without a valid definition. */ /*@{*/ ECA_TEST_REPOSITORY(void); ~ECA_TEST_REPOSITORY(void); ECA_TEST_REPOSITORY(const ECA_TEST_REPOSITORY&) {} ECA_TEST_REPOSITORY& operator=(const ECA_TEST_REPOSITORY&) { return *this; } /*@}*/ }; #endif /* INCLUDE_ECA_TEST_REPOSITORY_H */ ecasound-2.9.3/libecasound/Makefile.in0000644000076400007640000014576213606336177014647 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/libecasound/Makefile.am # Description: Ecasound main library # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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@ check_PROGRAMS = libecasound_tester$(EXEEXT) subdir = libecasound DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libecasound-config.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = libecasound-config 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 = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @ECA_AM_DEBUG_MODE_FALSE@am__DEPENDENCIES_2 = $(top_builddir)/libecasound/plugins/libecasound_plugins.la \ @ECA_AM_DEBUG_MODE_FALSE@ $(am__DEPENDENCIES_1) @ECA_AM_DEBUG_MODE_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/libecasound/plugins/libecasound_plugins_debug.la \ @ECA_AM_DEBUG_MODE_TRUE@ $(am__DEPENDENCIES_1) libecasound_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am__libecasound_la_SOURCES_DIST = audioio-cdr.cpp audioio-ewf.cpp \ audioio-mp3.cpp audioio-ogg.cpp audioio-wave.cpp audioio.cpp \ audioio-buffered.cpp audioio-device.cpp audioio-null.cpp \ audioio-raw.cpp audioio-mikmod.cpp audioio-rtnull.cpp \ audioio-loop.cpp audioio-forked-stream.cpp \ audioio-timidity.cpp audioio-db-server.cpp \ audioio-db-buffer.cpp audioio-db-client.cpp \ audioio-typeselect.cpp audioio-resample.cpp \ audioio-reverse.cpp audioio-proxy.cpp audioio-flac.cpp \ audioio-aac.cpp audioio-tone.cpp audioio-seqbase.cpp \ audioio-acseq.cpp audioio-oss.cpp jack-connections.cpp \ midi-server.cpp midi-client.cpp midi-parser.cpp midiio.cpp \ midiio-raw.cpp midiio-aseq.cpp eca-chain.cpp eca-engine.cpp \ samplebuffer.cpp samplebuffer_functions.cpp eca-session.cpp \ eca-resources.cpp resource-file.cpp eca-logger.cpp \ eca-logger-default.cpp eca-logger-interface.cpp \ eca-logger-wellformed.cpp layer.cpp samplebuffer_iterators.cpp \ eca-version.cpp eca-operator.cpp generic-controller.cpp \ eca-object-factory.cpp eca-chainsetup.cpp \ eca-chainsetup-bufparams.cpp eca-chainsetup-parser.cpp \ eca-chainsetup-position.cpp eca-control.cpp \ eca-control-base.cpp eca-control-dump.cpp eca-control-main.cpp \ eca-control-mt.cpp eca-control-objects.cpp \ eca-iamode-parser.cpp eca-samplerate-aware.cpp \ eca-audio-position.cpp eca-audio-format.cpp eca-audio-time.cpp \ eca-fileio-stream.cpp eca-fileio-mmap.cpp eca-osc.cpp \ eca-static-object-maps.cpp eca-object-map.cpp \ eca-preset-map.cpp audiofx.cpp audiofx_misc.cpp \ audiofx_amplitude.cpp audiofx_compressor.cpp \ audiofx_analysis.cpp audiofx_envelope_modulation.cpp \ audiofx_filter.cpp audiofx_rcfilter.cpp audiofx_reverb.cpp \ audiofx_timebased.cpp audiogate.cpp audiofx_mixing.cpp \ audiofx_ladspa.cpp audiofx_lv2.cpp audiofx_lv2_world.cpp \ audio-stamp.cpp global-preset.cpp preset.cpp file-preset.cpp \ midi-cc.cpp osc-gen.cpp osc-gen-file.cpp osc-sine.cpp \ linear-envelope.cpp two-stage-linear-envelope.cpp \ stamp-ctrl.cpp generic-linear-envelope.cpp am__objects_1 = audioio-cdr.lo audioio-ewf.lo audioio-mp3.lo \ audioio-ogg.lo audioio-wave.lo audioio.lo audioio-buffered.lo \ audioio-device.lo audioio-null.lo audioio-raw.lo \ audioio-mikmod.lo audioio-rtnull.lo audioio-loop.lo \ audioio-forked-stream.lo audioio-timidity.lo \ audioio-db-server.lo audioio-db-buffer.lo audioio-db-client.lo \ audioio-typeselect.lo audioio-resample.lo audioio-reverse.lo \ audioio-proxy.lo audioio-flac.lo audioio-aac.lo \ audioio-tone.lo audioio-seqbase.lo audioio-acseq.lo @ECA_AM_COMPILE_OSS_TRUE@am__objects_2 = audioio-oss.lo @ECA_AM_COMPILE_JACK_TRUE@am__objects_3 = jack-connections.lo am__objects_4 = midi-server.lo midi-client.lo midi-parser.lo midiio.lo \ midiio-raw.lo midiio-aseq.lo am__objects_5 = eca-chain.lo eca-engine.lo samplebuffer.lo \ samplebuffer_functions.lo eca-session.lo eca-resources.lo \ resource-file.lo eca-logger.lo eca-logger-default.lo \ eca-logger-interface.lo eca-logger-wellformed.lo layer.lo \ samplebuffer_iterators.lo eca-version.lo eca-operator.lo \ generic-controller.lo eca-object-factory.lo eca-chainsetup.lo \ eca-chainsetup-bufparams.lo eca-chainsetup-parser.lo \ eca-chainsetup-position.lo eca-control.lo eca-control-base.lo \ eca-control-dump.lo eca-control-main.lo eca-control-mt.lo \ eca-control-objects.lo eca-iamode-parser.lo \ eca-samplerate-aware.lo eca-audio-position.lo \ eca-audio-format.lo eca-audio-time.lo eca-fileio-stream.lo \ eca-fileio-mmap.lo eca-osc.lo eca-static-object-maps.lo \ eca-object-map.lo eca-preset-map.lo am__objects_6 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ $(am__objects_4) $(am__objects_5) am__objects_7 = audiofx.lo audiofx_misc.lo audiofx_amplitude.lo \ audiofx_compressor.lo audiofx_analysis.lo \ audiofx_envelope_modulation.lo audiofx_filter.lo \ audiofx_rcfilter.lo audiofx_reverb.lo audiofx_timebased.lo \ audiogate.lo audiofx_mixing.lo audiofx_ladspa.lo \ audiofx_lv2.lo audiofx_lv2_world.lo audio-stamp.lo am__objects_8 = global-preset.lo preset.lo file-preset.lo am__objects_9 = midi-cc.lo osc-gen.lo osc-gen-file.lo osc-sine.lo \ linear-envelope.lo two-stage-linear-envelope.lo stamp-ctrl.lo \ generic-linear-envelope.lo @ECA_AM_DISABLE_EFFECTS_FALSE@am__objects_10 = $(am__objects_7) \ @ECA_AM_DISABLE_EFFECTS_FALSE@ $(am__objects_8) \ @ECA_AM_DISABLE_EFFECTS_FALSE@ $(am__objects_9) am_libecasound_la_OBJECTS = $(am__objects_6) $(am__objects_10) libecasound_la_OBJECTS = $(am_libecasound_la_OBJECTS) @ECA_AM_DEBUG_MODE_FALSE@am_libecasound_la_rpath = -rpath $(libdir) am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) libecasound_debug_la_DEPENDENCIES = $(am__DEPENDENCIES_3) am__libecasound_debug_la_SOURCES_DIST = audioio-cdr.cpp \ audioio-ewf.cpp audioio-mp3.cpp audioio-ogg.cpp \ audioio-wave.cpp audioio.cpp audioio-buffered.cpp \ audioio-device.cpp audioio-null.cpp audioio-raw.cpp \ audioio-mikmod.cpp audioio-rtnull.cpp audioio-loop.cpp \ audioio-forked-stream.cpp audioio-timidity.cpp \ audioio-db-server.cpp audioio-db-buffer.cpp \ audioio-db-client.cpp audioio-typeselect.cpp \ audioio-resample.cpp audioio-reverse.cpp audioio-proxy.cpp \ audioio-flac.cpp audioio-aac.cpp audioio-tone.cpp \ audioio-seqbase.cpp audioio-acseq.cpp audioio-oss.cpp \ jack-connections.cpp midi-server.cpp midi-client.cpp \ midi-parser.cpp midiio.cpp midiio-raw.cpp midiio-aseq.cpp \ eca-chain.cpp eca-engine.cpp samplebuffer.cpp \ samplebuffer_functions.cpp eca-session.cpp eca-resources.cpp \ resource-file.cpp eca-logger.cpp eca-logger-default.cpp \ eca-logger-interface.cpp eca-logger-wellformed.cpp layer.cpp \ samplebuffer_iterators.cpp eca-version.cpp eca-operator.cpp \ generic-controller.cpp eca-object-factory.cpp \ eca-chainsetup.cpp eca-chainsetup-bufparams.cpp \ eca-chainsetup-parser.cpp eca-chainsetup-position.cpp \ eca-control.cpp eca-control-base.cpp eca-control-dump.cpp \ eca-control-main.cpp eca-control-mt.cpp \ eca-control-objects.cpp eca-iamode-parser.cpp \ eca-samplerate-aware.cpp eca-audio-position.cpp \ eca-audio-format.cpp eca-audio-time.cpp eca-fileio-stream.cpp \ eca-fileio-mmap.cpp eca-osc.cpp eca-static-object-maps.cpp \ eca-object-map.cpp eca-preset-map.cpp audiofx.cpp \ audiofx_misc.cpp audiofx_amplitude.cpp audiofx_compressor.cpp \ audiofx_analysis.cpp audiofx_envelope_modulation.cpp \ audiofx_filter.cpp audiofx_rcfilter.cpp audiofx_reverb.cpp \ audiofx_timebased.cpp audiogate.cpp audiofx_mixing.cpp \ audiofx_ladspa.cpp audiofx_lv2.cpp audiofx_lv2_world.cpp \ audio-stamp.cpp global-preset.cpp preset.cpp file-preset.cpp \ midi-cc.cpp osc-gen.cpp osc-gen-file.cpp osc-sine.cpp \ linear-envelope.cpp two-stage-linear-envelope.cpp \ stamp-ctrl.cpp generic-linear-envelope.cpp am_libecasound_debug_la_OBJECTS = $(am__objects_6) $(am__objects_10) libecasound_debug_la_OBJECTS = $(am_libecasound_debug_la_OBJECTS) @ECA_AM_DEBUG_MODE_TRUE@am_libecasound_debug_la_rpath = -rpath \ @ECA_AM_DEBUG_MODE_TRUE@ $(libdir) am__objects_11 = libecasound_tester.$(OBJEXT) \ eca-test-repository.$(OBJEXT) eca-test-case.$(OBJEXT) am_libecasound_tester_OBJECTS = $(am__objects_11) libecasound_tester_OBJECTS = $(am_libecasound_tester_OBJECTS) @ECA_AM_DEBUG_MODE_FALSE@am__DEPENDENCIES_4 = $(top_builddir)/libecasound/libecasound.la \ @ECA_AM_DEBUG_MODE_FALSE@ $(top_builddir)/kvutils/libkvutils.la @ECA_AM_DEBUG_MODE_TRUE@am__DEPENDENCIES_4 = $(top_builddir)/libecasound/libecasound_debug.la \ @ECA_AM_DEBUG_MODE_TRUE@ $(top_builddir)/kvutils/libkvutils_debug.la libecasound_tester_DEPENDENCIES = $(am__DEPENDENCIES_4) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libecasound_la_SOURCES) $(libecasound_debug_la_SOURCES) \ $(libecasound_tester_SOURCES) DIST_SOURCES = $(am__libecasound_la_SOURCES_DIST) \ $(am__libecasound_debug_la_SOURCES_DIST) \ $(libecasound_tester_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ # note! Automake >= 1.5 will install stripped libraries # with "make install-strip". Older versions won't # strip libraries even if INSTALL_STRIP_FLAG is set. # also libtool 1.3.2 and older have problems # with stripping libraries. # Pass pkgdatadir to CPPFLAGS AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/kvutils \ $(ECA_S_EXTRA_CPPFLAGS) "-DECA_PKGDATADIR=\"${pkgdatadir}\"" AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = ChangeLog AUTOMAKE_OPTIONS = foreign SUBDIRS = plugins @ECA_AM_DEBUG_MODE_FALSE@lib_LTLIBRARIES = libecasound.la # ---------------------------------------------------------------------- # build targets and compiler options target defines # ---------------------------------------------------------------------- @ECA_AM_DEBUG_MODE_TRUE@lib_LTLIBRARIES = libecasound_debug.la TESTS = libecasound_tester @ECA_AM_DEBUG_MODE_FALSE@eca_libadd = $(top_builddir)/libecasound/plugins/libecasound_plugins.la $(ECA_S_EXTRA_LIBS) # ---------------------------------------------------------------------- # compiler and linker options # ---------------------------------------------------------------------- # if ECA_AM_ALL_STATIC # FIXME: always link ecasound-plugins statically @ECA_AM_DEBUG_MODE_TRUE@eca_libadd = $(top_builddir)/libecasound/plugins/libecasound_plugins_debug.la $(ECA_S_EXTRA_LIBS) eca_ldflags = -version-info @LIBECASOUND_VERSION@:0:@LIBECASOUND_VERSION_AGE@ @ECA_AM_DEBUG_MODE_FALSE@libecasound_tester_libs = $(top_builddir)/libecasound/libecasound.la \ @ECA_AM_DEBUG_MODE_FALSE@ $(top_builddir)/kvutils/libkvutils.la @ECA_AM_DEBUG_MODE_TRUE@libecasound_tester_libs = $(top_builddir)/libecasound/libecasound_debug.la \ @ECA_AM_DEBUG_MODE_TRUE@ $(top_builddir)/kvutils/libkvutils_debug.la # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- ecasound_audiofx_include = \ audiofx.h \ audiofx_misc.h \ audiofx_amplitude.h \ audiofx_compressor.h \ audiofx_analysis.h \ audiofx_envelope_modulation.h \ audiofx_filter.h \ audiofx_rcfilter.h \ audiofx_reverb.h \ audiofx_timebased.h \ audiogate.h \ audiofx_mixing.h \ audiofx_ladspa.h \ audiofx_lv2.h \ audiofx_lv2_world.h \ audio-stamp.h ecasound_preset_include = \ preset.h \ preset_impl.h \ file-preset.h \ global-preset.h ecasound_audioio_include = \ audioio.h \ audioio-buffered.h \ audioio-device.h \ audioio-plugin.h \ audioio-manager.h \ audioio-cdr.h \ audioio-cdr_impl.h \ audioio-ewf.h \ audioio-mp3.h \ audioio-mp3_impl.h \ audioio-ogg.h \ audioio-wave.h \ audioio-raw.h \ audioio-oss.h \ audioio-oss_impl.h \ audioio-null.h \ audioio-rtnull.h \ audioio-mikmod.h \ audioio-loop.h \ audioio-forked-stream.h \ audioio-timidity.h \ audioio-db-server.h \ audioio-db-server_impl.h \ audioio-db-buffer.h \ audioio-db-client.h \ audioio-proxy.h \ audioio-typeselect.h \ audioio-resample.h \ audioio-reverse.h \ audioio-flac.h \ audioio-aac.h \ audioio-tone.h \ audioio-seqbase.h \ audioio-acseq.h \ audioio-barrier.h ecasound_midi_include = \ midi-server.h \ midi-client.h \ midi-parser.h \ midiio.h \ midiio-raw.h \ midiio-aseq.h ecasound_controller_include = \ ctrl-source.h \ midi-cc.h \ oscillator.h \ osc-gen.h \ osc-gen-file.h \ osc-sine.h \ linear-envelope.h \ two-stage-linear-envelope.h \ stamp-ctrl.h \ generic-linear-envelope.h ecasound_general_include = \ eca-chain.h \ eca-chainop.h \ eca-chainsetup-edit.h \ eca-error.h \ eca-logger.h \ eca-logger-default.h \ eca-logger-interface.h \ eca-logger-wellformed.h \ eca-engine.h \ eca-engine-driver.h \ eca-engine_impl.h \ eca-session.h \ eca-resources.h \ resource-file.h \ layer.h \ eca-static-object-maps.h \ eca-object-map.h \ eca-preset-map.h \ samplebuffer.h \ samplebuffer_impl.h \ samplebuffer_functions.h \ samplebuffer_iterators.h \ sample-specs.h \ sample-ops_impl.h \ eca-sample-conversion.h \ eca-version.h \ eca-object-factory.h \ eca-chainsetup.h \ eca-chainsetup_impl.h \ eca-chainsetup-bufparams.h \ eca-chainsetup-parser.h \ eca-chainsetup-position.h \ eca-control.h \ eca-control-dump.h \ eca-control-main.h \ eca-control-mt.h \ eca-iamode-parser.h \ eca-iamode-parser_impl.h \ eca-audio-position.h \ eca-fileio.h \ eca-fileio-stream.h \ eca-fileio-mmap.h \ eca-osc.h \ dynamic-parameters.h \ dynamic-object.h \ eca-object.h \ eca-operator.h \ generic-controller.h \ eca-samplerate-aware.h \ eca-audio-format.h \ eca-audio-time.h \ jack-connections.h ecasound_extra_include = \ ladspa.h ecasound_test_framework_include = \ eca-test-repository.h \ eca-test-case.h \ audiofx_amplitude_test.h \ audioio_test.h \ audioio-device_test.h \ eca-audio-time_test.h \ eca-chainsetup_test.h \ eca-chainsetup-parser_test.h \ eca-control_test.h \ eca-session_test.h \ eca-object-factory_test.h \ eca-sample-conversion_test.h \ generic-linear-envelope_test.h \ samplebuffer_test.h # note! also remembers to update install-data-local and # uninstall-data targets noinst_HEADERS = $(ecasound_audiofx_include) \ $(ecasound_preset_include) \ $(ecasound_audioio_include) \ $(ecasound_midi_include) \ $(ecasound_controller_include) \ $(ecasound_general_include) \ $(ecasound_extra_include) \ $(ecasound_test_framework_include) # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- ecasound_audiofx_src = audiofx.cpp \ audiofx_misc.cpp \ audiofx_amplitude.cpp \ audiofx_compressor.cpp \ audiofx_analysis.cpp \ audiofx_envelope_modulation.cpp \ audiofx_filter.cpp \ audiofx_rcfilter.cpp \ audiofx_reverb.cpp \ audiofx_timebased.cpp \ audiogate.cpp \ audiofx_mixing.cpp \ audiofx_ladspa.cpp \ audiofx_lv2.cpp \ audiofx_lv2_world.cpp \ audio-stamp.cpp ecasound_preset_src = global-preset.cpp \ preset.cpp \ file-preset.cpp ecasound_audioio1_src = audioio-cdr.cpp \ audioio-ewf.cpp \ audioio-mp3.cpp \ audioio-ogg.cpp \ audioio-wave.cpp \ audioio.cpp \ audioio-buffered.cpp \ audioio-device.cpp \ audioio-null.cpp \ audioio-raw.cpp \ audioio-mikmod.cpp \ audioio-rtnull.cpp \ audioio-loop.cpp \ audioio-forked-stream.cpp \ audioio-timidity.cpp \ audioio-db-server.cpp \ audioio-db-buffer.cpp \ audioio-db-client.cpp \ audioio-typeselect.cpp \ audioio-resample.cpp \ audioio-reverse.cpp \ audioio-proxy.cpp \ audioio-flac.cpp \ audioio-aac.cpp \ audioio-tone.cpp \ audioio-seqbase.cpp \ audioio-acseq.cpp @ECA_AM_COMPILE_OSS_FALSE@ecasound_audioio2_src = @ECA_AM_COMPILE_OSS_TRUE@ecasound_audioio2_src = audioio-oss.cpp @ECA_AM_COMPILE_JACK_FALSE@jack_connections_src = @ECA_AM_COMPILE_JACK_TRUE@jack_connections_src = jack-connections.cpp ecasound_midi_src = \ midi-server.cpp \ midi-client.cpp \ midi-parser.cpp \ midiio.cpp \ midiio-raw.cpp \ midiio-aseq.cpp ecasound_controller_src = \ midi-cc.cpp \ osc-gen.cpp \ osc-gen-file.cpp \ osc-sine.cpp \ linear-envelope.cpp \ two-stage-linear-envelope.cpp \ stamp-ctrl.cpp \ generic-linear-envelope.cpp ecasound_general_src = eca-chain.cpp \ eca-engine.cpp \ samplebuffer.cpp \ samplebuffer_functions.cpp \ eca-session.cpp \ eca-resources.cpp \ resource-file.cpp \ eca-logger.cpp \ eca-logger-default.cpp \ eca-logger-interface.cpp \ eca-logger-wellformed.cpp \ layer.cpp \ samplebuffer_iterators.cpp \ eca-version.cpp \ eca-operator.cpp \ generic-controller.cpp \ eca-object-factory.cpp \ eca-chainsetup.cpp \ eca-chainsetup-bufparams.cpp \ eca-chainsetup-parser.cpp \ eca-chainsetup-position.cpp \ eca-control.cpp \ eca-control-base.cpp \ eca-control-dump.cpp \ eca-control-main.cpp \ eca-control-mt.cpp \ eca-control-objects.cpp \ eca-iamode-parser.cpp \ eca-samplerate-aware.cpp \ eca-audio-position.cpp \ eca-audio-format.cpp \ eca-audio-time.cpp \ eca-fileio-stream.cpp \ eca-fileio-mmap.cpp \ eca-osc.cpp \ eca-static-object-maps.cpp \ eca-object-map.cpp \ eca-preset-map.cpp ecasound_common1_src = $(ecasound_audioio1_src) \ $(ecasound_audioio2_src) \ $(jack_connections_src) \ $(ecasound_midi_src) \ $(ecasound_general_src) @ECA_AM_DISABLE_EFFECTS_FALSE@ecasound_common2_src = $(ecasound_audiofx_src) \ @ECA_AM_DISABLE_EFFECTS_FALSE@ $(ecasound_preset_src) \ @ECA_AM_DISABLE_EFFECTS_FALSE@ $(ecasound_controller_src) @ECA_AM_DISABLE_EFFECTS_TRUE@ecasound_common2_src = libecasound_tester_src = \ libecasound_tester.cpp \ eca-test-repository.cpp \ eca-test-case.cpp libecasound_la_SOURCES = $(ecasound_common1_src) $(ecasound_common2_src) libecasound_debug_la_SOURCES = $(ecasound_common1_src) $(ecasound_common2_src) libecasound_la_LDFLAGS = -export-dynamic $(eca_ldflags) -static libecasound_la_LIBADD = $(eca_libadd) libecasound_debug_la_LDFLAGS = $(libecasound_la_LDFLAGS) libecasound_debug_la_LIBADD = $(libecasound_la_LIBADD) libecasound_tester_SOURCES = $(libecasound_tester_src) #libecasound_tester_CFLAGS = $(AM_CFLAGS) libecasound_tester_LDADD = $(libecasound_tester_libs) all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libecasound/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign libecasound/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 libecasound-config: $(top_builddir)/config.status $(srcdir)/libecasound-config.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ 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 libecasound.la: $(libecasound_la_OBJECTS) $(libecasound_la_DEPENDENCIES) $(CXXLINK) $(am_libecasound_la_rpath) $(libecasound_la_LDFLAGS) $(libecasound_la_OBJECTS) $(libecasound_la_LIBADD) $(LIBS) libecasound_debug.la: $(libecasound_debug_la_OBJECTS) $(libecasound_debug_la_DEPENDENCIES) $(CXXLINK) $(am_libecasound_debug_la_rpath) $(libecasound_debug_la_LDFLAGS) $(libecasound_debug_la_OBJECTS) $(libecasound_debug_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done libecasound_tester$(EXEEXT): $(libecasound_tester_OBJECTS) $(libecasound_tester_DEPENDENCIES) @rm -f libecasound_tester$(EXEEXT) $(CXXLINK) $(libecasound_tester_LDFLAGS) $(libecasound_tester_OBJECTS) $(libecasound_tester_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audio-stamp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_amplitude.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_analysis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_compressor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_envelope_modulation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_ladspa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_lv2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_lv2_world.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_mixing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_rcfilter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_reverb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiofx_timebased.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audiogate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-aac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-acseq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-buffered.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-cdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-db-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-db-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-db-server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-ewf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-flac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-forked-stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-loop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-mikmod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-mp3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-ogg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-oss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-raw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-resample.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-reverse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-rtnull.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-seqbase.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-timidity.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-tone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-typeselect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio-wave.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/audioio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-audio-format.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-audio-position.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-audio-time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-chain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-chainsetup-bufparams.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-chainsetup-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-chainsetup-position.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-chainsetup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-control-base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-control-dump.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-control-main.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-control-mt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-control-objects.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-control.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-engine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-fileio-mmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-fileio-stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-iamode-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-logger-default.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-logger-interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-logger-wellformed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-logger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-object-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-object-map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-operator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-osc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-preset-map.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-resources.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-samplerate-aware.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-static-object-maps.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-test-case.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-test-repository.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-version.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-preset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic-controller.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic-linear-envelope.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global-preset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jack-connections.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/layer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libecasound_tester.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linear-envelope.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midi-cc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midi-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midi-parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midi-server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midiio-aseq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midiio-raw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midiio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osc-gen-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osc-gen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osc-sine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource-file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samplebuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samplebuffer_functions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/samplebuffer_iterators.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stamp-ctrl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two-stage-linear-envelope.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # 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): @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; \ (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" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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 || \ tags="$$tags $$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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done 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) 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-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-exec-am: install-libLTLIBRARIES install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ uninstall-local uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-TESTS \ check-am clean clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-compile distclean-generic \ distclean-libtool distclean-recursive distclean-tags distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-exec \ install-exec-am install-info install-info-am \ install-libLTLIBRARIES install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am \ uninstall-libLTLIBRARIES uninstall-local # --------------------------------------------------------------------- # Install targets - note! we don't install $ecasound_extra_include # nor $ecasound_test_framework_include install-data-local: $(INSTALL) -d $(DESTDIR)$(includedir)/libecasound cd $(srcdir) ; \ $(INSTALL_DATA) \ $(ecasound_audiofx_include) \ $(ecasound_preset_include) \ $(ecasound_audioio_include) \ $(ecasound_controller_include) \ $(ecasound_midi_include) \ $(ecasound_general_include) \ $(DESTDIR)$(includedir)/libecasound $(INSTALL) -d $(DESTDIR)$(bindir) $(INSTALL_SCRIPT) libecasound-config $(DESTDIR)$(bindir)/libecasound-config # --------------------------------------------------------------------- # Uninstall targets uninstall-local: cd $(DESTDIR)$(includedir)/libecasound && \ rm -f $(ecasound_audiofx_include) \ $(ecasound_preset_include) \ $(ecasound_audioio_include) \ $(ecasound_controller_include) \ $(ecasound_midi_include) \ $(ecasound_general_include) rmdir $(DESTDIR)$(includedir)/libecasound || echo "Skipping" rm -f $(DESTDIR)$(bindir)/libecasound-config rmdir $(DESTDIR)$(bindir) || echo "Skipping" # 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: ecasound-2.9.3/libecasound/audioio-device.cpp0000644000076400007640000000463712501304363016150 00000000000000// ------------------------------------------------------------------------ // audioio-device.cpp: Virtual base class for real-time devices. // Copyright (C) 1999-2001,2010,2013,2015 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "audioio-device.h" #include "samplebuffer.h" AUDIO_IO_DEVICE::AUDIO_IO_DEVICE(void) : is_running_rep(false), is_prepared_rep(false), ignore_xruns_rep(true), max_buffers_rep(true) { } AUDIO_IO_DEVICE::~AUDIO_IO_DEVICE(void) { if (is_open() == true) close(); DBC_CHECK(is_running() != true); } bool AUDIO_IO_DEVICE::is_realtime_object(const AUDIO_IO* aobj) { const AUDIO_IO_DEVICE* p = dynamic_cast(aobj); if (p != 0) return(true); return(false); } string AUDIO_IO_DEVICE::status(void) const { MESSAGE_ITEM mitem; mitem << "realtime-device; position "; mitem << position_in_samples() << ", delay "; mitem << delay() << ".\n -> "; if (is_open() == true) mitem << "open, "; else mitem << "closed, "; mitem << format_string() << "/" << channels() << "ch/" << samples_per_second(); mitem << "Hz, buffer " << buffersize() << "."; return(mitem.to_string()); } void AUDIO_IO_DEVICE::write_buffer(SAMPLE_BUFFER* sbuf) { long int payload = sbuf->length_in_samples(); if (payload != buffersize() && sbuf->event_tag_test(SAMPLE_BUFFER::tag_var_length) != true) { // Unless explicitly allowed with 'tag_var_length' tag, pad the // buffer to full buffersize(). SAMPLE_BUFFER will ensure the // added samples are muted. sbuf->length_in_samples(buffersize()); } AUDIO_IO_BUFFERED::write_buffer(sbuf); } ecasound-2.9.3/libecasound/eca-logger-interface.cpp0000644000076400007640000001420511172721622017221 00000000000000// ------------------------------------------------------------------------ // eca-logger-interface.cpp: Logging subsystem interface // Copyright (C) 2002-2004,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include /* find() */ #include #include #include /* for getpid() */ #include /* --"-- */ #include #include #include #include #include #include "eca-version.h" #include "eca-logger-interface.h" using namespace std; const static int eca_l_i_default_log_history_len = 0; const static int eca_l_i_default_extlog_level = ECA_LOGGER::errors | ECA_LOGGER::info | ECA_LOGGER::subsystems | ECA_LOGGER::module_names | ECA_LOGGER::user_objects | ECA_LOGGER::system_objects | ECA_LOGGER::eiam_return_values; /** * Class constructor. Initializes log level to 'disabled'. */ ECA_LOGGER_INTERFACE::ECA_LOGGER_INTERFACE(void) : debug_value_rep(0), log_history_len_rep(eca_l_i_default_log_history_len), extlog_debug_level_rep(eca_l_i_default_extlog_level), extlog_file_repp(0) { char *extlog_dest = getenv("ECASOUND_LOGFILE"); char *extlog_loglevel = getenv("ECASOUND_LOGLEVEL"); if (extlog_dest) { if (extlog_loglevel) { extlog_debug_level_rep = atoi(extlog_loglevel); } extlog_file_repp = fopen(extlog_dest, "a"); if (extlog_file_repp) { time_t curtime; time(&curtime); fprintf(extlog_file_repp, "---------------------------------------------------------------------\n" "%sOpening logfile \"%s\" for ecasound-%s (logger=%p, pid=%d):\n", ctime(&curtime), extlog_dest, ecasound_library_version, this, getpid()); } else { std::cerr << "*** ERROR: Error in opening \"" << extlog_dest << "\". Check ECASOUND_LOGFILE and file permissions. ***\n"; } } } /** * Class destructor. */ ECA_LOGGER_INTERFACE::~ECA_LOGGER_INTERFACE(void) { if (extlog_file_repp != 0) { fprintf(extlog_file_repp, "Closing logfile (logger=%p, pid=%d).\n", this, getpid()); fclose(extlog_file_repp); } } /** * Issues a generic log message. */ void ECA_LOGGER_INTERFACE::msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message) { std::string logmsg; /* step: output message with subclass implementation */ do_msg(level, module_name, log_message); /* step: store item to history * (note that we cannot archive EIAM return values as this * could create a loop when the backlog itself is printed) */ if (log_history_len_rep > 0 && level != ECA_LOGGER::eiam_return_values) { format_log_msg(&logmsg, level, module_name, log_message); log_history_rep.push_back(string("[") + ECA_LOGGER::level_to_string(level) + "] (" + ECA_LOGGER_INTERFACE::filter_module_name(module_name) + ") " + log_message); if (static_cast(log_history_rep.size()) > log_history_len_rep) { log_history_rep.pop_front(); DBC_CHECK(static_cast(log_history_rep.size()) == log_history_len_rep); } } /* step: conditionally output to external logfile */ if (extlog_file_repp != 0) { ECA_LOGGER::Msg_level_t extlevel = static_cast(extlog_debug_level_rep > 0 ? extlog_debug_level_rep : debug_value_rep); /* if message matches the request level mask, write it to log */ if (extlevel & level) { static unsigned long counter = 0; if (logmsg.size() == 0) format_log_msg(&logmsg, level, module_name, log_message); logmsg += " <" + kvu_numtostr(counter++) + ">\n"; fwrite(logmsg.c_str(), logmsg.size(), 1, extlog_file_repp); if (ferror(extlog_file_repp)) { std::cerr << "*** ERROR: Error in writing to ECASOUND_LOGFILE. Check free disk space. ***\n"; fclose(extlog_file_repp); extlog_file_repp = 0; } fflush(extlog_file_repp); } } } /** * Sets logging level to 'level' state to 'enabled'. */ void ECA_LOGGER_INTERFACE::set_log_level(ECA_LOGGER::Msg_level_t level, bool enabled) { if (enabled == true) { debug_value_rep |= level; } else { debug_value_rep &= ~level; } } /** * Flush all log messages. */ void ECA_LOGGER_INTERFACE::flush(void) { do_flush(); } /** * Disables logging. * * Note! Is equivalent to * 'set_log_level(ECA_LOGGER_INTERFACE::disabled)'. */ void ECA_LOGGER_INTERFACE::disable(void) { debug_value_rep = 0; } /** * Sets the log message history length. */ void ECA_LOGGER_INTERFACE::set_log_history_length(int len) { log_history_len_rep = len; } /** * Formats module name for logging purposes. * * Both "foobar.cpp" and "../src/foobar.cpp" return * the same formatted string "foobar". */ string ECA_LOGGER_INTERFACE::filter_module_name(const string& rawmodule) { string retval; size_t begin = rawmodule.rfind("/"); if (begin == string::npos) begin = 0; else /* skip the initial "/" */ ++begin; size_t end = rawmodule.rfind("."); if (end > begin) return string(rawmodule, begin, end - begin); return rawmodule; } void ECA_LOGGER_INTERFACE::format_log_msg(std::string *logmsg, ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message) { *logmsg = string("[") + ECA_LOGGER::level_to_string(level) + "] (" + ECA_LOGGER_INTERFACE::filter_module_name(module_name) + ") " + log_message; } ecasound-2.9.3/libecasound/audiofx_misc.cpp0000644000076400007640000001530612501305173015727 00000000000000// ------------------------------------------------------------------------ // audiofx_misc.cpp: Miscellanous effect processing routines. // Copyright (C) 1999-2003,2005,2015 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "samplebuffer_iterators.h" #include "eca-operator.h" #include "audiofx_misc.h" #include "eca-logger.h" #include "eca-error.h" EFFECT_DCFIX::EFFECT_DCFIX (void) { } EFFECT_DCFIX::EFFECT_DCFIX (const EFFECT_DCFIX& x) { deltafixes_rep = x.deltafixes_rep; i_rep = x.i_rep; } void EFFECT_DCFIX::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { if (param == 1) { deltafixes_rep.resize(static_cast(value)); } else if (param > 1 && param - 2 < static_cast(deltafixes_rep.size())) { deltafixes_rep[param - 2] = value; } } CHAIN_OPERATOR::parameter_t EFFECT_DCFIX::get_parameter(int param) const { parameter_t result = 0.0f; if (param == 1) { result = static_cast(deltafixes_rep.size()); } else if (param > 1 && param - 2 < static_cast(deltafixes_rep.size())) { result = deltafixes_rep[param - 2]; } return result; } string EFFECT_DCFIX::parameter_names(void) const { std::vector t; t.push_back("channel-count"); for(int n = 0; n < static_cast(deltafixes_rep.size()); n++) { t.push_back("delta-ch" + kvu_numtostr(n + 1)); } return kvu_vector_to_string(t, ","); } void EFFECT_DCFIX::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); } void EFFECT_DCFIX::init(SAMPLE_BUFFER *insample) { i_rep.init(insample); set_channels(insample->number_of_channels()); if (channels() > static_cast(deltafixes_rep.size())) { deltafixes_rep.resize(channels()); } } void EFFECT_DCFIX::process(void) { for(int n = 0; n < channels(); n++) { i_rep.begin(n); while(!i_rep.end()) { *i_rep.current() = *i_rep.current() + deltafixes_rep[n]; i_rep.next(); } } } const int EFFECT_PITCH_SHIFT::resample_low_limit = 8; EFFECT_PITCH_SHIFT::EFFECT_PITCH_SHIFT (const EFFECT_PITCH_SHIFT& x) { pmod_rep = x.pmod_rep; target_rate_rep = x.target_rate_rep; sbuf_repp = 0; } void EFFECT_PITCH_SHIFT::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: double lowlimit = 1.0f / EFFECT_PITCH_SHIFT::resample_low_limit * 100.0f; if (value <= lowlimit) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING! Shift-% must be greater than " + kvu_numtostr(lowlimit) + "%! Limiting to the low-limit."); pmod_rep = lowlimit; } else { pmod_rep = value; } if (sbuf_repp != 0) { target_rate_rep = static_cast(samples_per_second() * 100.0 / pmod_rep); } else { target_rate_rep = 0; } break; } } CHAIN_OPERATOR::parameter_t EFFECT_PITCH_SHIFT::get_parameter(int param) const { switch (param) { case 1: return pmod_rep; } return 0.0; } void EFFECT_PITCH_SHIFT::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); switch(param) { case 1: pd->default_value = 100.0f; pd->bounded_above = true; /* 100x speed-up is a sensible upper limit */ pd->upper_bound = 10000.0f; pd->bounded_below = true; /* ~8x slow-down is a sensible lower limit: */ pd->lower_bound = 1.0f / EFFECT_PITCH_SHIFT::resample_low_limit * 100.0f; break; } } void EFFECT_PITCH_SHIFT::init(SAMPLE_BUFFER *insample) { sbuf_repp = insample; // truncate, not round, to integer target_rate_rep = static_cast((samples_per_second() * 100.0 / pmod_rep)); long int lowlimit = sbuf_repp->length_in_samples() * EFFECT_PITCH_SHIFT::resample_low_limit; sbuf_repp->reserve_length_in_samples(lowlimit); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Setting resampling lowlimit to " + kvu_numtostr(lowlimit) + " bytes."); sbuf_repp->resample_init_memory(samples_per_second(), target_rate_rep); sbuf_repp->resample_set_quality(50); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Resampling from " + kvu_numtostr(samples_per_second()) + " to " + kvu_numtostr(target_rate_rep) + "."); } void EFFECT_PITCH_SHIFT::release(void) { sbuf_repp = 0; } void EFFECT_PITCH_SHIFT::process(void) { sbuf_repp->resample(samples_per_second(), target_rate_rep); sbuf_repp->event_tag_set(SAMPLE_BUFFER::tag_var_length, true); } long int EFFECT_PITCH_SHIFT::max_output_samples(long int i_samples) const { DBC_CHECK(sbuf_repp != 0); return static_cast(static_cast(target_rate_rep) / samples_per_second() * i_samples); } EFFECT_AUDIO_STAMP::EFFECT_AUDIO_STAMP(void) : sbuf_repp(0) { } EFFECT_AUDIO_STAMP::EFFECT_AUDIO_STAMP(const EFFECT_AUDIO_STAMP& arg) : sbuf_repp(0) { } void EFFECT_AUDIO_STAMP::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: set_id(static_cast(value)); break; } } CHAIN_OPERATOR::parameter_t EFFECT_AUDIO_STAMP::get_parameter(int param) const { switch (param) { case 1: return static_cast(id()); } return 0.0; } void EFFECT_AUDIO_STAMP::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); switch(param) { case 1: pd->default_value = 1; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 1; pd->integer = true; break; } } void EFFECT_AUDIO_STAMP::init(SAMPLE_BUFFER *insample) { sbuf_repp = insample; } void EFFECT_AUDIO_STAMP::release(void) { sbuf_repp = 0; } void EFFECT_AUDIO_STAMP::process(void) { store(sbuf_repp); // std::cerr << "Storing audio stamp with id " << id() << "." << std::endl; } ecasound-2.9.3/libecasound/audiofx_filter.h0000644000076400007640000002742610664032032015733 00000000000000#ifndef INCLUDED_AUDIOFX_FILTER_H #define INCLUDED_AUDIOFX_FILTER_H #include #include #include #include "audiofx.h" #include "samplebuffer_iterators.h" /** * Virtual base for filter effects. * @author Kai Vehmanen */ class EFFECT_FILTER : public EFFECT_BASE { public: virtual ~EFFECT_FILTER(void); }; /** * Base class for butterworth filter effects. * * Based on SPKit Butterworth algorithms. * (for more info, see http://www.music.helsinki.fi/research/spkit) */ class EFFECT_BW_FILTER : public EFFECT_FILTER { private: SAMPLE_SPECS::sample_t outputSample; SAMPLE_ITERATOR_CHANNELS i; std::vector > sin; std::vector > sout; void init_values(void); protected: std::vector a; std::vector b; public: void process_notused(SAMPLE_BUFFER* sbuf); virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual EFFECT_BW_FILTER* clone(void) const = 0; // EFFECT_BW_FILTER(void) : sin(2), sout(2), a(3), b(2) { EFFECT_BW_FILTER(void) : a(3), b(2) { init_values(); } }; /** * Bandpass filter * * Based on SPKit Butterworth algorithms * (for more info, see http://www.music.helsinki.fi/research/spkit) */ class EFFECT_BANDPASS: public EFFECT_BW_FILTER { private: parameter_t center; parameter_t width; parameter_t C; parameter_t D; public: virtual std::string name(void) const { return("Bandpass filter"); } virtual std::string parameter_names(void) const { return("center-freq,width"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; EFFECT_BANDPASS* clone(void) const { return new EFFECT_BANDPASS(*this); } EFFECT_BANDPASS* new_expr(void) const { return new EFFECT_BANDPASS(); } EFFECT_BANDPASS (parameter_t centerf = 1000.0, parameter_t width = 1000.0); }; /** * Bandreject filter * * Based on SPKit Butterworth algorithms * (for more info, see http://www.music.helsinki.fi/research/spkit) */ class EFFECT_BANDREJECT: public EFFECT_BW_FILTER { private: parameter_t center; parameter_t width; parameter_t C; parameter_t D; public: virtual std::string name(void) const { return("Bandreject filter"); } virtual std::string parameter_names(void) const { return("center-freq,width"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; EFFECT_BANDREJECT* clone(void) const { return new EFFECT_BANDREJECT(*this); } EFFECT_BANDREJECT* new_expr(void) const { return new EFFECT_BANDREJECT(); } EFFECT_BANDREJECT (parameter_t centerf = 1000.0, parameter_t width = 1000.0); }; /** * Highpass filter * * Based on SPKit Butterworth algorithms * (for more info, see http://www.music.helsinki.fi/research/spkit) */ class EFFECT_HIGHPASS : public EFFECT_BW_FILTER { private: parameter_t cutOffFreq; parameter_t C; public: virtual std::string name(void) const { return("Highpass filter"); } virtual std::string parameter_names(void) const { return("cutoff-freq"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; EFFECT_HIGHPASS* clone(void) const { return new EFFECT_HIGHPASS(*this); } EFFECT_HIGHPASS* new_expr(void) const { return new EFFECT_HIGHPASS(); } EFFECT_HIGHPASS (parameter_t cutoff = 1000.0); }; /** * Allpass filter */ class EFFECT_ALLPASS_FILTER : public EFFECT_FILTER { std::vector > inbuf, outbuf; SAMPLE_ITERATOR_CHANNELS i; parameter_t feedback_gain; parameter_t D; public: virtual std::string name(void) const { return("Allpass filter"); } virtual std::string parameter_names(void) const { return("delay-samples,feedback-%"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_ALLPASS_FILTER* clone(void) const { return new EFFECT_ALLPASS_FILTER(*this); } EFFECT_ALLPASS_FILTER* new_expr(void) const { return new EFFECT_ALLPASS_FILTER(); } EFFECT_ALLPASS_FILTER (void); }; /** * Comb filter * * The basic theory behind this can be found from Ken Steiglitz's book * "A digital signal processing primer", page 103. */ class EFFECT_COMB_FILTER : public EFFECT_FILTER { std::vector > buffer; std::vector temp; SAMPLE_ITERATOR_CHANNELS i; parameter_t C; parameter_t D; public: virtual std::string name(void) const { return("Comb filter"); } virtual std::string parameter_names(void) const { return("delay-samples,radius"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_COMB_FILTER* clone(void) const { return new EFFECT_COMB_FILTER(*this); } EFFECT_COMB_FILTER* new_expr(void) const { return new EFFECT_COMB_FILTER(); } EFFECT_COMB_FILTER (int delay_in_samples = 1, parameter_t constant = 1.0); }; /** * Inverse comb filter * * The basic theory behind this can be found from Ken Steiglitz's book * "A digital signal processing primer", page 77. */ class EFFECT_INVERSE_COMB_FILTER : public EFFECT_FILTER { std::vector laskuri; std::vector > buffer; std::vector temp; SAMPLE_ITERATOR_CHANNELS i; parameter_t C; parameter_t D; public: virtual std::string name(void) const { return("Inverse comb filter"); } virtual std::string parameter_names(void) const { return("delay-samples,radius"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_INVERSE_COMB_FILTER* clone(void) const { return new EFFECT_INVERSE_COMB_FILTER(*this); } EFFECT_INVERSE_COMB_FILTER* new_expr(void) const { return new EFFECT_INVERSE_COMB_FILTER(); } EFFECT_INVERSE_COMB_FILTER (int delay_in_samples = 10, parameter_t constant = 1.0); }; /** * Lowpass filter * * Based on SPKit Butterworth algorithms * (for more info, see http://www.music.helsinki.fi/research/spkit) */ class EFFECT_LOWPASS: public EFFECT_BW_FILTER { private: parameter_t cutOffFreq; parameter_t C; public: virtual std::string name(void) const { return("Lowpass filter"); } virtual std::string parameter_names(void) const { return("cutoff-freq"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; void set_cutoff(parameter_t value, long int srate); EFFECT_LOWPASS* clone(void) const { return new EFFECT_LOWPASS(*this); } EFFECT_LOWPASS* new_expr(void) const { return new EFFECT_LOWPASS(); } EFFECT_LOWPASS (parameter_t cutoff = 1000.0); }; /** * A simple lowpass filter * * Algorithm: 1nd order filter. * From Fugue source code: * * output[N] = input[N] * A + input[N-1] * B * * A = 2.0 * pi * center * B = exp(-A / frequency) */ class EFFECT_LOWPASS_SIMPLE : public EFFECT_FILTER { private: parameter_t cutOffFreq; parameter_t A, B; std::vector outhist, tempin, temphist; SAMPLE_ITERATOR_CHANNELS i; public: virtual std::string name(void) const { return("Simple lowpass filter"); } virtual std::string parameter_names(void) const { return("cutoff-freq"); } virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; EFFECT_LOWPASS_SIMPLE* clone(void) const { return new EFFECT_LOWPASS_SIMPLE(*this); } EFFECT_LOWPASS_SIMPLE* new_expr(void) const { return new EFFECT_LOWPASS_SIMPLE(); } EFFECT_LOWPASS_SIMPLE (parameter_t cutoff = 1000.0); }; /** * Resonant bandpass filter */ class EFFECT_RESONANT_BANDPASS : public EFFECT_FILTER { private: std::vector outhist1, outhist2; parameter_t center; parameter_t width; parameter_t a, b, c, R; parameter_t pole_angle; SAMPLE_ITERATOR_CHANNELS i; public: virtual std::string name(void) const { return("Resonant bandpass filter"); } virtual std::string parameter_names(void) const { return("center-freq,width"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_RESONANT_BANDPASS* clone(void) const { return new EFFECT_RESONANT_BANDPASS(*this); } EFFECT_RESONANT_BANDPASS* new_expr(void) const { return new EFFECT_RESONANT_BANDPASS(); } EFFECT_RESONANT_BANDPASS (parameter_t centerf = 1000.0, parameter_t width = 1000.0); }; /** * Resonant lowpass filter * * Algorithm is based on a sample filter-routine (iir_filter) posted to comp.dsp. */ class EFFECT_RESONANT_LOWPASS : public EFFECT_FILTER { SAMPLE_ITERATOR_CHANNELS i; std::vector outhist0, outhist1, outhist2, outhist3; std::vector newhist0, newhist1; class TRIPLE_COEFS { public: parameter_t a0, a1, a2; // numerator coefficients parameter_t b0, b1, b2; // denominator coefficients }; class FILTER_COEFS { public: parameter_t A, B, C, D; // filter coefficients }; std::vector ProtoCoef; // Filter prototype coefficients, // for each filter section std::vector Coef; parameter_t cutoff, Q, gain, gain_orig; parameter_t pi; parameter_t laskuri; parameter_t ad, bd, wp; // for szxform() void szxform(int section); void refresh_values(void); public: virtual std::string name(void) const { return("Resonant lowpass filter"); } virtual std::string parameter_names(void) const { return("cutoff-freq,resonance,gain"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_RESONANT_LOWPASS* clone(void) const { return new EFFECT_RESONANT_LOWPASS(*this); } EFFECT_RESONANT_LOWPASS* new_expr(void) const { return new EFFECT_RESONANT_LOWPASS(); } EFFECT_RESONANT_LOWPASS (parameter_t cutoff = 1000.0, parameter_t resonance = 1.0, parameter_t gain = 1.0); }; /** * Resonating bandpass filter * * Based on a second order all-pole (IIR) band-pass filter from SPKit * (for more info, see: http://www.music.helsinki.fi/research/spkit) */ class EFFECT_RESONATOR : public EFFECT_FILTER { private: SAMPLE_ITERATOR_CHANNELS i; parameter_t center; parameter_t width; std::vector cona; std::vector conb; std::vector saout0, saout1; public: virtual std::string name(void) const { return("Resonator filter"); } virtual std::string parameter_names(void) const { return("center-freq,width"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_RESONATOR* clone(void) const { return new EFFECT_RESONATOR(*this); } EFFECT_RESONATOR* new_expr(void) const { return new EFFECT_RESONATOR(); } EFFECT_RESONATOR (parameter_t center = 1000.0, parameter_t width = 1000.0); }; #endif ecasound-2.9.3/libecasound/audiofx_compressor.h0000644000076400007640000000570010664032032016631 00000000000000#ifndef INCLUDED_AUDIOFX_COMPRESSOR_H #define INCLUDED_AUDIOFX_COMPRESSOR_H #include #include "audiofx_amplitude.h" /** * C++ version of John Dyson's advanced compressor design. * @author Kai Vehmanen */ class ADVANCED_COMPRESSOR : public EFFECT_AMPLITUDE { SAMPLE_ITERATOR_INTERLEAVED iter; public: static const int NFILT = 12; static const int NEFILT = 17; public: ADVANCED_COMPRESSOR (void) : rlevelsqn(ADVANCED_COMPRESSOR::NFILT), rlevelsqe(ADVANCED_COMPRESSOR::NEFILT) { init_values(); // map_parameters(); } virtual ~ADVANCED_COMPRESSOR (void); virtual std::string name(void) const { return("Advanced compressor"); } virtual std::string parameter_names(void) const { return("peak-limit-%,release-time-sec,fast-crate,overall-crate"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual int output_channels(int i_channels) const { return(2); } ADVANCED_COMPRESSOR* clone(void) const { return new ADVANCED_COMPRESSOR(*this); } ADVANCED_COMPRESSOR* new_expr(void) const { return new ADVANCED_COMPRESSOR(); } ADVANCED_COMPRESSOR (double peak_limit, double release_time, double cfrate, double crate); private: double rlevelsq0, rlevelsq1; double rlevelsq0filter, rlevelsq1filter; std::vector rlevelsqn; // [NFILT]; double rlevelsqefilter; std::vector rlevelsqe; // [NEFILT]; double rlevelsq0ffilter; int ndelay; /* delay for rlevelsq0ffilter delay */ int ndelayptr; /* ptr for the input */ std::vector rightdelay; std::vector leftdelay; /* Simple gain running average */ double rgain; double rgainfilter; double lastrgain; /* Max fast agc gain, slow agc gain */ double maxfastgain, maxslowgain; /* Fast gain compression ratio */ /* Note that .5 is 2:1, 1.0 is infinity (hard) */ double fastgaincompressionratio; double compressionratio; /* Max level, target level, floor level */ double maxlevel, targetlevel, floorlevel; /* Gainriding gain */ double rmastergain0filter; double rmastergain0; /* Peak limit gain */ double rpeakgain0, rpeakgain1, rpeakgainfilter; int peaklimitdelay, rpeaklimitdelay; /* Running total gain */ double totalgain; /* Idle gain */ double npeakgain; /* Compress enabled */ int compress; double level, levelsq0, levelsq1, levelsqe; double gain, qgain, tgain; double newright, newleft; double efilt; double fastgain, slowgain, tslowgain; double leveldelta; double right, left, rightd, leftd; int delayed; double nrgain, nlgain, ngain, ngsq; double sqrtrpeakgain; int i; int skipmode; double extra_maxlevel; int parm; double maxgain, mingain; int ch; double fratio; double ratio; double releasetime; double peakpercent; double tnrgain; void init_values(void); double hardlimit(double value, double knee, double limit); }; #endif ecasound-2.9.3/libecasound/generic-linear-envelope.h0000644000076400007640000000237711544706671017443 00000000000000#ifndef INCLUDED_GENERIC_LINEAR_ENVELOPE_H #define INCLUDED_GENERIC_LINEAR_ENVELOPE_H #include #include #include "ctrl-source.h" #include "eca-audio-position.h" /** * Generic multi-stage linear envelope */ class GENERIC_LINEAR_ENVELOPE : public CONTROLLER_SOURCE { public: GENERIC_LINEAR_ENVELOPE(void); virtual ~GENERIC_LINEAR_ENVELOPE(void); GENERIC_LINEAR_ENVELOPE* clone(void) const { return new GENERIC_LINEAR_ENVELOPE(*this); } GENERIC_LINEAR_ENVELOPE* new_expr(void) const { return new GENERIC_LINEAR_ENVELOPE(); } virtual void init(void); virtual parameter_t value(double pos); virtual void set_initial_value(parameter_t arg) {} virtual bool variable_params(void) const { return true; } virtual std::string parameter_names(void) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual std::string name(void) const { return("Generic linear envelope"); } private: std::vector pos_rep; std::vector val_rep; parameter_t curval; int curstage; std::string param_names_rep; bool is_valid_for_stage(double pos, int stage) const; void set_stage(double pos); void set_param_count(int params); }; #endif ecasound-2.9.3/libecasound/eca-object.h0000644000076400007640000000116710765306237014732 00000000000000#ifndef INCLUDED_ECA_OBJECT_H #define INCLUDED_ECA_OBJECT_H #include using std::string; /** * Virtual class for ecasound objects * * @author Kai Vehmanen */ class ECA_OBJECT { public: virtual ~ECA_OBJECT (void) {} /** * Object name used to identify the object type. In most * cases, object name is same for all class instances. * Must be implemented in all subclasses. */ virtual std::string name(void) const = 0; /** * Object description. Description should be short, informative * and unformatted. */ virtual std::string description(void) const { return(name()); } }; #endif ecasound-2.9.3/libecasound/eca-engine.h0000644000076400007640000001714112260762753014731 00000000000000#ifndef INCLUDED_ECA_ENGINE_H #define INCLUDED_ECA_ENGINE_H #include #include "sample-specs.h" #include "eca-engine-driver.h" #include "eca-chainsetup-edit.h" class AUDIO_IO; class AUDIO_IO_DB_CLIENT; class AUDIO_IO_DEVICE; class CHAIN; class CHAIN_OPERATOR; class ECA_CHAINSETUP; class ECA_ENGINE; class ECA_ENGINE_impl; class SAMPLE_BUFFER; /** * Default engine driver */ class ECA_ENGINE_DEFAULT_DRIVER : public ECA_ENGINE_DRIVER { public: virtual int exec(ECA_ENGINE* engine, ECA_CHAINSETUP* csetup); virtual void start(void); virtual void stop(bool drain = false); virtual void exit(void); private: ECA_ENGINE* engine_repp; bool exit_request_rep; }; /** * ECA_ENGINE is the actual processing engine. * It is initialized with a pointer to a * ECA_CHAINSETUP object, which has all information * needed at runtime. In other words ECA_ENGINE is * used to execute the chainsetup. You could say * ECA_ENGINE renders the final product according * to instruction given in ECA_CHAINSETUP. * * In most use cases ECA_ENGINE operation * involves multiple threads. The main thread * contexts are: * * - control context in which * ECA_ENGINE::exec() is executed * * - driver context; depending on the * used driver, this can be either * a separate thread or same as the * control thread * * - external context; other threads * sending commands to the engine * * Notes: This class is closely tied to * ECA_CHAINSETUP. Its private data and * function members can be accessed by * ECA_ENGINE through friend-access. */ class ECA_ENGINE { public: /** @name Public type definitions and constants */ /*@{*/ /** * Engine operation states */ enum Engine_status { engine_status_running, engine_status_stopped, engine_status_finished, engine_status_error, engine_status_notready }; typedef enum Engine_status Engine_status_t; /** * Commands used in ECA_ENGINE<->ECA_CONTROL communication. */ enum Engine_command { ep_prepare = 0, ep_start, ep_stop, ep_stop_with_drain, ep_debug, ep_exit, // -- ep_exec_edit, // -- ep_rewind, ep_forward, ep_setpos, ep_setpos_samples, ep_setpos_live_samples, }; typedef enum Engine_command Engine_command_t; struct complex_command { Engine_command_t type; union { struct { double value; } engine; struct { int chain; int op; int param; double value; } legacy; } m; ECA::chainsetup_edit_t cs; }; typedef struct complex_command complex_command_t; /*@}*/ /** @name Public functions */ /*@{*/ ECA_ENGINE(ECA_CHAINSETUP* eparam); ~ECA_ENGINE(void); int exec(bool batch_mode); void command(Engine_command_t cmd, double arg); void command(complex_command_t ccmd); void wait_for_stop(int timeout); void wait_for_exit(int timeout); /*@}*/ /** @name Public functions for observing engine status information */ /*@{*/ bool is_valid(void) const; bool is_finite_length(void) const; Engine_status_t status(void) const; /*@}*/ /** @name API for engine driver objects (@see ECA_ENGINE_DRIVER) */ /*@{*/ void check_command_queue(void); void wait_for_commands(void); void init_engine_state(void); void update_engine_state(void); void engine_iteration(void); void prepare_operation(void); void start_operation(void); void stop_operation(bool drain = false); void update_cache_chain_connections(void); void update_cache_latency_values(void); bool is_prepared(void) const; bool is_running(void) const; bool batch_mode(void) const { return(batchmode_enabled_rep); } SAMPLE_SPECS::sample_pos_t current_position_in_samples(void) const; double current_position_in_seconds_exact(void) const; const ECA_CHAINSETUP* connected_chainsetup(void) const { return(csetup_repp); } /*@}*/ private: /** @name Private data and functions */ /*@{*/ /** * Number of sample-frames of data is prefilled to * rt-outputs before starting processing. */ static const long int prefill_threshold_constant = 16348; static const int prefill_blocks_constant = 3; ECA_ENGINE_impl* impl_repp; bool use_midi_rep; bool batchmode_enabled_rep; bool processing_range_set_rep; bool prepared_rep; bool running_rep; bool started_rep; bool was_running_rep; bool driver_local; bool finished_rep; int outputs_finished_rep; int driver_errors_rep; int inputs_not_finished_rep; long int prefill_threshold_rep; long int preroll_samples_rep; long int recording_offset_rep; /*@}*/ /** @name Pointers to connected chainsetup */ /*@{*/ ECA_CHAINSETUP* csetup_repp; ECA_ENGINE_DRIVER* driver_repp; std::vector* chains_repp; std::vector* inputs_repp; std::vector* outputs_repp; /*@}*/ /** @name Audio data buffers */ /*@{*/ SAMPLE_BUFFER* mixslot_repp; std::vector cslots_rep; /*@}*/ /** * @name Various audio object maps. * * The main purpose of these maps is to make * it easier to iterate audio objects with * certain attributes. */ /*@{*/ std::vector realtime_inputs_rep; std::vector realtime_outputs_rep; std::vector realtime_objects_rep; std::vector non_realtime_inputs_rep; std::vector non_realtime_outputs_rep; std::vector non_realtime_objects_rep; /*@}*/ /** @name Cache objects for chainsetup and audio * object information */ /*@{*/ std::vector input_chain_count_rep; std::vector output_chain_count_rep; /** @name Attribute functions */ /*@{*/ long int buffersize(void) const; int max_channels(void) const; /*@}*/ /** @name Private functions for transport control */ /*@{*/ void request_start(void); void request_stop(bool drain = false); void signal_stop(void); void signal_exit(void); void signal_editlock(void); void conditional_start(void); void conditional_stop(void); void start_servers(void); void stop_servers(void); void prepare_realtime_objects(void); void start_realtime_objects(void); void reset_realtime_devices(void); void start_forked_objects(void); void stop_forked_objects(void); void state_change_to_finished(void); /*@}*/ /** @name Private functions for observing and modifying position */ /*@{*/ void set_position(double seconds); void set_position(int seconds) { set_position((double)seconds); } void set_position_samples(SAMPLE_SPECS::sample_pos_t samples); void set_position_samples_live(SAMPLE_SPECS::sample_pos_t samples); void change_position(double seconds); void prehandle_control_position(void); void posthandle_control_position(void); /*@}*/ /** @name Private functions for command queue handling */ /*@{*/ void interpret_queue(void); /*@}*/ /** @name Private functions for setup and cleanup */ /*@{*/ void init_variables(void); void init_connection_to_chainsetup(void); void init_driver(void); void init_prefill(void); void init_servers(void); void init_chains(void); void cleanup(void); void reinit_chains(bool force = false); void create_cache_object_lists(void); void init_profiling(void); void dump_profile_info(void); /*@}*/ /** @name Private functions for signal routing */ /*@{*/ void inputs_to_chains(void); void process_chains(void); void mix_to_outputs(bool skip_realtime_target_outputs); /*@}*/ /** @name Hidden/unimplemented functions */ /*@{*/ ECA_ENGINE& operator=(const ECA_ENGINE& x) { return *this; } /*@}*/ }; #endif ecasound-2.9.3/libecasound/audiofx_analysis.h0000644000076400007640000001005111167727646016300 00000000000000#ifndef INCLUDED_AUDIOFX_ANALYSIS_H #define INCLUDED_AUDIOFX_ANALYSIS_H #include #include #include #include "samplebuffer_iterators.h" #include "audiofx.h" class MESSAGE_ITEM; /** * Virtual base for signal analyzers. * @author Kai Vehmanen */ class EFFECT_ANALYSIS : public EFFECT_BASE { public: virtual void set_parameter(int param, parameter_t value) { } virtual parameter_t get_parameter(int param) const { return(0.0); } virtual std::string parameter_names(void) const { return(""); } virtual ~EFFECT_ANALYSIS(void); }; /** * Analyzes the audio signal volume by using a set of * amplitude range buckets. * * @author Kai Vehmanen */ class EFFECT_VOLUME_BUCKETS : public EFFECT_ANALYSIS { private: std::vector num_of_samples; // number of samples processed std::vector > pos_samples_db; std::vector > neg_samples_db; SAMPLE_SPECS::sample_t max_pos, max_neg; mutable pthread_mutex_t lock_rep; SAMPLE_ITERATOR_CHANNELS i; void reset_all_stats(void); void reset_period_stats(void); void status_entry(const std::vector& buckets, std::string& otemp) const; public: parameter_t max_multiplier(void) const; virtual std::string name(void) const { return("Volume analysis"); } virtual std::string parameter_names(void) const { return("cumulative-mode,result-max-multiplier"); } virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual std::string status(void) const; virtual EFFECT_VOLUME_BUCKETS* clone(void) const { return new EFFECT_VOLUME_BUCKETS(*this); } virtual EFFECT_VOLUME_BUCKETS* new_expr(void) const { return new EFFECT_VOLUME_BUCKETS(); } EFFECT_VOLUME_BUCKETS (void); virtual ~EFFECT_VOLUME_BUCKETS (void); }; /** * Keeps track of peak amplitude. * * @author Kai Vehmanen */ class EFFECT_VOLUME_PEAK : public EFFECT_ANALYSIS { public: virtual std::string name(void) const { return("Peak amplitude watcher"); } virtual std::string parameter_names(void) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); // virtual std::string status(void) const; virtual EFFECT_VOLUME_PEAK* clone(void) const { return new EFFECT_VOLUME_PEAK(*this); } virtual EFFECT_VOLUME_PEAK* new_expr(void) const { return new EFFECT_VOLUME_PEAK(); } EFFECT_VOLUME_PEAK (void); virtual ~EFFECT_VOLUME_PEAK (void); private: mutable volatile parameter_t * volatile max_amplitude_repp; mutable long int clipped_samples_rep; mutable std::string status_rep; SAMPLE_ITERATOR_CHANNELS i; }; /** * Calculates DC-offset. * * @author Kai Vehmanen */ class EFFECT_DCFIND : public EFFECT_ANALYSIS { private: std::vector pos_sum; std::vector neg_sum; std::vector num_of_samples; SAMPLE_SPECS::sample_t tempval; SAMPLE_ITERATOR_CHANNELS i; public: parameter_t get_deltafix(int channel) const; virtual std::string name(void) const { return("DC-Find"); } virtual std::string description(void) const { return("Calculates the DC-offset."); } virtual std::string parameter_names(void) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); virtual std::string status(void) const; virtual void parameter_description(int param, struct PARAM_DESCRIPTION *pd) const; virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual EFFECT_DCFIND* clone(void) const { return new EFFECT_DCFIND(*this); } virtual EFFECT_DCFIND* new_expr(void) const { return new EFFECT_DCFIND(); } EFFECT_DCFIND (void); }; #endif ecasound-2.9.3/libecasound/file-preset.cpp0000644000076400007640000000327010664032032015470 00000000000000// ------------------------------------------------------------------------ // file_preset.cpp: File based effect preset // Copyright (C) 2000,2001 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include "resource-file.h" #include "eca-logger.h" #include "eca-error.h" #include "file-preset.h" FILE_PRESET::FILE_PRESET(const std::string& file_name) { RESOURCE_FILE pfile (file_name); std::string pname = "empty"; if (pfile.keywords().size() > 0) pname = pfile.keywords()[0]; set_name(pname); set_filename(file_name); parse(pfile.resource(pname)); } FILE_PRESET* FILE_PRESET::clone(void) const { std::vector param_values; for(int n = 0; n < number_of_params(); n++) { param_values.push_back(get_parameter(n + 1)); } FILE_PRESET* preset = new FILE_PRESET(filename()); for(int n = 0; n < preset->number_of_params(); n++) { preset->set_parameter(n + 1, param_values[n]); } return(preset); } ecasound-2.9.3/libecasound/eca-control-dump.cpp0000644000076400007640000001120310664032032016415 00000000000000// ------------------------------------------------------------------------ // eca-control-dump.cpp: Class for dumping status information to // a standard output stream // Copyright (C) 2000 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include "audioio.h" #include "eca-chainop.h" #include "eca-control.h" #include "eca-control-dump.h" void ECA_CONTROL_DUMP::dump_status(void) { dump("dump-status", ctrl_repp->engine_status()); } void ECA_CONTROL_DUMP::dump_position(void) { dump("dump-position", kvu_numtostr(ctrl_repp->position_in_seconds_exact(), ctrl_repp->float_to_string_precision())); } void ECA_CONTROL_DUMP::dump_length(void) { dump("dump-length", kvu_numtostr(ctrl_repp->length_in_seconds_exact(), ctrl_repp->float_to_string_precision())); } void ECA_CONTROL_DUMP::dump_chainsetup_status(void) { if (ctrl_repp->is_connected() == true) dump("dump-cs-status", "connected"); else if (ctrl_repp->is_selected() == true) dump("dump-cs-status", "selected"); else dump("dump-cs-status", ""); } void ECA_CONTROL_DUMP::dump_selected_chain(void) { const std::vector& t = ctrl_repp->selected_chains(); if (t.empty() == false) { dump("dump-c-selected", kvu_vector_to_string(t, ",")); } else dump("dump-c-selected", ""); } void ECA_CONTROL_DUMP::dump_selected_audio_input(void) { const AUDIO_IO* t = ctrl_repp->get_audio_input(); if (t != 0) { dump("dump-ai-selected", t->label()); } else dump("dump-ai-selected", ""); } void ECA_CONTROL_DUMP::dump_selected_audio_output(void) { const AUDIO_IO* t = ctrl_repp->get_audio_output(); if (t != 0) { dump("dump-ao-selected", t->label()); } else dump("dump-ao-selected", ""); } void ECA_CONTROL_DUMP::dump_audio_input_position(void) { const AUDIO_IO* t = ctrl_repp->get_audio_input(); if (t != 0) { dump("dump-ai-position", kvu_numtostr(t->position_in_seconds_exact(), ctrl_repp->float_to_string_precision())); } else dump("dump-ai-position", ""); } void ECA_CONTROL_DUMP::dump_audio_output_position(void) { const AUDIO_IO* t = ctrl_repp->get_audio_output(); if (t != 0) { dump("dump-ao-position", kvu_numtostr(t->position_in_seconds_exact(), ctrl_repp->float_to_string_precision())); } else dump("dump-ao-position", ""); } void ECA_CONTROL_DUMP::dump_audio_input_length(void) { const AUDIO_IO* t = ctrl_repp->get_audio_input(); if (t != 0) { dump("dump-ai-length", kvu_numtostr(t->length_in_seconds_exact(), ctrl_repp->float_to_string_precision())); } else dump("dump-ai-length", ""); } void ECA_CONTROL_DUMP::dump_audio_output_length(void) { const AUDIO_IO* t = ctrl_repp->get_audio_output(); if (t != 0) { dump("dump-ao-length", kvu_numtostr(t->length_in_seconds_exact(), ctrl_repp->float_to_string_precision())); } else dump("dump-ao-length", ""); } void ECA_CONTROL_DUMP::dump_audio_input_open_state(void) { const AUDIO_IO* t = ctrl_repp->get_audio_input(); if (t != 0) { if (t->is_open() == true) dump("dump-ai-open-state", "open"); else dump("dump-ai-open-state", "closed"); } else dump("dump-ai-open-state", ""); } void ECA_CONTROL_DUMP::dump_audio_output_open_state(void) { const AUDIO_IO* t = ctrl_repp->get_audio_output(); if (t != 0) { if (t->is_open() == true) dump("dump-ao-open-state", "open"); else dump("dump-ao-open-state", "closed"); } else dump("dump-ao-open-state", ""); } void ECA_CONTROL_DUMP::dump_chain_operator_value(int chainop, int param) { ctrl_repp->select_chain_operator(chainop); const CHAIN_OPERATOR* t = ctrl_repp->get_chain_operator(); if (t != 0) { dump("dump-cop-value", kvu_numtostr(t->get_parameter(param), ctrl_repp->float_to_string_precision())); } else dump("dump-cop-value", ""); } ecasound-2.9.3/libecasound/eca-audio-format.cpp0000644000076400007640000001762511141053131016371 00000000000000// ------------------------------------------------------------------------ // eca-audio-format.cpp: Class for representing audio format parameters // Copyright (C) 1999-2002,2004 Kai Vehmanen // // Attributes: // eca-style-version: 2 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include "eca-audio-format.h" #include "eca-error.h" ECA_AUDIO_FORMAT::ECA_AUDIO_FORMAT(int channels, long int srate, ECA_AUDIO_FORMAT::Sample_format format, bool ileaved) { set_channels(channels); set_samples_per_second(srate); set_sample_format(format); toggle_interleaved_channels(ileaved); } ECA_AUDIO_FORMAT::ECA_AUDIO_FORMAT(void) { set_channels(0); set_samples_per_second(-1); set_sample_format(sfmt_none); toggle_interleaved_channels(true); } ECA_AUDIO_FORMAT::~ECA_AUDIO_FORMAT(void) { } ECA_AUDIO_FORMAT ECA_AUDIO_FORMAT::audio_format(void) const { return ECA_AUDIO_FORMAT(channels(), samples_per_second(), sample_format(), interleaved_channels()); } ECA_AUDIO_FORMAT::Sample_format ECA_AUDIO_FORMAT::sample_format(void) const { Sample_format format (sfmt_none); try { format = string_to_sample_format(format_string()); } catch(...) {} return format; } /** * Sets audio format to that of 'f'. */ void ECA_AUDIO_FORMAT::set_audio_format(const ECA_AUDIO_FORMAT& f) { set_channels(f.channels()); set_sample_format(f.sample_format()); set_samples_per_second(f.samples_per_second()); toggle_interleaved_channels(f.interleaved_channels()); } void ECA_AUDIO_FORMAT::set_sample_format(ECA_AUDIO_FORMAT::Sample_format sfmt) throw(ECA_ERROR&) { switch(sfmt) { case sfmt_none: sc_rep = sc_unsigned; update_sample_endianess(se_native); align_rep = 0; break; case sfmt_u8: sc_rep = sc_unsigned; update_sample_endianess(se_native); align_rep = 1; break; case sfmt_s8: sc_rep = sc_signed; update_sample_endianess(se_native); align_rep = 1; break; case sfmt_s16: sc_rep = sc_signed; update_sample_endianess(se_native); align_rep = 2; break; case sfmt_s16_le: sc_rep = sc_signed; update_sample_endianess(se_little); align_rep = 2; break; case sfmt_s16_be: sc_rep = sc_signed; update_sample_endianess(se_big); align_rep = 2; break; case sfmt_s24: sc_rep = sc_signed; update_sample_endianess(se_native); align_rep = 3; break; case sfmt_s24_le: sc_rep = sc_signed; update_sample_endianess(se_little); align_rep = 3; break; case sfmt_s24_be: sc_rep = sc_signed; update_sample_endianess(se_big); align_rep = 3; break; case sfmt_s32: sc_rep = sc_signed; update_sample_endianess(se_native); align_rep = 4; break; case sfmt_s32_le: sc_rep = sc_signed; update_sample_endianess(se_little); align_rep = 4; break; case sfmt_f32: sc_rep = sc_float; update_sample_endianess(se_native); align_rep = 4; break; case sfmt_s32_be: sc_rep = sc_signed; update_sample_endianess(se_big); align_rep = 4; break; case sfmt_f32_le: sc_rep = sc_float; update_sample_endianess(se_little); align_rep = 4; break; case sfmt_f32_be: sc_rep = sc_float; update_sample_endianess(se_big); align_rep = 4; break; case sfmt_f64: sc_rep = sc_float; update_sample_endianess(se_native); align_rep = 8; break; case sfmt_f64_le: sc_rep = sc_float; update_sample_endianess(se_little); align_rep = 8; break; case sfmt_f64_be: sc_rep = sc_float; update_sample_endianess(se_big); align_rep = 8; break; default: { throw(ECA_ERROR("ECA_AUDIO_FORMAT","Audio format not supported!")); } } DBC_ENSURE(se_rep == se_big || se_rep == se_little); } int ECA_AUDIO_FORMAT::bits(void) const { return align_rep * 8; } void ECA_AUDIO_FORMAT::set_channels(int v) { channels_rep = v; } void ECA_AUDIO_FORMAT::toggle_interleaved_channels(bool v) { ileaved_rep = v; } ECA_AUDIO_FORMAT::Sample_format ECA_AUDIO_FORMAT::string_to_sample_format(const std::string& str) const throw(ECA_ERROR&) { Sample_format sfmt = sfmt_none; if (str == "u8") sfmt = sfmt_u8; else if (str == "s16") sfmt = sfmt_s16; else if (str == "s16_le") sfmt = sfmt_s16_le; else if (str == "s16_be") sfmt = sfmt_s16_be; else if (str == "s24") sfmt = sfmt_s24; else if (str == "s24_le") sfmt = sfmt_s24_le; else if (str == "s24_be") sfmt = sfmt_s24_be; else if (str == "s32") sfmt = sfmt_s32; else if (str == "s32_le") sfmt = sfmt_s32_le; else if (str == "s32_be") sfmt = sfmt_s32_be; else if (str == "f32") sfmt = sfmt_f32; else if (str == "f32_le") sfmt = sfmt_f32_le; else if (str == "f32_be") sfmt = sfmt_f32_be; else if (str == "f64") sfmt = sfmt_f64; else if (str == "f64_le") sfmt = sfmt_f64_le; else if (str == "f64_be") sfmt = sfmt_f64_be; else if (str == "8") sfmt = sfmt_u8; else if (str == "16") sfmt = sfmt_s16; else if (str == "24") sfmt = sfmt_s24; else if (str == "32") sfmt = sfmt_s32; else { if (str != "none") throw(ECA_ERROR("ECA_AUDIO_FORMAT", "Unknown sample format \"" + str + "\".")); } return sfmt; } void ECA_AUDIO_FORMAT::set_sample_format_string(const std::string& f_str) throw(ECA_ERROR&) { /* note, may raise an exception */ set_sample_format(string_to_sample_format(f_str)); } /** * Internal helper function that sets sample endianess * and if needed, expands native to either little or big * byteorder. * * @see set_sample_endianess */ void ECA_AUDIO_FORMAT::update_sample_endianess(ECA_AUDIO_FORMAT::Sample_endianess v) { if (v == se_native) { #ifdef WORDS_BIGENDIAN se_rep = se_big; #else se_rep = se_little; #endif } else { se_rep = v; } } void ECA_AUDIO_FORMAT::set_sample_endianess(ECA_AUDIO_FORMAT::Sample_endianess v) { update_sample_endianess(v); /* make sure classes that reimplement set_sample_format * see the change in sample endianess */ set_sample_format_string(format_string()); DBC_ENSURE(se_rep == se_big || se_rep == se_little); } void ECA_AUDIO_FORMAT::set_sample_coding(ECA_AUDIO_FORMAT::Sample_coding v) { sc_rep = v; /* make sure classes that reimplement set_sample_format * see the change in sample coding */ set_sample_format_string(format_string()); } string ECA_AUDIO_FORMAT::format_string(void) const { std::string format; if (align_rep > 0) { /* coding */ switch(sc_rep) { case sc_unsigned: format += "u"; break; case sc_signed: format += "s"; break; case sc_float: format += "f"; break; } /* bits */ format += kvu_numtostr(bits()); DBC_CHECK(se_rep == se_big || se_rep == se_little); /* endianess */ if (align_rep > 1) { if (se_rep == se_little) { format += "_le"; } else { format += "_be"; } } } else { /* align_rep == 0 -> sfmt is yet unspecified */ format = "none"; } return format; } ecasound-2.9.3/libecasound/osc-gen-file.cpp0000644000076400007640000000724711747055227015547 00000000000000// ------------------------------------------------------------------------ // osc-gen-file.cpp: Generic oscillator using envelope presets // Copyright (C) 1999-2002,2004,2007,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "resource-file.h" #include "eca-resources.h" #include "osc-gen-file.h" #include "eca-logger.h" GENERIC_OSCILLATOR_FILE::GENERIC_OSCILLATOR_FILE(double freq, int mode) : GENERIC_OSCILLATOR(freq, mode) { set_parameter(1, get_parameter(1)); set_parameter(2, mode); } GENERIC_OSCILLATOR_FILE::~GENERIC_OSCILLATOR_FILE (void) { } void GENERIC_OSCILLATOR_FILE::get_oscillator_preset(int preset) { ECA_RESOURCES ecarc; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Opening genosc envelope file."); std::string user_filename = ecarc.resource("user-resource-directory") + "/" + ecarc.resource("resource-file-genosc-envelopes"); std::string pname = kvu_numtostr(preset); RESOURCE_FILE rc; rc.resource_file(user_filename); rc.load(); if (rc.has(pname) != true) { std::string global_filename = ecarc.resource("resource-directory") + "/" + ecarc.resource("resource-file-genosc-envelopes"); rc.resource_file(global_filename); rc.load(); } if (rc.has(pname) == true) { parse_envelope(rc.resource(pname)); } else { ECA_LOG_MSG(ECA_LOGGER::info, "ERROR: Oscillator preset " + pname + " not found!"); } } void GENERIC_OSCILLATOR_FILE::parse_envelope(const std::string& str) { std::vector tokens = kvu_string_to_words(str); size_t dynparams_offset = 2; // number of points if (tokens.size() > 2) { GENERIC_OSCILLATOR::set_parameter(3, (tokens.size() - dynparams_offset) / 2); } else { GENERIC_OSCILLATOR::set_parameter(3, 0); } if (tokens.size() > 0) { // start value GENERIC_OSCILLATOR::set_parameter(4, atof(tokens[0].c_str())); if (tokens.size() > 1) { // start value GENERIC_OSCILLATOR::set_parameter(5, atof(tokens[1].c_str())); // set individual points for(unsigned int n = dynparams_offset; n < tokens.size(); n++) { GENERIC_OSCILLATOR::set_parameter(6 + n - dynparams_offset, atof(tokens[n].c_str())); } } } prepare_envelope(); } void GENERIC_OSCILLATOR_FILE::set_parameter(int param, CONTROLLER_SOURCE::parameter_t value) { switch (param) { case 1: case 2: GENERIC_OSCILLATOR::set_parameter(param, value); break; case 3: preset_rep = static_cast(value); get_oscillator_preset(preset_rep); break; } } CONTROLLER_SOURCE::parameter_t GENERIC_OSCILLATOR_FILE::get_parameter(int param) const { switch (param) { case 1: case 2: return GENERIC_OSCILLATOR::get_parameter(param); case 3: return static_cast(preset_rep); } return 0.0; } ecasound-2.9.3/libecasound/eca-static-object-maps.h0000644000076400007640000000250411740524567017153 00000000000000#ifndef INCLUDED_ECA_STATIC_OBJECT_MAPS_H #define INCLUDED_ECA_STATIC_OBJECT_MAPS_H class ECA_OBJECT_FACTORY; class ECA_OBJECT_MAP; class ECA_PRESET_MAP; /** * A private classed used by ECA_OBJECT_FACTORY * to access object maps. * * @author Kai Vehmanen */ class ECA_STATIC_OBJECT_MAPS { public: friend class ECA_OBJECT_FACTORY; private: static void register_audio_io_rt_objects(ECA_OBJECT_MAP* objmap); static void register_audio_io_nonrt_objects(ECA_OBJECT_MAP* objmap); static void register_chain_operator_objects(ECA_OBJECT_MAP* objmap); static void register_lv2_plugin_objects(ECA_OBJECT_MAP* objmap); static void register_ladspa_plugin_objects(ECA_OBJECT_MAP* objmap); static void register_ladspa_plugin_id_objects(ECA_OBJECT_MAP* objmap); static void register_preset_objects(ECA_PRESET_MAP* objmap); static void register_controller_objects(ECA_OBJECT_MAP* objmap); static void register_midi_device_objects(ECA_OBJECT_MAP* objmap); /** * @name Constructors and destructors * * To prevent accidental use, located in private scope and * without a valid definition. */ /*@{*/ ECA_STATIC_OBJECT_MAPS(void); ECA_STATIC_OBJECT_MAPS(const ECA_STATIC_OBJECT_MAPS&); ECA_STATIC_OBJECT_MAPS& operator=(const ECA_STATIC_OBJECT_MAPS&); ~ECA_STATIC_OBJECT_MAPS(void); /*@}*/ }; #endif ecasound-2.9.3/libecasound/samplebuffer_test.h0000644000076400007640000000716611167613223016446 00000000000000// ------------------------------------------------------------------------ // samplebuffer_test.h: Unit test for SAMPLE_BUFFER // Copyright (C) 2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "kvu_dbc.h" #include "kvu_inttypes.h" #include "samplebuffer.h" #include "samplebuffer_functions.h" #include "eca-test-case.h" using namespace std; /** * Unit test for SAMPLE_BUFFER */ class SAMPLE_BUFFER_TEST : public ECA_TEST_CASE { protected: virtual string do_name(void) const { return("SAMPLE_BUFFER"); } virtual void do_run(void); public: virtual ~SAMPLE_BUFFER_TEST(void) { } private: }; void SAMPLE_BUFFER_TEST::do_run(void) { const int bufsize = 1024; const int channels = 12; const SAMPLE_BUFFER::sample_t multiplier = 100.1f; std::fprintf(stdout, "%s: tests for SAMPLE_BUFFER class\n", __FILE__); /* case: multiply_by */ { std::fprintf(stdout, "%s: multiply_by\n", __FILE__); SAMPLE_BUFFER sbuf_orig (bufsize, channels); SAMPLE_BUFFER sbuf_ref (bufsize, channels); SAMPLE_BUFFER sbuf_test (bufsize, channels); SAMPLE_BUFFER_FUNCTIONS::fill_with_random_samples(&sbuf_orig); sbuf_test.copy_all_content(sbuf_orig); sbuf_ref.copy_all_content(sbuf_orig); sbuf_test.multiply_by(multiplier); sbuf_ref.multiply_by_ref(multiplier); if (SAMPLE_BUFFER_FUNCTIONS::is_almost_equal(sbuf_ref, sbuf_test) != true) { ECA_TEST_FAILURE("optimized multiple_by"); } } /* case: copy_all_content */ { std::fprintf(stdout, "%s: copy_all_content\n", __FILE__); SAMPLE_BUFFER sbuf_orig (bufsize, channels); SAMPLE_BUFFER sbuf_ref (bufsize, channels); SAMPLE_BUFFER sbuf_test (bufsize, channels); SAMPLE_BUFFER_FUNCTIONS::fill_with_random_samples(&sbuf_orig); /* note: copy_all_content should modify the destination * channel and sample counts to match those of * the source object. */ sbuf_test.number_of_channels(0); sbuf_test.length_in_samples(1); sbuf_test.copy_all_content(sbuf_orig); sbuf_ref.copy_matching_channels(sbuf_orig); if (SAMPLE_BUFFER_FUNCTIONS::is_almost_equal(sbuf_ref, sbuf_test) != true) { ECA_TEST_FAILURE("copy_all_content"); } } /* case: multiply_by */ { std::fprintf(stdout, "%s: add_matching_channels\n", __FILE__); SAMPLE_BUFFER sbuf_orig (bufsize, channels); SAMPLE_BUFFER sbuf_ref (bufsize, channels); SAMPLE_BUFFER sbuf_test (bufsize, channels); SAMPLE_BUFFER_FUNCTIONS::fill_with_random_samples(&sbuf_orig); sbuf_test.copy_all_content(sbuf_orig); sbuf_ref.copy_all_content(sbuf_orig); sbuf_test.add_matching_channels(sbuf_orig); sbuf_ref.add_matching_channels_ref(sbuf_orig); if (SAMPLE_BUFFER_FUNCTIONS::is_almost_equal(sbuf_ref, sbuf_test) != true) { ECA_TEST_FAILURE("optimized add_matching_channels"); } } } ecasound-2.9.3/libecasound/audiofx_amplitude.cpp0000644000076400007640000004377011755703520016776 00000000000000// ------------------------------------------------------------------------ // audiofx_amplitude.cpp: Amplitude effects and dynamic processors. // Copyright (C) 1999-2000,2003,2008,2009,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include "samplebuffer_iterators.h" #include "audiofx_amplitude.h" #include "eca-logger.h" #include "eca-error.h" template static void priv_resize_buffer(std::vector *buffer, int count) { buffer->resize(count); for(int i = 0; i < count; i++) (*buffer)[i] = 0.0; } EFFECT_AMPLITUDE::~EFFECT_AMPLITUDE(void) { } EFFECT_AMPLITUDE::parameter_t EFFECT_AMPLITUDE::db_to_linear(parameter_t value) { return std::pow(10.0f, static_cast(value * 0.05f)); } void EFFECT_AMPLITUDE::init(SAMPLE_BUFFER* sbuf) { cur_sbuf_repp = sbuf; EFFECT_BASE::init(sbuf); } void EFFECT_AMPLITUDE::release(void) { cur_sbuf_repp = 0; EFFECT_BASE::release(); } EFFECT_AMPLIFY::EFFECT_AMPLIFY (EFFECT_AMPLITUDE::parameter_t multiplier_percent) { set_parameter(1, multiplier_percent); } EFFECT_AMPLIFY::~EFFECT_AMPLIFY(void) { } void EFFECT_AMPLIFY::set_parameter(int param, parameter_t value) { switch (param) { case 1: gain_rep = value / 100.0; break; } } CHAIN_OPERATOR::parameter_t EFFECT_AMPLIFY::get_parameter(int param) const { switch (param) { case 1: return gain_rep * 100.0; } return 0.0; } void EFFECT_AMPLIFY::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); } void EFFECT_AMPLIFY::init(SAMPLE_BUFFER* sbuf) { i.init(sbuf); sbuf_repp = sbuf; } void EFFECT_AMPLIFY::release(void) { sbuf_repp = 0; } void EFFECT_AMPLIFY::process(void) { sbuf_repp->multiply_by(gain_rep); } /** * Unoptimized version of process(). */ void EFFECT_AMPLIFY::process_ref(void) { i.begin(); while(!i.end()) { *i.current() = *i.current() * gain_rep; i.next(); } } EFFECT_AMPLIFY_DB::EFFECT_AMPLIFY_DB(parameter_t gain, int channel) : channel_rep(-1), sbuf_repp(0) { set_parameter(1, gain); set_parameter(2, channel); } EFFECT_AMPLIFY_DB::~EFFECT_AMPLIFY_DB(void) { } void EFFECT_AMPLIFY_DB::set_parameter(int param, parameter_t value) { switch (param) { case 1: gain_rep = EFFECT_AMPLITUDE::db_to_linear(value); gain_db_rep = value; break; case 2: { int ch = static_cast(value); /* note: ch==0 -> apply to all channels */ if (ch >= 0) { bool reinit = false; if (channel_rep != ch && sbuf_repp != 0) { reinit = true; } channel_rep = ch; /* note: must be done after 'channel_rep' is set */ if (reinit == true) init(sbuf_repp); } } break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_AMPLIFY_DB::get_parameter(int param) const { switch (param) { case 1: return gain_db_rep; case 2: return channel_rep; } DBC_NEVER_REACHED(); return 0.0; } void EFFECT_AMPLIFY_DB::init(SAMPLE_BUFFER* sbuf) { sbuf_repp = sbuf; if (channel_rep > 0) { i_ch.init(sbuf, channel_rep - 1); } else { i_all.init(sbuf); } EFFECT_BASE::init(sbuf); } void EFFECT_AMPLIFY_DB::release(void) { sbuf_repp = 0; } void EFFECT_AMPLIFY_DB::process(void) { if (channel_rep > 0 && channel_rep <= channels()) { sbuf_repp->multiply_by(gain_rep, channel_rep - 1); } else { sbuf_repp->multiply_by(gain_rep); } } /** * Unoptimized version of process(). */ void EFFECT_AMPLIFY_DB::process_ref(void) { if (channel_rep > 0 && channel_rep < channels()) { i_ch.begin(); while(!i_ch.end()) { *i_ch.current() *= gain_rep; i_ch.next(); } } else { i_all.begin(); while(!i_all.end()) { *i_all.current() *= gain_rep; i_all.next(); } } } int EFFECT_AMPLIFY_DB::output_channels(int i_channels) const { if (channel_rep > i_channels) return channel_rep; return i_channels; } EFFECT_AMPLIFY_CLIPCOUNT::EFFECT_AMPLIFY_CLIPCOUNT (parameter_t multiplier_percent, int max_clipped) { set_parameter(1, multiplier_percent); set_parameter(2, max_clipped); num_of_clipped = 0; } void EFFECT_AMPLIFY_CLIPCOUNT::set_parameter(int param, parameter_t value) { switch (param) { case 1: gain = value / 100.0; break; case 2: maxnum_of_clipped = (int)value; break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_AMPLIFY_CLIPCOUNT::get_parameter(int param) const { switch (param) { case 1: return gain * 100.0; case 2: return maxnum_of_clipped; } DBC_NEVER_REACHED(); return 0.0f; } void EFFECT_AMPLIFY_CLIPCOUNT::init(SAMPLE_BUFFER* sbuf) { i.init(sbuf); } void EFFECT_AMPLIFY_CLIPCOUNT::process(void) { i.begin(); while(!i.end()) { *i.current() = *i.current() * gain; if (*i.current() > SAMPLE_SPECS::impl_max_value || *i.current() < SAMPLE_SPECS::impl_min_value) { num_of_clipped++; } else { num_of_clipped = 0; } i.next(); } if (num_of_clipped > maxnum_of_clipped && maxnum_of_clipped != 0) { MESSAGE_ITEM otemp; otemp.setprecision(0); otemp << "(audiofx_amplitude) WARNING! Signal is clipping! "; otemp << num_of_clipped; otemp << " consecutive clipped samples."; ECA_LOG_MSG(ECA_LOGGER::info, otemp.to_string()); } } void EFFECT_AMPLIFY_CLIPCOUNT::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); } EFFECT_AMPLIFY_CHANNEL::EFFECT_AMPLIFY_CHANNEL (parameter_t multiplier_percent, int channel) { set_parameter(1, multiplier_percent); set_parameter(2, channel); } int EFFECT_AMPLIFY_CHANNEL::output_channels(int i_channels) const { if (channel_rep + 1 > i_channels) return channel_rep + 1; return i_channels; } void EFFECT_AMPLIFY_CHANNEL::set_parameter(int param, parameter_t value) { switch (param) { case 1: gain = value / 100.0; break; case 2: channel_rep = static_cast(value); channel_rep--; break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_AMPLIFY_CHANNEL::get_parameter(int param) const { switch (param) { case 1: return gain * 100.0; case 2: return static_cast(channel_rep + 1); } DBC_NEVER_REACHED(); return 0.0; } void EFFECT_AMPLIFY_CHANNEL::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); switch (param) { case 2: { pd->default_value = 1.0f; pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->integer = true; } } } void EFFECT_AMPLIFY_CHANNEL::init(SAMPLE_BUFFER *insample) { i.init(insample); EFFECT_AMPLITUDE::init(insample); } void EFFECT_AMPLIFY_CHANNEL::process(void) { if (channel_rep >= 0 && channel_rep < channels()) { cur_sbuf_repp->multiply_by(gain, channel_rep); } } /** * Unoptimized version of process(). */ void EFFECT_AMPLIFY_CHANNEL::process_ref(void) { if (channel_rep >= 0 && channel_rep < channels()) { i.begin(channel_rep); while(!i.end()) { *i.current() = *i.current() * gain; i.next(); } } } EFFECT_LIMITER::EFFECT_LIMITER (parameter_t limiting_percent) { set_parameter(1, limiting_percent); } EFFECT_LIMITER::~EFFECT_LIMITER(void) { } void EFFECT_LIMITER::set_parameter(int param, parameter_t value) { switch (param) { case 1: limit_rep = value / 100.0; break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_LIMITER::get_parameter(int param) const { switch (param) { case 1: return limit_rep * 100.0; } DBC_NEVER_REACHED(); return 0.0; } void EFFECT_LIMITER::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); } void EFFECT_LIMITER::init(SAMPLE_BUFFER* sbuf) { i.init(sbuf); } void EFFECT_LIMITER::process(void) { i.begin(); while(!i.end()) { if (*i.current() < 0) { if ((-(*i.current())) > limit_rep) *i.current() = -limit_rep; } else { if (*i.current() > limit_rep) *i.current() = limit_rep; } i.next(); } } EFFECT_COMPRESS::EFFECT_COMPRESS (parameter_t compress_rate, parameter_t thold) { set_parameter(1, compress_rate); set_parameter(2, thold); first_time = true; } EFFECT_COMPRESS::EFFECT_COMPRESS (const EFFECT_COMPRESS& x) { crate = x.crate; threshold = x.threshold; delta = x.delta; ratio = x.ratio; first_time = x.first_time; lastin = x.lastin; lastout = x.lastout; } void EFFECT_COMPRESS::set_parameter(int param, parameter_t value) { switch (param) { case 1: crate = std::pow(2.0, value / 6.0); break; case 2: threshold = value / 100.0; break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_COMPRESS::get_parameter(int param) const { switch (param) { case 1: return (log (crate)) / (log (2.0f)) * 6.0; case 2: return threshold * 100.0; } DBC_NEVER_REACHED(); return 0.0; } void EFFECT_COMPRESS::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch (param) { case 1: pd->default_value = 1.0f; pd->description = "compression-rate-dB"; pd->bounded_above = true; pd->upper_bound = 99.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = true; pd->output = false; break; case 2: pd->default_value = 30.0f; pd->description = "threshold-%"; pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = false; break; default: DBC_NEVER_REACHED(); } } void EFFECT_COMPRESS::init(SAMPLE_BUFFER *insample) { i.init(insample); set_channels(insample->number_of_channels()); set_samples_per_second(samples_per_second()); priv_resize_buffer(&lastin, insample->number_of_channels()); priv_resize_buffer(&lastout, insample->number_of_channels()); } void EFFECT_COMPRESS::process(void) { i.begin(); while(!i.end()) { if (first_time) { first_time = false; lastin[i.channel()] = lastout[i.channel()] = *i.current(); } else { if (fabs(*i.current()) > threshold) { delta = *i.current() - lastin[i.channel()]; delta /= crate; new_value = lastin[i.channel()] + delta; ratio = new_value / lastin[i.channel()]; new_value = lastout[i.channel()] * ratio; if (new_value > SAMPLE_SPECS::impl_max_value) new_value = SAMPLE_SPECS::impl_max_value; else if (new_value < SAMPLE_SPECS::impl_min_value) new_value = SAMPLE_SPECS::impl_min_value; lastin[i.channel()] = *i.current(); *i.current() = lastout[i.channel()] = new_value; } else { lastin[i.channel()] = lastout[i.channel()] = *i.current(); } } i.next(); } } EFFECT_NOISEGATE::EFFECT_NOISEGATE (parameter_t thlevel_percent, parameter_t thtime, parameter_t a, parameter_t h, parameter_t r) { // map_parameters(); set_parameter(1, thlevel_percent); set_parameter(2, thtime); set_parameter(3, a); set_parameter(4, h); set_parameter(5, r); } void EFFECT_NOISEGATE::set_parameter(int param, parameter_t value) { switch (param) { case 1: th_level = SAMPLE_SPECS::max_amplitude * (value / 100.0); break; case 2: th_time = (value * (parameter_t)samples_per_second() / 1000.0); break; case 3: atime = (value * (parameter_t)samples_per_second() / 1000.0); break; case 4: htime = (value * (parameter_t)samples_per_second() / 1000.0); break; case 5: rtime = (value * (parameter_t)samples_per_second() / 1000.0); break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_NOISEGATE::get_parameter(int param) const { switch (param) { case 1: return th_level * 100.0 / (parameter_t)SAMPLE_SPECS::max_amplitude; case 2: return th_time * 1000.0 / (parameter_t)samples_per_second(); case 3: return atime * 1000.0 / (parameter_t)samples_per_second(); case 4: return htime * 1000.0 / (parameter_t)samples_per_second(); case 5: return rtime * 1000.0 / (parameter_t)samples_per_second(); } DBC_NEVER_REACHED(); return 0.0; } void EFFECT_NOISEGATE::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); } void EFFECT_NOISEGATE::init(SAMPLE_BUFFER *insample) { i.init(insample); set_channels(insample->number_of_channels()); set_samples_per_second(samples_per_second()); priv_resize_buffer(&th_time_lask, insample->number_of_channels()); priv_resize_buffer(&attack_lask, insample->number_of_channels()); priv_resize_buffer(&hold_lask, insample->number_of_channels()); priv_resize_buffer(&release_lask, insample->number_of_channels()); priv_resize_buffer(&gain, insample->number_of_channels()); ng_status.resize(insample->number_of_channels(), int(ng_waiting)); for(size_t n = 0; n < ng_status.size(); n++) ng_status[n] = ng_waiting; } void EFFECT_NOISEGATE::process(void) { i.begin(); while(!i.end()) { bool below = fabs(*i.current()) <= th_level; switch(ng_status[i.channel()]) { case ng_waiting: // --- // phase 1 - waiting // --- { if (below) { th_time_lask[i.channel()]++; if (th_time_lask[i.channel()] >= th_time) { th_time_lask[i.channel()] = 0.0; ng_status[i.channel()] = ng_attacking; ECA_LOG_MSG(ECA_LOGGER::user_objects,"(audiofx) noisegate - from waiting to attacking"); } } else { th_time_lask[i.channel()] = 0; } break; } case ng_attacking: // --- // phase 2 - attack // --- { if (below) { attack_lask[i.channel()]++; gain[i.channel()] = (1.0 - (attack_lask[i.channel()] / atime)); if (attack_lask[i.channel()] >= atime) { attack_lask[i.channel()] = 0.0; ng_status[i.channel()] = ng_active; gain[i.channel()] = 0.0; ECA_LOG_MSG(ECA_LOGGER::user_objects,"(audiofx) noisegate - from attack to active"); } *i.current() = *i.current() * gain[i.channel()]; } else { attack_lask[i.channel()] = 0; ng_status[i.channel()] = ng_waiting; ECA_LOG_MSG(ECA_LOGGER::user_objects,"(audiofx) noisegate - from attack to waiting"); } break; } case ng_active: // --- // phase 3 - active // --- { if (below == false) { ng_status[i.channel()] = ng_holding; ECA_LOG_MSG(ECA_LOGGER::user_objects,"(audiofx) noisegate - from active to holding"); } *i.current() = *i.current() * 0.0; break; } case ng_holding: // --- // phase 4 - holding // --- { if (!below) { hold_lask[i.channel()]++; if (hold_lask[i.channel()] >= htime) { hold_lask[i.channel()] = 0.0; ng_status[i.channel()] = ng_releasing; ECA_LOG_MSG(ECA_LOGGER::user_objects,"(audiofx) noisegate - from holding to release"); } } *i.current() = *i.current() * 0.0; break; } case ng_releasing: // --- // phase 5 - releasing // --- { release_lask[i.channel()]++; gain[i.channel()] = release_lask[i.channel()] / rtime; if (release_lask[i.channel()] >= rtime) { release_lask[i.channel()] = 0.0; ng_status[i.channel()] = ng_waiting; ECA_LOG_MSG(ECA_LOGGER::user_objects,"(audiofx) noisegate - from releasing to waiting"); } *i.current() = *i.current() * gain[i.channel()]; break; } } i.next(); } } EFFECT_NORMAL_PAN::EFFECT_NORMAL_PAN (parameter_t right_percent) { set_parameter(1, right_percent); } void EFFECT_NORMAL_PAN::set_parameter(int param, parameter_t value) { switch (param) { case 1: right_percent_rep = value; if (value == 50.0) { l_gain = r_gain = 1.0; } else if (value < 50.0) { l_gain = 1.0; r_gain = value / 50.0; } else if (value > 50.0) { r_gain = 1.0; l_gain = (100.0 - value) / 50.0; } break; default: DBC_NEVER_REACHED(); } } CHAIN_OPERATOR::parameter_t EFFECT_NORMAL_PAN::get_parameter(int param) const { switch (param) { case 1: return right_percent_rep; } return 0.0; } void EFFECT_NORMAL_PAN::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { OPERATOR::parameter_description(param, pd); switch (param) { case 1: { pd->default_value = 50.0f; pd->bounded_above = true; pd->upper_bound = 100.0f; pd->bounded_below = true; pd->lower_bound = 0.0f; } default: DBC_NEVER_REACHED(); } } void EFFECT_NORMAL_PAN::init(SAMPLE_BUFFER *insample) { i.init(insample); EFFECT_AMPLITUDE::init(insample); } void EFFECT_NORMAL_PAN::process(void) { /* to match with out_channels() */ cur_sbuf_repp->number_of_channels(2); cur_sbuf_repp->multiply_by(l_gain, SAMPLE_SPECS::ch_left); cur_sbuf_repp->multiply_by(r_gain, SAMPLE_SPECS::ch_right); } /** * Unoptimized version of process(). */ void EFFECT_NORMAL_PAN::process_ref(void) { i.begin(0); while(!i.end()) { *i.current() = *i.current() * l_gain; i.next(); } i.begin(1); while(!i.end()) { *i.current() = *i.current() * r_gain; i.next(); } } ecasound-2.9.3/libecasound/audioio-flac.cpp0000644000076400007640000002025311137153215015610 00000000000000// ------------------------------------------------------------------------ // audioio-flac.cpp: Interface to FLAC decoders and encoders using UNIX // pipe i/o. // Copyright (C) 2004-2006,2008,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* atol() */ #include /* stat() */ #include /* stat() */ #include #include #include "audioio-flac.h" #include "eca-logger.h" /** * References: * http://flac.sourceforge.net/ * http://flac.sourceforge.net/format.html */ string FLAC_FORKED_INTERFACE::default_input_cmd = "flac -d -c %f"; string FLAC_FORKED_INTERFACE::default_output_cmd = "flac -o %f -f --force-raw-format --channels=%c --bps=%b --sample-rate=%s --sign=%I --endian=%E -"; void FLAC_FORKED_INTERFACE::set_input_cmd(const std::string& value) { FLAC_FORKED_INTERFACE::default_input_cmd = value; } void FLAC_FORKED_INTERFACE::set_output_cmd(const std::string& value) { FLAC_FORKED_INTERFACE::default_output_cmd = value; } FLAC_FORKED_INTERFACE::FLAC_FORKED_INTERFACE(const std::string& name) : triggered_rep(false), finished_rep(false) { set_label(name); } FLAC_FORKED_INTERFACE::~FLAC_FORKED_INTERFACE(void) { clean_child(true); if (is_open() == true) { close(); } } void FLAC_FORKED_INTERFACE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { std::string urlprefix; triggered_rep = false; finished_rep = false; /** * FIXME: we have no idea about the audio format of the * stream we get from ogg123... maybe we should force decoder * to generate RIFF wave to a named pipe and parse the header...? */ /* flac tools do not support packed 24bit samples, use * 32bit format instead */ if (bits() == 24) { enum Sample_endianess t = sample_endianess(); set_sample_format(ECA_AUDIO_FORMAT::sfmt_s32); set_sample_endianess(t); } if (io_mode() == io_read) { struct stat buf; int ret = ::stat(label().c_str(), &buf); if (ret != 0) { size_t offset = label().find_first_of("://"); if (offset == std::string::npos) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-FLAC: Can't open file " + label() + ".")); } else { urlprefix = std::string(label(), 0, offset); ECA_LOG_MSG(ECA_LOGGER::user_objects, "(audioio-flac) Found url; protocol '" + urlprefix + "'."); } } /* decoder supports: nothing configurable nor fixed * * FIXME: we have no idea about the audio format of the * stream we get from the decoder... ybe we should force the decoder * to generate RIFF wave to a named pipe and parse the header...? * * - possibly copy FLAC__metadata_get_streaminfo() from flac * package... might be messy due to dependencies * - see http://flac.sourceforge.net/format.html */ } else { /* encoder supports: coding, channel-count, srate and endianess configurable */ } AUDIO_IO::open(); } void FLAC_FORKED_INTERFACE::close(void) { if (pid_of_child() > 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Cleaning child process pid=" + kvu_numtostr(pid_of_child()) + "."); /* note: flac output must not be sent a SIGTERM upon close(), or otherwise the generated header is invalid */ clean_child(); triggered_rep = false; } AUDIO_IO::close(); } long int FLAC_FORKED_INTERFACE::read_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_input_process(); } if (f1_rep != 0) { bytes_rep = std::fread(target_buffer, 1, frame_size() * samples, f1_rep); } else { bytes_rep = 0; } if (bytes_rep < samples * frame_size() || bytes_rep == 0) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::info, "(audioio-flac) Can't start process \"" + FLAC_FORKED_INTERFACE::default_input_cmd + "\". Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; } else finished_rep = false; return(bytes_rep / frame_size()); } void FLAC_FORKED_INTERFACE::write_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_output_process(); } if (wait_for_child() != true) { finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Attempt to write after child process has terminated."); } else { if (filedes_rep > 0) { bytes_rep = ::write(filedes_rep, target_buffer, frame_size() * samples); } else { bytes_rep = 0; } if (bytes_rep < frame_size() * samples) { finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Error in writing to child process (to write " + kvu_numtostr(frame_size() * samples) + ", result " + kvu_numtostr(bytes_rep) + ")."); } else finished_rep = false; } } void FLAC_FORKED_INTERFACE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; } } string FLAC_FORKED_INTERFACE::get_parameter(int param) const { switch (param) { case 1: return(label()); } return(""); } void FLAC_FORKED_INTERFACE::fork_input_process(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, FLAC_FORKED_INTERFACE::default_input_cmd); set_fork_command(FLAC_FORKED_INTERFACE::default_input_cmd); set_fork_file_name(label()); fork_child_for_read(); if (child_fork_succeeded() == true) { /* NOTE: the file description will be closed by * AUDIO_IO_FORKED_STREAM::clean_child() */ filedes_rep = file_descriptor(); f1_rep = fdopen(filedes_rep, "r"); /* not part of */ if (f1_rep == 0) { finished_rep = true; triggered_rep = false; } } else f1_rep = 0; } void FLAC_FORKED_INTERFACE::fork_output_process(void) { string command = FLAC_FORKED_INTERFACE::default_output_cmd; // replace with 'little/big' byteorder if (command.find("%E") != string::npos) { string byteorder ("big"); if (sample_endianess() == ECA_AUDIO_FORMAT::se_little) byteorder = "little"; command.replace(command.find("%E"), 2, byteorder); } // replace with 'signed/unsigned' if (command.find("%I") != string::npos) { string sign ("signed"); if (sample_coding() == ECA_AUDIO_FORMAT::sc_unsigned) sign = "unsigned"; command.replace(command.find("%I"), 2, sign); } set_fork_command(command); set_fork_file_name(label()); int bitcount = bits(); if (bitcount == 32) { /* flac uses 24-in-32bit format, but you have to give * number of used bits for --bps=xxx */ bitcount = 24; } set_fork_bits(bitcount); set_fork_channels(channels()); set_fork_sample_rate(samples_per_second()); fork_child_for_write(); if (child_fork_succeeded() == true) { filedes_rep = file_descriptor(); } else { filedes_rep = 0; } } void FLAC_FORKED_INTERFACE::start_io(void) { if (triggered_rep != true) { if (io_mode() == io_read) fork_input_process(); else fork_output_process(); triggered_rep = true; } } void FLAC_FORKED_INTERFACE::stop_io(void) { if (triggered_rep == true) { if (io_mode() == io_read) clean_child(true); else clean_child(false); triggered_rep = false; } } ecasound-2.9.3/libecasound/audiofx_mixing.cpp0000644000076400007640000002575512501305177016304 00000000000000// ------------------------------------------------------------------------ // audiofx_mixing.cpp: Effects for channel mixing and routing // Copyright (C) 1999-2002,2006,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "samplebuffer_iterators.h" #include "audiofx_mixing.h" static EFFECT_MIXING::ch_type priv_from_make_sane(EFFECT_MIXING::ch_type channel, SAMPLE_BUFFER *insample) { EFFECT_MIXING::ch_type channels = static_cast(insample->number_of_channels()); if (channel < 0) return 0; if (channel >= channels) return channels - 1; return channel; } static EFFECT_MIXING::ch_type priv_to_make_sane(EFFECT_MIXING::ch_type channel, SAMPLE_BUFFER *insample) { if (channel < 0) return 0; return channel; } EFFECT_MIXING::~EFFECT_MIXING(void) { } EFFECT_CHANNEL_COPY::EFFECT_CHANNEL_COPY (parameter_t from, parameter_t to) { set_parameter(1, from); set_parameter(2, to); } int EFFECT_CHANNEL_COPY::output_channels(int i_channels) const { int c = static_cast(to_channel > from_channel ? to_channel : from_channel); ++c; return c > i_channels ? c : i_channels; } void EFFECT_CHANNEL_COPY::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { pd->default_value = 1; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; } void EFFECT_CHANNEL_COPY::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: from_channel = static_cast(value); DBC_CHECK(from_channel > 0); from_channel--; break; case 2: to_channel = static_cast(value); DBC_CHECK(to_channel > 0); to_channel--; break; } } CHAIN_OPERATOR::parameter_t EFFECT_CHANNEL_COPY::get_parameter(int param) const { switch (param) { case 1: return from_channel + 1; case 2: return to_channel + 1; } return 0.0f; } void EFFECT_CHANNEL_COPY::init(SAMPLE_BUFFER *insample) { f_iter.init(insample); t_iter.init(insample); from_channel = priv_from_make_sane(from_channel, insample); to_channel = priv_to_make_sane(to_channel, insample); } void EFFECT_CHANNEL_COPY::process(void) { f_iter.begin(from_channel); t_iter.begin(to_channel); while(!f_iter.end() && !t_iter.end()) { *t_iter.current() = *f_iter.current(); f_iter.next(); t_iter.next(); } } EFFECT_CHANNEL_MOVE::EFFECT_CHANNEL_MOVE (parameter_t from, parameter_t to) { set_parameter(1, from); set_parameter(2, to); } int EFFECT_CHANNEL_MOVE::output_channels(int i_channels) const { int c = static_cast(to_channel > from_channel ? to_channel : from_channel); ++c; return c > i_channels ? c : i_channels; } void EFFECT_CHANNEL_MOVE::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { pd->default_value = 1; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; } void EFFECT_CHANNEL_MOVE::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: from_channel = static_cast(value); DBC_CHECK(from_channel > 0); from_channel--; break; case 2: to_channel = static_cast(value); DBC_CHECK(to_channel > 0); to_channel--; break; } } CHAIN_OPERATOR::parameter_t EFFECT_CHANNEL_MOVE::get_parameter(int param) const { switch (param) { case 1: return from_channel + 1; case 2: return to_channel + 1; } return 0.0; } void EFFECT_CHANNEL_MOVE::init(SAMPLE_BUFFER *insample) { f_iter.init(insample); t_iter.init(insample); from_channel = priv_from_make_sane(from_channel, insample); to_channel = priv_to_make_sane(to_channel, insample); } void EFFECT_CHANNEL_MOVE::process(void) { f_iter.begin(from_channel); t_iter.begin(to_channel); while(!f_iter.end() && !t_iter.end()) { *t_iter.current() = *f_iter.current(); if (from_channel != to_channel) *f_iter.current() = SAMPLE_SPECS::silent_value; f_iter.next(); t_iter.next(); } } EFFECT_CHANNEL_MUTE::EFFECT_CHANNEL_MUTE (parameter_t channel) : EFFECT_AMPLIFY_CHANNEL(0, static_cast(channel)) { set_parameter(1, channel); } void EFFECT_CHANNEL_MUTE::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { pd->default_value = 1; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; } void EFFECT_CHANNEL_MUTE::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { EFFECT_MIXING::ch_type from_channel; switch (param) { case 1: from_channel = static_cast(value); DBC_CHECK(from_channel > 0); EFFECT_AMPLIFY_CHANNEL::set_parameter(2, from_channel); break; } } CHAIN_OPERATOR::parameter_t EFFECT_CHANNEL_MUTE::get_parameter(int param) const { switch (param) { case 1: return EFFECT_AMPLIFY_CHANNEL::get_parameter(2); } return 0.0; } EFFECT_MIX_TO_CHANNEL::EFFECT_MIX_TO_CHANNEL (parameter_t to) { set_parameter(1, to); } int EFFECT_MIX_TO_CHANNEL::output_channels(int i_channels) const { int c = static_cast(to_channel); ++c; return(c > i_channels ? c : i_channels); } void EFFECT_MIX_TO_CHANNEL::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { pd->default_value = 1; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; } void EFFECT_MIX_TO_CHANNEL::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { switch (param) { case 1: to_channel = static_cast(value); DBC_CHECK(to_channel > 0); to_channel--; break; } } CHAIN_OPERATOR::parameter_t EFFECT_MIX_TO_CHANNEL::get_parameter(int param) const { switch (param) { case 1: return to_channel + 1; } return 0.0f; } void EFFECT_MIX_TO_CHANNEL::init(SAMPLE_BUFFER *insample) { i.init(insample); t_iter.init(insample); channels = insample->number_of_channels(); to_channel = priv_to_make_sane(to_channel, insample); } void EFFECT_MIX_TO_CHANNEL::process(void) { i.begin(); t_iter.begin(to_channel); while(!t_iter.end() && !i.end()) { sum = SAMPLE_SPECS::silent_value; for (int n = 0; n < channels; n++) { if (i.end()) break; sum += (*i.current(n)); } *t_iter.current() = sum / channels; i.next(); t_iter.next(); } } EFFECT_CHANNEL_ORDER::EFFECT_CHANNEL_ORDER (void) : sbuf_repp(0), out_channels_rep(0) { } EFFECT_CHANNEL_ORDER* EFFECT_CHANNEL_ORDER::clone(void) const { EFFECT_CHANNEL_ORDER *obj = new EFFECT_CHANNEL_ORDER(); /* note: obj->sbuf_repp is shared but this is ok */ return obj; } int EFFECT_CHANNEL_ORDER::output_channels(int i_channels) const { return out_channels_rep; } void EFFECT_CHANNEL_ORDER::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { /* these apply for all params */ pd->default_value = 1; pd->description = "channel"; pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = true; pd->lower_bound = 1.0f; pd->toggled = false; pd->integer = true; pd->logarithmic = false; pd->output = false; } void EFFECT_CHANNEL_ORDER::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { int src_ch = static_cast(value); int dst_ch = param; if (dst_ch > 0) { if (dst_ch > static_cast(chsrc_map_rep.size())) { chsrc_map_rep.resize(dst_ch); } chsrc_map_rep[dst_ch - 1] = src_ch - 1; /* step: reset highest non-zero channel */ int n; for(n = chsrc_map_rep.size() - 1; n >= 0; n--) { if (chsrc_map_rep[n] >= 0) break; } out_channels_rep = n + 1; } } CHAIN_OPERATOR::parameter_t EFFECT_CHANNEL_ORDER::get_parameter(int param) const { /* note: we ignore zero-src channel at the end of * chsrc_map_rep to avoid infinite loops in * e.g. ECA_OBJECT_FACTORY */ if (param > 0 && param <= out_channels_rep) { DBC_CHECK(out_channels_rep <= static_cast(chsrc_map_rep.size())); /* return 1...N */ return chsrc_map_rep[param - 1] + 1; } return 0.0; } std::string EFFECT_CHANNEL_ORDER::parameter_names(void) const { std::string params; int ch = 0; while(ch < out_channels_rep) { params += "src-ch-" + kvu_numtostr(ch + 1); ++ch; if (ch != out_channels_rep) params += ","; } return params; //return param_names_rep; } void EFFECT_CHANNEL_ORDER::init(SAMPLE_BUFFER *insample) { sbuf_repp = insample; bouncebuf_rep.number_of_channels(sbuf_repp->number_of_channels()); bouncebuf_rep.length_in_samples(sbuf_repp->length_in_samples()); f_iter.init(&bouncebuf_rep); t_iter.init(insample); } void EFFECT_CHANNEL_ORDER::release(void) { sbuf_repp = 0; } void EFFECT_CHANNEL_ORDER::process(void) { /* step: copy input buffer to a temporary buffer */ bouncebuf_rep.copy_all_content(*sbuf_repp); /* step: route channels bouncebuf_rep -> sbuf_repp */ for(int dst_ch = 0; dst_ch < out_channels_rep; dst_ch++) { int src_ch = chsrc_map_rep[dst_ch]; /* for development use only */ #if 0 std::fprintf(stderr, "%sout#%d <-- in#%d (avail in=%d, out=%d)\n", dst_ch == 0 ? "---\n" : "", dst_ch, src_ch, bouncebuf_rep.number_of_channels(), sbuf_repp->number_of_channels()); #endif if (src_ch >= 0 && src_ch < bouncebuf_rep.number_of_channels()) { f_iter.begin(src_ch); t_iter.begin(dst_ch); while(!f_iter.end() && !t_iter.end()) { *t_iter.current() = *f_iter.current(); f_iter.next(); t_iter.next(); } } else { sbuf_repp->make_silent(dst_ch); } } /* step: make sure output buf has exactly N channels */ sbuf_repp->number_of_channels(out_channels_rep); } ecasound-2.9.3/libecasound/osc-sine.h0000644000076400007640000000137311034533077014447 00000000000000#ifndef INCLUDED_SINE_OSCILLATOR_H #define INCLUDED_SINE_OSCILLATOR_H #include #include "oscillator.h" /** * Sine oscillator */ class SINE_OSCILLATOR : public OSCILLATOR { public: virtual void init(void); virtual parameter_t value(double pos); std::string parameter_names(void) const { return("freq,phase-offset"); } void set_parameter(int param, parameter_t value); parameter_t get_parameter(int param) const; std::string name(void) const { return("Sine oscillator"); } SINE_OSCILLATOR* clone(void) const { return new SINE_OSCILLATOR(*this); } SINE_OSCILLATOR* new_expr(void) const { return new SINE_OSCILLATOR(); } SINE_OSCILLATOR (double freq = 0, double initial_phase = 0); private: double period_len_rep; }; #endif ecasound-2.9.3/libecasound/eca-logger-default.cpp0000644000076400007640000000372511261610622016706 00000000000000// ------------------------------------------------------------------------ // eca-logger-default.cpp: Default logging subsystem implementation. // Copyright (C) 2002-2004,2008 Kai Vehmanen // // Attributes: // eca-style-version: 2 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include /* find() */ #include #include "eca-logger-default.h" ECA_LOGGER_DEFAULT::ECA_LOGGER_DEFAULT(std::ostream& output) : output_rep(output) { } void ECA_LOGGER_DEFAULT::do_msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message) { if (is_log_level_set(level) == true) { if (level == ECA_LOGGER::subsystems) { output_rep << "[* "; } else if (module_name.size() > 0 && is_log_level_set(ECA_LOGGER::module_names) == true && level != ECA_LOGGER::eiam_return_values) { output_rep << "(" << ECA_LOGGER_INTERFACE::filter_module_name(module_name) << ") "; } output_rep << log_message; if (level == ECA_LOGGER::subsystems) { output_rep << " *]"; } output_rep << std::endl; } } void ECA_LOGGER_DEFAULT::do_flush(void) { } void ECA_LOGGER_DEFAULT::do_log_level_changed(void) { } ECA_LOGGER_DEFAULT::~ECA_LOGGER_DEFAULT(void) { } ecasound-2.9.3/libecasound/eca-chainsetup-parser.h0000644000076400007640000000531311541135170017103 00000000000000#ifndef INCLUDED_ECA_CHAINSETUP_PARSER_H #define INCLUDED_ECA_CHAINSETUP_PARSER_H #include #include class ECA_CHAINSETUP; class AUDIO_IO; /** * Functionality for parsing chainsetup * option syntax. * * Notes: Code was originally part of the * ECA_CHAINSETUP class. * * @author Kai Vehmanen */ class ECA_CHAINSETUP_PARSER { public: ECA_CHAINSETUP_PARSER(ECA_CHAINSETUP* csetup); // -- // functions for std::string->state conversions /** * Returns the result of last call to interpret_option(), interpret_global_option() * or interpret_object_option(). * * @result true if options interpreted successfully, otherwise false */ bool interpret_result(void) const { return(interpret_result_rep); } const std::string& interpret_result_verbose(void) const { return(interpret_result_verbose_rep); } void interpret_option(const std::string& arg); void interpret_global_option(const std::string& arg); void interpret_object_option(const std::string& arg); void interpret_options(const std::vector& opts); void reset_interpret_status(void); void preprocess_options(std::vector& opts) const; // -- // functions for state->string conversions std::string inputs_to_string(void) const; std::string outputs_to_string(void) const; std::string chains_to_string(void) const; std::string midi_to_string(void) const; std::string general_options_to_string(void) const; private: // -- // functions for std::string->state conversions void interpret_entry(void); void interpret_exit(const std::string& arg); void interpret_set_result(bool result, const std::string& verbose) { interpret_result_rep = result; interpret_result_verbose_rep = verbose; } void interpret_general_option (const std::string& arg); void interpret_processing_control (const std::string& arg); void interpret_audio_format (const std::string& arg); void interpret_chains (const std::string& arg); void interpret_chain_operator (const std::string& arg); void interpret_controller (const std::string& arg); void interpret_effect_preset (const std::string& arg); void interpret_audioio_device (const std::string& argu); void interpret_audioio_manager (const std::string& argu); void interpret_midi_device (const std::string& arg); bool interpret_match_found(void) const { return(istatus_rep); } // -- // data members ECA_CHAINSETUP* csetup_repp; std::vector* last_audio_add_vector_repp; AUDIO_IO* last_audio_object_repp; bool istatus_rep; /* whether we have found an option match? */ bool interpret_result_rep; /* whether we found an option match with correct format? */ std::string interpret_result_verbose_rep; }; #endif ecasound-2.9.3/libecasound/audioio-db-server.cpp0000644000076400007640000004364111562466671016621 00000000000000// ------------------------------------------------------------------------ // audioio-db-server.cpp: Audio i/o engine serving db clients. // Copyright (C) 2000-2005,2009,2011 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* ETIMEDOUT */ #include #include #include #include /* gettimeofday() */ #include #include #include #include "sample-specs.h" #include "samplebuffer.h" #include "eca-logger.h" #include "audioio-db-server.h" #include "audioio-db-server_impl.h" // -- // Select features // #define DB_PROFILING // -- // Macro definitions #ifdef DB_PROFILING #define DB_PROFILING_INC(x) ++(x) #define DB_PROFILING_STATEMENT(x) x #else #define DB_PROFILING_INC(x) (void)0 #define DB_PROFILING_STATEMENT(x) (void)0 #endif // -- // Initialization of static member functions const int AUDIO_IO_DB_SERVER::buffercount_default = 32; const long int AUDIO_IO_DB_SERVER::buffersize_default = 1024; // -- // Initialization of static, global functions static int timed_wait(pthread_mutex_t* mutex, pthread_cond_t* cond, long int usecs); static void timed_wait_print_result(int result, const char* tag, bool verbose); /** * Helper function for starting the slave thread. */ void* start_db_server_io_thread(void *ptr) { sigset_t sigset; sigemptyset(&sigset); sigaddset(&sigset, SIGINT); sigprocmask(SIG_BLOCK, &sigset, 0); AUDIO_IO_DB_SERVER* pserver = static_cast(ptr); pserver->io_thread(); return 0; } /** * Constructor. */ AUDIO_IO_DB_SERVER::AUDIO_IO_DB_SERVER (void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "constructor"); buffercount_rep = buffercount_default; buffersize_rep = buffersize_default; impl_repp = new AUDIO_IO_DB_SERVER_impl; thread_running_rep = false; pthread_cond_init(&impl_repp->client_cond_rep, NULL); pthread_mutex_init(&impl_repp->client_mutex_rep, NULL); pthread_cond_init(&impl_repp->data_cond_rep, NULL); pthread_mutex_init(&impl_repp->data_mutex_rep, NULL); pthread_cond_init(&impl_repp->full_cond_rep, NULL); pthread_mutex_init(&impl_repp->full_mutex_rep, NULL); pthread_cond_init(&impl_repp->stop_cond_rep, NULL); pthread_mutex_init(&impl_repp->stop_mutex_rep, NULL); pthread_cond_init(&impl_repp->flush_cond_rep, NULL); pthread_mutex_init(&impl_repp->flush_mutex_rep, NULL); running_rep.set(0); full_rep.set(0); stop_request_rep.set(0); exit_request_rep.set(0); exit_ok_rep.set(0); impl_repp->profile_full_rep = 0; impl_repp->profile_no_processing_rep = 0; impl_repp->profile_not_full_anymore_rep = 0; impl_repp->profile_processing_rep = 0; impl_repp->profile_read_xrun_danger_rep = 0; impl_repp->profile_write_xrun_danger_rep = 0; impl_repp->profile_rounds_total_rep = 0; } /** * Destructor. Doesn't delete any client objects. */ AUDIO_IO_DB_SERVER::~AUDIO_IO_DB_SERVER(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "destructor"); stop_request_rep.set(1); exit_request_rep.set(1); exit_ok_rep.set(0); if (thread_running_rep == true) { pthread_join(impl_repp->io_thread_rep, 0); } for(unsigned int p = 0; p < buffers_rep.size(); p++) { delete buffers_rep[p]; } delete impl_repp; DB_PROFILING_STATEMENT(dump_profile_counters()); ECA_LOG_MSG(ECA_LOGGER::system_objects, "destructor-out"); } /** * Starts the db server. * * @pre is_running() != true */ void AUDIO_IO_DB_SERVER::start(void) { // -- DBC_REQUIRE(is_running() != true); // -- ECA_LOG_MSG(ECA_LOGGER::system_objects, "start"); if (thread_running_rep != true) { int ret = pthread_create(&impl_repp->io_thread_rep, 0, start_db_server_io_thread, static_cast(this)); if (ret != 0) { ECA_LOG_MSG(ECA_LOGGER::info, "pthread_create failed, exiting"); exit(1); } thread_running_rep = true; } stop_request_rep.set(0); running_rep.set(1); ECA_LOG_MSG(ECA_LOGGER::system_objects, "starting processing"); } /** * Stops the db server. */ void AUDIO_IO_DB_SERVER::stop(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "stop requested"); stop_request_rep.set(1); } /** * Whether the db server has been started? */ bool AUDIO_IO_DB_SERVER::is_running(void) const { if (running_rep.get() == 0) return false; return true; } /** * Whether the db server buffers are full? */ bool AUDIO_IO_DB_SERVER::is_full(void) const { if (full_rep.get() == 0) return false; return true; } /** * Waits for condition to occur. * * @return 0 on success, * -ETIMEDOUT if timeout occured, * other nonzero value on other errors */ static int timed_wait(pthread_mutex_t* mutex, pthread_cond_t* cond, long int msecs) { struct timeval now; gettimeofday(&now, 0); struct timespec sleepcount; sleepcount.tv_nsec = now.tv_usec * 1000 + (msecs % 1000) * 1000000; sleepcount.tv_sec = now.tv_sec + msecs / 1000; if (sleepcount.tv_nsec > 1000000000) { sleepcount.tv_sec++; sleepcount.tv_nsec -= 1000000000; } int ret = 0; pthread_mutex_lock(mutex); ret = pthread_cond_timedwait(cond, mutex, &sleepcount); pthread_mutex_unlock(mutex); return ret; } /** * Prints debug information based on the result * of timed_wait() call. */ static void timed_wait_print_result(int result, const char* tag, bool verbose) { ECA_LOGGER::Msg_level_t level = ECA_LOGGER::info; if (verbose != true) level = ECA_LOGGER::continuous; if (result != 0) { if (result == -ETIMEDOUT) ECA_LOG_MSG(level, std::string(tag) + " failed; timeout"); else ECA_LOG_MSG(level, std::string(tag) + " failed"); } } /** * Signals the server that one of its client has * processed data from the db buffers. This * function helps server to keep its buffers * full without resorting to polling. * * Called by both db clients and the db server. */ void AUDIO_IO_DB_SERVER::signal_client_activity(void) { pthread_mutex_lock(&impl_repp->client_mutex_rep); pthread_cond_broadcast(&impl_repp->client_cond_rep); pthread_mutex_unlock(&impl_repp->client_mutex_rep); } /** * Function that blocks until some client * activity occurs. * * Only called by db server. * * @see signal_client_activity() * * @pre is_running() != true */ void AUDIO_IO_DB_SERVER::wait_for_client_activity(void) { // -- DBC_REQUIRE(is_running() == true); // -- /* note! we only wait for 100msec in case no clients * clients signal activity but there's still * room for new data */ int res = timed_wait(&impl_repp->client_mutex_rep, &impl_repp->client_cond_rep, 100); timed_wait_print_result(res, "wait_for_client_activity", false); } /** * Function that blocks until the server signals * that all its buffers are full. */ void AUDIO_IO_DB_SERVER::wait_for_full(void) { if (is_running() == true && clients_rep.size() > 0) { /* note! we wait until we get a signal_full() even though * full_rep could already be set */ int res = timed_wait(&impl_repp->full_mutex_rep, &impl_repp->full_cond_rep, 5000); timed_wait_print_result(res, "wait_for_full", true); } else { ECA_LOG_MSG(ECA_LOGGER::system_objects, "wait_for_full failed; not running"); } } /** * Function that blocks until the server signals * that it has stopped. */ void AUDIO_IO_DB_SERVER::wait_for_stop(void) { if (is_running() == true) { int res = timed_wait(&impl_repp->stop_mutex_rep, &impl_repp->stop_cond_rep, 5000); timed_wait_print_result(res, "wait_for_stop", true); } } /** * Function that blocks until the server signals * that it has flushed all buffers (after * exit request). */ void AUDIO_IO_DB_SERVER::wait_for_flush(void) { if (is_running() == true) { if (exit_ok_rep.get() == 0) { signal_client_activity(); int res = timed_wait(&impl_repp->flush_mutex_rep, &impl_repp->flush_cond_rep, 5000); timed_wait_print_result(res, "wait_for_flush", true); } } else { ECA_LOG_MSG(ECA_LOGGER::system_objects, "wait_for_flush failed; not running"); } } /** * Sends a signal notifying that server buffers * are fulls. * * Called by db server. */ void AUDIO_IO_DB_SERVER::signal_full(void) { pthread_mutex_lock(&impl_repp->full_mutex_rep); pthread_cond_broadcast(&impl_repp->full_cond_rep); pthread_mutex_unlock(&impl_repp->full_mutex_rep); } /** * Sends a signal notifying that server has * stopped. * * Called by db server. */ void AUDIO_IO_DB_SERVER::signal_stop(void) { pthread_mutex_lock(&impl_repp->stop_mutex_rep); pthread_cond_broadcast(&impl_repp->stop_cond_rep); pthread_mutex_unlock(&impl_repp->stop_mutex_rep); } /** * Sends a signal notifying that server has * flushed all buffers (after an exit request). * * Called by db server. */ void AUDIO_IO_DB_SERVER::signal_flush(void) { pthread_mutex_lock(&impl_repp->flush_mutex_rep); pthread_cond_broadcast(&impl_repp->flush_cond_rep); pthread_mutex_unlock(&impl_repp->flush_mutex_rep); } /** * Sets new default values for sample buffers. * * @pre is_running() != true */ void AUDIO_IO_DB_SERVER::set_buffer_defaults(int buffers, long int buffersize) { // -- DBC_REQUIRE(is_running() != true); // -- buffercount_rep = buffers; buffersize_rep = buffersize; } /** * Registers a new client object. * * @pre aobject != 0 * @pre is_running() != true */ void AUDIO_IO_DB_SERVER::register_client(AUDIO_IO* aobject) { // -- DBC_REQUIRE(aobject != 0); DBC_REQUIRE(is_running() != true); // -- clients_rep.push_back(aobject); ECA_LOG_MSG(ECA_LOGGER::system_objects, "Registering client " + kvu_numtostr(clients_rep.size() - 1) + ". Buffer count " + kvu_numtostr(buffercount_rep) + "."); buffers_rep.push_back(new AUDIO_IO_DB_BUFFER(buffercount_rep, buffersize_rep, aobject->channels())); client_map_rep[aobject] = clients_rep.size() - 1; } /** * Unregisters the client object given as the argument. No * resources are freed during this call. * */ void AUDIO_IO_DB_SERVER::unregister_client(AUDIO_IO* aobject) { // -- DBC_REQUIRE(is_running() != true); // -- ECA_LOG_MSG(ECA_LOGGER::system_objects, "unregister_client " + aobject->name() + "."); if (client_map_rep.find(aobject) != client_map_rep.end()) { size_t index = client_map_rep[aobject]; if (index >= 0 && index < clients_rep.size()) { clients_rep[index] = 0; delete buffers_rep[index]; buffers_rep[index] = 0; } else ECA_LOG_MSG(ECA_LOGGER::system_objects, "unregister_client failed (1)"); } else ECA_LOG_MSG(ECA_LOGGER::system_objects, "unregister_client failed (2)"); } /** * Gets a pointer to the client buffer belonging to * the audio object given as parameter. If no * buffers are found (client not registered, etc), * null is returned. */ AUDIO_IO_DB_BUFFER* AUDIO_IO_DB_SERVER::get_client_buffer(AUDIO_IO* aobject) { if (client_map_rep.find(aobject) == client_map_rep.end() || clients_rep[client_map_rep[aobject]] == 0) return 0; return buffers_rep[client_map_rep[aobject]]; } /** * Slave thread. */ void AUDIO_IO_DB_SERVER::io_thread(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Hey, in the I/O loop!"); int processed = 0; int passive_rounds = 0; DB_PROFILING_STATEMENT(bool one_time_full = false); /* set idle timeout to ~10% of total buffersize (using 44.1Hz as a reference) */ long int sleeplen = buffersize_rep * buffercount_rep * 1000 / 44100 / 10 * 1000000; ECA_LOG_MSG(ECA_LOGGER::system_objects, "Using idle timeout of " + kvu_numtostr(sleeplen) + " nsecs."); while(true) { if (running_rep.get() == 0) { kvu_sleep(0, sleeplen); if (exit_request_rep.get() == 1) break; continue; } DB_PROFILING_INC(impl_repp->profile_rounds_total_rep); processed = 0; int min_free_space = buffercount_rep; DB_PROFILING_STATEMENT(impl_repp->looptimer_rep.start()); for(unsigned int p = 0; p < clients_rep.size(); p++) { if (clients_rep[p] == 0 || buffers_rep[p]->finished_rep.get()) { continue; } else if (clients_rep[p]->finished() == true) { buffers_rep[p]->finished_rep.set(1); } int free_space = 0; if (buffers_rep[p]->io_mode_rep == AUDIO_IO::io_read) { free_space = buffers_rep[p]->write_space(); if (free_space > 0) { /* room available, so we can read at least one buffer of data */ if (clients_rep[p]->finished() != true) { clients_rep[p]->read_buffer(buffers_rep[p]->sbufs_rep[buffers_rep[p]->writeptr_rep.get()]); if (clients_rep[p]->finished() == true) buffers_rep[p]->finished_rep.set(1); buffers_rep[p]->advance_write_pointer(); ++processed; } #ifdef DB_PROFILING if (buffers_rep[p]->write_space() > 16 && one_time_full == true) { DB_PROFILING_INC(impl_repp->profile_read_xrun_danger_rep); } #endif } } else { free_space = buffers_rep[p]->read_space(); if (free_space > 0) { /* room available, so we can write at least one buffer of data */ if (clients_rep[p]->finished() != true) { clients_rep[p]->write_buffer(buffers_rep[p]->sbufs_rep[buffers_rep[p]->readptr_rep.get()]); if (clients_rep[p]->finished() == true) buffers_rep[p]->finished_rep.set(1); buffers_rep[p]->advance_read_pointer(); ++processed; } #ifdef DB_PROFILING if (buffers_rep[p]->read_space() < 16 && one_time_full == true) { DB_PROFILING_INC(impl_repp->profile_write_xrun_danger_rep); } #endif } } if (free_space < min_free_space) min_free_space = free_space; } DB_PROFILING_STATEMENT(impl_repp->looptimer_rep.stop()); if (stop_request_rep.get() == 1) { stop_request_rep.set(0); running_rep.set(0); full_rep.set(0); ECA_LOG_MSG(ECA_LOGGER::system_objects, "stop complete"); signal_stop(); } else { if (processed == 0) passive_rounds++; else passive_rounds = 0; if (processed == 0) { if (passive_rounds > 1) { /* case 1: nothing processed during the last two rounds ==> signal_full, wait_for_client_activity */ DB_PROFILING_INC(impl_repp->profile_full_rep); full_rep.set(1); DB_PROFILING_STATEMENT(if (one_time_full != true) one_time_full = true); signal_full(); DBC_CHECK(running_rep.get() == 1); } else { /* case 2: nothing processed during the last round ==> wait_for_client_activity */ DB_PROFILING_INC(impl_repp->profile_no_processing_rep); } wait_for_client_activity(); } else { /* case 3: something processed; business as usual */ DB_PROFILING_INC(impl_repp->profile_processing_rep); } /* case X: something processed; room in the buffers ==> data available */ // DB_PROFILING_INC(impl_repp->profile_not_full_anymore_rep); } } flush(); exit_ok_rep.set(1); // std::cerr << "Exiting db server thread." << std::endl; } void AUDIO_IO_DB_SERVER::dump_profile_counters(void) { std::cerr << "(audioio-db-server) *** profile begin ***" << std::endl; std::cerr << "Profile_full_rep: " << impl_repp->profile_full_rep << std::endl; std::cerr << "Profile_no_processing_rep: " << impl_repp->profile_no_processing_rep << std::endl; std::cerr << "Profile_not_full_anymore_rep: " << impl_repp->profile_not_full_anymore_rep << std::endl; std::cerr << "Profile_processing_rep: " << impl_repp->profile_processing_rep << std::endl; std::cerr << "Profile_read_xrun_danger_rep: " << impl_repp->profile_read_xrun_danger_rep << std::endl; std::cerr << "Profile_write_xrun_danger_rep: " << impl_repp->profile_write_xrun_danger_rep << std::endl; std::cerr << "Profile_rounds_total_rep: " << impl_repp->profile_rounds_total_rep << std::endl; std::cerr << "Fastest/slowest/average loop time: "; std::cerr << kvu_numtostr(impl_repp->looptimer_rep.min_duration_seconds() * 1000, 1); std::cerr << "/"; std::cerr << kvu_numtostr(impl_repp->looptimer_rep.max_duration_seconds() * 1000, 1); std::cerr << "/"; std::cerr << kvu_numtostr(impl_repp->looptimer_rep.average_duration_seconds() * 1000, 1); std::cerr << " msec." << std::endl; std::cerr << "(audioio-db-server) *** profile end ***" << std::endl; } /** * Flushes all data in the buffers to disk. */ void AUDIO_IO_DB_SERVER::flush(void) { int not_finished = 1; while(not_finished != 0) { not_finished = 0; for(unsigned int p = 0; p < clients_rep.size(); p++) { if (clients_rep[p] == 0 || buffers_rep[p]->finished_rep.get()) continue; if (buffers_rep[p]->io_mode_rep != AUDIO_IO::io_read) { if (buffers_rep[p]->read_space() > 0) { ++not_finished; ECA_LOG_MSG(ECA_LOGGER::info, "Flushing buffer " + kvu_numtostr(buffers_rep[p]->readptr_rep.get()) + " of client " + kvu_numtostr(p) + " read_space: " + kvu_numtostr(buffers_rep[p]->read_space()) + "."); clients_rep[p]->write_buffer(buffers_rep[p]->sbufs_rep[buffers_rep[p]->readptr_rep.get()]); if (clients_rep[p]->finished() == true) buffers_rep[p]->finished_rep.set(1); buffers_rep[p]->advance_read_pointer(); } } } } for(unsigned int p = 0; p < buffers_rep.size(); p++) { if (buffers_rep[p] != 0) { buffers_rep[p]->reset(); } } signal_flush(); } ecasound-2.9.3/libecasound/audioio-aac.cpp0000644000076400007640000001614411141367001015426 00000000000000// ------------------------------------------------------------------------ // audioio-aac.cpp: Interface class for FAAC/FAAD AAC encoder/decoder. // Copyright (C) 2004-2006,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* atol() */ #include /* stat() */ #include /* stat() */ #include #include #include "audioio-aac.h" #include "eca-logger.h" /** * References: * http://www.audiocoding.com/ */ string AAC_FORKED_INTERFACE::default_input_cmd = "faad -w -b 1 -f 2 -d %f"; string AAC_FORKED_INTERFACE::default_output_cmd = "faac -P -o %f -R %s -B %b -C %c -"; void AAC_FORKED_INTERFACE::set_input_cmd(const std::string& value) { AAC_FORKED_INTERFACE::default_input_cmd = value; } void AAC_FORKED_INTERFACE::set_output_cmd(const std::string& value) { AAC_FORKED_INTERFACE::default_output_cmd = value; } AAC_FORKED_INTERFACE::AAC_FORKED_INTERFACE(const std::string& name) : triggered_rep(false), finished_rep(false) { set_label(name); } AAC_FORKED_INTERFACE::~AAC_FORKED_INTERFACE(void) { clean_child(true); if (is_open() == true) { close(); } } void AAC_FORKED_INTERFACE::open(void) throw (AUDIO_IO::SETUP_ERROR &) { std::string urlprefix; finished_rep = false; triggered_rep = false; /** * FIXME: we have no idea about the audio format of the * stream we get from ogg123... maybe we should force decoder * to generate RIFF wave to a named pipe and parse the header...? */ if (io_mode() == io_read) { struct stat buf; int ret = ::stat(label().c_str(), &buf); if (ret != 0) { size_t offset = label().find_first_of("://"); if (offset == std::string::npos) { throw(SETUP_ERROR(SETUP_ERROR::io_mode, "AUDIOIO-AAC: Can't open file " + label() + ".")); } else { urlprefix = std::string(label(), 0, offset); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Found url; protocol '" + urlprefix + "'."); } } /* decoder supports: fixed channel count and sample format, sample rate unknown and must be set manually */ set_channels(2); /* 5.1 downmixed to stereo if needed by faad2 */ /* FIXME: fix properly */ set_sample_format(ECA_AUDIO_FORMAT::sfmt_s16_le); } else { /* encoder supports: coding, channel-count and srate configurable; fixed endianess */ set_sample_endianess(ECA_AUDIO_FORMAT::se_big); } AUDIO_IO::open(); } void AAC_FORKED_INTERFACE::close(void) { if (pid_of_child() > 0) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Cleaning child process pid=" + kvu_numtostr(pid_of_child()) + ")."); clean_child(); triggered_rep = false; } AUDIO_IO::close(); } long int AAC_FORKED_INTERFACE::read_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_input_process(); } if (f1_rep != 0) { bytes_rep = std::fread(target_buffer, 1, frame_size() * samples, f1_rep); } else { bytes_rep = 0; } if (bytes_rep < samples * frame_size() || bytes_rep == 0) { if (position_in_samples() == 0) ECA_LOG_MSG(ECA_LOGGER::info, "Can't start process \"" + AAC_FORKED_INTERFACE::default_input_cmd + "\". Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; } else finished_rep = false; return bytes_rep / frame_size(); } void AAC_FORKED_INTERFACE::write_samples(void* target_buffer, long int samples) { if (triggered_rep != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: triggering an external program in real-time context"); triggered_rep = true; fork_output_process(); } if (wait_for_child() != true) { finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Attempt to write after child process has terminated."); } else { if (filedes_rep > 0) { bytes_rep = ::write(filedes_rep, target_buffer, frame_size() * samples); } else { bytes_rep = 0; } if (bytes_rep < frame_size() * samples) { ECA_LOG_MSG(ECA_LOGGER::info, "Can't start process \"" + AAC_FORKED_INTERFACE::default_output_cmd + "\". FAAC v1.24 or newer is required. Please check your ~/.ecasound/ecasoundrc."); finished_rep = true; triggered_rep = false; ECA_LOG_MSG(ECA_LOGGER::errors, "Error in writing to child process (to write " + kvu_numtostr(frame_size() * samples) + ", result " + kvu_numtostr(bytes_rep) + ")."); } else finished_rep = false; } } void AAC_FORKED_INTERFACE::set_parameter(int param, string value) { switch (param) { case 1: set_label(value); break; } } string AAC_FORKED_INTERFACE::get_parameter(int param) const { switch (param) { case 1: return label(); } return ""; } void AAC_FORKED_INTERFACE::fork_input_process(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, AAC_FORKED_INTERFACE::default_input_cmd); set_fork_command(AAC_FORKED_INTERFACE::default_input_cmd); set_fork_file_name(label()); fork_child_for_read(); if (child_fork_succeeded() == true) { /* NOTE: the file description will be closed by * AUDIO_IO_FORKED_STREAM::clean_child() */ filedes_rep = file_descriptor(); f1_rep = fdopen(filedes_rep, "r"); /* not part of */ if (f1_rep == 0) { finished_rep = true; triggered_rep = false; } } else f1_rep = 0; } void AAC_FORKED_INTERFACE::fork_output_process(void) { string command = AAC_FORKED_INTERFACE::default_output_cmd; set_fork_command(command); set_fork_file_name(label()); set_fork_bits(bits()); set_fork_channels(channels()); set_fork_sample_rate(samples_per_second()); fork_child_for_write(); if (child_fork_succeeded() == true) { filedes_rep = file_descriptor(); } else { filedes_rep = 0; } } void AAC_FORKED_INTERFACE::start_io(void) { if (triggered_rep != true) { if (io_mode() == io_read) fork_input_process(); else fork_output_process(); triggered_rep = true; } } void AAC_FORKED_INTERFACE::stop_io(void) { if (triggered_rep == true) { if (io_mode() == io_read) clean_child(true); else clean_child(false); triggered_rep = false; } } ecasound-2.9.3/libecasound/audioio-plugin.h0000644000076400007640000000045410664032032015644 00000000000000#ifndef INCLUDED_AUDIOIO_PLUGIN_H #define INCLUDED_AUDIOIO_PLUGIN_H class AUDIO_IO; typedef AUDIO_IO * (*audio_io_descriptor)(void); typedef int (*audio_io_interface_version)(void); typedef const char * (*audio_io_keyword)(void); typedef const char * (*audio_io_keyword_regex)(void); #endif ecasound-2.9.3/libecasound/audioio-forked-stream.h0000644000076400007640000000410111141362451017104 00000000000000#ifndef INCLUDED_AUDIOIO_FORKED_STREAM_H #define INCLUDED_AUDIOIO_FORKED_STREAM_H #include #include #include "audioio-barrier.h" #include "sample-specs.h" /** * Helper class providing routines for forking new processes * and creating read/write pipes between the child and the * parent process. * * @author Kai Vehmanen */ class AUDIO_IO_FORKED_STREAM : public AUDIO_IO_BARRIER { private: int pid_of_parent_rep; int pid_of_child_rep; int fd_rep; bool last_fork_rep; bool sigkill_sent_rep; std::string tmpfile_repp; bool tmp_file_created_rep; bool use_named_pipe_rep; std::string command_rep; std::string object_rep; TEMPORARY_FILE_DIRECTORY tempfile_dir_rep; void init_temp_directory(void); void fork_child_for_fifo_read(void); void init_state_before_fork(void); public: virtual void stop_io(void); protected: /** * Initializes the command string. This must be done before any other set_* * calls. */ void set_fork_command(const std::string& cmd) { command_rep = cmd; } void set_fork_file_name(const std::string& filename); void set_fork_pipe_name(void); void set_fork_channels(int channels); void set_fork_sample_rate(long int sample_rate); void set_fork_bits(int bits); void fork_child_for_read(void); void fork_child_for_write(void); void clean_child(bool force = false); const std::string& fork_command(void) const { return(command_rep); } bool wait_for_child(void) const; bool child_fork_succeeded(void) const { return(last_fork_rep); } int pid_of_child(void) const { return(pid_of_child_rep); } int file_descriptor(void) const { return(fd_rep); } virtual bool do_supports_seeking(void) const = 0; virtual void do_set_position_in_samples(SAMPLE_SPECS::sample_pos_t pos) = 0; public: AUDIO_IO_FORKED_STREAM(void) : pid_of_parent_rep(-1), pid_of_child_rep(-1), fd_rep(0), last_fork_rep(false), sigkill_sent_rep(false), tmp_file_created_rep(false), use_named_pipe_rep(false) { } virtual ~AUDIO_IO_FORKED_STREAM(void); }; #endif ecasound-2.9.3/libecasound/eca-control-mt.h0000644000076400007640000000747711762413351015566 00000000000000// ------------------------------------------------------------------------ // eca-control-mt.h: Multithreaded implementation of ECA_CONTROL_INTERFACE // Copyright (C) 2009,2012 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // ------------------------------------------------------------------------ #ifndef INCLUDED_ECA_CONTROL_MT_H #define INCLUDED_ECA_CONTROL_MT_H #include #include "eca-control-main.h" class ECA_CONTROL; class ECA_SESSION; /** * High-level interface to libecasound functionality * * @see ECA_CONTROL_MAIN, ECA_CONTROL * * Related design patters: Facade (GoF185) * * @author Kai Vehmanen */ class ECA_CONTROL_MT : public ECA_CONTROL_MAIN { public: /** @name Constructors and dtors */ /*@{*/ ECA_CONTROL_MT(ECA_SESSION* psession); virtual ~ECA_CONTROL_MT (void); /*@}*/ // ------------------------------------------------------------------- /** @name Lock object exclusively to perform transactions */ /*@{*/ void lock_control(void); void unlock_control(void); /*@}*/ // ------------------------------------------------------------------- /** @name Runtime control */ /*@{*/ virtual void engine_start(void); virtual int start(void); virtual void stop(void); virtual void stop_on_condition(void); virtual int run(bool batchmode = true); virtual void quit(void); virtual void quit_async(void); virtual bool is_running(void) const; virtual bool is_connected(void) const; virtual bool is_selected(void) const; virtual bool is_finished(void) const; virtual bool is_valid(void) const; virtual bool is_engine_created(void) const; virtual bool is_engine_ready_for_commands(void) const; virtual const ECA_CHAINSETUP* get_connected_chainsetup(void) const; virtual void connect_chainsetup(struct eci_return_value *retval); virtual void disconnect_chainsetup(void); /*@}*/ // ------------------------------------------------------------------- /** @name Execute edit objects */ /*@{*/ virtual bool execute_edit_on_connected(const ECA::chainsetup_edit_t& edit); virtual bool execute_edit_on_selected(const ECA::chainsetup_edit_t& edit, int index = -1); /*@}*/ /** @name Building blocks for ECI -Ecasound Control Interface */ /*@{*/ /** * Parses and executes a string containing a single Ecasound * Interactive Mode (EIAM) command and its arguments. * * Result of the command can be queried with last_value_to_string(). */ virtual void command(const std::string& cmd_and_args, struct eci_return_value *retval); /** * A special version of 'command()' which parses a command taking * a single double parameter. * * Result of the command can be queried with last_value_to_string(). */ virtual void command_float_arg(const std::string& cmd, double arg, struct eci_return_value *retval); virtual void print_last_value(struct eci_return_value *retval) const; // ------------------------------------------------------------------- private: mutable pthread_mutex_t mutex_rep; ECA_CONTROL *ec_repp; ECA_CONTROL_MT& operator=(const ECA_CONTROL_MT& v) { return *this; } ECA_CONTROL_MT(const ECA_CONTROL_MT* v) {} }; #endif /* INCLUDED_ECA_CONTROL_IF_H */ ecasound-2.9.3/libecasound/eca-audio-time.h0000644000076400007640000000257211034134155015506 00000000000000#ifndef INCLUDED_ECA_AUDIO_TIME_H #define INCLUDED_ECA_AUDIO_TIME_H #include #include "sample-specs.h" /** * Generic class for representing time in audio environment */ class ECA_AUDIO_TIME { private: SAMPLE_SPECS::sample_pos_t samples_rep; mutable SAMPLE_SPECS::sample_rate_t sample_rate_rep; mutable bool rate_set_rep; static const SAMPLE_SPECS::sample_rate_t default_srate = 384000; static const SAMPLE_SPECS::sample_rate_t invalid_srate = -1; public: enum format_type { format_hour_min_sec, format_min_sec, format_seconds, format_samples }; ECA_AUDIO_TIME(SAMPLE_SPECS::sample_pos_t samples, SAMPLE_SPECS::sample_rate_t sample_rate); ECA_AUDIO_TIME(double time_in_seconds); ECA_AUDIO_TIME(format_type type, const std::string& time); ECA_AUDIO_TIME(const std::string& time); ECA_AUDIO_TIME(void); void set(format_type type, const std::string& time); void set_seconds(double seconds); void set_time_string(const std::string& time); void set_samples(SAMPLE_SPECS::sample_pos_t samples); void set_samples_per_second(long int srate); void set_samples_per_second_keeptime(long int srate); void mark_as_invalid(void); std::string to_string(format_type type) const; double seconds(void) const; SAMPLE_SPECS::sample_rate_t samples_per_second(void) const; SAMPLE_SPECS::sample_pos_t samples(void) const; bool valid(void) const; }; #endif ecasound-2.9.3/libecasound/audioio-oss.h0000644000076400007640000000416510664032032015155 00000000000000#ifndef INCLUDED_AUDIOIO_OSS_H #define INCLUDED_AUDIOIO_OSS_H #include #include #include #include #include #include #include #include #include #ifndef AFMT_S32_LE #define AFMT_S32_LE 0x00001000 #endif #ifndef AFMT_S32_BE #define AFMT_S32_BE 0x00002000 #endif #include "audioio-device.h" /** * Class for handling Open Sound System -devices (OSS/Linux * and OSS/Lite). * @author Kai Vehmanen */ class OSSDEVICE : public AUDIO_IO_DEVICE { public: OSSDEVICE (const std::string& name = "/dev/dsp", bool precise_sample_rates = false); virtual ~OSSDEVICE(void); virtual OSSDEVICE* clone(void) const; virtual OSSDEVICE* new_expr(void) const { return new OSSDEVICE(); } virtual std::string name(void) const { return("OSS soundcard device"); } virtual std::string description(void) const { return("Open Sound System -devices (OSS/Linux and OSS/Free)."); } /** @name Function reimplemented from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return(io_read | io_write); } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR &); virtual void close(void); virtual long int read_samples(void* target_buffer, long int samples); virtual void write_samples(void* target_buffer, long int samples); /*@}*/ /** @name Function reimplemented from AUDIO_IO_DEVICE */ /*@{*/ virtual void start(void); virtual void stop(void); virtual long int delay(void) const; virtual long int latency(void) const { return(buffersize()); } virtual long int prefill_space(void) const { if (io_mode() != io_read) return(buffersize() * fragment_count); else return(0); } /*@}*/ private: OSSDEVICE(const OSSDEVICE& x) { } OSSDEVICE& operator=(const OSSDEVICE& x) { return *this; } int audio_fd; audio_buf_info audiobuf; // soundcard.h count_info audioinfo; // soundcard.h fd_set fds; int fragment_size; int fragment_count; long int bytes_read; int oss_caps; struct timeval start_time; bool precise_srate_mode; }; #endif ecasound-2.9.3/libecasound/audioio-loop.h0000644000076400007640000000364511501246164015330 00000000000000#ifndef INCLUDED_AUDIOIO_LOOP_DEVICE_H #define INCLUDED_AUDIOIO_LOOP_DEVICE_H #include #include #include "audioio.h" #include "samplebuffer.h" /** * Audio object that routes data from inputs to outputs */ class LOOP_DEVICE : public AUDIO_IO { public: LOOP_DEVICE(std::string tag); LOOP_DEVICE(void) { } virtual ~LOOP_DEVICE(void); virtual LOOP_DEVICE* clone(void) const; virtual LOOP_DEVICE* new_expr(void) const { return new LOOP_DEVICE(); } virtual std::string name(void) const { return("Internal loop device"); } virtual std::string description(void) const { return("Loop device that routes data from output to input."); } /** @name Function reimplemented from AUDIO_IO */ /*@{*/ virtual int supported_io_modes(void) const { return io_read | io_write; } virtual bool locked_audio_format(void) const { return true; } virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void set_buffersize(long int samples) { }; virtual long int buffersize(void) const { return(0); }; virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual bool finished(void) const; virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); virtual std::string parameter_names(void) const { return("label,id_number"); } virtual void set_parameter(int param, std::string value); virtual std::string get_parameter(int param) const; /*@}*/ /** * Register a new input client */ void register_input(void) { ++registered_inputs_rep; } /** * Register a new output client */ void register_output(void) { ++registered_outputs_rep; } const std::string& tag(void) const { return(tag_rep); } private: std::string tag_rep; int writes_rep; int registered_inputs_rep; int registered_outputs_rep; int empty_rounds_rep; bool finished_rep; bool filled_rep; SAMPLE_BUFFER sbuf; }; #endif ecasound-2.9.3/libecasound/audioio-db-client.h0000644000076400007640000000501711141363244016212 00000000000000#ifndef INCLUDED_AUDIOIO_DB_CLIENT_H #define INCLUDED_AUDIOIO_DB_CLIENT_H #include #include #include "audioio-proxy.h" #include "audioio-db-server.h" class SAMPLE_BUFFER; /** * Client class for double-buffering providing * additional layer of buffering for objects * derived from AUDIO_IO. * * The buffering subsystem has been optimized for * reliable streaming performance. Because of this some * operations like random seeks are considerably slower * than with direct access. * * Related design patterns: * - Proxy (GoF207) * * @author Kai Vehmanen */ class AUDIO_IO_DB_CLIENT : public AUDIO_IO_PROXY { public: /** @name Public functions */ /*@{*/ AUDIO_IO_DB_CLIENT (AUDIO_IO_DB_SERVER *pserver, AUDIO_IO* aobject, bool transfer_ownership); virtual ~AUDIO_IO_DB_CLIENT(void); /*@}*/ /** @name Reimplemented functions from ECA_OBJECT */ /*@{*/ virtual std::string name(void) const { return(string("DB => ") + child()->name()); } virtual std::string description(void) const { return(child()->description()); } /*@}*/ /** @name Reimplemented functions from DYNAMIC_PARAMETERS */ /*@{*/ /* none */ /*@}*/ /** @name Reimplemented functions from DYNAMIC_OBJECT */ /*@{*/ AUDIO_IO_DB_CLIENT* clone(void) const { std::cerr << __FILE__ << ": Not implemented!" << std::endl; return 0; } AUDIO_IO_DB_CLIENT* new_expr(void) const { std::cerr << __FILE__ << ": Not implemented!" << std::endl; return 0; } /*@}*/ /** @name Reimplemented functions from ECA_AUDIO_POSITION */ /*@{*/ virtual SAMPLE_SPECS::sample_pos_t seek_position(SAMPLE_SPECS::sample_pos_t pos); /*@}*/ /** @name Reimplemented functions from AUDIO_IO_BARRIER */ /*@{*/ virtual void start_io(void); virtual void stop_io(void); /*@}*/ /** @name Reimplemented functions from AUDIO_IO */ /*@{*/ virtual void read_buffer(SAMPLE_BUFFER* sbuf); virtual void write_buffer(SAMPLE_BUFFER* sbuf); virtual void open(void) throw(AUDIO_IO::SETUP_ERROR&); virtual void close(void); virtual bool finished(void) const; /*@}*/ private: AUDIO_IO_DB_SERVER* pserver_repp; AUDIO_IO_DB_BUFFER* pbuffer_repp; AUDIO_IO_DB_CLIENT& operator=(const AUDIO_IO_DB_CLIENT& x) { return *this; } AUDIO_IO_DB_CLIENT (const AUDIO_IO_DB_CLIENT& x) { } int xruns_rep; bool finished_rep; bool free_child_rep; bool recursing_rep; void fetch_initial_child_data(void); bool pause_db_server_if_running(void); void restore_db_server_state(bool was_running); }; #endif ecasound-2.9.3/libecasound/eca-engine_impl.h0000644000076400007640000000165711743344155015754 00000000000000#ifndef INCLUDED_ECA_ENGINE_IMPL_H #define INCLUDED_ECA_ENGINE_IMPL_H #include #include #include #include #include #include #include "eca-chainsetup.h" /** * Private class used in ECA_ENGINE * implementation. */ class ECA_ENGINE_impl { friend class ECA_ENGINE; private: PROCEDURE_TIMER looptimer_rep; PROCEDURE_TIMER looptimer_range_rep; double looptimer_low_rep; double looptimer_mid_rep; double looptimer_high_rep; MESSAGE_QUEUE_RT_C command_queue_rep; pthread_cond_t editlock_cond_repp; pthread_mutex_t editlock_mutex_repp; pthread_cond_t ecasound_stop_cond_repp; pthread_mutex_t ecasound_stop_mutex_repp; pthread_cond_t ecasound_exit_cond_repp; pthread_mutex_t ecasound_exit_mutex_repp; struct timeval multitrack_input_stamp_rep; }; #endif /* INCLUDED_ECA_ENGINE_IMPL_H */ ecasound-2.9.3/libecasound/audiofx_envelope_modulation.h0000644000076400007640000000644610664032032020515 00000000000000#ifndef INCLUDED_AUDIOFX_ENVELOPE_MODULATION_H #define INCLUDED_AUDIOFX_ENVELOPE_MODULATION_H #include #include "samplebuffer_iterators.h" #include "audiofx.h" /** * Virtual base for envelope modulation effects. * @author Rob Coker */ class EFFECT_ENV_MOD : public EFFECT_BASE { public: virtual ~EFFECT_ENV_MOD(void); }; /** * Pulse shaped gate * @author Rob Coker */ class EFFECT_PULSE_GATE: public EFFECT_ENV_MOD { SAMPLE_ITERATOR_INTERLEAVED i; parameter_t freq_rep; parameter_t on_time_rep; long int period_rep; long int on_from_rep; long int current_rep; public: virtual std::string name(void) const { return("Pulse Gate"); } virtual std::string parameter_names(void) const { return("freq-Hz,on-time-%"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_PULSE_GATE (parameter_t freq_Hz = 1.0, parameter_t onTime_percent = 50.0); virtual ~EFFECT_PULSE_GATE(void); EFFECT_PULSE_GATE* clone(void) const { return new EFFECT_PULSE_GATE(*this); } EFFECT_PULSE_GATE* new_expr(void) const { return new EFFECT_PULSE_GATE(); } /** @name Protected virtual functions to notify about changes * (Reimplemented from ECA_SAMPLERATE_AWARE) */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ }; /** * Wrapper class for pulse shaped gate providing * a beats-per-minute (bpm) based parameters. * * @author Kai Vehmanen */ class EFFECT_PULSE_GATE_BPM : public EFFECT_ENV_MOD { EFFECT_PULSE_GATE pulsegate_rep; public: virtual std::string name(void) const { return("Pulse gate BPM"); } virtual std::string parameter_names(void) const { return("bpm,on-time-msec"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_PULSE_GATE_BPM (parameter_t bpm = 120.0, parameter_t ontime_percent = 5.0); virtual ~EFFECT_PULSE_GATE_BPM(void); EFFECT_PULSE_GATE_BPM* clone(void) const { return new EFFECT_PULSE_GATE_BPM(*this); } EFFECT_PULSE_GATE_BPM* new_expr(void) const { return new EFFECT_PULSE_GATE_BPM(); } /** @name Protected virtual functions to notify about changes * (Reimplemented from ECA_SAMPLERATE_AWARE) */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t v); /*@}*/ }; /** * Tremolo * @author Rob Coker */ class EFFECT_TREMOLO: public EFFECT_ENV_MOD { SAMPLE_ITERATOR_INTERLEAVED i; parameter_t freq; parameter_t depth; parameter_t currentTime; parameter_t incrTime; public: virtual std::string name(void) const { return("Tremolo"); } virtual std::string parameter_names(void) const { return("bpm,depth-%"); } virtual void set_parameter(int param, parameter_t value); virtual parameter_t get_parameter(int param) const; virtual void init(SAMPLE_BUFFER *insample); virtual void process(void); EFFECT_TREMOLO (parameter_t freq_bpm = 60.0, parameter_t depth_percent = 100.0); virtual ~EFFECT_TREMOLO(void); EFFECT_TREMOLO* clone(void) const { return new EFFECT_TREMOLO(*this); } EFFECT_TREMOLO* new_expr(void) const { return new EFFECT_TREMOLO(); } }; #endif ecasound-2.9.3/libecasound/audio-stamp.h0000644000076400007640000000154310664032032015142 00000000000000#ifndef INCLUDED_AUDIO_STAMP_H #define INCLUDED_AUDIO_STAMP_H #include #include "samplebuffer.h" class AUDIO_STAMP { public: int id(void) const; void fetch_stamp(SAMPLE_BUFFER* x); AUDIO_STAMP(void); protected: void set_id(int n); void store(const SAMPLE_BUFFER* x); private: SAMPLE_BUFFER buffer_rep; int id_rep; bool id_set_rep; }; class AUDIO_STAMP_SERVER { public: void register_stamp(AUDIO_STAMP* stamp); void fetch_stamp(int id, SAMPLE_BUFFER* x); private: std::map stamp_map_rep; }; class AUDIO_STAMP_CLIENT { public: int id(void) const; void register_server(AUDIO_STAMP_SERVER* server); AUDIO_STAMP_CLIENT(void); protected: void set_id(int n); void fetch_stamp(SAMPLE_BUFFER* x); private: int id_rep; bool id_set_rep; AUDIO_STAMP_SERVER* server_repp; }; #endif ecasound-2.9.3/libecasound/layer.cpp0000644000076400007640000001276010664032032014371 00000000000000/* layer.cpp Created by SMF aka Antoine Laydier . Minor modifications by Kai Vehmanen . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*============================================================================= HEADERs =============================================================================*/ #include #include #include #include #include "layer.h" /*============================================================================= Class : Layers =============================================================================*/ const int Layer::MPG_MD_STEREO = 0; const int Layer::MPG_MD_JOINT_STEREO = 1; const int Layer::MPG_MD_DUAL_CHANNEL = 2; const int Layer::MPG_MD_MONO = 3; const int Layer::MPG_MD_LR_LR = 0; const int Layer::MPG_MD_LR_I = 1; const int Layer::MPG_MD_MS_LR = 2; const int Layer::MPG_MD_MS_I = 3; const char *Layer::mode_names[5] = {"stereo", "j-stereo", "dual-ch", "single-ch", "multi-ch"}; const char *Layer::layer_names[3] = {"I", "II", "III"}; const char *Layer::version_names[3] = {"MPEG-1", "MPEG-2 LSF", "MPEG-2.5"}; const char *Layer::version_nums[3] = {"1", "2", "2.5"}; const unsigned int Layer::bitrates[3][3][15] = { { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448}, {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384}, {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320} }, { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160} }, { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160} } }; const unsigned int Layer::s_freq[3][4] = { {44100, 48000, 32000, 0}, {22050, 24000, 16000, 0}, {11025, 8000, 8000, 0} }; const char * Layer::mode_name(void) { return (Layer::mode_names[mode_rep]); } const char * Layer::layer_name(void) { return (Layer::layer_names[lay_rep - 1]); } const char * Layer::version_name(void) { return (Layer::version_names[version_rep]); } const char * Layer::version_num(void) { return (Layer::version_nums[version_rep]); } int Layer::mode(void) { return(mode_rep); } unsigned int Layer::bitrate(void) { return (Layer::bitrates[version_rep][lay_rep - 1][bitrate_index_rep]); } unsigned int Layer::sfreq(void) { return (Layer::s_freq[version_rep][sampling_frequency_rep]); } unsigned long Layer::length(void) { return bitrate() ? (fileSize_rep / (unsigned long)bitrate() /125) : 0; } unsigned int Layer::pcmPerFrame(void) { return pcm_rep; } bool Layer::get(const char* filename) { unsigned char *buff = new unsigned char[1024]; unsigned char *buffer; size_t temp; size_t readsize; struct stat buf; FILE *file; // -- // 22.3.2000 - added the second parameter for getting // around FILE* compatibility issues, k@eca.cx stat(filename, &buf); fileSize_rep = (unsigned long)buf.st_size; /* Theoretically reading 1024 instead of just 4 means a performance hit * if we transfer over net filesystems... However, no filesystem I know * of uses block sizes under 1024 bytes. */ file = fopen(filename,"r"); if (!file) return(false); fseek(file, 0, SEEK_SET); readsize = fread(buff, 1, 1024, file); fclose(file); readsize -= 4; if (readsize <= 0) { delete[] buff; return (false); } buffer = buff-1; /* Scan through the block looking for a header */ do { buffer++; temp = ((buffer[0] << 4) & 0xFF0) | ((buffer[1] >> 4) & 0xE); } while ((temp != 0xFFE) && ((size_t)(buffer-buff)> 3 & 0x3)) { case 3: version_rep = 0; break; case 2: version_rep = 1; break; case 0: version_rep = 2; break; default: delete[] buff; return (false); } lay_rep = 4 - ((buffer[1] >> 1) & 0x3); error_protection_rep = !(buffer[1] & 0x1); bitrate_index_rep = (buffer[2] >> 4) & 0x0F; sampling_frequency_rep = (buffer[2] >> 2) & 0x3; padding_rep = (buffer[2] >> 1) & 0x01; extension_rep = buffer[2] & 0x01; mode_rep = (buffer[3] >> 6) & 0x3; mode_ext_rep = (buffer[3] >> 4) & 0x03; copyright_rep = (buffer[3] >> 3) & 0x01; original_rep = (buffer[3] >> 2) & 0x1; emphasis_rep = (buffer[3]) & 0x3; stereo_rep = (mode_rep == Layer::MPG_MD_MONO) ? 1 : 2; // Added by Cp pcm_rep = 32; if (lay_rep == 3) { pcm_rep *= 18; if (version_rep == 0) pcm_rep *= 2; } else{ pcm_rep *= 12; if (lay_rep == 2) pcm_rep *= 3; } delete[] buff; return (true); } } ecasound-2.9.3/libecasound/eca-session.cpp0000644000076400007640000004044611170072260015470 00000000000000// ------------------------------------------------------------------------ // eca-session.cpp: Ecasound runtime setup and parameters. // Copyright (C) 1999-2004,2007 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is fre software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "eca-resources.h" #include "eca-version.h" #include "eca-chain.h" #include "audiofx.h" #include "audioio.h" #include "audioio-mp3.h" #include "audioio-mikmod.h" #include "audioio-timidity.h" #include "audioio-ogg.h" #include "audioio-flac.h" #include "audioio-aac.h" #include "osc-gen-file.h" #include "eca-error.h" #include "eca-logger.h" #include "eca-logger.h" #include "eca-session.h" #include "eca-chainsetup.h" using std::string; using std::vector; ECA_SESSION::ECA_SESSION(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Session created (empty)"); connected_chainsetup_repp = 0; selected_chainsetup_repp = 0; cs_defaults_set_rep = false; } ECA_SESSION::~ECA_SESSION(void) { ECA_LOG_MSG(ECA_LOGGER::system_objects,"ECA_SESSION destructor-in"); for(std::vector::iterator q = chainsetups_rep.begin(); q != chainsetups_rep.end(); q++) { delete *q; } ECA_LOG_MSG(ECA_LOGGER::system_objects,"ECA_SESSION destructor-out"); } ECA_SESSION::ECA_SESSION(COMMAND_LINE& cline) throw(ECA_ERROR&) { int errors = 0; connected_chainsetup_repp = 0; selected_chainsetup_repp = 0; cs_defaults_set_rep = false; cline.combine(); std::vector options,csoptions; create_chainsetup_options(cline, &options); preprocess_options(&options); errors += interpret_general_options(options,&csoptions); /* NOTE: must be printed after general options are parsed * in case user has specified -q (quiet operation) */ ECA_LOG_MSG(ECA_LOGGER::system_objects, "Session created"); if (errors > 0) { throw(ECA_ERROR("ECA-SESSION", "Errors parsing session-level options. Unable to create session.")); } set_cs_param_defaults(); if (chainsetups_rep.size() == 0) { /* Try to create a valid chainsetup from the options given * on the command-line. */ ECA_CHAINSETUP* comline_setup = new ECA_CHAINSETUP(csoptions); if (comline_setup->interpret_result() != true) { string temp = comline_setup->interpret_result_verbose(); delete comline_setup; // std::cerr << "EXCEPTION DETECTED:'" << temp << "'. Core dump follows if you've compiled with gcc-3.3...\n"; throw(ECA_ERROR("ECA-SESSION", temp)); } else { add_chainsetup(comline_setup); /* ownership object transfered */ if (selected_chainsetup_repp == 0) { /* adding the chainsetup failed */ delete comline_setup; } else if (selected_chainsetup_repp->is_valid() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "NOTE: Unable to create a valid chainsetup from the command-line arguments."); } } } } /** * Sets defaults values for various chainsetup parameters * using ECA_RESOURCES class services. */ void ECA_SESSION::set_cs_param_defaults(void) { if (cs_defaults_set_rep != true) { // --- // Interpret resources ECA_RESOURCES ecaresources; string v; /* note: defaults specified in ecasoundrc(5) */ v = ecaresources.resource("ext-cmd-mp3-input"); if (v.size() > 0) MP3FILE::set_input_cmd(v); v = ecaresources.resource("ext-cmd-mp3-output"); if (v.size() > 0) MP3FILE::set_output_cmd(v); v = ecaresources.resource("ext-cmd-mikmod"); if (v.size() > 0) MIKMOD_INTERFACE::set_mikmod_cmd(v); v = ecaresources.resource("ext-cmd-timidity"); if (v.size() > 0) TIMIDITY_INTERFACE::set_timidity_cmd(v); v = ecaresources.resource("ext-cmd-ogg-input"); if (v.size() > 0) OGG_VORBIS_INTERFACE::set_input_cmd(v); v = ecaresources.resource("ext-cmd-ogg-output"); if (v.size() > 0) OGG_VORBIS_INTERFACE::set_output_cmd(v); v = ecaresources.resource("ext-cmd-flac-input"); if (v.size() > 0) FLAC_FORKED_INTERFACE::set_input_cmd(v); v = ecaresources.resource("ext-cmd-flac-output"); if (v.size() > 0) FLAC_FORKED_INTERFACE::set_output_cmd(v); v = ecaresources.resource("ext-cmd-aac-input"); if (v.size() > 0) AAC_FORKED_INTERFACE::set_input_cmd(v); v = ecaresources.resource("ext-cmd-aac-output"); if (v.size() > 0) AAC_FORKED_INTERFACE::set_output_cmd(v); cs_defaults_set_rep = true; } } /** * Add a new chainsetup * * require: * name.empty() != true * * ensure: * selected_chainsetup->name() == name || * chainsetup_names().size() has not changed */ void ECA_SESSION::add_chainsetup(const std::string& name) { // -------- DBC_REQUIRE(name != ""); // -------- set_cs_param_defaults(); ECA_CHAINSETUP* newsetup = new ECA_CHAINSETUP; newsetup->set_name(name); add_chainsetup(newsetup); if (selected_chainsetup_repp == 0) { /* adding the chainsetup failed */ delete newsetup; } // -------- DBC_ENSURE((selected_chainsetup_repp != 0 && selected_chainsetup_repp->name() == name) || selected_chainsetup_repp == 0); // -------- } /** * Add a new chainsetup. Ownership of the object given as argument * is passed along the call. If a chainsetup with the same name already * exists, the call will fail and the chainsetup given as argument * is deleted. * * require: * comline_setup != 0 * * ensure: * (selected_chainsetup_repp == comline_setup && * static_cast(chainsetups_rep.size()) == old_size + 1) || * (selected_chainsetup_repp == 0 && * static_cast(chainsetups_rep.size()) == old_size) */ void ECA_SESSION::add_chainsetup(ECA_CHAINSETUP* comline_setup) { // -------- DBC_REQUIRE(comline_setup != 0); DBC_DECLARE(int old_size = chainsetups_rep.size()); // -------- selected_chainsetup_repp = comline_setup; set_cs_param_defaults(); std::vector::const_iterator p = chainsetups_rep.begin(); while(p != chainsetups_rep.end()) { if ((*p)->name() == comline_setup->name()) { ECA_LOG_MSG(ECA_LOGGER::info, "Unable to add chainsetup, chainsetup with the same name already exists."); selected_chainsetup_repp = 0; break; } ++p; } if (selected_chainsetup_repp != 0) { chainsetups_rep.push_back(selected_chainsetup_repp); } // -------- DBC_ENSURE((selected_chainsetup_repp == comline_setup && static_cast(chainsetups_rep.size()) == old_size + 1) || (selected_chainsetup_repp == 0 && static_cast(chainsetups_rep.size()) == old_size)); // -------- } /** * Removes selected chainsetup * * require: * connected_chainsetup != selected_chainsetup * * ensure: * selected_chainsetup == 0 */ void ECA_SESSION::remove_chainsetup(void) { // -------- // require: DBC_REQUIRE(connected_chainsetup_repp != selected_chainsetup_repp); // -------- std::vector::iterator p = chainsetups_rep.begin(); while(p != chainsetups_rep.end()) { if (*p == selected_chainsetup_repp) { selected_chainsetup_repp = 0; delete *p; chainsetups_rep.erase(p); break; } ++p; } // -------- DBC_ENSURE(selected_chainsetup_repp == 0); // -------- } void ECA_SESSION::select_chainsetup(const std::string& name) { // -------- // require: DBC_REQUIRE(name.empty() != true); // -------- selected_chainsetup_repp = 0; std::vector::const_iterator p = chainsetups_rep.begin(); while(p != chainsetups_rep.end()) { if ((*p)->name() == name) { // ECA_LOG_MSG(ECA_LOGGER::system_objects, "Chainsetup \"" + name + "\" selected."); selected_chainsetup_repp = *p; break; } ++p; } // -------- DBC_ENSURE(selected_chainsetup_repp == 0 || selected_chainsetup_repp->name() == name); // -------- } void ECA_SESSION::save_chainsetup(void) throw(ECA_ERROR&) { // -------- // require: DBC_REQUIRE(selected_chainsetup_repp != 0); // -------- selected_chainsetup_repp->save(); } void ECA_SESSION::save_chainsetup(const std::string& filename) throw(ECA_ERROR&) { // -------- // require: DBC_REQUIRE(selected_chainsetup_repp != 0 && filename.empty() != true); // -------- selected_chainsetup_repp->save_to_file(filename); } /** * Load a chainsetup from file (ecs). If operation fails, * selected_chainsetup_repp == 0, ie. no chainsetup * selected. * * @post (selected_chainsetup_repp != 0 && * selected_chainsetup_repp->filename() == filename || * selected_chainsetup_repp == 0) */ void ECA_SESSION::load_chainsetup(const std::string& filename) { // -------- DBC_REQUIRE(filename.empty() != true); // -------- set_cs_param_defaults(); ECA_CHAINSETUP* new_setup = new ECA_CHAINSETUP(filename); if (new_setup->interpret_result() != true) { string temp = new_setup->interpret_result_verbose(); delete new_setup; selected_chainsetup_repp = 0; ECA_LOG_MSG(ECA_LOGGER::info, "Error loading chainsetup: " + temp); } else { add_chainsetup(new_setup); if (selected_chainsetup_repp == 0) { /* adding the chainsetup failed */ delete new_setup; } } // -------- DBC_ENSURE((selected_chainsetup_repp != 0 && selected_chainsetup_repp->filename() == filename) || selected_chainsetup_repp == 0); // -------- } void ECA_SESSION::connect_chainsetup(void) throw(ECA_ERROR&) { // -------- DBC_REQUIRE(selected_chainsetup_repp != 0); DBC_REQUIRE(selected_chainsetup_repp->is_valid()); // -------- ECA_LOG_MSG(ECA_LOGGER::user_objects, "Connecting chainsetup"); if (selected_chainsetup_repp == connected_chainsetup_repp) return; if (connected_chainsetup_repp != 0) { disconnect_chainsetup(); } /** * enable() throws an exception if it wasn't possibly * to open/activate all input and output objects */ selected_chainsetup_repp->enable(); connected_chainsetup_repp = selected_chainsetup_repp; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Chainsetup connected"); // -------- // ensure: DBC_ENSURE(selected_chainsetup_repp == connected_chainsetup_repp); // -------- } void ECA_SESSION::disconnect_chainsetup(void) { // -------- DBC_REQUIRE(connected_chainsetup_repp != 0); // -------- connected_chainsetup_repp->disable(); connected_chainsetup_repp = 0; ECA_LOG_MSG(ECA_LOGGER::user_objects, "Chainsetup disconnected"); // -------- DBC_ENSURE(connected_chainsetup_repp == 0); // -------- } std::vector ECA_SESSION::chainsetup_names(void) const { std::vector result; std::vector::const_iterator p = chainsetups_rep.begin(); while(p != chainsetups_rep.end()) { result.push_back((*p)->name()); ++p; } return result; } void ECA_SESSION::create_chainsetup_options(COMMAND_LINE& cline, std::vector* options) { cline.begin(); cline.next(); // skip the program name while(cline.end() == false) { options->push_back(cline.current()); cline.next(); } } /** * Tests whether the given argument is a session-level option. */ bool ECA_SESSION::is_session_option(const std::string& arg) const { if (arg.size() < 2 || arg[0] != '-') return false; switch(arg[1]) { case 'R': case 'd': case 'q': return true; case 's': if (arg.size() > 2 && arg[2] == ':') return true; } return false; } /** * Preprocesses a set of options. * * Notes! See also ECA_CHAINSETUP_PARSER::preprocess_options() * * ensure: * all options valid for further processing (all options * must start with a '-' sign) */ void ECA_SESSION::preprocess_options(std::vector* opts) { std::vector::iterator p = opts->begin(); while(p != opts->end()) { if (p->size() > 0 && (*p)[0] != '-') { /* hack1: options ending with .ecs as "-s:file.ecs" */ string::size_type pos = p->find(".ecs"); if (pos + 4 == p->size()) { ECA_LOG_MSG(ECA_LOGGER::info, "NOTE: Interpreting option " + *p + " as -s:" + *p + "."); *p = "-s:" + *p; } } ++p; } } /** * Interprets all session specific options from 'inopts'. * All unprocessed options are copied to 'outopts'. * * @return number of parsing errors */ int ECA_SESSION::interpret_general_options(const std::vector& inopts, std::vector* outopts) { int errors = 0; std::vector::const_iterator p = inopts.begin(); while(p != inopts.end()) { if (p->size() > 0 && (*p)[0] == '-') errors += interpret_general_option(*p); ++p; } p = inopts.begin(); while(p != inopts.end()) { if (p->size() > 0 && (*p)[0] == '-') errors += interpret_chainsetup_option(*p); if (is_session_option(*p) != true) outopts->push_back(*p); ++p; } return errors; } /** * Parses session option 'argu'. * * See also is_session_parameter() * * @return number of parsing errors */ int ECA_SESSION::interpret_general_option (const std::string& argu) { if (argu.size() < 2) return 0; if (argu[0] != '-') return 0; switch(argu[1]) { case 'd': { if (argu.size() > 2 && argu[2] == ':') { /* argu == "-d:XXX" */ ECA_LOGGER::instance().set_log_level_bitmask(atoi(kvu_get_argument_number(1, argu).c_str())); } else { /* argu == "-dXXX" */ ECA_LOGGER::instance().set_log_level_bitmask(0); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::errors, 1); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::info, 1); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::subsystems, 1); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::module_names, 1); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::user_objects, 1); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::eiam_return_values, 1); if (argu.size() > 2 && argu[2] == 'd') { /* argu == "-dd" */ ECA_LOGGER::instance().set_log_level(ECA_LOGGER::system_objects, 1); if (argu.size() > 3 && argu[3] == 'd') { /* argu == "-ddd" */ ECA_LOGGER::instance().set_log_level(ECA_LOGGER::functions, 1); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::continuous, 1); } } } MESSAGE_ITEM mtempd; mtempd << "Set debug level to: " << ECA_LOGGER::instance().get_log_level_bitmask(); ECA_LOG_MSG(ECA_LOGGER::info, mtempd.to_string()); break; } case 'R': { string tname = kvu_get_argument_number(1, argu); /* note: options are normalized, so ':' is always present * if there are any argument to an option */ if (argu.size() > 2 && argu[2] == ':') { ECA_RESOURCES::rc_override_file = tname; cs_defaults_set_rep = false; ECA_LOG_MSG(ECA_LOGGER::info, "Using resource file \"" + tname + "\". Disabling use of global/user resource files."); } } break; case 'q': ECA_LOGGER::instance().disable(); break; default: { } } return 0; } /** * Parses session chainsetup option 'argu'. * * @return number of parsing errors */ int ECA_SESSION::interpret_chainsetup_option (const std::string& argu) { int errors = 0; if (argu.size() == 0) return errors; string tname = kvu_get_argument_number(1, argu); if (argu.size() < 2) return errors; switch(argu[1]) { case 's': { if (argu.size() > 2 && argu[2] == ':') { load_chainsetup(tname); if (selected_chainsetup_repp == 0 || selected_chainsetup_repp->is_valid_for_connection(true) != true) { ECA_LOG_MSG(ECA_LOGGER::info, "Chainsetup loaded from \"" + tname + "\" is not valid!"); ++errors; } } break; } default: { } } return errors; } ecasound-2.9.3/libecasound/eca-object-factory.h0000644000076400007640000000704111740524567016376 00000000000000#ifndef INCLUDED_ECA_OBJECT_FACTORY_H #define INCLUDED_ECA_OBJECT_FACTORY_H #include #include #include #include /** * Forward declarations */ class AUDIO_IO; class CHAIN_OPERATOR; class ECA_AUDIO_FORMAT; class ECA_OBJECT; class ECA_OBJECT_MAP; class ECA_PRESET_MAP; class EFFECT_LADSPA; class GENERIC_CONTROLLER; class OPERATOR; class LOOP_DEVICE; class MIDI_IO; class PRESET; /** * Abstract factory for creating libecasound objects. * Implemented as a static singleton class. * * Related design patterns: * - Abstract Factory (GoF87) * - Singleton (GoF127) * * @author Kai Vehmanen */ class ECA_OBJECT_FACTORY { public: /** * @name Functions for accessing object map instances * * Note! Return value is a reference to avoid * accidental deletion of the singleton objects. **/ /*@{*/ static ECA_OBJECT_MAP& audio_io_rt_map(void); static ECA_OBJECT_MAP& audio_io_nonrt_map(void); static ECA_OBJECT_MAP& chain_operator_map(void); static ECA_OBJECT_MAP& lv2_plugin_map(void); static ECA_OBJECT_MAP& ladspa_plugin_map(void); static ECA_OBJECT_MAP& ladspa_plugin_id_map(void); static ECA_PRESET_MAP& preset_map(void); static ECA_OBJECT_MAP& controller_map(void); static ECA_OBJECT_MAP& midi_device_map(void); /*@}*/ /** @name Functions for creating objects based on EOS (Ecasound Option Syntax) strings. */ /*@{*/ static AUDIO_IO* create_audio_object(const std::string& arg); static MIDI_IO* create_midi_device(const std::string& arg); static AUDIO_IO* create_loop_output(const std::string& argu, std::map* loop_map); static AUDIO_IO* create_loop_input(const std::string& argu, std::map* loop_map); static CHAIN_OPERATOR* create_chain_operator (const std::string& arg); static CHAIN_OPERATOR* create_ladspa_plugin (const std::string& arg); static CHAIN_OPERATOR* create_lv2_plugin (const std::string& arg); static GENERIC_CONTROLLER* create_controller (const std::string& arg); /*@}*/ /** @name Functions for creating EOS strings */ /*@{*/ static std::string probe_default_output_device(void); /*@}*/ /** @name Functions for describing existing objects with EOS strings */ /*@{*/ static std::string chain_operator_to_eos(const CHAIN_OPERATOR* chainop); static std::string controller_to_eos(const GENERIC_CONTROLLER* gctrl); static std::string operator_parameters_to_eos(const OPERATOR* chainop); static std::string audio_format_to_eos(const ECA_AUDIO_FORMAT* aformat); static std::string audio_object_to_eos(const AUDIO_IO* aiod, const std::string& direction); static std::string audio_object_format_to_eos(const AUDIO_IO* aiod); /*@}*/ private: static ECA_OBJECT_MAP* audio_io_rt_map_repp; static ECA_OBJECT_MAP* audio_io_nonrt_map_repp; static ECA_OBJECT_MAP* chain_operator_map_repp; static ECA_OBJECT_MAP* lv2_plugin_map_repp; static ECA_OBJECT_MAP* ladspa_plugin_map_repp; static ECA_OBJECT_MAP* ladspa_plugin_id_map_repp; static ECA_PRESET_MAP* preset_map_repp; static ECA_OBJECT_MAP* controller_map_repp; static ECA_OBJECT_MAP* midi_device_map_repp; static pthread_mutex_t lock_rep; /** * @name Constructors and destructors * * To prevent accidental use, located in private scope and * without a valid definition. */ /*@{*/ ECA_OBJECT_FACTORY(void); ECA_OBJECT_FACTORY(const ECA_OBJECT_FACTORY&); ECA_OBJECT_FACTORY& operator=(const ECA_OBJECT_FACTORY&); ~ECA_OBJECT_FACTORY(void); /*@}*/ }; #endif /* INCLUDED_ECA_OBJECT_FACTORY_H */ ecasound-2.9.3/libecasound/eca-logger.h0000644000076400007640000000660411067734242014741 00000000000000#ifndef INCLUDE_ECA_LOGGER_H #define INCLUDE_ECA_LOGGER_H #include #include /** * Forward declarations */ class ECA_LOGGER_INTERFACE; /** * A logging subsystem implemented as a singleton * class. * * Related design patterns: * - Singleton (GoF127) * * @author Kai Vehmanen */ class ECA_LOGGER { public: /** * Log level is a bitmasked integer value that is used to * categorize different log message types. * * disabled = no output * * errors = error messages * * info = high-level info about user-visible objects * and concepts, warning messages; low volume * * subsystems = notifications of control flow transitions * between high-level subsystems; low volume * * module_names = include module names in log output * * user_objects = info about user-visible objects (audio i/o, * chain operators, controllers); high volume * * system_objects = info about internal objects; high volume * * functions = info about internal operation of individual * functions and algorithms; high volume bursts * * continuous = debug info printed for during processing; * continuous high volume * * eiam_return_values = return values for EIAM commands * * @see level_to_string() */ typedef enum { disabled = 0, errors = 1, info = 2, subsystems = 4, module_names = 8, user_objects = 16, system_objects = 32, functions = 64, continuous = 128, eiam_return_values = 256 } Msg_level_t; /** * Returns a reference to a logging system * implementation object. * * Note! Return value is a reference to * avoid accidental deletion of * the singleton object. */ static ECA_LOGGER_INTERFACE& instance(void); /** * Replace the default logging sybsystem * with a custom implementation. * * Note! Ownership of 'logger' is transferred * to the singleton object. */ static void attach_logger(ECA_LOGGER_INTERFACE* logger); /** * Detaches the current logger implementation. */ static void detach_logger(void); /** * Returns description of log level 'arg'. */ static const char* level_to_string(Msg_level_t arg); private: static ECA_LOGGER_INTERFACE* interface_impl_repp; static pthread_mutex_t lock_rep; /** * @name Constructors and destructors * * To prevent accidental use, located in private scope and * without a valid definition. */ /*@{*/ ECA_LOGGER(void); ECA_LOGGER(const ECA_LOGGER&); ECA_LOGGER& operator=(const ECA_LOGGER&); ~ECA_LOGGER(void); /*@}*/ }; /** * Macro definitions */ /** * Issues a log message. * * @param x log level, type 'ECA_LOGGER::Msg_level_t' * @param y log message, type 'const std:string&' */ #define ECA_LOG_MSG(x,y) \ do { ECA_LOGGER::instance().msg(x, __FILE__, y); } while(0) /** * Issue a log message, but do not print out the module prefix. * A variant of ECA_LOG_MSG(). */ #define ECA_LOG_MSG_NOPREFIX(x,y) \ do { ECA_LOGGER::instance().msg(x, std::string(), y); } while(0) /** * To make ECA_LOG_MSG work we need to include the * public interface ECA_LOGGER_INTERFACE. */ #include "eca-logger-interface.h" #endif /* INCLUDE_ECA_LOGGER_H */ ecasound-2.9.3/libecasound/audiofx_analysis.cpp0000644000076400007640000002704211747067761016642 00000000000000// ------------------------------------------------------------------------ // audiofx_analysis.cpp: Classes for signal analysis // Copyright (C) 1999-2002,2008 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include "samplebuffer_iterators.h" #include "audiofx_analysis.h" #include "audiofx_amplitude.h" #include "eca-logger.h" #include "eca-error.h" using namespace std; static string priv_align_right(const string txt, int width, char padchar) { string res; int pad = width - static_cast(txt.size()); if (pad > 0) { res.resize(pad, padchar); } return res + txt; } struct bucket { const char *name; SAMPLE_SPECS::sample_t threshold; }; #define BUCKET_ENTRY_DB(x) \ { #x, EFFECT_AMPLITUDE::db_to_linear(x) } static struct bucket bucket_table[] = { BUCKET_ENTRY_DB(3), BUCKET_ENTRY_DB(0), BUCKET_ENTRY_DB(-0.1), BUCKET_ENTRY_DB(-3), BUCKET_ENTRY_DB(-6), BUCKET_ENTRY_DB(-10), BUCKET_ENTRY_DB(-20), BUCKET_ENTRY_DB(-30), BUCKET_ENTRY_DB(-60), { "-inf", -1 } }; EFFECT_ANALYSIS::~EFFECT_ANALYSIS(void) { } EFFECT_VOLUME_BUCKETS::EFFECT_VOLUME_BUCKETS (void) { reset_all_stats(); int res = pthread_mutex_init(&lock_rep, NULL); DBC_CHECK(res == 0); } EFFECT_VOLUME_BUCKETS::~EFFECT_VOLUME_BUCKETS (void) { } void EFFECT_VOLUME_BUCKETS::status_entry(const std::vector& buckets, std::string& otemp) const { /* note: is called with 'lock_rep' taken */ for(unsigned int n = 0; n < buckets.size(); n++) { string samples = kvu_numtostr(buckets[n]); otemp += priv_align_right(samples, 8, '_'); #if NEVER_USED_PRINT_PERCENTAGE otemp += " ("; otemp += priv_align_right(kvu_numtostr(100.0f * buckets[n] / num_of_samples[n], 2), 6, '_'); otemp += "%)"; #endif if (n != buckets.size()) otemp += " "; } } void EFFECT_VOLUME_BUCKETS::reset_all_stats(void) { reset_period_stats(); max_pos = max_neg = 0.0f; } void EFFECT_VOLUME_BUCKETS::reset_period_stats(void) { for(unsigned int nm = 0; nm < pos_samples_db.size(); nm++) for(unsigned int ch = 0; ch < pos_samples_db[nm].size(); ch++) pos_samples_db[nm][ch] = 0; for(unsigned int nm = 0; nm < neg_samples_db.size(); nm++) for(unsigned int ch = 0; ch < neg_samples_db[nm].size(); ch++) neg_samples_db[nm][ch] = 0; for(unsigned int nm = 0; nm < num_of_samples.size(); nm++) num_of_samples[nm] = 0; } string EFFECT_VOLUME_BUCKETS::status(void) const { int res = pthread_mutex_lock(&lock_rep); DBC_CHECK(res == 0); std::string status_str; status_str = "-- Amplitude statistics --\n"; status_str += "Pos/neg, count,(%), ch1...n"; for(unsigned j = 0; j < pos_samples_db.size(); j++) { status_str += std::string("\nPos ") + priv_align_right(bucket_table[j].name, 4, ' ') + "dB: "; status_entry(pos_samples_db[j], status_str); } for(unsigned int j = neg_samples_db.size(); j > 0; j--) { status_str += std::string("\nNeg ") + priv_align_right(bucket_table[j-1].name, 4, ' ') + "dB: "; status_entry(neg_samples_db[j-1], status_str); } status_str += std::string("\nTotal.....: "); status_entry(num_of_samples, status_str); status_str += "\n"; status_str += "(audiofx) Peak amplitude: pos=" + kvu_numtostr(max_pos,5) + " neg=" + kvu_numtostr(max_neg,5) + ".\n"; status_str += "(audiofx) Max gain without clipping: " + kvu_numtostr(max_multiplier(),5) + ".\n"; status_str += "(audiofx) -- End of statistics --\n"; res = pthread_mutex_unlock(&lock_rep); DBC_CHECK(res == 0); return status_str; } void EFFECT_VOLUME_BUCKETS::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { switch(param) { case 1: pd->default_value = 0; pd->description = get_parameter_name(param); pd->bounded_above = true; pd->upper_bound = 1.0; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = true; pd->integer = true; pd->logarithmic = false; pd->output = false; break; case 2: pd->default_value = 1.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = false; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = true; break; } } void EFFECT_VOLUME_BUCKETS::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { return; } CHAIN_OPERATOR::parameter_t EFFECT_VOLUME_BUCKETS::get_parameter(int param) const { switch (param) { case 1: /* note: always enabled since 2.7.0, but keeping the parameter * still for backwards compatibility */ return 1.0f; case 2: return max_multiplier(); } return 0.0; } CHAIN_OPERATOR::parameter_t EFFECT_VOLUME_BUCKETS::max_multiplier(void) const { parameter_t k; SAMPLE_SPECS::sample_t max_peak = max_pos; if (max_neg > max_pos) max_peak = max_neg; if (max_peak != 0.0f) k = SAMPLE_SPECS::max_amplitude / max_peak; else k = 0.0f; return k; } void EFFECT_VOLUME_BUCKETS::init(SAMPLE_BUFFER* insample) { int res = pthread_mutex_lock(&lock_rep); DBC_CHECK(res == 0); i.init(insample); set_channels(insample->number_of_channels()); DBC_CHECK(channels() == insample->number_of_channels()); num_of_samples.resize(insample->number_of_channels(), 0); int entries = sizeof(bucket_table) / sizeof(struct bucket); pos_samples_db.resize(entries, std::vector (channels())); neg_samples_db.resize(entries, std::vector (channels())); reset_all_stats(); res = pthread_mutex_unlock(&lock_rep); DBC_CHECK(res == 0); EFFECT_ANALYSIS::init(insample); } void EFFECT_VOLUME_BUCKETS::process(void) { DBC_CHECK(static_cast(num_of_samples.size()) == channels()); int res = pthread_mutex_trylock(&lock_rep); if (res == 0) { i.begin(); while(!i.end()) { DBC_CHECK(num_of_samples.size() > static_cast(i.channel())); num_of_samples[i.channel()]++; if (*i.current() >= 0) { if (*i.current() > max_pos) max_pos = *i.current(); for(unsigned j = 0; j < pos_samples_db.size(); j++) { if (*i.current() > bucket_table[j].threshold) { pos_samples_db[j][i.channel()]++; break; } } } else { if (-(*i.current()) > max_neg) max_neg = -(*i.current()); for(unsigned j = 0; j < neg_samples_db.size(); j++) { if (*i.current() < -bucket_table[j].threshold) { neg_samples_db[j][i.channel()]++; break; } } } i.next(); } res = pthread_mutex_unlock(&lock_rep); DBC_CHECK(res == 0); } // else { std::cerr << "(audiofx_analysis) lock taken, skipping process().\n"; } } EFFECT_VOLUME_PEAK::EFFECT_VOLUME_PEAK (void) { max_amplitude_repp = 0; } EFFECT_VOLUME_PEAK::~EFFECT_VOLUME_PEAK (void) { if (max_amplitude_repp != 0) { delete[] max_amplitude_repp; max_amplitude_repp = 0; } } void EFFECT_VOLUME_PEAK::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { if (param > 0 && param <= channels()) { pd->default_value = 0; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->bounded_below = true; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = true; } } std::string EFFECT_VOLUME_PEAK::parameter_names(void) const { string params; for(int n = 0; n < channels(); n++) { params += "peak-amplitude-ch" + kvu_numtostr(n + 1); if (n + 1 < channels()) params += ","; } return params; } void EFFECT_VOLUME_PEAK::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { } CHAIN_OPERATOR::parameter_t EFFECT_VOLUME_PEAK::get_parameter(int param) const { if (param > 0 && param <= channels()) { parameter_t temp = max_amplitude_repp[param - 1]; max_amplitude_repp[param - 1] = 0.0f; return temp; } return 0.0f; } void EFFECT_VOLUME_PEAK::init(SAMPLE_BUFFER* insample) { i.init(insample); if (max_amplitude_repp != 0) { delete[] max_amplitude_repp; max_amplitude_repp = 0; } max_amplitude_repp = new parameter_t [insample->number_of_channels()]; set_channels(insample->number_of_channels()); } void EFFECT_VOLUME_PEAK::process(void) { i.begin(); while(!i.end()) { SAMPLE_SPECS::sample_t abscurrent = std::fabs(*i.current()); DBC_CHECK(i.channel() >= 0); DBC_CHECK(i.channel() < channels()); if (abscurrent > max_amplitude_repp[i.channel()]) { max_amplitude_repp[i.channel()] = std::fabs(*i.current()); } i.next(); } } EFFECT_DCFIND::EFFECT_DCFIND (void) { } string EFFECT_DCFIND::status(void) const { MESSAGE_ITEM mitem; mitem.setprecision(5); mitem << "(audiofx) Optimal value for DC-adjust: "; mitem << get_deltafix(SAMPLE_SPECS::ch_left) << " (left), "; mitem << get_deltafix(SAMPLE_SPECS::ch_right) << " (right)."; return mitem.to_string(); } string EFFECT_DCFIND::parameter_names(void) const { std::vector t; for(int n = 0; n < channels(); n++) { t.push_back("result-offset-ch" + kvu_numtostr(n + 1)); } return kvu_vector_to_string(t, ","); } CHAIN_OPERATOR::parameter_t EFFECT_DCFIND::get_deltafix(int channel) const { SAMPLE_SPECS::sample_t deltafix; if (channel < 0 || channel >= static_cast(pos_sum.size()) || channel >= static_cast(neg_sum.size())) return 0.0; if (pos_sum[channel] > neg_sum[channel]) deltafix = -(pos_sum[channel] - neg_sum[channel]) / num_of_samples[channel]; else deltafix = (neg_sum[channel] - pos_sum[channel]) / num_of_samples[channel]; return (CHAIN_OPERATOR::parameter_t)deltafix; } void EFFECT_DCFIND::parameter_description(int param, struct PARAM_DESCRIPTION *pd) const { pd->default_value = 0.0f; pd->description = get_parameter_name(param); pd->bounded_above = false; pd->upper_bound = 0.0f; pd->bounded_below = false; pd->lower_bound = 0.0f; pd->toggled = false; pd->integer = false; pd->logarithmic = false; pd->output = true; } void EFFECT_DCFIND::set_parameter(int param, CHAIN_OPERATOR::parameter_t value) { } CHAIN_OPERATOR::parameter_t EFFECT_DCFIND::get_parameter(int param) const { return get_deltafix(param-1); } void EFFECT_DCFIND::init(SAMPLE_BUFFER *insample) { i.init(insample); set_channels(insample->number_of_channels()); pos_sum.resize(channels()); neg_sum.resize(channels()); num_of_samples.resize(channels()); } void EFFECT_DCFIND::process(void) { i.begin(); while(!i.end()) { tempval = *i.current(); if (tempval > SAMPLE_SPECS::silent_value) pos_sum[i.channel()] += tempval; else neg_sum[i.channel()] += fabs(tempval); num_of_samples[i.channel()]++; i.next(); } } ecasound-2.9.3/libecasound/eca-logger-wellformed.cpp0000644000076400007640000000550610664032032017420 00000000000000// ------------------------------------------------------------------------ // eca-logger-wellformed.cpp: Logging implementation that outputs // messages in a well-formed format. // Copyright (C) 2002-2004 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "eca-logger-wellformed.h" using namespace std; ECA_LOGGER_WELLFORMED::ECA_LOGGER_WELLFORMED(void) { } ECA_LOGGER_WELLFORMED::~ECA_LOGGER_WELLFORMED(void) { } /** * Prints the given log message in well-formed * format. * * See section "Ecasound Interactive Mode - * Well-Formed Output Mode" in the Ecasound * Programmer's Guide for more detailed documentation. */ void ECA_LOGGER_WELLFORMED::do_msg(ECA_LOGGER::Msg_level_t level, const string& module_name, const string& log_message) { if (is_log_level_set(level) == true) { cout << ECA_LOGGER_WELLFORMED::create_wellformed_message(level, log_message); } } void ECA_LOGGER_WELLFORMED::do_flush(void) { } void ECA_LOGGER_WELLFORMED::do_log_level_changed(void) { } string ECA_LOGGER_WELLFORMED::create_wellformed_message(ECA_LOGGER::Msg_level_t level, const string& message) { string result, rettype; string::const_iterator p = message.begin(); size_t msglen = message.size(); /* 1. loglevel */ result += kvu_numtostr(static_cast(level)); /* 2. space */ result += " "; if (level == ECA_LOGGER::eiam_return_values) { while(p != message.end()) { msglen--; if (isspace(*p) != 0) { rettype = string(message.begin(), p); p++; /* skip space to reach start of actual msg */ break; } ++p; } } /* 3. message size */ result += kvu_numtostr(msglen); if (level == ECA_LOGGER::eiam_return_values) { /* 4. space */ result += " "; /* 5. return type */ result += rettype; } /* 6. contentblock */ result += "\r\n"; result += string(p,message.end()); result += "\r\n\r\n"; return result; } ecasound-2.9.3/libecasound/eca-engine-driver.h0000644000076400007640000000322311560606715016213 00000000000000#ifndef INCLUDED_ECA_ENGINE_DRIVER_H #define INCLUDED_ECA_ENGINE_DRIVER_H class ECA_ENGINE; class ECA_CHAINSETUP; /** * Virtual base class for implementing ecasound * engine driver objects. * * Drivers are used to synchronize engine * execution to external timing sources. * For example soundcard's interrupt generation * can serve as a driver. * * @author Kai Vehmanen */ class ECA_ENGINE_DRIVER { public: /** @name Public API for driver execution */ /*@{*/ /** * Launches the driver. Returns an error if any problems are * detected during drier operation. * * @pre engine != 0 * @pre engine->is_valid() == true * @pre engine->connected_chainsetup() == csetup * @return zero on success; -1 on error */ virtual int exec(ECA_ENGINE* engine, ECA_CHAINSETUP* csetup) = 0; /*@}*/ /** @name Public API for external requests */ /*@{*/ /** * Signals that driver should start operating * the engine. Once started, driver is allowed * to call ECA_ENGINE functions. */ virtual void start(void) = 0; /** * Signals that driver should stop operation. * Once stopped, driver must not call * any non-const ECA_ENGINE functions. * * @param drain whether to block until all queued data is processed * by realtime devices before stopping */ virtual void stop(bool drain = false) = 0; /** * Signals that driver should stop operation * and return from its exec() method. * After exiting, driver must not call any * ECA_ENGINE functions. */ virtual void exit(void) = 0; /*@}*/ virtual ~ECA_ENGINE_DRIVER(void) {} }; #endif /* INCLUDED_ECA_ENGINE_DRIVER_H */ ecasound-2.9.3/libecasound/libecasound_tester.cpp0000644000076400007640000000576311170171737017151 00000000000000// ------------------------------------------------------------------------ // libecasound_tester.cpp: Runs all tests registered to ECA_TEST_REPOSITORY // Copyright (C) 2002-2003,2009 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include /* POSIX: various signal functions */ #include /* POSIX: sleep() */ #include "eca-logger.h" #include "eca-test-repository.h" using namespace std; /** * See also 'ecasound/testsuite/eca_test1.cpp' */ int main(int argc, char *argv[]) { ECA_LOGGER::instance().set_log_level_bitmask(ECA_LOGGER::errors | ECA_LOGGER::info); /** * Uncomment to enable libecasound log messages */ //ECA_LOGGER::instance().set_log_level(ECA_LOGGER::user_objects, true); ECA_TEST_REPOSITORY& repo = ECA_TEST_REPOSITORY::instance(); #ifdef __FreeBSD__ { /* on FreeBSD, SIGFPEs are not ignored by default */ struct sigaction blockaction; blockaction.sa_flags = 0; blockaction.sa_handler = SIG_IGN; sigaction(SIGFPE, &blockaction, 0); } #endif cout << "-------------------------------------------------------------------------" << endl; cout << "libecasound_tester start:" << endl; cout << "-------------------------------------------------------------------------" << endl; if (argc > 1) /* note: run one test case */ repo.run(std::string(argv[1])); else /* note: run all test cases */ repo.run(); cout << "-------------------------------------------------------------------------" << endl; cout << "libecasound_tester summary:" << endl; cout << "-------------------------------------------------------------------------" << endl; cout << endl; if (repo.success() != true) { cout << repo.failures().size() << " failed test cases "; cout << "in ECA_TEST_REPOSITORY:" << endl << endl; const list& failures = repo.failures(); list::const_iterator q = failures.begin(); int n = 1; while(q != failures.end()) { cout << n++ << ". " << *q << endl; ++q; } return -1; } else { cout << "All tests succesful." << endl; } cout << endl; cout << "-------------------------------------------------------------------------"; cout << endl << endl; return 0; } ecasound-2.9.3/libecasound/eca-chainsetup-position.h0000644000076400007640000000361211032763261017456 00000000000000#ifndef INCLUDED_ECA_CONTROL_POSITION_H #define INCLUDED_ECA_CONTROL_POSITION_H #include "sample-specs.h" #include "eca-audio-position.h" /** * Virtual class implementing position and * length related chainsetup features. */ class ECA_CHAINSETUP_POSITION : public ECA_AUDIO_POSITION { public: /** @name Init and cleaup */ /*@{*/ ECA_CHAINSETUP_POSITION(void); virtual ~ECA_CHAINSETUP_POSITION(void); /*@}*/ /** @name Public getter/setter functions for max length information. * Note that this length information is different from * that defined in ECA_AUDIO_POSITION. Max length can be * set by the users of this class, and can be either shorter * or longer than the actual length. */ /*@{*/ void set_max_length_in_samples(SAMPLE_SPECS::sample_pos_t pos); void set_max_length_in_seconds(double pos_in_seconds); inline bool is_over_max_length(void) const { return((position_in_samples() > max_length_in_samples() && max_length_set() == true) ? true : false); } SAMPLE_SPECS::sample_pos_t max_length_in_samples(void) const; double max_length_in_seconds_exact(void) const; bool max_length_set(void) const { return(max_length_set_rep); } /*@}*/ /** @name Functions reimplemented from ECA_SAMPLERATE_AWARE */ /*@{*/ virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value); /*@}*/ /** @name Functions implemented from ECA_AUDIO_POSITION */ /*@{*/ virtual bool supports_seeking(void) const { return true; } virtual bool supports_seeking_sample_accurate(void) const { return true; } /*@}*/ protected: /** @name Protected functions for controlling looping */ /*@{*/ void toggle_looping(bool v) { looping_rep = v; } bool looping_enabled(void) const { return(looping_rep); } /*@}*/ private: bool looping_rep, max_length_set_rep; SAMPLE_SPECS::sample_pos_t max_length_in_samples_rep; }; #endif ecasound-2.9.3/libecasound/audioio-acseq.cpp0000644000076400007640000001444711433027220016002 00000000000000// ------------------------------------------------------------------------ // audioio-audioseq.cpp: Audio clip sequencer class. // Copyright (C) 2008,2010 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #include "eca-object-factory.h" #include "samplebuffer.h" #include "audioio-acseq.h" #include "eca-error.h" #include "eca-logger.h" using std::cout; using std::endl; using SAMPLE_SPECS::sample_pos_t; /** * FIXME notes (last update 2008-03-04) * * - None. */ AUDIO_CLIP_SEQUENCER::AUDIO_CLIP_SEQUENCER () { set_label("audiocseq"); /* note: index of last sequencer parameter (one if no * extra parameters); params beyond this value are * passed on to the child object */ child_param_offset_rep = 1; cseq_mode_rep = AUDIO_CLIP_SEQUENCER::cseq_none; } AUDIO_CLIP_SEQUENCER::~AUDIO_CLIP_SEQUENCER(void) { } AUDIO_CLIP_SEQUENCER* AUDIO_CLIP_SEQUENCER::clone(void) const { AUDIO_CLIP_SEQUENCER* target = new AUDIO_CLIP_SEQUENCER(); for(int n = 0; n < number_of_params(); n++) { target->set_parameter(n + 1, get_parameter(n + 1)); } return target; } void AUDIO_CLIP_SEQUENCER::open(void) throw(AUDIO_IO::SETUP_ERROR &) { if (io_mode() != AUDIO_IO::io_read) throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ACLIPSEQ: Only read mode supported.")); ECA_LOG_MSG(ECA_LOGGER::user_objects, "Opening audio clip sequencer in mode: " + get_parameter(1)); /* note: change behaviour based on first param */ if (cseq_mode_rep == AUDIO_CLIP_SEQUENCER::cseq_loop) { /* following is specific to looping */ AUDIO_SEQUENCER_BASE::toggle_looping(true); DBC_CHECK(finite_length_stream() != true); AUDIO_SEQUENCER_BASE::set_child_object_string( child_params_as_string(1 + child_param_offset_rep, ¶ms_rep)); } else if (cseq_mode_rep == AUDIO_CLIP_SEQUENCER::cseq_select) { AUDIO_SEQUENCER_BASE::toggle_looping(false); AUDIO_SEQUENCER_BASE::set_child_start_position(get_parameter(2)); AUDIO_SEQUENCER_BASE::set_child_length(get_parameter(3)); AUDIO_SEQUENCER_BASE::set_child_object_string( child_params_as_string(1 + child_param_offset_rep, ¶ms_rep)); } else if (cseq_mode_rep == AUDIO_CLIP_SEQUENCER::cseq_play_at) { /* following is specific to play-at */ AUDIO_SEQUENCER_BASE::toggle_looping(false); AUDIO_SEQUENCER_BASE::set_child_offset(get_parameter(2)); AUDIO_SEQUENCER_BASE::set_child_object_string( child_params_as_string(1 + child_param_offset_rep, ¶ms_rep)); } else throw(SETUP_ERROR(SETUP_ERROR::unexpected, "AUDIOIO-ACLIPSEQ: Unknown audio sequencing mode (loop, select, ...).")); AUDIO_SEQUENCER_BASE::open(); /* step: set additional child params (if any) */ int numparams = child()->number_of_params(); for(int n = 0; n < numparams; n++) { child()->set_parameter(n + 1, get_parameter(n + 1 + child_param_offset_rep)); if (child()->variable_params()) numparams = child()->number_of_params(); } } void AUDIO_CLIP_SEQUENCER::close(void) { AUDIO_SEQUENCER_BASE::close(); } std::string AUDIO_CLIP_SEQUENCER::parameter_names(void) const { std::string baseparams; if (cseq_mode_rep == AUDIO_CLIP_SEQUENCER::cseq_loop) baseparams += std::string("audioloop"); else if (cseq_mode_rep == AUDIO_CLIP_SEQUENCER::cseq_select) baseparams += std::string("select,start-sec,dur-sec"); else if (cseq_mode_rep == AUDIO_CLIP_SEQUENCER::cseq_play_at) baseparams += std::string("playat,pos-sec"); else baseparams += std::string("acseqtype"); if (is_child_initialized() == true) { baseparams += "," + child()->parameter_names(); } else { /* create a generic parameter name list */ for (size_t i = 1; i < params_rep.size(); i++) { baseparams += ",param" + kvu_numtostr(i); } } ECA_LOG_MSG(ECA_LOGGER::system_objects, "param list: " + baseparams); return baseparams; } void AUDIO_CLIP_SEQUENCER::set_parameter(int param, string value) { ECA_LOG_MSG(ECA_LOGGER::user_objects, AUDIO_IO::parameter_set_to_string(param, value)); if (param > static_cast(params_rep.size())) params_rep.resize(param); if (param > 0) params_rep[param - 1] = value; if (param == 1) { set_label(value); if (value == "audioloop") { cseq_mode_rep = AUDIO_CLIP_SEQUENCER::cseq_loop; child_param_offset_rep = 1; } else if (value == "select") { cseq_mode_rep = AUDIO_CLIP_SEQUENCER::cseq_select; child_param_offset_rep = 3; } else if (value == "playat") { cseq_mode_rep = AUDIO_CLIP_SEQUENCER::cseq_play_at; child_param_offset_rep = 2; } else { cseq_mode_rep = AUDIO_CLIP_SEQUENCER::cseq_none; child_param_offset_rep = 1; } } if (param > child_param_offset_rep && is_child_initialized() == true) { child()->set_parameter(param - child_param_offset_rep, value); } AUDIO_IO::set_parameter(param, value); } string AUDIO_CLIP_SEQUENCER::get_parameter(int param) const { ECA_LOG_MSG(ECA_LOGGER::system_objects, AUDIO_IO::parameter_get_to_string(param)); if (param > 0 && param < static_cast(params_rep.size()) + 1) { if (param > child_param_offset_rep && is_child_initialized() == true) { params_rep[param - 1] = child()->get_parameter(param - child_param_offset_rep); } return params_rep[param - 1]; } return ""; } ecasound-2.9.3/libecasound/eca-logger.cpp0000644000076400007640000000657310664032032015267 00000000000000// ------------------------------------------------------------------------ // eca-logger.cpp: A logging subsystem implemented as a singleton class // Copyright (C) 2002 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include "eca-logger-interface.h" #include "eca-logger-default.h" #include "eca-logger.h" ECA_LOGGER_INTERFACE* ECA_LOGGER::interface_impl_repp = 0; pthread_mutex_t ECA_LOGGER::lock_rep = PTHREAD_MUTEX_INITIALIZER; static const char *level_descs[] = { "ERROR ", /* 0 */ "INFO ", "SUBSYST.", "MODULE ", "OBJECTS ", "SYSTEM ", "FUNCTION", "CONTINU.", "EIAM ", "UNKNOWN " /* 9 */ }; ECA_LOGGER_INTERFACE& ECA_LOGGER::instance(void) { // // Note! Below we use the Double-Checked Locking Pattern // to protect against concurrent access if (ECA_LOGGER::interface_impl_repp == 0) { KVU_GUARD_LOCK guard(&ECA_LOGGER::lock_rep); if (ECA_LOGGER::interface_impl_repp == 0) { ECA_LOGGER::interface_impl_repp = new ECA_LOGGER_DEFAULT(); } } return(*interface_impl_repp); } void ECA_LOGGER::attach_logger(ECA_LOGGER_INTERFACE* logger) { int oldloglevel = -1; if (interface_impl_repp != 0) { oldloglevel = interface_impl_repp->get_log_level_bitmask(); } ECA_LOGGER::detach_logger(); if (ECA_LOGGER::interface_impl_repp == 0) { KVU_GUARD_LOCK guard(&ECA_LOGGER::lock_rep); if (ECA_LOGGER::interface_impl_repp == 0) { ECA_LOGGER::interface_impl_repp = logger; if (oldloglevel != -1) { logger->set_log_level_bitmask(oldloglevel); } } } DBC_ENSURE(ECA_LOGGER::interface_impl_repp == logger); } /** * Detaches the current logger implementation. */ void ECA_LOGGER::detach_logger(void) { if (ECA_LOGGER::interface_impl_repp != 0) { KVU_GUARD_LOCK guard(&ECA_LOGGER::lock_rep); if (ECA_LOGGER::interface_impl_repp != 0) { delete ECA_LOGGER::interface_impl_repp; ECA_LOGGER::interface_impl_repp = 0; } } DBC_ENSURE(ECA_LOGGER::interface_impl_repp == 0); } const char* ECA_LOGGER::level_to_string(ECA_LOGGER::Msg_level_t arg) { switch(arg) { case ECA_LOGGER::errors: return level_descs[0]; case ECA_LOGGER::info: return level_descs[1]; case ECA_LOGGER::subsystems: return level_descs[2]; case ECA_LOGGER::module_names: return level_descs[3]; case ECA_LOGGER::user_objects: return level_descs[4]; case ECA_LOGGER::system_objects: return level_descs[5]; case ECA_LOGGER::functions: return level_descs[6]; case ECA_LOGGER::continuous: return level_descs[7]; case ECA_LOGGER::eiam_return_values: return level_descs[8]; default: return level_descs[9]; } } ecasound-2.9.3/libecasound/audioio-forked-stream.cpp0000644000076400007640000003102711565760647017471 00000000000000// ------------------------------------------------------------------------ // audioio-forked-streams.cpp: Helper class providing routines for // forking for piped input/output. // Copyright (C) 2000-2004,2006,2008,2011 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "eca-logger.h" #include "audioio-forked-stream.h" using namespace std; /** * Maximum number of arguments passed to exec() */ const static int afs_max_exec_args = 1024; /** * Runs exec() with the given parameters. * @return exec() return value */ static int afs_run_exec(const string& command, const string& filename) { vector temp = kvu_string_to_tokens_quoted(command); if (static_cast(temp.size()) > afs_max_exec_args) { temp.resize(afs_max_exec_args); ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: too many arguments for external application, truncating."); } const char* args[afs_max_exec_args]; vector::size_type p = 0; while(p < temp.size()) { if (temp[p].find("%f") != string::npos) { temp[p].replace(temp[p].find("%f"), 2, filename); args[p] = temp[p].c_str(); } else args[p] = temp[p].c_str(); ++p; } args[p] = 0; return execvp(temp[0].c_str(), const_cast(args)); } static int afs_fd_set_cloexec(int fd) { int flags; flags = fcntl(fd, F_GETFD); if (flags >= 0) { flags |= FD_CLOEXEC; if (fcntl(fd, F_SETFD, flags) >= 0) return 0; } ECA_LOG_MSG(ECA_LOGGER::info, "unable to set FD_CLOEXEC: " + std::string(strerror(errno))); return -1; } AUDIO_IO_FORKED_STREAM::~AUDIO_IO_FORKED_STREAM(void) { if (pid_of_child_rep > 0) clean_child(true); } void AUDIO_IO_FORKED_STREAM::stop_io(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "stop_io()"); clean_child(false); } /** * If found, replaces the string '%f' with 'filename'. This is * the file used by the forked child for input/output. */ void AUDIO_IO_FORKED_STREAM::set_fork_file_name(const string& filename) { object_rep = filename; /* do not yet replace %f yet as it would make it more difficult to tokenize the exec string */ } /** * If found, replaces the string '%F' with a path name to a * temporary named pipe. This pipe will be used for communicating * with the forked child instead of standard input and output pipes. */ void AUDIO_IO_FORKED_STREAM::set_fork_pipe_name(void) { if (command_rep.find("%F") != string::npos) { use_named_pipe_rep = true; init_temp_directory(); if (tempfile_dir_rep.is_valid() == true) { tmpfile_repp = tempfile_dir_rep.create_filename("fork-pipe", ".raw"); ::mkfifo(tmpfile_repp.c_str(), 0755); command_rep.replace(command_rep.find("%F"), 2, tmpfile_repp); tmp_file_created_rep = true; } else tmp_file_created_rep = false; } else use_named_pipe_rep = false; } void AUDIO_IO_FORKED_STREAM::init_temp_directory(void) { string tmpdir ("ecasound-"); char* tmp_p = getenv("USER"); if (tmp_p != NULL) { tmpdir += string(tmp_p); tempfile_dir_rep.reserve_directory(tmpdir); } if (tempfile_dir_rep.is_valid() != true) { ECA_LOG_MSG(ECA_LOGGER::info, "WARNING: Unable to create temporary directory \"" + tmpdir + "\"."); } } /** * If found, replaces the string '%c' with value of parameter * 'channels'. */ void AUDIO_IO_FORKED_STREAM::set_fork_channels(int channels) { if (command_rep.find("%c") != string::npos) { command_rep.replace(command_rep.find("%c"), 2, kvu_numtostr(channels)); } } /** * If found, replaces the string '%s' with value of parameter * 'sample_rate', and '%S' with 'sample_rate/1000' (kHz). */ void AUDIO_IO_FORKED_STREAM::set_fork_sample_rate(long int sample_rate) { if (command_rep.find("%s") != string::npos) { command_rep.replace(command_rep.find("%s"), 2, kvu_numtostr(sample_rate)); } if (command_rep.find("%S") != string::npos) { command_rep.replace(command_rep.find("%S"), 2, kvu_numtostr(sample_rate/1000.0f)); } } /** * If found, replaces the string '%b' with value of parameter * 'bits'. */ void AUDIO_IO_FORKED_STREAM::set_fork_bits(int bits) { if (command_rep.find("%b") != string::npos) { command_rep.replace(command_rep.find("%b"), 2, kvu_numtostr(bits)); } } void AUDIO_IO_FORKED_STREAM::fork_child_for_read(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Fork child-for-read: '" + fork_command() + "'"); init_state_before_fork(); if (use_named_pipe_rep == true) { if (tmp_file_created_rep == true) { fork_child_for_fifo_read(); } else { last_fork_rep = false; } } else { int fpipes[2]; if (pipe(fpipes) == 0) { sigkill_sent_rep = false; pid_of_child_rep = fork(); if (pid_of_child_rep == 0) { // --- // child // --- sigset_t newset; sigemptyset(&newset); sigaddset(&newset, SIGTERM); sigaddset(&newset, SIGPIPE); #if defined(HAVE_PTHREAD_SIGMASK) pthread_sigmask(SIG_UNBLOCK, &newset, NULL); #elif defined(HAVE_SIGPROCMASK) sigprocmask(SIG_UNBLOCK, &newset, NULL); #endif ::close(1); dup2(fpipes[1], 1); ::close(fpipes[0]); ::close(fpipes[1]); freopen("/dev/null", "w", stderr); int res = afs_run_exec(command_rep, object_rep); ::close(1); exit(res); cerr << "You shouldn't see this!\n"; } else if (pid_of_child_rep > 0) { // --- // parent // --- pid_of_parent_rep = ::getpid(); ::close(fpipes[1]); fd_rep = fpipes[0]; afs_fd_set_cloexec(fd_rep); if (wait_for_child() == true) last_fork_rep = true; else last_fork_rep = false; } } } } /** * Initializes state that needs to be reset/refresh * between every new fork of a child object. */ void AUDIO_IO_FORKED_STREAM::init_state_before_fork(void) { last_fork_rep = false; fd_rep = 0; if (do_supports_seeking() != true) do_set_position_in_samples(0); } void AUDIO_IO_FORKED_STREAM::fork_child_for_fifo_read(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Fork child-for-fifo-read: '" + fork_command() + "'"); init_state_before_fork(); sigkill_sent_rep = false; pid_of_child_rep = fork(); if (pid_of_child_rep == 0) { // --- // child // --- sigset_t newset; sigemptyset(&newset); sigaddset(&newset, SIGTERM); sigaddset(&newset, SIGPIPE); #if defined(HAVE_PTHREAD_SIGMASK) pthread_sigmask(SIG_UNBLOCK, &newset, NULL); #elif defined(HAVE_SIGPROCMASK) sigprocmask(SIG_UNBLOCK, &newset, NULL); #endif freopen("/dev/null", "w", stderr); int res = afs_run_exec(command_rep, object_rep); if (res < 0) { /** * If execvp failed, make sure that the other end of * the pipe doesn't block forever. */ cerr << "execvp() failed!\n"; int fd = open(tmpfile_repp.c_str(), O_WRONLY); close(fd); } exit(res); cerr << "You shouldn't see this!\n"; } else if (pid_of_child_rep > 0) { // --- // parent // --- pid_of_parent_rep = ::getpid(); fd_rep = 0; if (wait_for_child() == true) fd_rep = ::open(tmpfile_repp.c_str(), O_RDONLY); if (fd_rep > 0) { last_fork_rep = true; afs_fd_set_cloexec(fd_rep); } } } void AUDIO_IO_FORKED_STREAM::fork_child_for_write(void) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Fork child-for-write: '" + fork_command() + "'"); init_state_before_fork(); int fpipes[2]; if (pipe(fpipes) == 0) { sigkill_sent_rep = false; pid_of_child_rep = fork(); if (pid_of_child_rep == 0) { // --- // child // --- sigset_t newset; sigaddset(&newset, SIGTERM); sigaddset(&newset, SIGPIPE); #if defined(HAVE_PTHREAD_SIGMASK) pthread_sigmask(SIG_UNBLOCK, &newset, NULL); #elif defined(HAVE_SIGPROCMASK) sigprocmask(SIG_UNBLOCK, &newset, NULL); #endif ::close(0); ::dup2(fpipes[0],0); ::close(fpipes[0]); ::close(fpipes[1]); freopen("/dev/null", "w", stderr); exit(afs_run_exec(command_rep, object_rep)); cerr << "You shouln't see this!\n"; } else if (pid_of_child_rep > 0) { // --- // parent // --- pid_of_parent_rep = ::getpid(); ::close(fpipes[0]); fd_rep = fpipes[1]; /* make sure in case the parent forks again, the fd_rep * is closed -> otherwise the mechanism to signal end-of-stream * gets broken */ afs_fd_set_cloexec(fd_rep); if (wait_for_child() == true) last_fork_rep = true; else last_fork_rep = false; } } } /** * Cleans (waits for) the forked child process. Note! This * function should be called from the same thread as * fork_child_for_read/write() was called. * * In case the function is called from a different thread, * it attemts to terminate the child anyways, but the child's * state is not known exactly when function returns. * * @param force if true, client is terminated with SIGKILL, * which guarantees that it terminates (but * possibly without going through normal * exit procedure); should be avoided especially * for output objects as this may result in * data loss */ void AUDIO_IO_FORKED_STREAM::clean_child(bool force) { if (fd_rep > 0) { /* close the pipe between this process and the forked child * process, should terminate the forked application -> see * waitpid() below */ ECA_LOG_MSG(ECA_LOGGER::system_objects, "closing pipe handle for: " + object_rep); ::close(fd_rep); fd_rep = -1; } if (pid_of_child_rep > 0 && force == true) { if (sigkill_sent_rep != true) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Sending SIGKILL to child process related to: " + object_rep); kill(pid_of_child_rep, SIGKILL); sigkill_sent_rep = true; } else { /* SIGKILL already sent once for this process, don't send it again */ pid_of_child_rep = -1; } } if (pid_of_child_rep > 0 && pid_of_parent_rep == getpid()) { /* wait until child process has exited * note: this only works reliable when our pid is * the same as used for starting the child */ int flags = 0; int status = 0; ECA_LOG_MSG(ECA_LOGGER::system_objects, "waitpid() for: " + object_rep); int res = waitpid(pid_of_child_rep, &status, flags); if (res == pid_of_child_rep) { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Child process exit ok: " + object_rep); pid_of_child_rep = 0; } else { ECA_LOG_MSG(ECA_LOGGER::system_objects, "Problems in terminating child process:" + std::string(strerror(errno))); } } if (pid_of_child_rep > 0) { /* unable to use wait(), terminating with a signal */ ECA_LOG_MSG(ECA_LOGGER::system_objects, "Child not responding, sending SIGTERM: " + object_rep); kill(pid_of_child_rep, SIGTERM); pid_of_child_rep = 0; } if (tmp_file_created_rep == true) { ::remove(tmpfile_repp.c_str()); tmp_file_created_rep = false; } } /** * Checks whether child is still active. Returns false * if child has exited, otherwise true. */ bool AUDIO_IO_FORKED_STREAM::wait_for_child(void) const { if (pid_of_child_rep <= 0) return false; else if (pid_of_parent_rep == getpid() && pid_of_child_rep > 0) { int pid = waitpid(pid_of_child_rep, 0, WNOHANG); if (pid == pid_of_child_rep) { return false; } /* no change in state, so still active */ return true; } else /* note: we don't really know so assume that yes */ return true; } ecasound-2.9.3/libecasound/eca-preset-map.cpp0000644000076400007640000001033610664032032016055 00000000000000// ------------------------------------------------------------------------ // eca-preset-map: Dynamic register for storing effect presets // Copyright (C) 2000-2003 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "eca-object.h" #include "eca-resources.h" #include "eca-preset-map.h" #include "global-preset.h" using std::find; using std::list; using std::map; using std::string; using std::vector; ECA_PRESET_MAP::ECA_PRESET_MAP(void) { #ifndef ECA_DISABLE_EFFECTS ECA_RESOURCES ecarc; string filename = ecarc.resource("user-resource-directory") + "/" + ecarc.resource("resource-file-effect-presets"); string global_filename = ecarc.resource("resource-directory") + "/" + ecarc.resource("resource-file-effect-presets"); load_preset_file(global_filename); load_preset_file(filename); #endif } ECA_PRESET_MAP::~ECA_PRESET_MAP(void) { } void ECA_PRESET_MAP::load_preset_file(const string& fname) { RESOURCE_FILE preset_file; preset_file.resource_file(fname); preset_file.load(); const vector& pmap = preset_file.keywords(); vector::const_iterator p = pmap.begin(); while(p != pmap.end()) { if (*p != "") preset_keywords_rep.push_back(*p); ++p; } } void ECA_PRESET_MAP::register_object(const string& keyword, const string& matchstr, ECA_OBJECT* object) { if (find(preset_keywords_rep.begin(), preset_keywords_rep.end(), keyword) == preset_keywords_rep.end()) preset_keywords_rep.push_back(keyword); ECA_OBJECT_MAP::register_object(keyword, matchstr, object); } void ECA_PRESET_MAP::unregister_object(const string& keyword) { preset_keywords_rep.remove(keyword); ECA_OBJECT_MAP::unregister_object(keyword); } const list& ECA_PRESET_MAP::registered_objects(void) const { return(preset_keywords_rep); } bool ECA_PRESET_MAP::has_keyword(const std::string& keyword) const { if (find(preset_keywords_rep.begin(), preset_keywords_rep.end(), keyword) == preset_keywords_rep.end()) return(false); return (true); } const ECA_OBJECT* ECA_PRESET_MAP::object_expr(const string& expr) const { if (find(preset_keywords_rep.begin(), preset_keywords_rep.end(), expr) != preset_keywords_rep.end()) { return(object(expr)); } return(0); } const ECA_OBJECT* ECA_PRESET_MAP::object(const string& keyword) const { const PRESET* retobj = 0; #ifndef ECA_DISABLE_EFFECTS if (find(preset_keywords_rep.begin(), preset_keywords_rep.end(), keyword) != preset_keywords_rep.end()) { const list& objlist = ECA_OBJECT_MAP::registered_objects(); if (find(objlist.begin(), objlist.end(), keyword) == objlist.end()) { try { PRESET* obj = dynamic_cast(new GLOBAL_PRESET(keyword)); if (obj != 0) { const_cast(this)->register_object(keyword, "^" + keyword + "$", obj); retobj = obj; // std::cerr << "(eca-preset-map) registering obj; " << keyword << ".\n"; } // else std::cerr << "(eca-preset-map) fail (3); " << keyword << ".\n"; } catch(...) { retobj = 0; } DBC_CHECK(find(objlist.begin(), objlist.end(), keyword) != objlist.end() || retobj == 0); } else { retobj = dynamic_cast(ECA_OBJECT_MAP::object(keyword)); // if (retobj == 0) std::cerr << "(eca-preset-map) fail (2); " << keyword << ".\n"; } } // else std::cerr << "(eca-preset-map) fail (1); " << keyword << ".\n"; #endif return(retobj); } ecasound-2.9.3/libecasound/ctrl-source.h0000644000076400007640000000207011034750333015160 00000000000000#ifndef INCLUDE_CTRL_SOURCE_H #define INCLUDE_CTRL_SOURCE_H #include "eca-audio-position.h" #include "eca-operator.h" /** * Interface class for implementing control data * source objects. */ class CONTROLLER_SOURCE : public OPERATOR { public: typedef SAMPLE_SPECS::sample_t parameter_t; /** * Initializes the controller source. * * This function is called at least once before * the first call to value(). */ virtual void init(void) = 0; /** * Returns the current value for the given * position. */ virtual parameter_t value(double pos_secs) = 0; /** * Sets an initial value for the controller. * * Controllers that are driven by external sources, can use the * initial value if there is an initial gap in control data. The * standard value range ofs [0,1] should be used. * * Should be set before the first call to value(). */ virtual void set_initial_value(parameter_t arg) = 0; virtual CONTROLLER_SOURCE* clone(void) const = 0; virtual CONTROLLER_SOURCE* new_expr(void) const = 0; }; #endif ecasound-2.9.3/pyecasound/0000755000076400007640000000000013606336217012520 500000000000000ecasound-2.9.3/pyecasound/ChangeLog0000644000076400007640000000136110664032032014200 000000000000002003-03-18 Kai Vehmanen * ecacontrol.py: support for ECASOUND environment variable 2003-03-11 Janne Halttunen * python module name change from ecanative to ecacontrol * support for multiple functional instances of ECI class * disabled curses output from ecasound engine * added check for ecasound version number 2003-02-22 Janne Halttunen * native python ECI implementation 2001-04-27 Kai Vehmanen * library version 0:0:0 frozen 2000-12-06 Kai Vehmanen * development started; libtool version number 0:0:0 ----------------------------------------------------------------------- ecasound-2.9.3/pyecasound/TODO0000644000076400007640000000020410664032032013111 00000000000000------------------- * pyecasound TODO * ------------------- - finish eiam-class, in which eiam commands are seen as python-methods ecasound-2.9.3/pyecasound/ecacontrol.py0000755000076400007640000002175513604674645015170 00000000000000"""Native Python ECI (ecasound control interface) implementation""" from __future__ import print_function import sys import re import subprocess from select import select import os import signal import time AUTHORS = """Kai Vehmanen, Eric S. Tiedemann, Janne Halttunen""" if sys.version.split()[0] < '2.7': print("ERROR: Python 2.7 or newer is required by ecacontrol.py", file=sys.stderr) sys.exit(-1) class ECA_CONTROL_INTERFACE: def __init__(self, verbose=1): """Instantiate new ECI session verbose: set this false to get rid of startup-messages """ self.type_override = {} self.verbose = verbose self._cmd = "" self._type = "" self._prompt = "ecasound ('h' for help)> " self._timeout = 1 # in seconds self._resp = {} self.initialize() def __call__(self, cmd, f=None): if f is not None: val = self.command_float_arg(cmd, f) else: cmds = cmd.split("\n") if len(cmds) > 1: v = [] for c in cmds: c = c.strip() if c: v.append(self.command(c)) if self.error(): raise Exception(v[-1]) val = "\n".join(list(map(str, v))) else: val = self.command(cmd) if self.error(): raise Exception(val) return val def _readline(self): """Return one line of ECA output""" return self.eca.stdout.readline().decode().strip() def _read_eca(self): """Return ECA output (or None if timeout)""" str_buf = "" timeout = time.time() + self._timeout while time.time() < timeout: in_buf = b"" while select([self.eca.stdout], [], [], 0)[0]: in_buf += self.eca.stdout.read(1) str_buf += in_buf.decode() if str_buf.endswith("> "): return str_buf def _parse_response(self): r = () if self.verbose > 2: print("c=" + self._cmd) s = self._read_eca() if s is None: r = ("e", "Connection to the processing engine was lost.\n") elif s: if self.verbose > 3: print("s=<", s, ">") m = expand_eiam_response(s) # print('expand_eiam_response', m) r = parse_eiam_response(s, m) if not r: r = ("e", "-") if self.verbose > 2: print("r=", r) self._type = r[0] if self._cmd in self.type_override: self._type = self.type_override[self._cmd] if self._type == "S": self._resp[self._type] = r[1].split(",") elif self._type == "Sn": self._resp[self._type] = r[1].split("\n") elif self._type == "f": self._resp[self._type] = float(r[1]) elif self._type == "i": self._resp[self._type] = int(r[1]) elif self._type == "li": self._resp[self._type] = int(r[1]) else: self._resp[self._type] = r[1] return self._resp[self._type] def initialize(self): """Reserve resources""" try: ecasound_binary = os.environ["ECASOUND"] except KeyError: ecasound_binary = "" if ecasound_binary == "": ecasound_binary = "ecasound" self.eca = subprocess.Popen( [ecasound_binary, "-c", "-E", "int-output-mode-wellformed"], shell=False, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True, ) lines = self._readline() + "\n" version = self._readline() s = version.find("ecasound v") if float(version[s + 10: s + 13]) >= 2.2: lines = lines + version + "\n" else: raise RuntimeError("ecasound version 2.2+ required!") lines = lines + self._readline() + "\n" if self.verbose: print(lines) print(__doc__) print("by", AUTHORS) print("\n(to get rid of this message, pass zero to instance init)") print(self._parse_response()) # self.command('debug 256') def cleanup(self): """Free all reserved resources""" self.eca.stdin.write("quit\n".encode()) os.kill(self.eca.pid, signal.SIGTERM) signal.signal(signal.SIGALRM, handler) signal.alarm(2) try: return self.eca.wait() except: signal.alarm(0) os.kill(self.eca.pid, signal.SIGKILL) def command(self, cmd): """Issue an EIAM command""" cmd = cmd.strip() if cmd: self._cmd = cmd cmd += "\r" self.eca.stdin.write(cmd.encode()) return self._parse_response() def command_float_arg(self, cmd, f=None): """Issue an EIAM command This function can be used instead of command(string), if the command in question requires exactly one numerical parameter. """ cmd = cmd.strip() if cmd: self._cmd = cmd if f: self.eca.stdin.write(("%s %f\n" % (cmd, f)).encode()) else: self.eca.stdin.write((cmd + "\n").encode()) return self._parse_response() def error(self): """Return true if error has occured during the execution of last EIAM command""" if self._type == "e": return 1 def last_error(self): """Return a string describing the last error""" if self.error(): return self._resp.get("e") return "" def last_float(self): """Return the last floating-point return value""" return self._resp.get("f") def last_integer(self): """Return the last integer return value This function is also used to return boolean values.""" return self._resp.get("i") def last_long_integer(self): """Return the last long integer return value Long integers are used to pass values like 'length_in_samples' and 'length_in_bytes'. It's implementation specific whether there's any real difference between integers and long integers.""" return self._resp.get("li") def last_string(self): """Return the last string return value""" return self._resp.get("s") def last_string_list(self): """Return the last collection of strings (one or more strings)""" return self._resp.get("S") def last_type(self): """Return the last type""" return self._type def current_event(self): """** not implemented **""" def events_available(self): """** not implemented **""" def next_event(self): """** not implemented **""" def handler(*args): print("AARGH!") raise Exception("killing me not so softly") EXPAND = re.compile("256 ([0-9]{1,5}) (.+)\r\n(.*)\r\n\r\n.*", re.MULTILINE | re.S) def expand_eiam_response(st): """Checks wheter 'str' is a valid EIAM response. @return Regex match object. """ return EXPAND.search(st) PARSE = re.compile("256 ([0-9]{1,5}) (.+)\r\n(.*)", re.MULTILINE | re.S) def parse_eiam_response(st, m=None): """Parses a valid EIAM response. @param m Valid regex match object. @param str The whole EIAM response. @return tuple of return value type and value """ if not m: m = PARSE.search(st) if not m: return () if m and len(m.groups()) == 0: return ("e", "Matching groups failed") if m and len(m.groups()) == 3: if int(m.group(1)) != len(m.group(3)): print( "(pyeca) Response length error. Received ", len(m.group(3)), ", expected for ", m.group(1), ".", ) return ("e", "Response length error.") if m: return (m.group(2), m.group(3)) return ("e", "") class CmdBase: def __init__(self, eci, cmd): self.eci = eci self.cmd = cmd.replace("_", "-") def __call__(self): return self.eci(self.cmd) class StringArgument(CmdBase): def __call__(self, s): return self.eci("%s %s" % (self.cmd, s)) class EIAM: def __init__(self, verbose=0): self._eci = ECA_CONTROL_INTERFACE(verbose) self._cmds = self._eci("int-cmd-list") for c in self._cmds: c = c.replace("-", "_") if c.count("add") or c.count("select"): self.__dict__[c] = StringArgument(self._eci, c) else: self.__dict__[c] = CmdBase(self._eci, c) def main(): e = ECA_CONTROL_INTERFACE() print(e.command("c-add huppaa")) print(e.command("c-list")) print( e( """ c-list c-status """ ) ) print(e.cleanup()) if __name__ == "__main__": main() ecasound-2.9.3/pyecasound/Makefile.am0000644000076400007640000000357213604161211014467 00000000000000# ---------------------------------------------------------------------- # File: ecasound/pyecasound/Makefile.am # Description: Python implmentation of the Ecasound Control Interface # License: LGPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- AUTOMAKE_OPTIONS = foreign EXTRA_DIST = eci.py pyeca.py ecacontrol.py \ test1_stresstest.py \ test2_stresstest.py # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- if ECA_AM_PYECASOUND_INSTALL pyecasound_install_list1 = $(srcdir)/eci.py \ $(srcdir)/pyeca.py \ $(srcdir)/ecacontrol.py pyecasound_uninstall_list1 = $(DESTDIR)$(ECA_S_PYTHON_DLMODULES)/eci.py \ $(DESTDIR)$(ECA_S_PYTHON_DLMODULES)/pyeca.py \ $(DESTDIR)$(ECA_S_PYTHON_DLMODULES)/ecacontrol.py endif if ECA_AM_PYECASOUND_INSTALL TESTS = test1_stresstest.py \ test2_stresstest.py endif # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # hooks # ---------------------------------------------------------------------- if ECA_AM_PYECASOUND_INSTALL install-exec-hook: $(pyecasound_install_list1) $(INSTALL) -d $(DESTDIR)$(ECA_S_PYTHON_DLMODULES) $(INSTALL) $(pyecasound_install_list1) $(DESTDIR)$(ECA_S_PYTHON_DLMODULES) else install-exec-hook: endif if ECA_AM_PYECASOUND_INSTALL uninstall-local: rm -f $(pyecasound_uninstall_list1) rmdir $(DESTDIR)$(ECA_S_PYTHON_DLMODULES) || echo "Skipping non-empty directory" else uninstall-local: endif ecasound-2.9.3/pyecasound/test1_stresstest.py0000755000076400007640000000426213604674645016374 00000000000000#!/usr/bin/env python # ----------------------------------------------------------------------- # Runs a stress test using the pyeca interface # # Copyright (C) 2003 Kai Vehmanen (kai.vehmanen@wakkanet.fi) # Licensed under GPL. See the file 'COPYING' for more information. # ----------------------------------------------------------------------- import time import sys import os # --- # select pyeca implementation to use # test the default implementation from pyeca import * # test the native Python implementation # from ecacontrol import * # test the C implementation # from pyecasound import * # --- # configuration variables # run for how many seconds runlen = 5 # debug level (0, 1, 2, ...) debuglevel = 0 if os.path.isfile("../ecasound/ecasound_debug"): os.environ["ECASOUND"] = "../ecasound/ecasound_debug" if os.path.isfile("../ecasound/ecasound"): os.environ["ECASOUND"] = "../ecasound/ecasound" # if above tests fail, the default ecasound binary # will be used # main program e = ECA_CONTROL_INTERFACE(debuglevel) result = 0 e.command("cs-add play_chainsetup") e.command("c-add 1st_chain") e.command("ai-add rtnull") e.command("ao-add null") e.command("cop-add -ezx:1,0.0") e.command("ctrl-add -kos:2,-1,1,300,0") e.command("cop-add -efl:300") e.command("cop-add -evp") e.command("cop-select 3") e.command("copp-select 1") e.command("cs-connect") e.command("start") total_cmds = 0 while 1 and e.last_type() != "e": e.command("get-position") curpos = e.last_float() if curpos > runlen or e.last_type() == "e": break e.command("copp-get") if debuglevel == 2: # print curpos, e.last_float() # if curpos == None: # curpos = 0.0 sys.stderr.write("%6.2f %6.4f\r" % (curpos, e.last_float())) else: if debuglevel == 1: sys.stderr.write(".") total_cmds = total_cmds + 2 if e.last_type() == "e": print("Ended to error:", e.last_error()) result = -1 else: e.command("stop") e.command("cs-disconnect") if debuglevel == 2: sys.stderr.write( "\nprocessing speed: " + str(total_cmds / runlen) + " cmds/second.\n" ) if debuglevel > 0: sys.stderr.write("\n") sys.exit(result) ecasound-2.9.3/pyecasound/Makefile.in0000644000076400007640000004054213606336177014517 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/pyecasound/Makefile.am # Description: Python implmentation of the Ecasound Control Interface # License: LGPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = pyecasound DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \ TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = eci.py pyeca.py ecacontrol.py \ test1_stresstest.py \ test2_stresstest.py # ---------------------------------------------------------------------- # defines # ---------------------------------------------------------------------- @ECA_AM_PYECASOUND_INSTALL_TRUE@pyecasound_install_list1 = $(srcdir)/eci.py \ @ECA_AM_PYECASOUND_INSTALL_TRUE@ $(srcdir)/pyeca.py \ @ECA_AM_PYECASOUND_INSTALL_TRUE@ $(srcdir)/ecacontrol.py @ECA_AM_PYECASOUND_INSTALL_TRUE@pyecasound_uninstall_list1 = $(DESTDIR)$(ECA_S_PYTHON_DLMODULES)/eci.py \ @ECA_AM_PYECASOUND_INSTALL_TRUE@ $(DESTDIR)$(ECA_S_PYTHON_DLMODULES)/pyeca.py \ @ECA_AM_PYECASOUND_INSTALL_TRUE@ $(DESTDIR)$(ECA_S_PYTHON_DLMODULES)/ecacontrol.py @ECA_AM_PYECASOUND_INSTALL_TRUE@TESTS = test1_stresstest.py \ @ECA_AM_PYECASOUND_INSTALL_TRUE@ test2_stresstest.py all: all-am .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign pyecasound/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign pyecasound/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 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: tags: TAGS TAGS: ctags: CTAGS CTAGS: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ echo "SKIP: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ skipped="($$skip tests were not run)"; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: 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) 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-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-local .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool distclean distclean-generic distclean-libtool \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-exec-hook install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am uninstall uninstall-am uninstall-info-am \ uninstall-local # ---------------------------------------------------------------------- # header files # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # source files # ---------------------------------------------------------------------- # ---------------------------------------------------------------------- # hooks # ---------------------------------------------------------------------- @ECA_AM_PYECASOUND_INSTALL_TRUE@install-exec-hook: $(pyecasound_install_list1) @ECA_AM_PYECASOUND_INSTALL_TRUE@ $(INSTALL) -d $(DESTDIR)$(ECA_S_PYTHON_DLMODULES) @ECA_AM_PYECASOUND_INSTALL_TRUE@ $(INSTALL) $(pyecasound_install_list1) $(DESTDIR)$(ECA_S_PYTHON_DLMODULES) @ECA_AM_PYECASOUND_INSTALL_FALSE@install-exec-hook: @ECA_AM_PYECASOUND_INSTALL_TRUE@uninstall-local: @ECA_AM_PYECASOUND_INSTALL_TRUE@ rm -f $(pyecasound_uninstall_list1) @ECA_AM_PYECASOUND_INSTALL_TRUE@ rmdir $(DESTDIR)$(ECA_S_PYTHON_DLMODULES) || echo "Skipping non-empty directory" @ECA_AM_PYECASOUND_INSTALL_FALSE@uninstall-local: # 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: ecasound-2.9.3/pyecasound/test2_stresstest.py0000755000076400007640000000414113604674645016371 00000000000000#!/usr/bin/env python # ----------------------------------------------------------------------- # A second stress test for the pyeca interface # # Copyright (C) 2003 Kai Vehmanen (kai.vehmanen@wakkanet.fi) # Licensed under GPL. See the file 'COPYING' for more information. # ----------------------------------------------------------------------- import time import sys import os # --- # select pyeca implementation to use # test the default implementation from pyeca import * # test the native Python implementation # from ecacontrol import * # test the C implementation # from pyecasound import * # --- # configuration variables # run for how many seconds runlen = 5 # debug level (0, 1, 2, ...) debuglevel = 0 if os.path.isfile("../ecasound/ecasound_debug"): os.environ["ECASOUND"] = "../ecasound/ecasound_debug" if os.path.isfile("../ecasound/ecasound"): os.environ["ECASOUND"] = "../ecasound/ecasound" # if above tests fail, the default ecasound binary # will be used # main program e = ECA_CONTROL_INTERFACE(debuglevel) result = 0 e.command("cs-add play_chainsetup") e.command("c-add 1st_chain") e.command("ai-add rtnull") e.command("ao-add null") e.command("cop-add -ezx:1,0.0") e.command("ctrl-add -kos:2,-1,1,300,0") e.command("cop-add -efl:300") e.command("cop-add -evp") e.command("cop-select 3") e.command("copp-select 1") e.command("cs-connect") e.command("start") total_cmds = 0 while 1 and e.last_type() != "e": e.command("get-position") curpos = e.last_float() if curpos > runlen or e.last_type() == "e": break if debuglevel > 0: sys.stderr.write(".") # some commands that return a lot # of return data e.command("cop-register") e.command("aio-register") e.command("int-cmd-list") total_cmds = total_cmds + 4 if e.last_type() == "e": print("Ended to error:", e.last_error()) result = -1 else: e.command("stop") e.command("cs-disconnect") if debuglevel == 2: sys.stderr.write( "\nprocessing speed: " + str(total_cmds / runlen) + " cmds/second.\n" ) if debuglevel > 0: sys.stderr.write("\n") sys.exit(result) ecasound-2.9.3/pyecasound/eci.py0000644000076400007640000000544113604674645013566 00000000000000""" # eci.ECI -- A higher-level interface to pyeca. # Copyright 2001 Eric S. Tiedemann (est@hyperreal.org) # GPLed some updates by Janne Halttunen """ import pyeca class ECIError(Exception): def __init__(self, what): Exception.__init__(self, what) self.what = what def __str__(self): return "" % self.what class ECI: """An ECI is and ECA Control Interface object. It can be called with ECI command strings (and an optional float value) as arguments. A list or tuple of command strings is also accepted and commands can be separated by newlines within a single string. The value of a command (or of the last command in a sequence) if returned as a value of the appropriate Python type (possibly None). On errors, an ECIException is raised that has a `what' member with the exception message. These exceptions also stringify prettily. """ def __init__(self, *args): self.e = pyeca.ECA_CONTROL_INTERFACE(*args) def __call__(self, cmd, f=None): if f is not None: self.e.command_float_arg(cmd, f) else: if type(cmd) in [list, tuple]: v = None for c in cmd: v = self(c) return v else: cmds = cmd.split("\n") if len(cmds) > 1: v = None for c in cmds: v = self(c) return v else: self.e.command(cmd) t = self.e.last_type() if not t or t == "-": return None elif t == "S": return self.e.last_string_list() elif t == "s": return self.e.last_string() elif t == "f": return self.e.last_float() elif t == "i": return self.e.last_integer() elif t == "li": return self.e.last_long_integer() elif t == "e" or self.e.error(): raise ECIError("%s: %s" % (self.e.last_error(), cmd)) else: raise ECIError("unknown return type '%s'!" % t) if __name__ == "__main__": import time import sys file = sys.argv[1] e = ECI() # uncomment to raise an error :) # e('foo') e( """ cs-add play_chainsetup c-add 1st_chain ai-add %s ao-add-default cop-add -efl:100 cop-select 1 copp-select 1 cs-connect start""" % file ) cutoff_inc = 500.0 while 1: time.sleep(1) if e("engine-status") != "running" or e("get-position") > 15: break e("copp-set", cutoff_inc + e("copp-get")) e( """stop cs-disconnect""" ) print("Chain operator status: ", e("cop-status")) ecasound-2.9.3/pyecasound/pyeca.py0000644000076400007640000000016713604161211014103 00000000000000"""Wrapper module which loads pyecasound (python module for Ecasound Control Interface). """ from ecacontrol import * ecasound-2.9.3/ecasound/0000755000076400007640000000000013606336217012147 500000000000000ecasound-2.9.3/ecasound/eca-plaintext.h0000644000076400007640000000166510664032032014773 00000000000000#ifndef INCLUDED_ECA_PLAINTEXT_H #define INCLUDED_ECA_PLAINTEXT_H #include #include #include "eca-console.h" /** * Plain text interface for the console * mode ecasound. * * @author Kai Vehmanen */ class ECA_PLAIN_TEXT : public ECA_CONSOLE { public: /** * Constructor. */ ECA_PLAIN_TEXT(std::ostream* ostr); /** * Virtual destructor. */ virtual ~ECA_PLAIN_TEXT(void); /** * Prints the text string 'msg'. */ virtual void print(const std::string& msg); /** * Prints the ecasound banner. */ virtual void print_banner(void); /** * Reads the next user command. * * @see last_command() */ virtual void read_command(const std::string& prompt); /** * Returns the last read user command. */ virtual const std::string& last_command(void) const; private: std::string last_cmd_rep; std::ostream* ostream_repp; }; #endif /* INCLUDED_ECA_PLAIN_TEXT_H */ ecasound-2.9.3/ecasound/eca-curses.cpp0000644000076400007640000001470311170063146014622 00000000000000// ------------------------------------------------------------------------ // eca-curses.cpp: Curses implementation of the console user interface. // Copyright (C) 1999-2004,2007 Kai Vehmanen // // Attributes: // eca-style-version: 2 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #if defined(ECA_PLATFORM_CURSES) #ifdef ECA_USE_NCURSES_H #include #include /* for setupterm() */ #elif ECA_USE_NCURSES_NCURSES_H #include #include /* for setupterm() */ #else #include #include /* for setupterm() */ #endif #define READLINE_LIBRARY #include #include #include #include #include /* kvu_string_search_and_replace() */ #include "ecasound.h" #include "eca-curses.h" #if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0402 static char** ecasound_completion (const char *text, int start, int end); static char* ecasound_command_generator (const char* text, int state); #else static char** ecasound_completion (char *text, int start, int end); static char* ecasound_command_generator (char* text, int state); #endif ECA_CURSES::ECA_CURSES(void) { rl_initialized_rep = false; setupterm((char *)0, 1, (int *)0); init_readline_support(); } ECA_CURSES::~ECA_CURSES(void) { if (rl_initialized_rep == true) { rl_cleanup_after_signal(); } } void ECA_CURSES::print(const std::string& msg) { std::cout << msg << std::endl; } void ECA_CURSES::print_banner(void) { int width = COLS - 4; if (width > ECASOUND_TERM_WIDTH_DEFAULT) width = ECASOUND_TERM_WIDTH_DEFAULT; string banner (width, '*'); std::cout << banner << std::endl; std::cout << "*"; putp(tigetstr("bold")); std::cout << " ecasound v" << ecasound_library_version << ECASOUND_COPYRIGHT; putp(tigetstr("sgr0")); std::cout << "\n"; std::cout << banner << std::endl; } void ECA_CURSES::read_command(const std::string& prompt) { if (rl_initialized_rep != true) rl_initialized_rep = true; last_cmdchar_repp = readline(const_cast(prompt.c_str())); if (last_cmdchar_repp != 0) { add_history(last_cmdchar_repp); last_cmd_rep = last_cmdchar_repp; free(last_cmdchar_repp); } else { /* handle EOF */ last_cmd_rep = "q"; } } const std::string& ECA_CURSES::last_command(void) const { return last_cmd_rep; } void ECA_CURSES::init_readline_support(void) { /* for conditional parsing of ~/.inputrc file. */ rl_readline_name = "ecasound"; /* we want to attempt completion first */ #if RL_READLINE_VERSION >= 0x0402 rl_attempted_completion_function = (rl_completion_func_t*)ecasound_completion; #else rl_attempted_completion_function = (CPPFunction *)ecasound_completion; #endif } /* **************************************************************** */ /* */ /* Interface to Readline Completion */ /* */ /* **************************************************************** */ /** * Attempt to complete on the contents of TEXT. START and END bound the * region of rl_line_buffer that contains the word to complete. TEXT is * the word to complete. We can use the entire contents of rl_line_buffer * in case we want to do some simple parsing. Return the array of matches, * or NULL if there aren't any. */ #if RL_READLINE_VERSION >= 0x0402 char** ecasound_completion (const char *text, int start, int end) #else char** ecasound_completion (char *text, int start, int end) #endif { char **matches; matches = (char **)NULL; /* complete only the first command, otherwise complete files in * the current directory */ if (start == 0) { #if RL_READLINE_VERSION >= 0x0402 matches = rl_completion_matches (text, (rl_compentry_func_t *)ecasound_command_generator); #else matches = completion_matches (text, (CPFunction *)ecasound_command_generator); #endif } return matches; } /** * Generator function for command completion. STATE lets us know whether * to start from scratch; without any state (i.e. STATE == 0), then we * start at the top of the list. */ #if RL_READLINE_VERSION >= 0x0402 char* ecasound_command_generator (const char* text, int state) #else char* ecasound_command_generator (char* text, int state) #endif { static int list_index, len; static const std::map& map_ref = ECA_IAMODE_PARSER::registered_commands(); static std::map::const_iterator p; static std::string cmd; /* If this is a new word to complete, initialize now. This includes * saving the length of TEXT for efficiency, and initializing the index * variable to 0 */ if (!state) { list_index = 0; p = map_ref.begin(); len = strlen (text); } /* Return the next name which partially matches from the command list */ while (p != map_ref.end()) { cmd = p->first; list_index++; ++p; if (p != map_ref.end()) { std::string hyphenstr = kvu_string_search_and_replace(text, '_', '-'); if (strncmp(hyphenstr.c_str(), cmd.c_str(), len) == 0) { return strdup(cmd.c_str()); } } } return (char *)0; } #else #include "eca-curses.h" ECA_CURSES::ECA_CURSES(void) {} ECA_CURSES::~ECA_CURSES(void) {} void ECA_CURSES::print(const std::string& msg) {} void ECA_CURSES::print_banner(void) {} void ECA_CURSES::read_command(const std::string& prompt) {} const std::string& ECA_CURSES::last_command(void) const { static std::string empty; return empty; } void ECA_CURSES::init_readline_support(void) {} #endif /* ECA_PLATFORM_CURSES */ ecasound-2.9.3/ecasound/eca-neteci-server.h0000644000076400007640000000356111144366244015544 00000000000000#ifndef INCLUDED_ECA_NETECI_SERVER_H #define INCLUDED_ECA_NETECI_SERVER_H #include #include #include /* Generic socket definitions */ #include /* UNIX socket definitions */ #include /* IP socket definitions */ struct ecasound_state; class ECASOUND_RUN_STATE; struct ecasound_neteci_server_client { std::string peername; char* buffer; int fd; int buffer_current_ptr; int buffer_length; }; /** * NetECI server implementation. * * @author Kai Vehmanen */ class ECA_NETECI_SERVER { public: /** * Constructor. */ ECA_NETECI_SERVER(ECASOUND_RUN_STATE* state); /** * Virtual destructor. */ ~ECA_NETECI_SERVER(void); static void* launch_server_thread(void* arg); private: void run(void); void create_server_socket(void); void open_server_socket(void); void close_server_socket(void); void listen_for_events(void); void check_for_events(int timeout); void handle_connection(int fd); void handle_client_messages(struct ecasound_neteci_server_client* client); void handle_eci_command(const std::string& cmd, struct ecasound_neteci_server_client* client); void parse_raw_incoming_data(const char* buffer, ssize_t bytes, struct ecasound_neteci_server_client* client); void remove_client(struct ecasound_neteci_server_client* client); void clean_removed_clients(void); struct sockaddr_un addr_un_rep; struct sockaddr_in addr_in_rep; struct sockaddr* addr_repp; ECASOUND_RUN_STATE* state_repp; std::list clients_rep; /* FIXME: turn into a buffer of pointers to allow ptr-fields */ std::list parsed_cmd_queue_rep; std::string socketpath_rep; int srvfd_rep; bool server_listening_rep; bool unix_sockets_rep; bool cleanup_request_rep; }; #endif /* INCLUDED_ECA_NETECI_SERVER_H */ ecasound-2.9.3/ecasound/eca-curses.h0000644000076400007640000000200410664032032014253 00000000000000#ifndef INCLUDED_ECA_CURSES_H #define INCLUDED_ECA_CURSES_H #include #include "eca-console.h" /** * Abstract interface for console * mode ecasound user interface * implementations. * * @author Kai Vehmanen */ class ECA_CURSES : public ECA_CONSOLE { public: /** * Constructor. Initialized the GNU readline * interface. */ ECA_CURSES(void); /** * Virtual destructor. */ virtual ~ECA_CURSES(void); /** * Prints the text string 'msg'. */ virtual void print(const std::string& msg); /** * Prints the ecasound banner. */ virtual void print_banner(void); /** * Reads the next user command. * * @see last_command() */ virtual void read_command(const std::string& prompt); /** * Returns the last read user command. */ virtual const std::string& last_command(void) const; private: void init_readline_support(void); char* last_cmdchar_repp; std::string last_cmd_rep; bool rl_initialized_rep; }; #endif /* INCLUDED_ECA_CURSES_H */ ecasound-2.9.3/ecasound/eca-comhelp.cpp0000644000076400007640000002112412260766016014747 00000000000000// ------------------------------------------------------------------------ // ecasound.cpp: Console mode user interface to ecasound. // Copyright (C) 2000,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include "eca-comhelp.h" /* FIXME: get chainop list from libecasound! * - 2009/Jan: or maybe not, people should just be pointed to * ecasound(1) */ static const char* ecasound_parameter_help_rep = "USAGE: ecasound [options] \n" " -c enable interactive mode \n" " -C disable interactive mode (batchmode)\n" " -d:debug_level show debug info \n" " -D print all trace messages to stderr\n" " -q quiet mode, no output\n" " -s[:]file.ecs load chainsetup from 'file' \n" " -E \"foo1 ; foo 2\" execute interactive commands at start\n" " --server enable ecasound's network control mode\n" " --server-tcp-port=NNN use TCP port NNN\n" " --no-server disable the daemon mode (default)\n" " --osc-udp-port=NNN listen for OSC messages on UDP port NNN\n" " --keep-running (or -K) do not exit from batchmode\n" " --help (or -h) show this help\n" " --version print version info\n" " --- \n" " -b:buffersize size of sample buffer in samples\n" " -B:mode buffering mode\n" " -m:mixmode mixmode\n" " -n:name set chainsetup name\n" " -r[:priority] raise runtime priority\n" " -sr:sample_rate set internal sample rate\n" " -x truncate outputs\n" " -X open outputs for update (default)\n" " -z:feature enable feature 'feature', see ecasound(1)\n" " --- \n" " -t:seconds processing time in seconds\n" " -tl enable looping\n" " --- \n" " -a:name1,name2, ... select/create chains ('all' reserved)\n" " -f:type,channels,srate set file format (for all following inputs/outputs)\n" " -i[:]infile specify an input (assigned to active chains)\n" " -o[:]outfile specify an input (assigned to active chains)\n" " -y:seconds set start position for preceding input/output\n" " --- \n" " -Md:rawmidi,midi_device set MIDI-device\n" " -Mms:device_id send MMC start/stop\n" " -Mss send MIDI start/stop\n" " --- \n" " -pf:preset.eep insert the first preset from file 'preset.eep'\n" " -pn:preset_name insert preset 'preset_name' from the\n" " preset database\n" " --- \n" " -eS:stamp-id audio stamp\n" " -ea:amp-% amplify\n" " -eac:amp-%,channel channel amplify\n" " -eaw:amp-%,max-clipped-samples - \n" " amplify with clip-control\n" " -ec:compression-rate-dB,threshold-% ...\n" " compressor\n" " -eca:peak-limit-%,release-time-sec,fast-crate,overall-crate ...\n" " advanced compressor\n" " -eemb:bpm,on-time-msec pulse gate (bpm)\n" " -eemp:freq-Hz,on-time-% pulse gate\n" " -eemt:bpm,depth-% tremolo\n" " -ef1:center-freq,width resonant bandpass filter\n" " -ef3:cutoff-freq,resonance,gain ...\n" " resonant lowpass filter\n" " -ef4:cutoff-freq,resonance ...\n" " resonant lowpass filter (2nd-order,24dB)\n" " -efa:delay-samples,feedback-% ...\n" " allpass filter\n" " -efb:center-freq,width bandpass filter\n" " -efc:delay-samples,radius ...\n" " comb filter\n" " -efh:cutoff-freq highpass filter\n" " -efi:delay-samples,radius ...\n" " inverse comb filter\n" " -efl:cutoff-freq lowpass filter\n" " -efr:center-freq,width bandreject filter\n" " -efs:center-freq,width resonator filter\n" " -ei:change-% pitch shifter\n" " -el:name,par1,...,parN LADSPA-plugin 'name'\n" " -eli:id,par1,...,parnN LADSPA-plugin with numeric 'id'\n" " -elv2:uri,par1,...,parN LV2-plugin 'uri'\n" " -enm:threshold-level-%,pre-hold-time-msec,attack-time-msec,post-hold-time-msec,release-time-msec ...\n" " noise gate\n" " -erc:from-channel,to-channel ...\n" " copy 'from-channel' to 'to-channel'\n" " -erm:to-channel mix all channels to channel 'to-channel' \n" " -epp:right-% normal pan\n" " -etc:delay-time-msec,variance-time-samples,feedback-%,lfo-freq ...\n" " chorus\n" " -etd:delay-time-msec,surround-mode,number-of-delays,mix-%,feedback-% ...\n" " delay\n" " -ete:room-size,feedback-%,wet-% ...\n" " advanced reverb\n" " -etf:delay-time-msec fake stereo\n" " -etl:delay-time-msec,variance-time-samples,feedback-%,lfo-freq ...\n" " flanger\n" " -etm:delay-time-msec,number-of-delays,mix-% ...\n" " multitap delay\n" " -etp:delay-time-msec,variance-time-samples,feedback-%,lfo-freq ...\n" " phaser\n" " -etr:delay-time,surround-mode,feedback-% ...\n" " reverb\n" " -ev:cumulative-mode,result-max-multiplier ...\n" " analyze/maximize volume\n" " -evp:peak-ch1,peak-chN peak amplitude watcher\n" " -ezf find optimal value for DC-offset adjustment\n" " -ezx:channel-count,delta-ch1,...,delta-chN\n" " adjust DC-offset\n" " --- \n" " -gc:open-at-sec,duration-sec ...\n" " time crop gate\n" " -ge:threshold-openlevel-%,threshold-closelevel-%,rms-enabled ...\n" " threshold gate\n" " --- \n" " -kf:param-id,range-low,range-high,freq,mode,preset-number ...\n" " file envelope (generic oscillator)\n" " -kl:param-id,range-low,range-high,length-sec ...\n" " linear envelope (fade-in and fade-out)\n" " -kl2:param-id,range-low,range-high,1st-stage-sec,2nd-stage-sec ...\n" " two-stage linear envelope\n" " -klg:param-id,range-low,range-high,point_count ...\n" " generic linear envelope\n" " -km:param-id,range-low,range-high,controller,channel ...\n" " MIDI-controlled envelope\n" " -kog:param-id,range-low,range-high,freq,mode,pcount,start_val,end_val ...\n" " generic oscillator\n" " -kos:param-id,range-low,range-high,freq,phase-offset ...\n" " sine oscillator\n" " -ksv:param-id,range-low,range-high,stamp-id,rms-toggle ...\n" " volume analyzing controller" " --- \n" " -kx use last specified controller as\n" " controller target\n" "\n" "Note that this is only a partial list of available options. For\n" "a complete list of available options, as well as more detailed\n" "descriptions of of their use, see ecasound(1) manual page and\n" "the documentation at ecasound's website. Documentation is available\n" "online at:\n" " - http://nosignal.fi/ecasound/Documentation/ecasound_manpage.html\n" " - http://nosignal.fi/ecasound/Documentation/examples.html\n" "\n" "Report bugs to ecasound-list mailing list (http://nosignal.fi/ecasound/mlists.php).\n"; const char* ecasound_parameter_help(void) { return ecasound_parameter_help_rep; } ecasound-2.9.3/ecasound/eca-plaintext.cpp0000644000076400007640000000410111546665537015340 00000000000000// ------------------------------------------------------------------------ // eca-plaintext.cpp: Plaintext implementation of the console user // interface. // Copyright (C) 2002-2004 Kai Vehmanen // // Attributes: // eca-style-version: 2 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include "ecasound.h" #include "eca-plaintext.h" using namespace std; ECA_PLAIN_TEXT::ECA_PLAIN_TEXT(std::ostream* ostr) { ostream_repp = ostr; } ECA_PLAIN_TEXT::~ECA_PLAIN_TEXT(void) { } void ECA_PLAIN_TEXT::print(const std::string& msg) { *ostream_repp << msg << endl; } void ECA_PLAIN_TEXT::print_banner(void) { *ostream_repp << ECASOUND_BANNER_ASTERISK_BAR; *ostream_repp << "*"; *ostream_repp << " ecasound v" << ecasound_library_version << ECASOUND_COPYRIGHT; *ostream_repp << "\n"; *ostream_repp << ECASOUND_BANNER_ASTERISK_BAR; } void ECA_PLAIN_TEXT::read_command(const string& prompt) { if (ostream_repp->good() == true) { *ostream_repp << prompt; ostream_repp->flush(); if (cin.good() == true) { getline(cin, last_cmd_rep); } else { last_cmd_rep = "q"; } } else { last_cmd_rep = "q"; } } const string& ECA_PLAIN_TEXT::last_command(void) const { return last_cmd_rep; } ecasound-2.9.3/ecasound/eca-console.h0000644000076400007640000000142210664032032014414 00000000000000#ifndef INCLUDED_ECA_CONSOLE_H #define INCLUDED_ECA_CONSOLE_H #include /** * Abstract interface for console * mode ecasound user interface * implementations. * * @author Kai Vehmanen */ class ECA_CONSOLE { public: /** * Prints the text string 'msg'. */ virtual void print(const std::string& msg) = 0; /** * Prints the ecasound banner. */ virtual void print_banner(void) = 0; /** * Reads the next user command. * * @param prompt prompt shown to user * * @see last_command() */ virtual void read_command(const std::string& prompt) = 0; /** * Returns the last read user command. */ virtual const std::string& last_command(void) const = 0; virtual ~ECA_CONSOLE(void) {}; }; #endif /* INCLUDED_ECA_CONSOLE_H */ ecasound-2.9.3/ecasound/Makefile.am0000644000076400007640000000255512303075645014130 00000000000000AM_CPPFLAGS = -I$(ECA_S_READLINE_INCLUDES) -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/libecasound -I$(top_srcdir)/kvutils if ECA_AM_USE_NCURSES termcap_library_ncurses = -lncurses endif if ECA_AM_USE_TERMCAP termcap_library_termcap = -ltermcap endif termcap_library = $(termcap_library_ncurses) $(termcap_library_termcap) if ECA_AM_DEBUG_MODE bin_PROGRAMS = ecasound_debug else bin_PROGRAMS = ecasound endif ecasound_SOURCES = ecasound.cpp \ ecasound.h \ eca-console.h \ eca-curses.h \ eca-curses.cpp \ eca-comhelp.cpp \ eca-comhelp.h \ eca-neteci-server.cpp \ eca-neteci-server.h \ eca-plaintext.h \ eca-plaintext.cpp \ textdebug.cpp \ textdebug.h ecasound_debug_SOURCES = $(ecasound_SOURCES) ecasound_LDFLAGS = -export-dynamic ecasound_LDADD = $(termcap_library) \ $(ECA_S_READLINE_LIBS) \ $(top_builddir)/libecasound/libecasound.la \ $(top_builddir)/kvutils/libkvutils.la ecasound_debug_LDFLAGS = $(ecasound_LDFLAGS) ecasound_debug_LDADD = $(termcap_library) \ $(ECA_S_READLINE_LIBS) \ $(top_builddir)/libecasound/libecasound_debug.la \ $(top_builddir)/kvutils/libkvutils_debug.la # -- # special targets with dependency tracking ecainstall: $(MAKE) -C $(srcdir)/../libecasound -q 2>/dev/null || make -C $(srcdir)/../libecasound $(MAKE) -C $(srcdir)/../kvutils -q 2>/dev/null || make -C $(srcdir)/../kvutils $(MAKE) install ecasound-2.9.3/ecasound/eca-comhelp.h0000644000076400007640000000016210664032032014401 00000000000000#ifndef INCLUDED_ECA_COMHELP_H #define INCLUDED_ECA_COMHELP_H const char* ecasound_parameter_help(void); #endif ecasound-2.9.3/ecasound/ecasound.h0000644000076400007640000000364613606335516014053 00000000000000#ifndef INCLUDED_ECASOUND_H #define INCLUDED_ECASOUND_H #include #include #include /* POSIX: pthread_create() */ #include /* POSIX: sigaction(), sigwait(), sig_atomic_t */ class ECA_CONSOLE; class ECA_CONTROL_MT; class ECA_LOGGER_INTERFACE; class ECA_NETECI_SERVER; class ECA_SESSION; class ECA_OSC_INTERFACE; /** * String constants */ #define ECASOUND_BANNER_ASTERISK_BAR "********************************************************************************\n" #define ECASOUND_COPYRIGHT " (C) 1997-2020 Kai Vehmanen and others " #define ECASOUND_RETVAL_SUCCESS 0 /**< Succesful run */ #define ECASOUND_RETVAL_INIT_FAILURE 1 /**< Unable to initialize */ #define ECASOUND_RETVAL_START_ERROR 2 /**< Unable to start processing */ #define ECASOUND_RETVAL_RUNTIME_ERROR 3 /**< Error during processing */ #define ECASOUND_RETVAL_CLEANUP_ERROR 4 /**< Error during cleanup/exit */ #define ECASOUND_TERM_WIDTH_DEFAULT 74 /** * Type definitions */ /* Note! Check the initialization in ecasound.cpp if * you change the state struct! */ class ECASOUND_RUN_STATE { public: ECASOUND_RUN_STATE(void); ~ECASOUND_RUN_STATE(void); void exit_request(void); bool exit_requested(void); void lock(void); void unlock(void); ECA_CONSOLE* console; ECA_CONTROL_MT* control; ECA_LOGGER_INTERFACE* logger; ECA_NETECI_SERVER* eciserver; ECA_OSC_INTERFACE* osc; ECA_SESSION* session; std::vector* launchcmds; pthread_t* neteci_thread; pthread_t* watchdog_thread; pthread_mutex_t lock_rep; pthread_cond_t cond_rep; bool wd_alive; sig_atomic_t exit_request_rep; sigset_t* signalset; int retval; bool neteci_mode; int neteci_tcp_port; bool osc_mode; int osc_udp_port; bool keep_running_mode; bool cerr_output_only_mode; bool interactive_mode; bool quiet_mode; }; #endif /* INCLUDED_ECASOUND_H */ ecasound-2.9.3/ecasound/ecasound.cpp0000644000076400007640000007134513606335523014405 00000000000000// ------------------------------------------------------------------------ // ecasound.cpp: Console mode user interface to ecasound. // Copyright (C) 2002-2019 Kai Vehmanen // // Attributes: // eca-style-version: 3 (see Ecasound Programmer's Guide) // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include /* POSIX: various signal functions */ #include /* POSIX: sleep() */ #include #include #include #include #include #include #include #include #include #include #ifdef ECA_USE_LIBLO #include #endif #include "eca-comhelp.h" #include "eca-console.h" #include "eca-curses.h" #include "eca-neteci-server.h" #include "eca-plaintext.h" #include "textdebug.h" #include "ecasound.h" /** * Check build time reqs */ #undef SIGNALS_CAN_BE_BLOCKED #if defined(HAVE_SIGWAIT) && defined(HAVE_PTHREAD_SIGMASK) && defined(HAVE_SIGPROCMASK) # define SIGNALS_CAN_BE_BLOCKED #endif /** * Static/private function definitions */ static void ecasound_create_eca_objects(ECASOUND_RUN_STATE* state, COMMAND_LINE& cline); static void ecasound_launch_neteci(ECASOUND_RUN_STATE* state); static void ecasound_launch_osc(ECASOUND_RUN_STATE* state); static int ecasound_pass_at_launch_commands(ECASOUND_RUN_STATE* state); static void ecasound_main_loop_interactive(ECASOUND_RUN_STATE* state); static void ecasound_main_loop_batch(ECASOUND_RUN_STATE* state); void ecasound_parse_command_line(ECASOUND_RUN_STATE* state, const COMMAND_LINE& clinein, COMMAND_LINE* clineout); static void ecasound_print_usage(void); static void ecasound_print_version_banner(void); static void ecasound_signal_setup(ECASOUND_RUN_STATE* state); static void ecasound_signal_unblock(void); #ifdef SIGNALS_CAN_BE_BLOCKED extern "C" { static void* ecasound_watchdog_thread(void* arg); static void ecasound_signal_handler(int signal); } #endif /* Define to get exit debug traces */ // #define ENABLE_ECASOUND_EXIT_PROCESS_TRACES 1 /* Exit process has not yet started. */ #define ECASOUND_EXIT_PHASE_NONE 0 /* Termination will block until signal watchdog thread * has exited. */ #define ECASOUND_EXIT_PHASE_WAIT_FOR_WD 1 /* Watchdog has terminated, only a single thread * is left running. */ #define ECASOUND_EXIT_PHASE_ONE_THREAD 2 /* All resources freed, about to return from main(). */ #define ECASOUND_EXIT_PHASE_DONE 3 /** * Global variable that is set to one of 'ECASOUND_EXIT_PHASE_*' * * When ecasound's main() function is about to exit (all engine * threads have been terminated and only single thread aside the * watchdog is left, and to ECASOUND_EXIT_PHASE_ONE_THREAD when * all running state has been clearer in ~ECASOUND_RUN_STATE(). */ static sig_atomic_t glovar_ecasound_exit_phase = ECASOUND_EXIT_PHASE_NONE; /* Global variable that is set to one, when common * POSIX signals are blocked and watchdog thread is * blocking on a call to sigwait(). */ static sig_atomic_t glovar_wd_signals_blocked = 0; /* Global variable counting how many SIGINT signals * have been ignored. */ static sig_atomic_t glovar_soft_signals_ignored = 0; /* Debugging macros, see ENABLE_ECASOUND_EXIT_PROCESS_TRACES * above */ #ifdef ENABLE_ECASOUND_EXIT_PROCESS_TRACES #define TRACE_EXIT(x) do { x; } while(0) #else #define TRACE_EXIT(x) while(0) { x; } #endif /** * Namespace imports */ using namespace std; ECASOUND_RUN_STATE::ECASOUND_RUN_STATE(void) : console(0), control(0), logger(0), eciserver(0), osc(0), session(0), launchcmds(0), neteci_thread(0), watchdog_thread(0), wd_alive(false), exit_request_rep(0), signalset(0), retval(ECASOUND_RETVAL_SUCCESS), neteci_mode(false), neteci_tcp_port(2868), osc_mode(false), osc_udp_port(-1), keep_running_mode(false), cerr_output_only_mode(false), interactive_mode(false), quiet_mode(false) { pthread_mutex_init(&lock_rep, NULL); pthread_cond_init(&cond_rep, NULL); } ECASOUND_RUN_STATE::~ECASOUND_RUN_STATE(void) { /* note: global variable */ DBC_CHECK(glovar_ecasound_exit_phase == ECASOUND_EXIT_PHASE_ONE_THREAD); if (control != 0) { delete control; control = 0; } if (session != 0) { delete session; session = 0; } if (launchcmds != 0) { delete launchcmds; launchcmds = 0; } if (eciserver != 0) { delete eciserver; eciserver = 0; } #ifdef ECA_USE_LIBLO if (osc != 0) { delete osc; osc = 0; } #endif if (console != 0) { delete console; console = 0; } if (neteci_thread != 0) { delete neteci_thread; neteci_thread = 0; } if (watchdog_thread != 0) { delete watchdog_thread; watchdog_thread = 0; } if (signalset != 0) { delete signalset; signalset = 0; } glovar_ecasound_exit_phase = ECASOUND_EXIT_PHASE_DONE; } void ECASOUND_RUN_STATE::lock(void) { pthread_mutex_lock(&lock_rep); } void ECASOUND_RUN_STATE::unlock(void) { pthread_mutex_unlock(&lock_rep); } void ECASOUND_RUN_STATE::exit_request(void) { lock(); exit_request_rep = true; unlock(); } bool ECASOUND_RUN_STATE::exit_requested(void) { bool v = false; lock(); if (exit_request_rep) v = true; unlock(); return v; } /** * Function definitions */ int main(int argc, char *argv[]) { ECASOUND_RUN_STATE state; bool have_curses = #if defined(ECA_PLATFORM_CURSES) true #else false #endif ; /* 1. setup signals and the signal watchdog thread */ ecasound_signal_setup(&state); /* 2. parse command-line args */ COMMAND_LINE* cline = new COMMAND_LINE(argc, argv); COMMAND_LINE* clineout = new COMMAND_LINE(); ecasound_parse_command_line(&state, *cline, clineout); delete cline; cline = 0; /* 3. create console interface */ if (state.retval == ECASOUND_RETVAL_SUCCESS) { if (have_curses == true && state.quiet_mode != true && state.cerr_output_only_mode != true) { state.console = new ECA_CURSES(); state.logger = new TEXTDEBUG(); } else { ostream* ostr = (state.cerr_output_only_mode == true) ? &cerr : &cout; state.console = new ECA_PLAIN_TEXT(ostr); state.logger = new ECA_LOGGER_DEFAULT(*ostr); } ECA_LOGGER::attach_logger(state.logger); if (state.quiet_mode != true) { /* 4. print banner */ state.console->print_banner(); } /* 5. set default debug levels */ ECA_LOGGER::instance().set_log_level(ECA_LOGGER::errors, true); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::info, true); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::subsystems, true); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::eiam_return_values, true); ECA_LOGGER::instance().set_log_level(ECA_LOGGER::module_names, true); /* 6. create eca objects */ ecasound_create_eca_objects(&state, *clineout); delete clineout; clineout = 0; /* 7. enable remote control over socket connection */ if (state.retval == ECASOUND_RETVAL_SUCCESS) { /* 7.a) ... ECI over socket connection */ if (state.neteci_mode == true) { ecasound_launch_neteci(&state); } /* 7.b) ... over OSC */ if (state.osc_mode == true) { ecasound_launch_osc(&state); } } /* 8. pass launch commands */ ecasound_pass_at_launch_commands(&state); /* 9. start processing */ if (state.retval == ECASOUND_RETVAL_SUCCESS) { if (state.interactive_mode == true) ecasound_main_loop_interactive(&state); else ecasound_main_loop_batch(&state); } } TRACE_EXIT(cerr << endl << "ecasound: out of mainloop..." << endl); /* step: terminate neteci thread */ if (state.neteci_mode == true) { /* wait until the NetECI thread has exited */ state.exit_request(); if (state.neteci_thread) pthread_join(*state.neteci_thread, NULL); } /* step: terminate the engine thread */ if (state.control != 0) { if (state.control->is_running() == true) { state.control->stop_on_condition(); } if (state.control->is_connected() == true) { state.control->disconnect_chainsetup(); } } state.lock(); glovar_ecasound_exit_phase = ECASOUND_EXIT_PHASE_WAIT_FOR_WD; state.unlock(); TRACE_EXIT(cerr << endl << "ecasound: joining watchdog..." << endl); /* step: Send a signal to the watchdog thread to wake it up */ if (state.watchdog_thread) pthread_kill(*state.watchdog_thread, SIGHUP); TRACE_EXIT(cerr << endl << "ecasound: SIGHUP sent, unblock..." << endl); /* step: Unblock signals for the main thread as well (but not * SIGHUP -> this is very important). * At this point the engine threads have been already terminated, * so we don't have to anymore worry about which thread * gets the signals. */ ecasound_signal_unblock(); TRACE_EXIT(cerr << endl << "ecasound: the actual join" << endl); if (state.watchdog_thread) pthread_join(*state.watchdog_thread, NULL); TRACE_EXIT(cerr << endl << "ecasound: joined watchdog..." << endl); glovar_ecasound_exit_phase = ECASOUND_EXIT_PHASE_ONE_THREAD; DBC_CHECK(state.retval == ECASOUND_RETVAL_SUCCESS || state.retval == ECASOUND_RETVAL_INIT_FAILURE || state.retval == ECASOUND_RETVAL_START_ERROR || state.retval == ECASOUND_RETVAL_RUNTIME_ERROR); TRACE_EXIT(cerr << endl << "ecasound: main() exiting with code " << state.retval << endl); return state.retval; } /** * Enters the main processing loop. */ void ecasound_create_eca_objects(ECASOUND_RUN_STATE* state, COMMAND_LINE& cline) { DBC_REQUIRE(state != 0); DBC_REQUIRE(state->console != 0); try { state->session = new ECA_SESSION(cline); state->control = new ECA_CONTROL_MT(state->session); DBC_ENSURE(state->session != 0); DBC_ENSURE(state->control != 0); } catch(ECA_ERROR& e) { state->console->print("---\necasound: ERROR: [" + e.error_section() + "] : \"" + e.error_message() + "\"\n"); state->retval = ECASOUND_RETVAL_INIT_FAILURE; } } /** * Launches a background thread that allows NetECI * clients to connect to the current ecasound * session. */ void ecasound_launch_neteci(ECASOUND_RUN_STATE* state) { DBC_REQUIRE(state != 0); // DBC_REQUIRE(state->console != 0); // state->console->print("ecasound: starting the NetECI server."); state->neteci_thread = new pthread_t; state->eciserver = new ECA_NETECI_SERVER(state); int res = pthread_create(state->neteci_thread, NULL, ECA_NETECI_SERVER::launch_server_thread, reinterpret_cast(state->eciserver)); if (res != 0) { cerr << "ecasound: Warning! Unable to create a thread for control over socket connection (NetECI)." << endl; delete state->neteci_thread; state->neteci_thread = 0; delete state->eciserver; state->eciserver = 0; } // state->console->print("ecasound: NetECI server started"); } /** * Sets up and activates Ecasound OSC interface */ void ecasound_launch_osc(ECASOUND_RUN_STATE* state) { #ifdef ECA_USE_LIBLO DBC_REQUIRE(state != 0); state->osc = new ECA_OSC_INTERFACE (state->control, state->osc_udp_port); if (state->osc) state->osc->start(); #endif } static int ecasound_pass_at_launch_commands(ECASOUND_RUN_STATE* state) { if (state->launchcmds) { std::vector::const_iterator p = state->launchcmds->begin(); while(p != state->launchcmds->end()) { struct eci_return_value retval; state->control->command(*p, &retval); state->control->print_last_value(&retval); ++p; } } return 0; } static void ecasound_check_for_quit(ECASOUND_RUN_STATE* state, const string& cmd) { if (cmd == "quit" || cmd == "q") { state->console->print("---\necasound: Exiting..."); state->exit_request(); ECA_LOGGER::instance().flush(); } } /** * The main processing loop for interactive use. */ void ecasound_main_loop_interactive(ECASOUND_RUN_STATE* state) { DBC_REQUIRE(state != 0); DBC_REQUIRE(state->console != 0); ECA_CONTROL_MAIN* ctrl = state->control; while(state->exit_requested() != true) { state->console->read_command("ecasound ('h' for help)> "); const string& cmd = state->console->last_command(); if (cmd.size() > 0 && state->exit_requested() != true) { struct eci_return_value retval; ctrl->command(cmd, &retval); ctrl->print_last_value(&retval); ecasound_check_for_quit(state, cmd); } } } /** * The main processing loop for noninteractive use. */ void ecasound_main_loop_batch(ECASOUND_RUN_STATE* state) { DBC_REQUIRE(state != 0); DBC_REQUIRE(state->console != 0); ECA_CONTROL_MAIN* ctrl = state->control; struct eci_return_value connect_retval; if (ctrl->is_selected() == true && ctrl->is_valid() == true) { ctrl->connect_chainsetup(&connect_retval); } if (state->neteci_mode != true && state->osc_mode != true) { /* case: 2.1: non-interactive, neither NetECI or OSC is used, * so this thread can use 'ctrl' exclusively */ if (ctrl->is_connected() == true) { if (state->exit_requested() != true) { int res = ctrl->run(!state->keep_running_mode); if (res < 0) { state->retval = ECASOUND_RETVAL_RUNTIME_ERROR; cerr << "ecasound: Warning! Errors detected during processing." << endl; } } } else { ctrl->print_last_value(&connect_retval); state->retval = ECASOUND_RETVAL_START_ERROR; } } else { /* case: 2.2: non-interactive, NetECI active * * (special handling is needed as NetECI needs * to submit atomic bundles of ECI commands and thus * needs to be able to lock the ECA_CONTROL object * for itself) */ int res = -1; if (ctrl->is_connected() == true) { res = ctrl->start(); } /* note: if keep_running_mode is enabled, we do not * exit even if there are errors during startup */ if (state->keep_running_mode != true && res < 0) { state->retval = ECASOUND_RETVAL_START_ERROR; state->exit_request(); } while(state->exit_requested() != true) { if (state->keep_running_mode != true && ctrl->is_finished() == true) break; /* note: sleep for one second and let the NetECI thread * access the ECA_CONTROL object for a while */ /* FIXME: a proper wait mechanism should be implemented * instead of waking up continuously after sleep */ kvu_sleep(1, 0); } ecasound_check_for_quit(state, "quit"); } // cerr << endl << "ecasound: mainloop exiting..." << endl; } /** * Parses the command lines options in 'cline'. */ void ecasound_parse_command_line(ECASOUND_RUN_STATE* state, const COMMAND_LINE& cline, COMMAND_LINE* clineout) { if (cline.size() < 2) { ecasound_print_usage(); state->retval = ECASOUND_RETVAL_INIT_FAILURE; } else { bool jack_defaults_set = false; cline.begin(); while(cline.end() != true) { /* libecasound options we also parse: * ---------------------------------- */ if (cline.current() == "-o:stdout" || cline.current() == "stdout") { state->cerr_output_only_mode = true; /* pass option to libecasound */ clineout->push_back(cline.current()); } else if (cline.current() == "-d:0" || cline.current() == "-q") { state->quiet_mode = true; /* pass option to libecasound */ clineout->push_back(cline.current()); } else if (cline.current().compare(0, 8, "-G:jack,") == 0) { /* see action at the end of function */ jack_defaults_set = true; /* pass option to libecasound */ clineout->push_back(cline.current()); } /* ecasound frontend specific options: * ----------------------------------- */ else if (cline.current() == "-c") { state->interactive_mode = true; } else if (cline.current() == "-C") { state->interactive_mode = false; } else if (cline.current() == "-D") { state->cerr_output_only_mode = true; } else if (cline.current() == "--server" || cline.current() == "--daemon") { /* note: --daemon* deprecated as of 2.6.0 */ state->neteci_mode = true; } else if (cline.current().compare(0, 2, "-E") == 0) { cline.next(); if (cline.end() != true) { state->launchcmds = new std::vector (kvu_string_to_vector(cline.current(), ';')); } } else if (cline.current().find("--server-tcp-port") != string::npos || cline.current().find("--daemon-port") != string::npos) { std::vector argpair = kvu_string_to_vector(cline.current(), '='); if (argpair.size() > 1) { /* --server-tcp-port=XXXX */ /* note: --daemon* deprecated as of 2.6.0 */ state->neteci_tcp_port = atoi(argpair[1].c_str()); } } else if (cline.current() == "--no-server" || cline.current() == "--nodaemon") { /* note: --daemon deprecated as of 2.6.0 */ state->neteci_mode = false; } else if (cline.current().find("--osc-udp-port") != string::npos) { std::vector argpair = kvu_string_to_vector(cline.current(), '='); if (argpair.size() > 1) { /* --osc-udp-port=XXXX */ state->osc_udp_port = atoi(argpair[1].c_str()); fprintf(stdout, "set UDP port based on %s to %d.\n", cline.current().c_str(), state->osc_udp_port); } #ifdef ECA_USE_LIBLO state->osc_mode = true; #else state->osc_mode = false; cerr << "ERROR: ecasound was built without OSC support" << endl; #endif } else if (cline.current() == "-h" || cline.current() == "--help") { ecasound_print_usage(); state->retval = ECASOUND_RETVAL_INIT_FAILURE; break; } else if (cline.current() == "-K" || cline.current() == "--keep-running") { state->keep_running_mode = true; } else if (cline.current() == "--version") { ecasound_print_version_banner(); state->retval = ECASOUND_RETVAL_INIT_FAILURE; break; } else { /* pass rest of the options to libecasound */ clineout->push_back(cline.current()); } cline.next(); } if (jack_defaults_set != true && state->interactive_mode != true) { /* having JACK transport support enabled in batchmode can * be very confusing to users */ clineout->push_back("-G:jack,ecasound,notransport"); } } } void ecasound_print_usage(void) { cout << ecasound_parameter_help(); } void ecasound_print_version_banner(void) { cout << "ecasound v" << ecasound_library_version << endl; cout << "Copyright (C) 1997-2020 Kai Vehmanen and others." << endl; cout << "Ecasound comes with ABSOLUTELY NO WARRANTY." << endl; cout << "You may redistribute copies of ecasound under the terms of the GNU" << endl; cout << "General Public License. For more information about these matters, see" << endl; cout << "the file named COPYING." << endl; } static void ecasound_signal_handler(int signal) { /* note: If either sigprocmask() or pthread_sigmask() * is available, all relevant signals should be blocked * and this handler should be never called until the final * phase (ECASOUND_EXIT_PHASE_WAIT_FOR_WD) of the process * termination starts. */ #if defined(SIGNALS_CAN_BE_BLOCKED) if (glovar_wd_signals_blocked) { TRACE_EXIT(cerr << "WARNING: ecasound_signal_handler entered, this should _NOT_ happen!"; cerr << " pid=" << getpid() << endl); } #else /* !SIGNALS_CAN_BE_BLOCKED */ { /* note: user needs to see this, not using TRACE_EXIT() macro */ cerr << endl << "WARNING: Ecasound received signal (" << signal << ").\n" << " This version of Ecasound was built without sigwait() support\n" << " so process will be terminated immediately.\n" << " Normal exit process is skipped, which may have some side-effects\n" << " (e.g. file header information not updated).\n"; exit(ECASOUND_RETVAL_CLEANUP_ERROR); } #endif TRACE_EXIT(cerr << "Signal " << signal << " received in exit phase " << glovar_ecasound_exit_phase << endl); /* note: In ECASOUND_EXIT_PHASE_WAIT_FOR_WD, the main() thread * will send a signal to the watchdog and we need to * ignore this properly (as it's an internally generated * signal, not sent from an external source. */ if (glovar_ecasound_exit_phase == ECASOUND_EXIT_PHASE_NONE || glovar_ecasound_exit_phase == ECASOUND_EXIT_PHASE_ONE_THREAD || glovar_ecasound_exit_phase == ECASOUND_EXIT_PHASE_DONE) { if (signal == SIGINT && glovar_soft_signals_ignored == 0) { cerr << endl << "NOTICE: SIGINT (ctrl-c) was received while terminating ecasound. If\n" << " another signal is received, the normal cleanup procedure will\n" << " be skipped and process will terminate immediately.\n"; glovar_soft_signals_ignored = 1; return; } /* note: user needs to see this, not using TRACE_EXIT() macro */ cerr << endl << "WARNING: Signal was received while terminating ecasound, so exiting immediately!\n" << " Normal exit process is skipped, which may have some side-effects\n" << " (e.g. file header information not updated).\n"; /* step: Make sure the watchdog is woken up (a hack, but it seems * exit() can in some cases be blocked when watchdog is * still in sigwait() at this point. */ if (signal != SIGHUP) kill(0, SIGHUP); exit(ECASOUND_RETVAL_CLEANUP_ERROR); } } /** * Sets up a signal mask with sigaction() that blocks * all common signals, and then launces a signal watchdog * thread that waits on the blocked signals using * sigwait(). * * This design causes all non-fatal termination signals * to be routed through a single thread. This signal watchdog * in turn performs a clean exit upon receiving a signal. * Without this setup, interactions between threads when handling * would be harder to control (especially considering that * ecasound needs to work on various different platforms). */ void ecasound_signal_setup(ECASOUND_RUN_STATE* state) { sigset_t* signalset; /* man pthread_sigmask: * "...signal actions and signal handlers, as set with * sigaction(2), are shared between all threads" */ /* handle the following signals explicitly */ signalset = new sigset_t; state->signalset = signalset; sigemptyset(signalset); sigaddset(signalset, SIGTERM); sigaddset(signalset, SIGINT); sigaddset(signalset, SIGPIPE); sigaddset(signalset, SIGQUIT); /* note: SIGHUP is special and it must remain blocked at * all times if signal watchdog thread is run */ sigaddset(signalset, SIGHUP); /* create a dummy signal handler */ struct sigaction blockaction; blockaction.sa_handler = ecasound_signal_handler; sigemptyset(&blockaction.sa_mask); blockaction.sa_flags = 0; /* attach the dummy handler to the following signals */ sigaction(SIGTERM, &blockaction, 0); sigaction(SIGINT, &blockaction, 0); sigaction(SIGHUP, &blockaction, 0); sigaction(SIGPIPE, &blockaction, 0); sigaction(SIGQUIT, &blockaction, 0); #ifdef __FreeBSD__ /* ignore signals instead of passing them to our handler */ blockaction.sa_handler = SIG_IGN; sigaction(SIGFPE, &blockaction, 0); #endif #if defined(SIGNALS_CAN_BE_BLOCKED) /* note: this is done on purpose before the thread creation so * that the signal mask is inherited */ pthread_sigmask(SIG_BLOCK, signalset, NULL); state->watchdog_thread = new pthread_t; int res = pthread_create(state->watchdog_thread, NULL, ecasound_watchdog_thread, reinterpret_cast(state)); if (res != 0) { cerr << "ecasound: Warning! Unable to create watchdog thread." << endl; } pthread_mutex_lock(&state->lock_rep); /* note: specific to sigwait() logic */ glovar_wd_signals_blocked = 1; while(state->wd_alive != true) { pthread_cond_wait(&state->cond_rep, &state->lock_rep); }; pthread_mutex_unlock(&state->lock_rep); #else /* !SIGNALS_CAN_BE_BLOCKED */ /* note: no sigwait() so no need to bother with a wd thread */ state->watchdog_thread = 0; glovar_wd_signals_blocked = 0; #endif } /** * Unblocks SIGTERM, SIGINT, SIGPIPE and SIGQUIT signals for * the calling thread, or in case pthread_sigmask() is not supported, * for the whole process. */ static void ecasound_signal_unblock(void) { #ifdef SIGNALS_CAN_BE_BLOCKED sigset_t sigs; sigemptyset(&sigs); sigaddset(&sigs, SIGTERM); sigaddset(&sigs, SIGINT); sigaddset(&sigs, SIGPIPE); sigaddset(&sigs, SIGQUIT); sigprocmask(SIG_UNBLOCK, &sigs, NULL); #endif } /* * Signal watchdog implementation * ------------------------------- */ #ifdef SIGNALS_CAN_BE_BLOCKED static void ecasound_wd_prepare_for_signals(ECASOUND_RUN_STATE* state) { /* only if sigwait() and pthread_sigmask() are available */ pthread_sigmask(SIG_BLOCK, state->signalset, NULL); glovar_wd_signals_blocked = 1; } static void ecasound_wd_wait_for_signals(ECASOUND_RUN_STATE* state, int *signalno) { /* only if sigwait() and pthread_sigmask() are available */ sigwait(state->signalset, signalno); TRACE_EXIT(cerr << endl << "(ecasound-watchdog) Received signal " << *signalno << ". Cleaning up and exiting..." << endl); } /** * Runs a watchdog thread that centrally catches signals that * will cause ecasound to exit. */ void* ecasound_watchdog_thread(void* arg) { ECASOUND_RUN_STATE* state = reinterpret_cast(arg); int signalno = 0; TRACE_EXIT(cerr << endl << "(ecasound-watchdog) thread started..." << endl); ecasound_wd_prepare_for_signals(state); /* step: announce we are alive */ // cerr << "Watchdog-thread created, pid=" << getpid() << "." << endl; state->lock(); state->wd_alive = true; pthread_cond_broadcast(&state->cond_rep); state->unlock(); TRACE_EXIT(cerr << endl << "(ecasound-watchdog) startup sync done, waiting for signals" << endl); /* step: block until a signal is received */ ecasound_wd_wait_for_signals(state, &signalno); TRACE_EXIT(cerr << endl << "(ecasound-watchdog) out of sigwait" << endl); /* step: unblock signals for watchdog thread after process * termination has been started */ ecasound_signal_unblock(); state->lock(); glovar_wd_signals_blocked = 0; state->unlock(); TRACE_EXIT(cerr << endl << "(ecasound-watchdog) signals unblocked, exit req up" << endl); /* step: signal the mainloop that process should terminate */ state->exit_request(); /* step: in case mainloop is blocked running a batch job, we signal * the engine thread directly and force it to terminate. * This operation is thread-safe as main thread will not * delete state until watchdog has terminated, and * quit_async() is thread safe by design. */ if (state->interactive_mode != true && state->control) state->control->quit_async(); TRACE_EXIT(cerr << endl << "(ecasound-watchdog) looping until main reaches join point..." << endl); while(glovar_ecasound_exit_phase != ECASOUND_EXIT_PHASE_WAIT_FOR_WD) { TRACE_EXIT(cerr << "(ecasound-watchdog) watchdog thread exiting (looping)..." << endl); /* sleep for one 200ms */ kvu_sleep(0, 200000000); /* note: A race condition exists between ECA_CONTROL_BASE * quit_async() and run(): if quit_async() is called * after run() has been entered, but before run() * has managed to start the engine, it is possible engine * may still be started. * * Thus we will keep checking the engine status until * shutdown is really completed. * * For robustness, this check is also done when in * interactive mode (in case the mainloop does not for * some reason react to our exit request). */ if (state->control) { if (state->control->is_engine_ready_for_commands() == true) { state->control->quit_async(); } } } /* note: this function should always exit before main() */ DBC_CHECK(glovar_ecasound_exit_phase == ECASOUND_EXIT_PHASE_WAIT_FOR_WD); TRACE_EXIT(cerr << endl << "(ecasound-watchdog) thread exiting..." << endl); return 0; } #endif /* SIGNALS_CAN_BE_BLOCKED */ ecasound-2.9.3/ecasound/Makefile.in0000644000076400007640000005045213606336177014147 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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@ @ECA_AM_DEBUG_MODE_FALSE@bin_PROGRAMS = ecasound$(EXEEXT) @ECA_AM_DEBUG_MODE_TRUE@bin_PROGRAMS = ecasound_debug$(EXEEXT) subdir = ecasound DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(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 = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_ecasound_OBJECTS = ecasound.$(OBJEXT) eca-curses.$(OBJEXT) \ eca-comhelp.$(OBJEXT) eca-neteci-server.$(OBJEXT) \ eca-plaintext.$(OBJEXT) textdebug.$(OBJEXT) ecasound_OBJECTS = $(am_ecasound_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) ecasound_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(top_builddir)/libecasound/libecasound.la \ $(top_builddir)/kvutils/libkvutils.la am__objects_1 = ecasound.$(OBJEXT) eca-curses.$(OBJEXT) \ eca-comhelp.$(OBJEXT) eca-neteci-server.$(OBJEXT) \ eca-plaintext.$(OBJEXT) textdebug.$(OBJEXT) am_ecasound_debug_OBJECTS = $(am__objects_1) ecasound_debug_OBJECTS = $(am_ecasound_debug_OBJECTS) ecasound_debug_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) \ $(top_builddir)/libecasound/libecasound_debug.la \ $(top_builddir)/kvutils/libkvutils_debug.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(ecasound_SOURCES) $(ecasound_debug_SOURCES) DIST_SOURCES = $(ecasound_SOURCES) $(ecasound_debug_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = -I$(ECA_S_READLINE_INCLUDES) -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/libecasound -I$(top_srcdir)/kvutils AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ @ECA_AM_USE_NCURSES_TRUE@termcap_library_ncurses = -lncurses @ECA_AM_USE_TERMCAP_TRUE@termcap_library_termcap = -ltermcap termcap_library = $(termcap_library_ncurses) $(termcap_library_termcap) ecasound_SOURCES = ecasound.cpp \ ecasound.h \ eca-console.h \ eca-curses.h \ eca-curses.cpp \ eca-comhelp.cpp \ eca-comhelp.h \ eca-neteci-server.cpp \ eca-neteci-server.h \ eca-plaintext.h \ eca-plaintext.cpp \ textdebug.cpp \ textdebug.h ecasound_debug_SOURCES = $(ecasound_SOURCES) ecasound_LDFLAGS = -export-dynamic ecasound_LDADD = $(termcap_library) \ $(ECA_S_READLINE_LIBS) \ $(top_builddir)/libecasound/libecasound.la \ $(top_builddir)/kvutils/libkvutils.la ecasound_debug_LDFLAGS = $(ecasound_LDFLAGS) ecasound_debug_LDADD = $(termcap_library) \ $(ECA_S_READLINE_LIBS) \ $(top_builddir)/libecasound/libecasound_debug.la \ $(top_builddir)/kvutils/libkvutils_debug.la all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ecasound/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign ecasound/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 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done ecasound$(EXEEXT): $(ecasound_OBJECTS) $(ecasound_DEPENDENCIES) @rm -f ecasound$(EXEEXT) $(CXXLINK) $(ecasound_LDFLAGS) $(ecasound_OBJECTS) $(ecasound_LDADD) $(LIBS) ecasound_debug$(EXEEXT): $(ecasound_debug_OBJECTS) $(ecasound_debug_DEPENDENCIES) @rm -f ecasound_debug$(EXEEXT) $(CXXLINK) $(ecasound_debug_LDFLAGS) $(ecasound_debug_OBJECTS) $(ecasound_debug_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-comhelp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-curses.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-neteci-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eca-plaintext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecasound.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textdebug.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && 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)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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) 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-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: 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-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic 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-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ 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-binPROGRAMS uninstall-info-am # -- # special targets with dependency tracking ecainstall: $(MAKE) -C $(srcdir)/../libecasound -q 2>/dev/null || make -C $(srcdir)/../libecasound $(MAKE) -C $(srcdir)/../kvutils -q 2>/dev/null || make -C $(srcdir)/../kvutils $(MAKE) install # 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: ecasound-2.9.3/ecasound/textdebug.cpp0000644000076400007640000001331511172716051014563 00000000000000// ------------------------------------------------------------------------ // textdebug.cpp: Implementation of console logging subsystem. // Copyright (C) 1999-2002,2004-2005,2008,2009 Kai Vehmanen // // Attributes: // eca-style-version: 2 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include "ecasound.h" #include "textdebug.h" #ifdef ECA_USE_NCURSES_H #include #include /* for setupterm() */ #elif ECA_USE_NCURSES_NCURSES_H #include #include /* for setupterm() */ #elif ECA_USE_CURSES_H #include #include /* for setupterm() */ #endif using namespace std; const static int tb_terminal_width_default = ECASOUND_TERM_WIDTH_DEFAULT; /** * Set terminal width used in pretty-printing ecasound console output. */ static int tb_terminal_width = tb_terminal_width_default; /** * Set terminal width used in pretty-printing banners and * other purely cosmetic traces. */ static int tb_terminal_width_banners = tb_terminal_width_default; /** * Wraps text 'msg' by adding + "... " breaks so that none * of the lines exceed 'width' characteds. */ static string tb_wrap(const string& msg, int width, int first_line_offset) { string result; int wrlines = 0; int offset = first_line_offset; const string wrap_prefix ("... "); size_t wrap_offset = wrap_prefix.size(); size_t begin, end; #undef VERBOSE_DEBUG #ifdef VERBOSE_DEBUG fprintf(stdout, "msg-in=<%s>\n", msg.c_str()); #endif for(begin = 0, end = 0; end < msg.size(); end++) { if (begin == end) continue; /* case: trace messages has a newline itself, no wrap needed */ if (msg[end] == '\n') { result += string(msg, begin, end - begin); begin = end; offset = 0; ++wrlines; } /* case: current line exceeds the width, wrap */ else if (end - begin + offset >= static_cast(width)) { string tmpstr (msg, begin, end - begin); size_t last_space = tmpstr.find_last_of(" "); /* case: spaces on the line, wrap before last token */ if (last_space != string::npos) { result += string(tmpstr, 0, last_space); begin += last_space + 1; } /* case: no spaces on the line, cannot wrap */ else { /* note: with first line, wrap all input */ if (static_cast(first_line_offset) > wrap_offset && wrlines == 0) { /* nop */ } else { result += tmpstr; begin = end; } } result += "\n" + wrap_prefix; offset = wrap_offset; ++wrlines; } } if ((end - begin) > 0) { result += string(msg, begin, end - begin); } #ifdef VERBOSE_DEBUG fprintf(stdout, "msg-out=<%s>\n", result.c_str()); #endif return result; } void TEXTDEBUG::stream(std::ostream* dos) { dostream_repp = dos; } std::ostream* TEXTDEBUG::stream(void) { return dostream_repp; } void TEXTDEBUG::do_flush(void) { dostream_repp->flush(); } void TEXTDEBUG::do_msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message) { if (is_log_level_set(level) == true) { int offset = 0; if (level == ECA_LOGGER::subsystems) { #if defined(ECA_USE_NCURSES_H) || defined(ECA_USE_NCURSES_NCURSES_H) || defined(ECA_USE_CURSES_H) *dostream_repp << "- [ "; putp(tigetstr("bold")); offset += 4; #endif } else if (module_name.size() > 0 && is_log_level_set(ECA_LOGGER::module_names) == true && level != ECA_LOGGER::eiam_return_values) { std::string module_name_without_ext = ECA_LOGGER_INTERFACE::filter_module_name(module_name); *dostream_repp << "(" << module_name_without_ext << ") "; offset += module_name_without_ext.size() + 3; } *dostream_repp << tb_wrap(log_message, tb_terminal_width, offset); if (level == ECA_LOGGER::subsystems) { #if defined(ECA_USE_NCURSES_H) || defined(ECA_USE_NCURSES_NCURSES_H) || defined(ECA_USE_CURSES_H) putp(tigetstr("sgr0")); *dostream_repp << " ] "; #else *dostream_repp << " ] "; #endif offset += 3; int fillchars = tb_terminal_width_banners - (static_cast(log_message.size()) + offset); if (fillchars > 0) { string fillstr (fillchars, '-'); *dostream_repp << fillstr; } } *dostream_repp << endl; } } TEXTDEBUG::TEXTDEBUG(void) { char *columns_str = getenv("COLUMNS"); if (columns_str) { tb_terminal_width = std::atoi(columns_str) - 4; if (tb_terminal_width < 8) tb_terminal_width = tb_terminal_width_default; } #if defined(ECA_USE_NCURSES_H) || defined(ECA_USE_NCURSES_NCURSES_H) || defined(ECA_USE_CURSES_H) else if (COLS > 0) { tb_terminal_width = COLS - 4; } #endif if (tb_terminal_width < tb_terminal_width_banners) tb_terminal_width_banners = tb_terminal_width; dostream_repp = &std::cout; } TEXTDEBUG::~TEXTDEBUG(void) { flush(); } ecasound-2.9.3/ecasound/textdebug.h0000644000076400007640000000113410664032032014217 00000000000000#ifndef INCLUDED_TEXTDEBUG_H #define INCLUDED_TEXTDEBUG_H #include #include #include class TEXTDEBUG : public ECA_LOGGER_INTERFACE { public: virtual void do_msg(ECA_LOGGER::Msg_level_t level, const std::string& module_name, const std::string& log_message); virtual void do_flush(void); virtual void do_log_level_changed(void) { } TEXTDEBUG(void); virtual ~TEXTDEBUG(void); private: std::ostream* dostream_repp; void stream(std::ostream* dos); std::ostream* stream(void); }; #endif /* INCLUDED_TEXTDEBUG_H */ ecasound-2.9.3/ecasound/eca-neteci-server.cpp0000644000076400007640000003723611546676461016120 00000000000000// ------------------------------------------------------------------------ // eca-neteci-server.c: NetECI server implementation. // Copyright (C) 2002,2004,2009 Kai Vehmanen // // Attributes: // eca-style-version: 3 // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include /* memcpy() */ #include #include #include /* POSIX: fcntl() */ #include /* POSIX: pthread_* */ #include /* POSIX: fcntl() */ #include /* BSD: inet_ntoa() */ #include /* BSD: inet_ntoa() */ #include /* POSIX: poll() */ #include /* BSD: getpeername() */ #include /* OSX: u_int32_t (INADDR_ANY) */ #include #include #include #include #include #include #include #include "ecasound.h" #include "eca-neteci-server.h" /** * Options */ // #define NETECI_DEBUG_ENABLED #define ECA_NETECI_START_BUFFER_SIZE 128 #define ECA_NETECI_MAX_BUFFER_SIZE 65536 /** * Macro definitions */ #ifdef NETECI_DEBUG_ENABLED #define NETECI_DEBUG(x) x #else #define NETECI_DEBUG(x) ((void) 0) #endif /** * Import namespaces */ using namespace std; ECA_NETECI_SERVER::ECA_NETECI_SERVER(ECASOUND_RUN_STATE* state) : state_repp(state), srvfd_rep(-1), server_listening_rep(false), unix_sockets_rep(false), cleanup_request_rep(false) { } ECA_NETECI_SERVER::~ECA_NETECI_SERVER(void) { if (server_listening_rep == true) { close_server_socket(); } } /** * Launches the server thread. * * @param arg pointer to a ECA_NETECI_SERVER object */ void* ECA_NETECI_SERVER::launch_server_thread(void* arg) { ECA_LOG_MSG(ECA_LOGGER::user_objects, "Server thread started"); ECA_NETECI_SERVER* self = reinterpret_cast(arg); self->run(); return 0; } /** * Starts running the NetECI server. * * After calling this function, the ECA_CONTROL_MAIN object * may be used at any time from the NetECI server thread. */ void ECA_NETECI_SERVER::run(void) { create_server_socket(); open_server_socket(); if (server_listening_rep == true) { listen_for_events(); } else { ECA_LOG_MSG(ECA_LOGGER::info, "Unable to start NetECI server. Please check that no other program is using the TCP port " + kvu_numtostr(state_repp->neteci_tcp_port) + "."); } close_server_socket(); ECA_LOG_MSG(ECA_LOGGER::user_objects, "server thread exiting"); } /** * Creates a server socket with 'socket()'. Depending on * object configuration either UNIX or IP socket is * created. */ void ECA_NETECI_SERVER::create_server_socket(void) { DBC_REQUIRE(server_listening_rep != true); DBC_REQUIRE(srvfd_rep <= 0); if (unix_sockets_rep == true) { srvfd_rep = socket(AF_UNIX, SOCK_STREAM, 0); if (srvfd_rep >= 0) { /* create a temporary filename for the socket in a secure way */ socketpath_rep = "/tmp/neteci_server_1"; addr_un_rep.sun_family = AF_UNIX; memcpy(addr_un_rep.sun_path, socketpath_rep.c_str(), socketpath_rep.size() + 1); addr_repp = reinterpret_cast(&addr_un_rep); } } else { srvfd_rep = socket(PF_INET, SOCK_STREAM, 0); if (srvfd_rep >= 0) { addr_in_rep.sin_family = AF_INET; addr_in_rep.sin_port = htons(state_repp->neteci_tcp_port); addr_in_rep.sin_addr.s_addr = INADDR_ANY; addr_repp = reinterpret_cast(&addr_in_rep); } } } /** * Opens the server socket for listening. If succesful, * 'server_listening_rep' will be true after the call. */ void ECA_NETECI_SERVER::open_server_socket(void) { DBC_REQUIRE(server_listening_rep != true); DBC_REQUIRE(srvfd_rep > 0); int val = 1; int ret = setsockopt(srvfd_rep, SOL_SOCKET, SO_REUSEADDR, (void *)&val, sizeof(val)); if (ret < 0) std::cerr << "setsockopt() failed." << endl; // int res = bind(srvfd_rep, (struct sockaddr*)addr_repp, sizeof(*addr_repp)); int res = 0; if (unix_sockets_rep == true) res = bind(srvfd_rep, (struct sockaddr*)&addr_un_rep, sizeof(addr_un_rep)); else res = bind(srvfd_rep, (struct sockaddr*)&addr_in_rep, sizeof(addr_in_rep)); if (res == 0) { res = listen(srvfd_rep, 5); if (res == 0) { int res = fcntl(srvfd_rep, F_SETFL, O_NONBLOCK); if (res == -1) std::cerr << "fcntl() failed." << endl; NETECI_DEBUG(std::cout << "server socket created." << endl); server_listening_rep = true; } else std::cerr << "listen() failed." << endl; } else { if (unix_sockets_rep == true) { unlink(socketpath_rep.c_str()); } socketpath_rep.resize(0); std::cerr << "bind() failed." << endl; } DBC_ENSURE((unix_sockets_rep == true && (((server_listening_rep == true && socketpath_rep.size() > 0) || (server_listening_rep != true && socketpath_rep.size() == 0)))) || (unix_sockets_rep != true)); } /** * Closes the server socket. */ void ECA_NETECI_SERVER::close_server_socket(void) { DBC_REQUIRE(srvfd_rep > 0); DBC_REQUIRE(server_listening_rep == true); NETECI_DEBUG(cerr << "closing socket " << kvu_numtostr(srvfd_rep) << "." << endl); close(srvfd_rep); srvfd_rep = -1; server_listening_rep = false; DBC_ENSURE(srvfd_rep == -1); DBC_ENSURE(server_listening_rep != true); } /** * Listens for and accepts incoming connections. */ void ECA_NETECI_SERVER::listen_for_events(void) { /* * - loop until we get an exit request from network or from * ecasound_state */ /* - enter poll * - if new connections, accept them and add the new client to * client list * - if incoming bytes, grab ecasound_state lock, send command, * store retval, release lock, send the reply to client * - return to poll */ while(state_repp->exit_requested() != true) { // NETECI_DEBUG(cerr << "checking for events" << endl); check_for_events(2000); } if (state_repp->exit_requested() == true) { NETECI_DEBUG(cerr << "exit_request received" << endl); } } /** * Checks for new connections and messages from * clients. * * @param timeout upper-limit in ms for how long * function waits for events; if -1, * call will return immediately * (ie. is non-blocking) */ void ECA_NETECI_SERVER::check_for_events(int timeout) { int nfds = clients_rep.size() + 1; struct pollfd* ufds = new struct pollfd [nfds]; ufds[0].fd = srvfd_rep; ufds[0].events = POLLIN; ufds[0].revents = 0; std::list::iterator p = clients_rep.begin(); for(int n = 1; n < nfds; n++) { ufds[n].fd = (*p)->fd; ufds[n].events = POLLIN; ufds[n].revents = 0; ++p; } DBC_CHECK(nfds == 1 || p == clients_rep.end()); int ret = poll(ufds, nfds, timeout); if (ret > 0) { if (ufds[0].revents & POLLIN) { /* 1. new incoming connection */ handle_connection(srvfd_rep); } p = clients_rep.begin(); for(int n = 1; n < nfds; n++) { if (ufds[n].revents & POLLIN) { /* 2. client has sent a message */ handle_client_messages(*p); } else if (ufds[n].revents == POLLERR || ufds[n].revents == POLLHUP || ufds[n].revents == POLLNVAL) { /* 3. error, remove client */ remove_client(*p); } if (p != clients_rep.end()) ++p; } } if (cleanup_request_rep == true) { clean_removed_clients(); } delete[] ufds; } void ECA_NETECI_SERVER::handle_connection(int fd) { socklen_t bytes = 0; string peername; int connfd = 0; if (unix_sockets_rep == true) { bytes = static_cast(sizeof(addr_un_rep)); connfd = accept(fd, reinterpret_cast(&addr_un_rep), &bytes); peername = "UNIX:" + socketpath_rep; } else { bytes = static_cast(sizeof(addr_in_rep)); connfd = accept(fd, reinterpret_cast(&addr_in_rep), &bytes); if (connfd > 0) { struct sockaddr_in peeraddr; socklen_t peernamelen; // struct in_addr peerip; peername = "TCP/IP:"; int res = getpeername(connfd, reinterpret_cast(&peeraddr), reinterpret_cast(&peernamelen)); if (res == 0) peername += string(inet_ntoa(peeraddr.sin_addr)); else peername += string(inet_ntoa(addr_in_rep.sin_addr)); } } ECA_LOG_MSG(ECA_LOGGER::info, "New connection from " + peername + "."); if (connfd >= 0) { NETECI_DEBUG(cerr << "incoming connection accepted" << endl); struct ecasound_neteci_server_client* client = new struct ecasound_neteci_server_client; /* add a new client */ client->fd = connfd; client->buffer_length = ECA_NETECI_START_BUFFER_SIZE; client->buffer = new char [client->buffer_length]; client->buffer_current_ptr = 0; client->peername = peername; clients_rep.push_back(client); } } /** * Handle incoming messages for client 'client'. */ void ECA_NETECI_SERVER::handle_client_messages(struct ecasound_neteci_server_client* client) { char* buf[128]; int connfd = client->fd; NETECI_DEBUG(cerr << "handle_client_messages for fd " << connfd << endl); ssize_t c = kvu_fd_read(connfd, buf, 128, 5000); if (c > 0) { parse_raw_incoming_data(reinterpret_cast(buf), c, client); while(parsed_cmd_queue_rep.size() > 0) { const string& nextcmd = parsed_cmd_queue_rep.front(); if (nextcmd == "quit" || nextcmd == "q") { NETECI_DEBUG(cerr << "client initiated quit, removing client-fd " << connfd << "." << endl); remove_client(client); } else { handle_eci_command(nextcmd, client); } parsed_cmd_queue_rep.pop_front(); } /* ... */ } else { /* read() <= 0 */ NETECI_DEBUG(cerr << "read error, removing client-fd " << connfd << "." << endl); remove_client(client); } } void ECA_NETECI_SERVER::parse_raw_incoming_data(const char* buffer, ssize_t bytes, struct ecasound_neteci_server_client* client) { DBC_REQUIRE(buffer != 0); DBC_REQUIRE(bytes >= 0); DBC_REQUIRE(client != 0); DBC_DECLARE(int old_client_ptr = client->buffer_current_ptr); DBC_DECLARE(unsigned int old_cmd_queue_size = parsed_cmd_queue_rep.size()); NETECI_DEBUG(cerr << "parse incoming data; " << bytes << " bytes. Buffer length is " << client->buffer_length << endl); for(int n = 0; n < bytes; n++) { DBC_CHECK(client->buffer_current_ptr <= client->buffer_length); if (client->buffer_current_ptr == client->buffer_length) { int new_buffer_length = client->buffer_length * 2; char *new_buffer = new char [new_buffer_length]; if (new_buffer_length > ECA_NETECI_MAX_BUFFER_SIZE) { cerr << "client buffer overflow, unable to increase buffer size. flushing..." << endl; client->buffer_current_ptr = 0; } else { NETECI_DEBUG(cerr << "client buffer overflow, increasing buffer size from " << client->buffer_length << " to " << new_buffer_length << " bytes." << endl); for(int i = 0; i < client->buffer_length; i++) new_buffer[i] = client->buffer[i]; delete[] client->buffer; client->buffer = new_buffer; client->buffer_length = new_buffer_length; } } NETECI_DEBUG(cerr << "copying '" << buffer[n] << "'\n"); client->buffer[client->buffer_current_ptr] = buffer[n]; if (client->buffer_current_ptr > 0 && client->buffer[client->buffer_current_ptr] == '\n' && client->buffer[client->buffer_current_ptr - 1] == '\r') { string cmd (client->buffer, client->buffer_current_ptr - 1); NETECI_DEBUG(cerr << "storing command '" << cmd << "'" << endl); parsed_cmd_queue_rep.push_back(cmd); NETECI_DEBUG(cerr << "copying " << client->buffer_length - client->buffer_current_ptr - 1 << " bytes from " << client->buffer_current_ptr + 1 << " to the beginning of the buffer." << " Index is " << client->buffer_current_ptr << endl); DBC_CHECK(client->buffer_current_ptr < client->buffer_length); #if 0 /* must not use memcpy() as the affected areas may overlap! */ for(int o = 0, p = index + 1; p < client->buffer_length; o++, p++) { client->buffer[o] = client->buffer[p]; } #endif client->buffer_current_ptr = 0; } else { // NETECI_DEBUG(cerr << "crlf not found, index=" << index << ", n=" << n << "cur_ptr=" << client->buffer_current_ptr << ".\n"); client->buffer_current_ptr++; } } DBC_ENSURE(client->buffer_current_ptr > old_client_ptr || parsed_cmd_queue_rep.size() > old_cmd_queue_size); } void ECA_NETECI_SERVER::handle_eci_command(const string& cmd, struct ecasound_neteci_server_client* client) { ECA_CONTROL_MT* ctrl = state_repp->control; NETECI_DEBUG(cerr << "handle eci command: " << cmd << endl); assert(ctrl != 0); struct eci_return_value retval; ctrl->command(cmd, &retval); string strtosend = ECA_LOGGER_WELLFORMED::create_wellformed_message(ECA_LOGGER::eiam_return_values, std::string(ECA_CONTROL_MAIN::return_value_type_to_string(&retval)) + " " + ECA_CONTROL_MAIN::return_value_to_string(&retval)); int bytes_to_send = strtosend.size(); while(bytes_to_send > 0) { int ret = kvu_fd_write(client->fd, strtosend.c_str(), strtosend.size(), 5000); if (ret < 0) { cerr << "error in kvu_fd_write(), removing client.\n"; remove_client(client); break; } else { bytes_to_send -= ret; } } } /** * Removes 'client' from list of clients. * * Note! Internally, the 'fd' field of the deleted client * is marked to be -1. * * @see clean_removed_clients() */ void ECA_NETECI_SERVER::remove_client(struct ecasound_neteci_server_client* client) { NETECI_DEBUG(std::cout << "removing client." << std::endl); if (client != 0 && client->fd > 0) { ECA_LOG_MSG(ECA_LOGGER::info, "Closing connection " + client->peername + "."); close(client->fd); client->fd = -1; } cleanup_request_rep = true; } /** * Cleans the list of clients from removed objects. * * @see remove_client() */ void ECA_NETECI_SERVER::clean_removed_clients(void) { DBC_DECLARE(size_t oldsize = clients_rep.size()); DBC_DECLARE(size_t counter = 0); NETECI_DEBUG(std::cerr << "cleaning removed clients." << std::endl); list::iterator p = clients_rep.begin(); while(p != clients_rep.end()) { NETECI_DEBUG(std::cerr << "checking for delete, client " << *p << std::endl); if (*p != 0 && (*p)->fd == -1) { if ((*p)->buffer != 0) { delete[] (*p)->buffer; (*p)->buffer = 0; } std::list::iterator q = p; ++q; NETECI_DEBUG(std::cerr << "deleting client " << *p << std::endl); delete *p; NETECI_DEBUG(std::cerr << "erasing client " << *p << std::endl); *p = 0; clients_rep.erase(p); p = q; DBC_DECLARE(++counter); } else { ++p; } } cleanup_request_rep = false; DBC_ENSURE(clients_rep.size() == oldsize - counter); } ecasound-2.9.3/effect_presets0000644000076400007640000001733710664032032013212 00000000000000# -------------------------------------------------------------------- # ecasound effect presets definitions # -------------------------------------------------------------------- # # - all lines beginning with a '#' are ignored # - preset format: # "preset_name_or_number = | ... | " # - you can use '\' sign to split lines # - preset parameters and available descriptors: # -efl:%1,100 = first param of -efl is a public preset parameter # -pd:name_of_preset = preset description # -ppn:par1,...,parN = parameter names (public params) # -ppd:val1,...,valN = default param values # -ppl:val1,...,valN = lower bounds for param values # -ppu:val1,...,valN = upper bounds for param values # -ppt:flags1,...,flagsN = special flags for parameter N # ('i'=integer, 'l'=logarithmic, 'o'=output, 't'=toggle) # # -------------------------------------------------------------------- # ====== # Compression/dynamics (dyn_) # dyn_compress_supersoft = -eca:69,0,0.25,0.25 -ea:%1 \ -pd:Supersoft_compressor -ppn:gain-% -ppd:100 -ppl:0 -ppu:1000 dyn_compress_soft = -eca:69,0,0.25,0.5 -ea:%1 \ -pd:Soft_compressor -ppn:gain-% -ppd:100 -ppl:0 -ppu:1000 dyn_compress_medium = -eca:69,0,0.25,1.0 -ea:%1 \ -pd:Medium_compressor -ppn:gain-% -ppd:100 -ppl:0 -ppu:1000 dyn_compress_hard = -eca:69,0,0.5,1.0 -ea:%1 \ -pd:Hard_compressor -ppn:gain-% -ppd:100 -ppl:0 -ppu:1000 dyn_compress_infinite = -eca:69,0,1.0,1.0 -ea:%1 \ -pd:Infinite_to_one_compressor -ppn:gain-% -ppd:100 -ppl:0 -ppu:1000 dyn_compress_brutal = -ec:999,10 -ea:%1 \ -pd:Ultra_brutal_compressor -ppn:gain-% -ppd:100 -ppl:0 -ppu:1000 # ====== # EQ (eq_) # eq_template = -efb:10,20 -ea:%1 | \ -efb:40,40 -ea:%2 | \ -efb:100,80 -ea:%3 | \ -efb:220,160 -ea:%4 | \ -efb:460,320 -ea:%5 | \ -efb:940,640 -ea:%6 | \ -efb:1900,1280 -ea:%7 | \ -efb:3800,2520 -ea:%8 | \ -efb:7620,5120 -ea:%9 | \ -efb:15300,10240 -ea:%10 \ -pd:Big_eq_template \ -ppn:10hz,40hz,100hz,220hz,460hz,940hz,1900hz,3800hz,7620hz,15300hz \ -ppd:100,100,100,100,100,100,100,100,100,100 \ -ppl:0,0,0,0,0,0,0,0,0,0 \ -ppu:500,500,500,500,500,500,500,500,500,500 eq_template2 = -efb:1000,2000 -ea:%1 | \ -efb:4000,2000 -ea:%2 \ -pd:Dual_band_eq_template \ -ppn:1000hz,4000hz -ppd:100,100 \ -ppl:0,0 -ppu:500,500 # ====== # Filters (f_) # f_lowp_sine = -ef3:800,1.5,0.9 -kos:1,400,4200,0.2,0 \ -pd:Reson_lowpass_filter_controlled_by_a_sine_oscillator f_lowp_sine2 = -efl:400 -kos:1,200,2000,0.5,0 \ -pd:Lowpass_filter_controlled_by_a_sine_oscillator f_high_and_low = -efl:400 | -efh:4000 -ea:800 \ -pd:Parallel_high_and_lowpass_filters f_res_bandpass = -ef1:%1,%2 \ -pd:Reson_bandpass_filter -ppn:freq,width -ppd:1500,700 -ppl:0,1 f_res_lowpass = -ef3:%1,1.5,0.7 \ -pd:Reson_lowpass_filter -ppd:800 -ppl:0 f_lowpass = -efl:%1 -ppn:freq_hz -ppd:300 -pd:Simple_lowpass_filter f_bandpass = -efb:%1,%2 \ -pd:Bandpass_filter -ppn:freq,width -ppd:1500,700 -ppl:0,1 f_rejectband = -efr:1500,1000 -pd:Band_reject_filter f_highpass = -efh:2000 \ -pd:Reson_lowpass -ppd:1500 -ppl:0 f_inverse_comb = -efi:8,0.999 \ -pd:Inverse_comb_filter f_resonator = -efs:1500,1000 -pd:Resonator_filter f_two_filters = -efl:800 -ea:%1 | -efh:800 -ea:%2 \ -pd:Parallel_highpass_and_lowpass_filters \ -ppl:0,0 -ppu:1000,- \ -ppd:100,100 -ppn:lowgain,highgain f_two_filters_pareq = -efl:%1 -ea:%2 | \ -efh:%3 -ea:%4 \ -ppn:lowfreq,lowgain,highfreq,highgain \ -ppd:200,100,2000,100 \ -pd:Two_paraller_filters_with_gain_controls f_filtertest = -efl:%1 -ea:100 | \ -efh:%2 -ea:100 | \ -ea:100 -ppd:100 -ppn:freq1,freq2 \ -pd:Two_paraller_filters # ====== # Gates (gate_) gate_noisegate_1 = -enm:18,20,50,50,50 -pd:Noise_gate gate_noisegate_delanalog = -enm:0.20,0.1,1000,50,0 -pd:Noise_gate_for_analog_hum_removal gate_crop = -gc:1,0.5 -pd:Crop_gate_example gate_threshold = -ge:15,20,1 -pd:Threshold_gate_example # ====== # Time/delay effects (time_) time_reverb1 = -etr:40,0,85 -pd:Bathroom_reverb time_reverb2 = -etr:60,0,70 -pd:Plain_reverb time_reverb3 = -etf:30 -pd:Fake_stereo time_reverb4 = -pn:reverb1 -pn:reverb2 -pd:Reverb_combo time_delay1 = -etd:200,0,3,60 -pd:200ms_triple_delay time_delay2 = -etm:200,3,60 -pd:200ms_triple_multidelay time_wicked_dub = -etm:500,1,90 -epp:100 -kos:1,0,100,0.3,0.5 | \ -etm:333,1,90 -epp:0 -kos:1,0,100,0.8,0 | -ea:90 \ -pd:Wicked_dub_mix time_flanger1 = -etl:2,20,50,0.5 -pd:Flanger time_chorus1 = -etc:2,20,50,0.5 -pd:Chorus time_phaser1 = -etp:2,50,50,0.05 -pd:Phaser # ====== # Various / mixes (var_) var_sweeping_pan = -epp:0 -kos:1,0,100,%1,5 \ -pd:Sweeping_pan_envelope -ppn:speed_hz -ppd:0.2 var_switching_pan = -epp:0 -kf:1,0,100,%1,0,0 \ -pd:Panner_that_alternates_between_left_and_right -ppn:speed_hz -ppd:0.2 var_chipmunk = -ei:400 -efl:400 -kos:1,400,10000,2,0 \ -pd:Chipmunk_generator var_parchip = -ei:%1 -efl:400 -kos:1,400,10000,%2,0 \ -ppn:pitch,modfreq -ppd:100,0.5 \ -pd:Chipmunk_sweep var_paralmadness = -efb:0,2000 -kos:1,1,3000,%1,0 -ea:150 | \ -efb:0,2000 -kos:1,3000,5000,%2,0 -ea:150 | \ -efh:0 -kos:1,3000,5000,%3,0 -ea:200 \ -ppn:freq1,freq2,freq3 -ppd:0.2,0.2,0.2 \ -pd:Parallel_madness # ====== # Contributed / Arto Hamara [artham] var_stretched_tape = -ei:100 -kos:1,93,100,.5,0 -kx -kos:4,.1,1,.1 \ -pd:Stretched_tape var_molten_tape = -ei:100 -kos:1,85,105,.5,0 -kx -kos:4,.1,2,.1 \ -pd:Molten_tape var_dali = -ei:100 -kos:1,85,105,.5,0 -kx -kos:4,.1,2,.1 \ -etd:100,1,0,70 -epp:0 -kos:1,20,80,.5,0 -kx -kos:4,.1,2,.1 \ -pd:Dali # ====== # Contributed / S.Massy [smassy] # Results of spending an hour messing around. # var_aw = -efl:0 -kos:1,500,5500,%1,0 -ppn:speed -ppd:0.5 \ -pd:Classic_auto_wah var_aw_custom = -efl:0 -kos:1,%1,%2,%3,0 -ppn:low,high,speed -ppd:100,8000,0.5 \ -pd:Class_auto_wah_with_controls # Now the autowah again but with the triangular osc which gives a sharper # movement. It really depends of what you're playing, can sound as good as it # can sound bad. That's the joy of autowahs. var_aw_tri = -efl:0 -kf:1,500,5500,%1,1,0 -ppn:speed -ppd:0.5 \ -pd:Auto_wah_triangular_osc # Now once again we define another version with more definable params. var_aw_tri_custom = -efl:0 -kf:1,%low,%high,%1,1,0 -ppn:speed -ppd:0.5 \ -pd:Auto_wah_triangular_osc_with_control # Experimental stuff: # I was trying to have a wah reacting to the volume, it doesn't work very # well but I still end up with a "to dig up" envelope shaper. var_aw_ksv = -eS:0 -efl:0 -ksv:1,1000,6000,0,1 \ -pd:Volume_sensitive_wah # ====== # Presets using LADSPA plugins (lad_) lad_hermes = \ -eli:1200,3,%1,0.27,%2,100,%3,40,%4,1.5,1,2,-4,-4,-50,-20,-20,-20,200,1000,3,1,3,5,1500,0.65,0,130,0,5,400,0.8,0,0,-177,1,150,0.9,0.97,30,30,0.025,0.9,0.5,0.05,0.7,0.5,0.1,0.5,0.5,0,20,20 \ -pd:LADSPA_hermesFilter -ppn:p1,p2,p3,p4 -ppd:1,1,1,1 lad_sc4 = \ -eli:1882,0,40,40,-18,6,6,6,%1,%2 \ -pd:LADSPA_SC4_compressor -ppn:output-amplitude-dB,output-gain-reduction-dB \ -ppd:0,0 -ppt:lo,lo lad_sc4_rg = \ -eli:1882,0,40,40,-18,%1,6,%2,%3,%4 \ -pd:LADSPA_SC4_compressor -ppn:ratio,gain-dB,output-amplitude-dB,output-gain-reduction-dB \ -ppd:6,3,0,0 -ppl:1,-40 -ppu:20,12 -ppt:-,-,lo,lo lad_metronome = -el:sine_fcac,880,1 -eemb:%1,10 -efl:2000 \ -pd:LADSPA_sineosc_metronome -ppn:bpm -ppd:120 -ppl:1 lad_oscillator_test = -eli:1205,%1,0 -ea:%2 \ -pd:LADSPA_Oscillator_test \ -ppn:freq,gain1 \ -ppd:200,100 \ -ppl:1,0 -ppu:1300,1000 \ -ppt:-,- lad_oscillator_stack = -el:analogueOsc,%1,%2 -ea:%4 | \ -el:analogueOsc,%1,%3 -ea:%5 \ -pd:LADSPA_stack_of_analogue_oscillators \ -ppn:freq,osctype1,osctype2,gain1,gain2 \ -ppd:200,0,0,100,100 \ -ppl:1,0,0,0,0 -ppu:1300,3,3,1000,1000 \ -ppt:-,i,i,- # ====== # Other / compatibility presets metronome = -el:sine_fcac,880,1 -eemb:%1,10 -efl:2000 \ -ppn:bpm -ppd:100 -pd:Sineosc_metronome ecasound-2.9.3/Makefile.in0000644000076400007640000005760213606336177012352 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ # ---------------------------------------------------------------------- # File: ecasound/Makefile.am # Description: Ecasound multitrack audio processing tool # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING INSTALL NEWS TODO \ compile config.guess config.sub depcomp install-sh ltmain.sh \ missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ AR = @AR@ ARTSC_CONFIG = @ARTSC_CONFIG@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECA_AM_ALL_STATIC_FALSE = @ECA_AM_ALL_STATIC_FALSE@ ECA_AM_ALL_STATIC_TRUE = @ECA_AM_ALL_STATIC_TRUE@ ECA_AM_COMPILE_ALSA_FALSE = @ECA_AM_COMPILE_ALSA_FALSE@ ECA_AM_COMPILE_ALSA_TRUE = @ECA_AM_COMPILE_ALSA_TRUE@ ECA_AM_COMPILE_ARTS_FALSE = @ECA_AM_COMPILE_ARTS_FALSE@ ECA_AM_COMPILE_ARTS_TRUE = @ECA_AM_COMPILE_ARTS_TRUE@ ECA_AM_COMPILE_AUDIOFILE_FALSE = @ECA_AM_COMPILE_AUDIOFILE_FALSE@ ECA_AM_COMPILE_AUDIOFILE_TRUE = @ECA_AM_COMPILE_AUDIOFILE_TRUE@ ECA_AM_COMPILE_JACK_FALSE = @ECA_AM_COMPILE_JACK_FALSE@ ECA_AM_COMPILE_JACK_TRUE = @ECA_AM_COMPILE_JACK_TRUE@ ECA_AM_COMPILE_OSS_FALSE = @ECA_AM_COMPILE_OSS_FALSE@ ECA_AM_COMPILE_OSS_TRUE = @ECA_AM_COMPILE_OSS_TRUE@ ECA_AM_COMPILE_SAMPLERATE_FALSE = @ECA_AM_COMPILE_SAMPLERATE_FALSE@ ECA_AM_COMPILE_SAMPLERATE_TRUE = @ECA_AM_COMPILE_SAMPLERATE_TRUE@ ECA_AM_COMPILE_SNDFILE_FALSE = @ECA_AM_COMPILE_SNDFILE_FALSE@ ECA_AM_COMPILE_SNDFILE_TRUE = @ECA_AM_COMPILE_SNDFILE_TRUE@ ECA_AM_DEBUG_MODE_FALSE = @ECA_AM_DEBUG_MODE_FALSE@ ECA_AM_DEBUG_MODE_TRUE = @ECA_AM_DEBUG_MODE_TRUE@ ECA_AM_DISABLE_EFFECTS_FALSE = @ECA_AM_DISABLE_EFFECTS_FALSE@ ECA_AM_DISABLE_EFFECTS_TRUE = @ECA_AM_DISABLE_EFFECTS_TRUE@ ECA_AM_FEELING_EXPERIMENTAL_FALSE = @ECA_AM_FEELING_EXPERIMENTAL_FALSE@ ECA_AM_FEELING_EXPERIMENTAL_TRUE = @ECA_AM_FEELING_EXPERIMENTAL_TRUE@ ECA_AM_KVUTILS_INSTALLED_FALSE = @ECA_AM_KVUTILS_INSTALLED_FALSE@ ECA_AM_KVUTILS_INSTALLED_TRUE = @ECA_AM_KVUTILS_INSTALLED_TRUE@ ECA_AM_PYECASOUND_CEXT_FALSE = @ECA_AM_PYECASOUND_CEXT_FALSE@ ECA_AM_PYECASOUND_CEXT_TRUE = @ECA_AM_PYECASOUND_CEXT_TRUE@ ECA_AM_PYECASOUND_INSTALL_FALSE = @ECA_AM_PYECASOUND_INSTALL_FALSE@ ECA_AM_PYECASOUND_INSTALL_TRUE = @ECA_AM_PYECASOUND_INSTALL_TRUE@ ECA_AM_RUBYECASOUND_INSTALL_FALSE = @ECA_AM_RUBYECASOUND_INSTALL_FALSE@ ECA_AM_RUBYECASOUND_INSTALL_TRUE = @ECA_AM_RUBYECASOUND_INSTALL_TRUE@ ECA_AM_SYSTEM_READLINE_FALSE = @ECA_AM_SYSTEM_READLINE_FALSE@ ECA_AM_SYSTEM_READLINE_TRUE = @ECA_AM_SYSTEM_READLINE_TRUE@ ECA_AM_USE_NCURSES_FALSE = @ECA_AM_USE_NCURSES_FALSE@ ECA_AM_USE_NCURSES_TRUE = @ECA_AM_USE_NCURSES_TRUE@ ECA_AM_USE_TERMCAP_FALSE = @ECA_AM_USE_TERMCAP_FALSE@ ECA_AM_USE_TERMCAP_TRUE = @ECA_AM_USE_TERMCAP_TRUE@ ECA_S_EXTRA_CPPFLAGS = @ECA_S_EXTRA_CPPFLAGS@ ECA_S_EXTRA_LIBS = @ECA_S_EXTRA_LIBS@ ECA_S_JACK_INCLUDES = @ECA_S_JACK_INCLUDES@ ECA_S_JACK_LIBS = @ECA_S_JACK_LIBS@ ECA_S_PREFIX = @ECA_S_PREFIX@ ECA_S_PYTHON_DLMODULES = @ECA_S_PYTHON_DLMODULES@ ECA_S_PYTHON_MODULES = @ECA_S_PYTHON_MODULES@ ECA_S_READLINE_INCLUDES = @ECA_S_READLINE_INCLUDES@ ECA_S_READLINE_LIBS = @ECA_S_READLINE_LIBS@ ECA_S_RUBY_SITEDIR = @ECA_S_RUBY_SITEDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBECASOUNDC_VERSION = @LIBECASOUNDC_VERSION@ LIBECASOUNDC_VERSION_AGE = @LIBECASOUNDC_VERSION_AGE@ LIBECASOUND_VERSION = @LIBECASOUND_VERSION@ LIBECASOUND_VERSION_AGE = @LIBECASOUND_VERSION_AGE@ LIBKVUTILS_VERSION = @LIBKVUTILS_VERSION@ LIBKVUTILS_VERSION_AGE = @LIBKVUTILS_VERSION_AGE@ LIBLILV_CFLAGS = @LIBLILV_CFLAGS@ LIBLILV_LIBS = @LIBLILV_LIBS@ LIBLO_CFLAGS = @LIBLO_CFLAGS@ LIBLO_LIBS = @LIBLO_LIBS@ LIBOBJS = @LIBOBJS@ LIBOIL_CFLAGS = @LIBOIL_CFLAGS@ LIBOIL_LIBS = @LIBOIL_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ 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@ PYTHONPATH = @PYTHONPATH@ RANLIB = @RANLIB@ RUBYPATH = @RUBYPATH@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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@ 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@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = AUTHORS BUGS COPYING.GPL COPYING.LGPL NEWS RELNOTES TODO ecasoundrc.in effect_presets generic_oscillators SUBDIRS = kvutils libecasound ecasound libecasoundc pyecasound rubyecasound ecatools Documentation examples AUTOMAKE_OPTIONS = foreign RELEASE = 1 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # 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): @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; \ (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" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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 || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/libecasound $(distdir)/libecasoundc @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h 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) 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 clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-data-local install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -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: uninstall-info-am uninstall-local uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-local \ clean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-libtool \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am uninstall-local docs: cd Documentation ; $(MAKE) $(AM_MAKEFLAGS) docs install-data-local: ecasoundrc $(INSTALL) -d $(DESTDIR)$(pkgdatadir) $(INSTALL_DATA) $(top_builddir)/ecasoundrc $(DESTDIR)$(pkgdatadir)/ecasoundrc $(INSTALL_DATA) $(top_srcdir)/effect_presets $(DESTDIR)$(pkgdatadir)/effect_presets $(INSTALL_DATA) $(top_srcdir)/ecatools/ecasound.el $(DESTDIR)$(pkgdatadir)/ecasound.el $(INSTALL_DATA) $(top_srcdir)/generic_oscillators $(DESTDIR)$(pkgdatadir)/generic_oscillators uninstall-local: rm -f $(DESTDIR)$(pkgdatadir)/effect_presets \ $(DESTDIR)$(pkgdatadir)/ecasound.el \ $(DESTDIR)$(pkgdatadir)/generic_oscillators \ $(DESTDIR)$(pkgdatadir)/ecasoundrc rmdir $(DESTDIR)$(pkgdatadir) || echo "Skipping non-empty directory" ecasoundrc: ecasoundrc.in Makefile.am sed -e "s%[@]VERSION[@]%$(VERSION)%" \ -e "s%[@]prefix[@]%$(prefix)%" \ -e "s%[@]pkgdatadir[@]%$(pkgdatadir)%" \ < $(top_srcdir)/ecasoundrc.in > ecasoundrc clean-local: rm -fv ecasoundrc dist-hook: docs # 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: ecasound-2.9.3/aclocal.m40000644000076400007640000133002213606336176012133 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file 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. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) ecasound-2.9.3/ecatools/0000755000076400007640000000000013606336217012157 500000000000000ecasound-2.9.3/ecatools/ecaconvert.cpp0000644000076400007640000000613510664032032014726 00000000000000// ------------------------------------------------------------------------ // ecaconvert.cpp: A simple command-line tool for converting // audio files. // Copyright (C) 2000,2002,2005-2006 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "ecicpp_helpers.h" /** * Function declarations */ int main(int argc, char *argv[]); void print_usage(void); using std::cerr; using std::cout; using std::endl; using std::string; static const string ecatools_play_version = "20050316-18"; int main(int argc, char *argv[]) { COMMAND_LINE cline = COMMAND_LINE (argc, argv); if (cline.size() < 2) { print_usage(); return(1); } string filename; ECA_CONTROL_INTERFACE eci; cline.begin(); cline.next(); // skip the program name string extension (".raw"); if (cline.end() != true) { extension = cline.current(); cline.next(); } while(cline.end() != true) { filename = cline.current(); cout << "Converting file \"" << filename << "\" --> "; cout << "\"" << filename + extension << "\"." << endl; eci.command("cs-add default"); eci.command("c-add default"); string format; if (ecicpp_add_file_input(&eci, filename, &format) < 0) break; cout << "Using audio format -f:" << format << "\n"; if (ecicpp_add_output(&eci, filename + extension, format) < 0) break; if (ecicpp_connect_chainsetup(&eci, "default") < 0) { break; } cout << "Starting processing...\n"; // blocks until processing is done eci.command("run"); cout << "Processing finished.\n"; eci.command("cs-disconnect"); eci.command("cs-select default"); eci.command("cs-remove"); cline.next(); } return(0); } void print_usage(void) { cerr << "****************************************************************************\n"; cerr << "* ecaconvert, v" << ecatools_play_version << " (" << VERSION << ")\n"; cerr << "* (C) 2000-2004 Kai Vehmanen, released under GPL licence \n"; cerr << "****************************************************************************\n"; cerr << "\nUSAGE: ecaconvert .extension file1 [ file2, ... fileN ]\n\n"; } ecasound-2.9.3/ecatools/ecasignalview.cpp0000644000076400007640000004117411143666651015435 00000000000000// ------------------------------------------------------------------------ // ecasignalview.cpp: A simple command-line tools for monitoring // signal amplitude. // Copyright (C) 1999-2005,2007,2008 Kai Vehmanen // Copyright (C) 2005 Jeffrey Cunningham // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include /* POSIX: select() */ #include /* POSIX: timeval struct */ #include #include #include #include #include "ecicpp_helpers.h" #ifdef HAVE_TERMIOS_H /* see: http://www.opengroup.org/onlinepubs/007908799/xsh/termios.h.html */ #include #endif #if defined(ECA_USE_NCURSES_H) || defined(ECA_USE_NCURSES_NCURSES_H) || defined(ECA_USE_CURSES_H) #define ECASV_USE_CURSES 1 #ifdef ECA_USE_NCURSES_H #include #include /* for setupterm() */ #elif ECA_USE_NCURSES_NCURSES_H #include #include /* for setupterm() */ #else #include #include /* for setupterm() */ #endif #endif /* ECA_*CURSES_H */ #include /** * Import namespaces */ using namespace std; /** * Type definitions */ struct ecasv_channel_stats { double last_peak; double drawn_peak; double max_peak; long int clipped_samples; vector avg_peak; // jkc: addition int avg_peak_ptr; // jkc: addition double avg_peak_val; // jkc: addition }; /** * Function declarations */ int main(int argc, char *argv[]); void ecasv_parse_command_line(ECA_CONTROL_INTERFACE* cop, int argc, char *argv[]); void ecasv_fill_defaults(void); std::string ecasv_cop_to_string(ECA_CONTROL_INTERFACE* cop); void ecasv_output_init(void); void ecasv_output_cleanup(void); int ecasv_print_vu_meters(ECA_CONTROL_INTERFACE* eci, std::vector* chstats); void ecasv_update_chstats(std::vector* chstats, int ch, double value); void ecasv_create_bar(double value, int barlen, unsigned char* barbuf); void ecasv_print_usage(void); void ecasv_signal_handler(int signum); void reset_stats_fcn(vector* chstats); // jkc: addition float dB(float v) { return 10.0*log10(v*v); } // jkc: addition void ecasv_set_buffered(void); void ecasv_set_unbuffered(void); int ecasv_kbhit(); /** * Static global variables */ static const string ecatools_signalview_version = "20051112-10"; static bool ecasv_log_display_mode = false; // jkc: addition static const double ecasv_clipped_threshold_const = 1.0f - 1.0f / 16384.0f; static const int ecasv_bar_length_const = 32; static const int ecasv_header_height_const = 9; static const long int ecasv_rate_default_const = 50; static const long int ecasv_buffersize_default_const = 128; static unsigned char ecasv_bar_buffer[ecasv_bar_length_const + 1] = { 0 }; static bool ecasv_enable_debug, ecasv_enable_cumulative_mode; static long int ecasv_buffersize, ecasv_rate_msec; static string ecasv_input, ecasv_output, ecasv_format_string; static int ecasv_chcount = 0; static ECA_CONTROL_INTERFACE* ecasv_eci_repp = 0; static sig_atomic_t done = 0; static sig_atomic_t reset_stats = 0; static int avg_peak_buffer_sz=100; // jkc: addition #ifdef HAVE_TERMIOS_H struct termios old_term, new_term; #endif /** * Function definitions */ int main(int argc, char *argv[]) { int res; struct sigaction es_handler; es_handler.sa_handler = ecasv_signal_handler; sigemptyset(&es_handler.sa_mask); es_handler.sa_flags = 0; sigaction(SIGTERM, &es_handler, 0); sigaction(SIGINT, &es_handler, 0); sigaction(SIGQUIT, &es_handler, 0); sigaction(SIGABRT, &es_handler, 0); sigaction(SIGHUP, &es_handler, 0); struct sigaction ign_handler; ign_handler.sa_handler = SIG_IGN; sigemptyset(&ign_handler.sa_mask); ign_handler.sa_flags = 0; /* ignore the following signals */ sigaction(SIGPIPE, &ign_handler, 0); sigaction(SIGFPE, &ign_handler, 0); ECA_CONTROL_INTERFACE eci; eci.command("cs-add default"); eci.command("c-add default"); /* set engine buffersize */ eci.command("cs-set-param -b:" + kvu_numtostr(ecasv_buffersize)); /* in case JACK is used, do not send nor receive transport events */ eci.command("cs-set-param -G:jack,ecasignalview,notransport"); /* note: might change the cs options (-G, -z, etc) */ ecasv_parse_command_line(&eci,argc,argv); if (ecasv_format_string.size() > 0) { eci.command("cs-set-audio-format " + ecasv_format_string); } string format; if (ecicpp_add_input(&eci, ecasv_input, &format) < 0) return -1; cout << "Using audio format -f:" << format << "\n"; ecasv_chcount = ecicpp_format_channels(format); cout << "Setting up " << ecasv_chcount << " separate channels for analysis." << endl; if (ecicpp_add_output(&eci, ecasv_output, format) < 0) return -1; ecasv_eci_repp = &eci; vector chstats; eci.command("cop-add -evp"); eci.command("cop-add -ev"); if (ecasv_enable_cumulative_mode == true) { eci.command("cop-set 2,1,1"); } eci.command("cop-select 1"); if (ecicpp_connect_chainsetup(&eci, "default") < 0) { return -1; } int secs = 0, msecs = ecasv_rate_msec; while(msecs > 999) { ++secs; msecs -= 1000; } ecasv_output_init(); eci.command("start"); int chr=0; // jkc: addition int rv=0; // jkc: addition while(! done ) { kvu_sleep(secs, msecs * 1000000); res = ecasv_print_vu_meters(&eci, &chstats); if (res < 0) break; #if defined(ECASV_USE_CURSES) // jkc: addition until noted if (ecasv_kbhit()) { /* note: getch() is a curses.h function */ switch (chr=getch()) { case 'q': case 27: /* Esc */ case 'Q': done=true; break; case ' ': reset_stats_fcn(&chstats); break; } } // jkc: end of addition #endif } ecasv_output_cleanup(); #ifdef ECASV_USE_CURSES endwin(); #endif return rv; } void ecasv_parse_command_line(ECA_CONTROL_INTERFACE *eci, int argc, char *argv[]) { COMMAND_LINE cline = COMMAND_LINE (argc, argv); if (cline.size() == 0 || cline.has("--version") || cline.has("--help") || cline.has("-h")) { ecasv_print_usage(); exit(1); } ecasv_enable_debug = false; ecasv_enable_cumulative_mode = false; ecasv_rate_msec = 0; ecasv_buffersize = 0; cline.begin(); cline.next(); // 1st argument while (cline.end() != true) { string arg = cline.current(); if (arg.size() > 0) { if (arg[0] != '-') { if (ecasv_input == "") ecasv_input = arg; else if (ecasv_output == "") ecasv_output = arg; } else { string prefix = kvu_get_argument_prefix(arg); if (prefix == "b") ecasv_buffersize = atol(kvu_get_argument_number(1, arg).c_str()); if (prefix == "c") ecasv_enable_cumulative_mode = true; if (prefix == "d") ecasv_enable_debug = true; if (prefix == "f") ecasv_format_string = string(arg.begin() + 3, arg.end()); if (prefix == "I") ecasv_log_display_mode = false; // jkc: addition if (prefix == "L") ecasv_log_display_mode = true; // jkc: addition if (prefix == "r") ecasv_rate_msec = atol(kvu_get_argument_number(1, arg).c_str()); if (prefix == "G" || prefix == "B" || (prefix.size() > 0 && prefix[0] == 'M') || prefix == "r" || prefix == "z") { eci->command("cs-option " + arg); } } } cline.next(); } ecasv_fill_defaults(); } void ecasv_fill_defaults(void) { // ECA_RESOURCES ecarc; if (ecasv_input.size() == 0) ecasv_input = "/dev/dsp"; if (ecasv_output.size() == 0) ecasv_output = "null"; if (ecasv_buffersize == 0) ecasv_buffersize = ecasv_buffersize_default_const; if (ecasv_rate_msec == 0) ecasv_rate_msec = ecasv_rate_default_const; if (ecasv_format_string.size() == 0) ecasv_format_string = "s16_le,2,44100,i"; // ecarc.resource("default-audio-format"); } string ecasv_cop_to_string(ECA_CONTROL_INTERFACE* eci) { eci->command("cop-status"); return(eci->last_string()); } void ecasv_output_init(void) { #ifdef ECASV_USE_CURSES initscr(); erase(); int r=0; // jkc: added r for row indexing here and below mvprintw(r++, 0, "ecasignalview v%s (%s) -- (C) K.Vehmanen, J.Cunningham", ecatools_signalview_version.c_str(), VERSION); //mvprintw(r++, 0, "* (C) 1999-2005 Kai Vehmanen, Jeff Cunningham *\n"); //mvprintw(r++, 0, "******************************************************\n\n"); ++r; mvprintw(r++, 2, "Input/output: \"%s\" => \"%s\"", ecasv_input.c_str(),ecasv_output.c_str()); double avg_length = (double)ecasv_rate_msec * avg_peak_buffer_sz; mvprintw(r++, 2, "Settings: %s refresh=%ldms bsize=%ld avg-length=%.0fms", ecasv_format_string.c_str(), ecasv_rate_msec, ecasv_buffersize, avg_length); /* mvprintw(r++, 0, "refresh rate = %ld (msec), buffer size = %ld, " "avg-length = %.0f (msec)", ecasv_rate_msec, ecasv_buffersize, avg_length); */ ++r; const char* bar="------------------------------------------------------------------------------\n"; mvprintw(r++, 0, bar); mvprintw(r, 0, "channel"); if (ecasv_log_display_mode) mvprintw(r++,38, "%s avg-peak dB max-peak dB clipped\n", ecasv_bar_buffer); else mvprintw(r++,38, "%s avg-peak max-peak clipped\n", ecasv_bar_buffer); mvprintw(r++, 0, bar); memset(ecasv_bar_buffer, ' ', ecasv_bar_length_const - 4); ecasv_bar_buffer[ecasv_bar_length_const - 4] = 0; mvprintw(r + ecasv_chcount + 3, 0, "Press spacebar to reset stats"); // jkc: addition move(r + ecasv_chcount - 2, 0); // 13 + 12 refresh(); #endif } void ecasv_output_cleanup(void) { #ifdef ECASV_USE_CURSES endwin(); #endif // FIXME: should be enabled #if 0 if (ecasv_eci_repp != 0) { cout << endl << endl << endl; ecasv_eci_repp->command("cop-status"); } #endif } // jkc: addition of reset_stats function void reset_stats_fcn(vector* chstats) { #ifdef ECASV_USE_CURSES vector::iterator s=chstats->begin(); while (s!=chstats->end()) { s->last_peak=0; s->max_peak=0; s->drawn_peak=0; s->clipped_samples=0; s++; } #endif } // jkc: end of addition int ecasv_print_vu_meters(ECA_CONTROL_INTERFACE* eci, vector* chstats) { int result = 0; /* check wheter to reset peaks */ if (reset_stats) { reset_stats = 0; for(int n = 0; n < ecasv_chcount; n++) { (*chstats)[n].max_peak = 0; (*chstats)[n].clipped_samples = 0; } } #ifdef ECASV_USE_CURSES for(int n = 0; n < ecasv_chcount; n++) { eci->command("copp-select " + kvu_numtostr(n + 1)); eci->command("copp-get"); if (eci->error()) { result = -1; break; } double value = eci->last_float(); ecasv_update_chstats(chstats, n, value); ecasv_create_bar((*chstats)[n].drawn_peak, ecasv_bar_length_const, ecasv_bar_buffer); // jkc: commented out following two lines and substituted what follows until noted // mvprintw(ecasv_header_height_const+n, 0, "Ch-%02d: %s| %.5f %ld\n", // n + 1, ecasv_bar_buffer, (*chstats)[n].max_peak, (*chstats)[n].clipped_samples); // Calculate average peak value if (ecasv_log_display_mode) mvprintw(ecasv_header_height_const+n, 0, "Ch-%02d: %s %.2f %.2f %ld\n", n+1, ecasv_bar_buffer, dB((*chstats)[n].avg_peak_val), dB((*chstats)[n].max_peak), (*chstats)[n].clipped_samples); else mvprintw(ecasv_header_height_const+n, 0, "Ch-%02d: %s %.5f %.5f %ld\n", n+1, ecasv_bar_buffer, (*chstats)[n].avg_peak_val, (*chstats)[n].max_peak, (*chstats)[n].clipped_samples); // jkc: end of substitution } move(ecasv_header_height_const + 2 + ecasv_chcount, 0); refresh(); #else cout << ecasv_cop_to_string(eci) << endl; #endif return result; } void ecasv_update_chstats(vector* chstats, int ch, double value) { /* 1. in case a new channel is encoutered */ if (static_cast(chstats->size()) <= ch) { chstats->resize(ch + 1); // jkc: added until noted (*chstats)[ch].last_peak=0; (*chstats)[ch].drawn_peak=0; (*chstats)[ch].max_peak=0; (*chstats)[ch].clipped_samples=0; (*chstats)[ch].avg_peak.resize(avg_peak_buffer_sz,0); (*chstats)[ch].avg_peak_ptr=0; // jkc: end of additions } /* 2. update last_peak and drawn_peak */ (*chstats)[ch].last_peak = value; if ((*chstats)[ch].last_peak < (*chstats)[ch].drawn_peak) { (*chstats)[ch].drawn_peak *= ((*chstats)[ch].last_peak / (*chstats)[ch].drawn_peak); } else { (*chstats)[ch].drawn_peak = (*chstats)[ch].last_peak; } /* 3. update max_peak */ if (value > (*chstats)[ch].max_peak) { (*chstats)[ch].max_peak = value; } /* 4. update clipped_samples counter */ if (value > ecasv_clipped_threshold_const) { (*chstats)[ch].clipped_samples++; } // jkc: added until noted /* 5. update running average vector */ (*chstats)[ch].avg_peak[(*chstats)[ch].avg_peak_ptr] = value; (*chstats)[ch].avg_peak_ptr = ((*chstats)[ch].avg_peak_ptr == avg_peak_buffer_sz-1)? 0 : (*chstats)[ch].avg_peak_ptr+1; vector::iterator p=(*chstats)[ch].avg_peak.begin(); (*chstats)[ch].avg_peak_val=0; while (p!=(*chstats)[ch].avg_peak.end()) { (*chstats)[ch].avg_peak_val+=*p++; } (*chstats)[ch].avg_peak_val/=avg_peak_buffer_sz; // jkc; end of addition } void ecasv_create_bar(double value, int barlen, unsigned char* barbuf) { int curlen = static_cast(rint(((value / 1.0f) * barlen))); for(int n = 0; n < barlen; n++) { if (n <= curlen) barbuf[n] = '*'; else barbuf[n] = ' '; } } /** * Sets terminal to unbuffered mode (no echo, * non-canonical input). -jkc */ void ecasv_set_unbuffered(void) { #ifdef HAVE_TERMIOS_H tcgetattr( STDIN_FILENO, &old_term ); new_term = old_term; new_term.c_lflag &= ~( ICANON | ECHO ); tcsetattr( STDIN_FILENO, TCSANOW, &new_term ); #endif } /** * Sets terminal to buffered mode -jkc */ void ecasv_set_buffered(void) { #ifdef HAVE_TERMIOS_H tcsetattr( STDIN_FILENO, TCSANOW, &old_term ); #endif } /** * Reads a character from the terminal console. -jkc */ int ecasv_kbhit(void) { int result; fd_set set; struct timeval tv; FD_ZERO(&set); FD_SET(STDIN_FILENO,&set); /* watch stdin */ tv.tv_sec = 0; tv.tv_usec = 0; /* don't wait */ /* quick peek at the input, to see if anything is there */ ecasv_set_unbuffered(); result = select( STDIN_FILENO+1,&set,NULL,NULL,&tv); ecasv_set_buffered(); return result == 1; } void ecasv_print_usage(void) { cerr << "****************************************************************************\n"; cerr << "* ecasignalview, v" << ecatools_signalview_version << " (" << VERSION << ")\n"; cerr << "* Copyright 1999-2005 Kai Vehmanen, Jeffrey Cunningham\n"; cerr << "* Licensed under the terms of the GNU General Public License\n"; cerr << "****************************************************************************\n"; cerr << "\nUSAGE: ecasignalview [options] [input] [output] \n"; cerr << "\nOptions:\n"; cerr << "\t-b:buffersize\n"; // cerr << "\t\t-c (cumulative mode)\n"; cerr << "\t-d (debug mode)\n"; cerr << "\t-f:bits,channels,samplerate\n"; cerr << "\t-r:refresh_msec\n\n"; cerr << "\t-I (linear-scale)\n"; cerr << "\t-L (logarithmic-scale)\n"; } void ecasv_signal_handler(int signum) { if (signum == SIGHUP) { reset_stats = 1; } else { cerr << "Interrupted... cleaning up.\n"; done=1; } } ecasound-2.9.3/ecatools/ecamonitor0000755000076400007640000001744713604161211014166 00000000000000#!/usr/bin/env python # ------------------------------------------------------------------------ # ecamonitor: Ecasound monitor client implemented using NetECI # Copyright (C) 2002-2003,2009 Kai Vehmanen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ------------------------------------------------------------------------ import curses import re import socket import string import sys import time ecamonitor_remote_host = "localhost" ecamonitor_remote_port = 2868 ecamonitor_version = "v20090419-7" # TODO: # - nothing at the moment # References: # - http://www.python.org/doc/essays/styleguide.html # - http://py-howto.sourceforge.net/curses/curses.html # - http://www.python.org/doc/2.2.2/lib/module-curses.html # - http://py-howto.sourceforge.net/regex/regex.html # - http://www.python.org/doc/2.2.2/lib/module-re.html # - http://py-howto.sourceforge.net/sockets/sockets.html # - http://www.python.org/doc/2.2.2/lib/module-string.html def connect_to_server(remote_host, remote_port): """Connects to the ecasound server. @return Socket object for the connection. """ while 1: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((remote_host, remote_port)) s.setblocking(1) return(s) except Exception as e: if e[0] == 111: # 111 = connection refused time.sleep(1) pass else: raise def issue_eiam_command(s, cmd): """Sends a command to ecasound and waits for an response. @param s socket for an active connection @param cmd EIAM command to send @return tuple of return value type and value """ tm = '' counter = 0 s.send((cmd + '\r\n').encode()) while counter < 16: count = counter + 1 newdata = s.recv(4096) if len(newdata) == 0: return ('e','') tm = str(tm + newdata.decode()) # lets test whether we have received a valid # EIAM command try: m = expand_eiam_response(tm) return parse_eiam_response(m, tm) except Exception as e: pass return ('e','') def expand_eiam_response(str): """Checks wheter 'str' is a valid EIAM response. @return Regex match object. """ m = re.match('256 ([0-9]{1,5}) (.+)\r\n(.*)\r\n\r\n.*', str, re.MULTILINE | re.S) return m def parse_eiam_response(m, str): """Parses a valid EIAM response. @param m Valid regex match object. @param str The whole EIAM response. @return tuple of return value type and value """ if not m: m = re.match('256 ([0-9]{1,5}) (.+)\r\n(.*)', str, re.MULTILINE | re.S) if not m: raise Exception('Regexp failed!') if m and len(m.groups()) == 0: print("(ecamonitor) Matching groups failed: ", m.groups()) if m and len(m.groups()) == 3: #print 'received=', len(m.group(3)), ', expected=', m.group(1) if int(m.group(1)) != len(m.group(3)): print("(ecamonitor) Response length error.") if m: return (m.group(2), m.group(3)) return ('e','') def main(): s = None remote_host = ecamonitor_remote_host remote_port = ecamonitor_remote_port if not hasattr(sys, 'hexversion') or sys.hexversion < 0x02070000: print('Error! Ecamonitor requires python-2.7, python-3 or newer to run!') return 1 if len(sys.argv) > 1: destination = sys.argv[1] address = string.split(destination, ':') remote_host = address[0] if len(address) > 1: remote_port = int(address[1]) try: stdscr = curses.initscr() pad = curses.newpad(255, 80) pad.nodelay(1) # to make getch() nonblocking while 1: try: pad.erase() pad.addstr(0, 0, "ecamonitor " + ecamonitor_version, curses.A_BOLD) if s == None: pad.addstr(2, 0, "No connection. Trying to connect to " + remote_host + ":" + str(remote_port) + ".\n") pad.refresh(0, 0, 0, 0, stdscr.getmaxyx()[0]-1, stdscr.getmaxyx()[1]-1) #time.sleep(3) s = connect_to_server(remote_host, remote_port) pad.addstr(3, 0, "Connection established.\n") pad.refresh(0, 0, 0, 0, stdscr.getmaxyx()[0]-1, stdscr.getmaxyx()[1]-1) pad.addstr(1, 0, "") else: pad.addstr("\n") pad.addstr("\n------------------------------------------------------------") pad.addstr("\nEngine status: ") pad.addstr((issue_eiam_command(s, 'engine-status')[1]), curses.A_BOLD) pad.addstr("\nConnected chainsetup: ") pad.addstr(issue_eiam_command(s, 'cs-connected')[1], curses.A_BOLD) pad.addstr("\nSelected chainsetup: ") pad.addstr(issue_eiam_command(s, 'cs-selected')[1], curses.A_BOLD) #pad.addstr("\nSelected chainsetup status:: ") #pad.addstr(issue_eiam_command(s, 'cs-status')[1]) pad.addstr("\n\nPosition: ") pad.addstr(issue_eiam_command(s, 'cs-get-position')[1] + "s", curses.A_BOLD) pad.addstr(" / Length: ") pad.addstr(issue_eiam_command(s, 'cs-get-length')[1] + "s", curses.A_BOLD) pad.addstr("\nChains: ") pad.addstr(str(len(str.split(issue_eiam_command(s, 'c-list')[1],','))), curses.A_BOLD) pad.addstr(" / Inputs: ") pad.addstr(str(len(str.split(issue_eiam_command(s, 'ai-list')[1],','))), curses.A_BOLD) pad.addstr(" / Outputs: ") pad.addstr(str(len(str.split(issue_eiam_command(s, 'ao-list')[1],','))), curses.A_BOLD) pad.addstr("\n\n------------------------------------------------------------\n") res = issue_eiam_command(s, 'aio-status') pad.addstr(res[1]) pad.addstr("\n\n------------------------------------------------------------\n") res = issue_eiam_command(s, 'cop-status') pad.addstr(res[1]) pad.addstr("\n\n------------------------------------------------------------\n") res = issue_eiam_command(s, 'ctrl-status') pad.addstr(res[1]) pad.addstr("\n\n------------------------------------------------------------\n") pad.refresh(0, 0, 0, 0, stdscr.getmaxyx()[0]-1, stdscr.getmaxyx()[1]-1) time.sleep(1.0) ch=pad.getch() if ch == ord('q'): break except curses.error: raise except socket.error as e: if e[0] == 32 or e[0] == 104 or e[0] == 111: s = None pass else: curses.endwin() print("Exception!" , e) raise except KeyboardInterrupt: break finally: if s != None: s.close() curses.endwin() if __name__ == '__main__': main() ecasound-2.9.3/ecatools/ecicpp_helpers.cpp0000644000076400007640000000702712260762753015601 00000000000000// ------------------------------------------------------------------------ // ecicpp_helper.cpp: Helper routines for C++ ECI programming. // Copyright (C) 2002-2007 Kai Vehmanen // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include "ecicpp_helpers.h" /** * Definitions and options */ using std::cerr; using std::cout; using std::endl; using std::string; /** * Function declarations */ static void escape(string& str, string& x, string& rep) { for (size_t i = 0; (i = str.find(x, i)) != string::npos; i += rep.length()) str.replace(i, x.length(), rep); } int ecicpp_add_file_input(ECA_CONTROL_INTERFACE* eci, string& filename, string* format) { string space(" "); string space_e("\\ "); string comma(","); string comma_e("\\\\,"); escape(filename, space, space_e); escape(filename, comma, comma_e); return ecicpp_add_input(eci, filename, format); } int ecicpp_add_input(ECA_CONTROL_INTERFACE* eci, const string& input, string* format) { eci->command("ai-add " + input); bool error = eci->error(); eci->command("ai-list"); if (error == true || eci->last_string_list().size() != 1) { cerr << eci->last_error() << endl; cerr << "---\nError while processing input " << input << ". Exiting...\n"; return -1; } /* we must connect to get correct input format */ eci->command("ao-add null"); eci->command("cs-connect"); eci->command("ai-iselect 1"); eci->command("ai-get-format"); *format = eci->last_string(); /* disconnect and remove the null output */ eci->command("cs-disconnect"); eci->command("ao-iselect 1"); eci->command("ao-remove"); return 0; } int ecicpp_add_output(ECA_CONTROL_INTERFACE* eci, const string& output, const string& format) { eci->command("cs-set-audio-format " + format); eci->command("ao-add " + output); bool error = eci->error(); eci->command("ao-list"); if (error == true || eci->last_string_list().size() != 1) { cerr << eci->last_error() << endl; cerr << "---\nError while processing output " << output << ". Exiting...\n"; return -1; } return 0; } int ecicpp_connect_chainsetup(ECA_CONTROL_INTERFACE* eci, const string& csname) { eci->command("cs-connect"); bool error = eci->error(); string errorstr = eci->last_error(); eci->command("cs-connected"); if (error == true || eci->last_string() != csname) { cerr << endl << errorstr << endl; cerr << "---\nUnable to start processing. Exiting...\n"; return -1; } return 0; } int ecicpp_format_channels(const string& format) { std::vector tokens = kvu_string_to_vector(format, ','); DBC_CHECK(tokens.size() >= 3); return atoi(tokens[1].c_str()); } ecasound-2.9.3/ecatools/ecaplay.c0000644000076400007640000004536611747070633013700 00000000000000/** * ecaplay.c: A simple command-line tool for playing audio files. * * Copyright (C) 1999-2002,2004-2006 Kai Vehmanen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * TODO: * - show playlist length during runtime * - random start switch (both for cmdline and playlist modes) * - write some notes about locking issues */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include /* ANSI-C: malloc(), free() */ #include /* ANSI-C: strlen(), strncmp() */ #include /* POSIX: ... */ #include /* POSIX: sigaction() */ #include /* POSIX: mkdir() */ #include /* POSIX: mkdir() */ #include /** * Function declarations */ int main(int argc, char *argv[]); static void add_input_to_chainsetup(eci_handle_t eci, const char* nextrack); static int flush_tracks(void); static const char* get_next_track(int *tracknum, int argc, char *argv[], eci_handle_t *eci); static char* get_playlist_path(void); static const char* get_track_cmdline(int n, int argc, char *argv[]); static const char* get_track_playlist(int* next_track); static void initialize_chainsetup_for_playback(eci_handle_t* eci, const char* nexttrack, int tracknum); static void initialize_check_output(eci_handle_t* eci); static int list_tracks(void); static int play_tracks(int argc, char *argv[]); static void print_usage(FILE* stream); static int process_option(const char* option); static int queue_tracks(int argc, char *argv[]); static int set_audio_format(eci_handle_t* eci, const char* fmt); static void setup_signal_handling(void); static void signal_handler(int signum); /** * Definitions and options */ #define ECAPLAY_AFMT_MAXLEN 64 #define ECAPLAY_EIAM_LOGLEVEL 256 #define ECAPLAY_TIMEOUT 3 #define ECAPLAY_MODE_NORMAL 0 #define ECAPLAY_MODE_PL_FLUSH 1 #define ECAPLAY_MODE_PL_LIST 2 #define ECAPLAY_MODE_PL_PLAY 3 #define ECAPLAY_MODE_PL_QUEUE 4 #define ECAPLAY_PLAYLIST_BASEDIR ".ecasound" #define ECAPLAY_PLAYLIST_FILE "ecaplay_queue" /** * Global variables */ static const char* ecaplay_version = "20061206-45"; /* ecaplay version */ static char ecaplay_next[PATH_MAX]; /* file to play next */ static char ecaplay_audio_format[ECAPLAY_AFMT_MAXLEN]; /* audio format to use */ static const char* ecaplay_output = NULL; /* output device to use */ static int ecaplay_debuglevel = ECAPLAY_EIAM_LOGLEVEL; /* debug level to use */ static int ecaplay_skip = 0; /* how many playlist items to skip */ static int ecaplay_mode = ECAPLAY_MODE_NORMAL; /* playlist mode */ /* FIX: static int ecaplay_list_len = -1; playlist length */ static int ecaplay_initialized = 0; /* playlist mode */ static sig_atomic_t ecaplay_skip_flag = 0; /* signal flag for ctrl-c */ /** * Function definitions */ int main(int argc, char *argv[]) { int i, res = 0; /* get the default output device */ ecaplay_output = getenv("ECAPLAY_OUTPUT_DEVICE"); /* process command-line arguments */ for(i = 1; i < argc; i++) { res += process_option(argv[i]); } if (res == 0) { switch(ecaplay_mode) { case ECAPLAY_MODE_PL_FLUSH: res = flush_tracks(); break; case ECAPLAY_MODE_PL_LIST: res = list_tracks(); break; case ECAPLAY_MODE_PL_QUEUE: res = queue_tracks(argc, argv); break; case ECAPLAY_MODE_NORMAL: case ECAPLAY_MODE_PL_PLAY: res = play_tracks(argc, argv); break; default: assert(0); } } if (res != 0) { fprintf(stderr, "(ecaplay) Errors encountered, return code is %d.\n", res); } return res; } /** * Adds input 'nexttrack' to currently selected chainsetup * of 'eci'. Sets the global variable 'ecaplay_audio_format'. */ static void add_input_to_chainsetup(eci_handle_t eci, const char* nexttrack) { size_t len = strlen("ai-add '") + strlen(nexttrack) + strlen("'") + 1; char* tmpbuf = malloc(len); assert(tmpbuf != NULL); snprintf(tmpbuf, len, "ai-add \"%s\"", nexttrack); eci_command_r(eci, tmpbuf); /* check that add succeeded */ eci_command_r(eci, "ai-list"); if (eci_last_string_list_count_r(eci) != 1) { fprintf(stderr, "(ecaplay) Warning! Failed to add input '%s'.\n", nexttrack); } /* we must connect to get correct input format */ eci_command_r(eci, "ao-add null"); eci_command_r(eci, "cs-connect"); eci_command_r(eci, "ai-iselect 1"); eci_command_r(eci, "ai-get-format"); strncpy(ecaplay_audio_format, eci_last_string_r(eci), ECAPLAY_AFMT_MAXLEN); ecaplay_audio_format[ECAPLAY_AFMT_MAXLEN - 1] = 0; /* disconnect and remove the null output */ eci_command_r(eci, "cs-disconnect"); eci_command_r(eci, "ao-iselect 1"); eci_command_r(eci, "ao-remove"); free(tmpbuf); } /** * Flushes the playlist contents. * * @return zero on success, non-zero otherwise */ static int flush_tracks(void) { char *path = get_playlist_path(); if (truncate(path, 0) != 0) { printf("(ecaplay) Unable to flush playlist '%s'.\n", path); return -1; } return 0; } /** * Checks that current chainsetup has exactly one * output. */ static void initialize_check_output(eci_handle_t* eci) { eci_command_r(eci, "ao-list"); if (eci_last_string_list_count_r(eci) != 1) { fprintf(stderr, "(ecaplay) Warning! Failed to add output device.\n"); } else { static int once = 1; if (once) { char *tmpstr; eci_command_r(eci, "ao-iselect 1"); eci_command_r(eci, "ao-describe"); tmpstr = (char*)eci_last_string_r(eci); /* skip the "-x:" prefix where x is one of [io] */ while(*tmpstr && *tmpstr++ != ':') ; printf("(ecaplay) Output device: '%s'\n", tmpstr); once = 0; } } } static void initialize_chainsetup_for_playback(eci_handle_t* eci, const char* nexttrack, int tracknum) { const char* ret = NULL; *eci = eci_init_r(); ecaplay_initialized = 1; if (ecaplay_debuglevel != -1) { char tmpbuf[32]; snprintf(tmpbuf, 32, "debug %d", ecaplay_debuglevel); eci_command_r(*eci, tmpbuf); } eci_command_r(*eci, "cs-add ecaplay_chainsetup"); /* check that add succeeded */ eci_command_r(*eci, "cs-list"); if (eci_last_string_list_count_r(*eci) != 2) { fprintf(stderr, "(ecaplay) Warning! Failed to add a new chainsetup.\n"); } /* as this is a new chainsetup, we can assume that * adding chains succeeds */ eci_command_r(*eci, "c-add ecaplay_chain"); add_input_to_chainsetup(*eci, nexttrack); set_audio_format(*eci, ecaplay_audio_format); if (ecaplay_output == NULL) { eci_command_r(*eci, "ao-add-default"); /* check that add succeeded */ initialize_check_output(*eci); } else { int len = strlen("ao-add ") + strlen(ecaplay_output) + 1; char* tmpbuf = (char*)malloc(len); snprintf(tmpbuf, len, "ao-add %s", ecaplay_output); eci_command_r(*eci, tmpbuf); initialize_check_output(*eci); free(tmpbuf); } /* FIXME: add detection of consecutive errors */ eci_command_r(*eci, "cs-connect"); if (eci_error_r(*eci)) { fprintf(stderr, "(ecaplay) Unable to play file '%s':\n%s\n", nexttrack, eci_last_error_r(*eci)); } else { eci_command_r(*eci, "cs-connected"); ret = eci_last_string_r(*eci); if (strncmp(ret, "ecaplay_chainsetup", strlen("ecaplay_chainsetup")) != 0) { fprintf(stderr, "(ecaplay) Error while playing file '%s' . Skipping...\n", nexttrack); } else { /* note: audio format set separately for each input file */ printf("(ecaplay) Playing %d: '%s' (%s).\n", tracknum, nexttrack, ecaplay_audio_format); eci_command_r(*eci, "start"); } } } static const char* get_next_track(int *tracknum, int argc, char *argv[], eci_handle_t *eci) { const char *nexttrack = NULL; if (ecaplay_mode == ECAPLAY_MODE_PL_PLAY) nexttrack = get_track_playlist(tracknum); else nexttrack = get_track_cmdline(*tracknum, argc, argv); if (nexttrack != NULL) { /* queue nexttrack for playing */ if (ecaplay_initialized) { eci_cleanup_r(*eci); } initialize_chainsetup_for_playback(eci, nexttrack, *tracknum); } else { /* reached end of playlist */ if (ecaplay_mode != ECAPLAY_MODE_PL_PLAY) { /* normal mode; end processing after all files played */ /* printf("(ecaplay) No more files...\n"); */ assert(nexttrack == NULL); } else { /* if in playlist mode, loop from beginning */ *tracknum = 1; /* FIXME: if in playlist mode; query the current lenght of * playlist and set 'tracknum = (tracknum % pllen)' */ if (ecaplay_mode == ECAPLAY_MODE_PL_PLAY) nexttrack = get_track_playlist(tracknum); else nexttrack = get_track_cmdline(*tracknum, argc, argv); /* printf("(ecaplay) Looping back to start of playlist...(%s)\n", nexttrack); */ if (nexttrack != NULL) { /* queue nexttrack for playing */ if (ecaplay_initialized) { eci_cleanup_r(*eci); } initialize_chainsetup_for_playback(eci, nexttrack, *tracknum); } else { /* get_next_track() failed two times, stopping processing */ assert(nexttrack == NULL); } } } return nexttrack; } /** * Returns the track number 'n' from the list * given in argc and argv. * * @return track name or NULL on error */ static const char* get_track_cmdline(int n, int argc, char *argv[]) { int i, c = 0; assert(n > 0 && n <= argc); for(i = 1; i < argc; i++) { /* FIXME: add support for '-- -foo.wav' */ if (argv[i][0] != '-') { if (++c == n) { return argv[i]; } } } return NULL; } /** * Returns a string containing the full path to the * playlist file. Ownership of the string is transfered * to the caller (i.e. it must be free()'ed). * * @return full pathname or NULL if error has occured */ static char* get_playlist_path(void) { char *path = malloc(PATH_MAX); struct stat statbuf; /* create pathname based on HOME */ strncpy(path, getenv("HOME"), PATH_MAX); strncat(path, "/" ECAPLAY_PLAYLIST_BASEDIR, PATH_MAX - strlen(path) - 1); /* make sure basedir exists */ if (stat(path, &statbuf) != 0) { printf("(ecaplay) Creating directory %s.\n", path); mkdir(path, 0700); } else { if (!S_ISDIR(statbuf.st_mode)) { /* error, basedir exists but is not a directory */ free(path); path = NULL; } } if (path != NULL) { /* add filename to basedir */ strncat(path, "/" ECAPLAY_PLAYLIST_FILE, PATH_MAX - strlen(path) - 1); } return path; } /** * Returns the track from playlist matching number 'next_track'. * * In case 'next_track' is larger than the playlist length, * track 'next_track mod playlist_len' will be selected, and * the modified playlist item number stored to 'next_track'. * * Note: modifies global variable 'ecaplay_next'. * * @return track name or NULL on error */ static const char* get_track_playlist(int* next_track) { const char *res = NULL; char *path; FILE *f1; int next = *next_track; assert(next > 0); path = get_playlist_path(); if (path == NULL) { return path; } f1 = fopen(path, "rb"); if (f1 != NULL) { int c, w, cur_item = 1; /* iterate through all data octet at a time */ for(w = 0;;) { c = fgetc(f1); if (c == EOF) { if (next > cur_item) { /* next_track beyond playlist length, reset to valid track number */ next = next % cur_item; *next_track = next; /* seek back to start and look again */ fseek(f1, 0, SEEK_SET); cur_item = 1; w = 0; continue; } break; } if (cur_item == next) { if (c == '\n') { ecaplay_next[w] = 0; res = ecaplay_next; break; } else { ecaplay_next[w] = c; } ++w; } if (c == '\n') { ++cur_item; } } /* close the file and return results */ fclose(f1); } free(path); return res; } /** * Lists tracks on the playlist. * * @return zero on success, non-zero otherwise */ static int list_tracks(void) { FILE *f1; char *path = get_playlist_path(); f1 = fopen(path, "rb"); if (f1 != NULL) { int c; while((c = fgetc(f1)) != EOF) { printf("%c", c); } fclose(f1); return 0; } return -1; } /** * Play tracks using the Ecasound engine via the * ECI interface. * * Depending on the mode, tracks are selected either * from the command-line or from the playlist. */ static int play_tracks(int argc, char *argv[]) { eci_handle_t eci = NULL; int tracknum = 1, stop = 0; const char* nexttrack = NULL; assert(ecaplay_mode == ECAPLAY_MODE_NORMAL || ecaplay_mode == ECAPLAY_MODE_PL_PLAY); tracknum += ecaplay_skip; nexttrack = get_next_track(&tracknum, argc, argv, &eci); if (nexttrack != NULL) { setup_signal_handling(); while(nexttrack != NULL) { unsigned int timeleft = ECAPLAY_TIMEOUT; while(timeleft > 0) { timeleft = sleep(timeleft); if (timeleft > 0 && ecaplay_skip_flag > 1) { fprintf(stderr, "\n(ecaplay) Interrupted, exiting...\n"); eci_cleanup_r(eci); stop = 1; break; } } /* see above while() loop */ if (stop) break; if (ecaplay_skip_flag == 0) { eci_command_r(eci, "engine-status"); } else { printf("(ecaplay) Skipping...\n"); } if (ecaplay_skip_flag != 0 || strcmp(eci_last_string_r(eci), "running") != 0) { ecaplay_skip_flag = 0; ++tracknum; nexttrack = get_next_track(&tracknum, argc, argv, &eci); /* printf("Next track is %s.\n", nexttrack); */ } } fprintf(stderr, "exiting...\n"); /* see while() loop above */ if (stop == 0) { eci_cleanup_r(eci); } } return 0; } static void print_usage(FILE* stream) { fprintf(stream, "Ecaplay v%s (%s)\n\n", ecaplay_version, VERSION); fprintf(stream, "Copyright (C) 1997-2005 Kai Vehmanen, released under GPL licence \n"); fprintf(stream, "Ecaplay comes with ABSOLUTELY NO WARRANTY.\n"); fprintf(stream, "You may redistribute copies of ecasound under the terms of the GNU\n"); fprintf(stream, "General Public License. For more information about these matters, see\n"); fprintf(stream, "the file named COPYING.\n"); fprintf(stream, "\nUSAGE: ecaplay [-dfhklopq] [ file1 file2 ... fileN ]\n\n"); fprintf(stream, "See ecaplay(1) man page for more details.\n"); } static int process_option(const char* option) { if (option[0] == '-') { if (strncmp("--help", option, sizeof("--help")) == 0 || strncmp("--version", option, sizeof("--version")) == 0) { print_usage(stdout); return 0; } switch(option[1]) { case 'd': { const char* level = &option[3]; if (option[2] != 0 && option[3] != 0) { ecaplay_debuglevel |= atoi(level); printf("(ecaplay) Setting log level to %d.\n", ecaplay_debuglevel); } break; } case 'f': { ecaplay_mode = ECAPLAY_MODE_PL_FLUSH; printf("(ecaplay) Flushing playlist.\n"); break; } case 'h': { print_usage(stdout); return 0; } case 'k': { const char* skip = &option[3]; if (option[2] != 0 && option[3] != 0) { ecaplay_skip = atoi(skip); printf("(ecaplay) Skipping the first %d files..\n", ecaplay_skip); } break; } case 'l': { ecaplay_mode = ECAPLAY_MODE_PL_LIST; /* printf("(ecaplay) Listing playlist contents.\n"); */ break; } case 'o': { const char* output = &option[3]; if (option[2] != 0 && option[3] != 0) { ecaplay_output = output; /* printf("(ecaplay) Output device: '%s'\n", ecaplay_output); */ } break; } case 'p': { ecaplay_mode = ECAPLAY_MODE_PL_PLAY; printf("(ecaplay) Playlist mode selected (file: %s).\n", "~/" ECAPLAY_PLAYLIST_BASEDIR "/" ECAPLAY_PLAYLIST_FILE); break; } case 'q': { ecaplay_mode = ECAPLAY_MODE_PL_QUEUE; printf("(ecaplay) Queuing tracks to playlist.\n"); break; } default: { fprintf(stderr, "(ecaplay) Error! Unknown option '%s'.\n", option); print_usage(stderr); return 1; } } } return 0; } static int queue_tracks(int argc, char *argv[]) { int i, res = 0; char *path; FILE *f1; path = get_playlist_path(); /* path maybe NULL but fopen can handle it */ f1 = fopen(path, "a+b"); if (f1 != NULL) { for(i = 1; i < argc; i++) { char c = argv[i][0]; /* printf("(ecaplay) processing arg '%s' (%c).\n", argv[i], c); */ /* FIXME: add support for '-- -foo.wav' */ if (c != '-') { /* printf("(ecaplay) 2:processing arg '%s' (%c).\n", argv[i], c); */ if (c != '/') { /* reserve extra room for '/' */ char* tmp = malloc(PATH_MAX + strlen(argv[i]) + 1); if (getcwd(tmp, PATH_MAX) != NULL) { strcat(tmp, "/"); strcat(tmp, argv[i]); printf("(ecaplay) Track '%s' added to playlist.\n", argv[i]); fwrite(tmp, 1, strlen(tmp), f1); } free(tmp); } else { printf("(ecaplay) Track '%s' added to playlist.\n", argv[i]); fwrite(argv[i], 1, strlen(argv[i]), f1); } fwrite("\n", 1, 1, f1); } } fclose(f1); } else { res = -1; } free(path); /* can be NULL */ return res; } /** * Sets the chainsetup audio format to 'fmt'. * * @return zero on success, non-zero on error */ int set_audio_format(eci_handle_t* eci, const char* fmt) { size_t len = strlen("cs-set-audio-format -f:") + strlen(fmt) + 1; char* tmpbuf = malloc(len); int res = 0; strcpy(tmpbuf, "cs-set-audio-format "); strcat(tmpbuf, fmt); tmpbuf[len - 1] = 0; eci_command_r(eci, tmpbuf); if (eci_error_r(eci)) { fprintf(stderr, "(ecaplay) Unknown audio format encountered.\n"); res = -1; } free(tmpbuf); return res; } static void setup_signal_handling(void) { struct sigaction es_handler_int; struct sigaction ign_handler; es_handler_int.sa_handler = signal_handler; sigemptyset(&es_handler_int.sa_mask); es_handler_int.sa_flags = 0; ign_handler.sa_handler = SIG_IGN; sigemptyset(&ign_handler.sa_mask); ign_handler.sa_flags = 0; /* handle the follwing signals explicitly */ sigaction(SIGINT, &es_handler_int, 0); /* ignore the following signals */ sigaction(SIGPIPE, &ign_handler, 0); sigaction(SIGFPE, &ign_handler, 0); } static void signal_handler(int signum) { ++ecaplay_skip_flag; } ecasound-2.9.3/ecatools/Makefile.am0000644000076400007640000000525012303075645014133 00000000000000# ---------------------------------------------------------------------- # File: ecasound/ecatools/Makefile.am # Description: Utility applications built on Ecasound libraries # License: GPL (see ecasound/{AUTHORS,COPYING}) # ---------------------------------------------------------------------- EXTRA_DIST = ecasound.el ecamonitor if ECA_AM_DEBUG_MODE libkvutils_path = $(top_builddir)/kvutils/libkvutils_debug.la libecasoundc_path = $(top_builddir)/libecasoundc/libecasoundc_debug.la else libkvutils_path = $(top_builddir)/kvutils/libkvutils.la libecasoundc_path = $(top_builddir)/libecasoundc/libecasoundc.la endif if ECA_AM_USE_NCURSES ncurses_library = -lncurses endif if ECA_AM_USE_TERMCAP termcap_library = -ltermcap endif AM_CPPFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/kvutils -I$(top_srcdir)/libecasound -I$(top_srcdir)/libecasoundc bin_SCRIPTS = ecamonitor if ECA_AM_DEBUG_MODE bin_PROGRAMS = ecaconvert_debug \ ecafixdc_debug \ ecalength_debug \ ecanormalize_debug \ ecaplay_debug \ ecasignalview_debug else bin_PROGRAMS = ecaconvert \ ecafixdc \ ecalength \ ecanormalize \ ecaplay \ ecasignalview endif # -- noinst_HEADERS = ecicpp_helpers.h ecaconvert_SOURCES = ecaconvert.cpp ecicpp_helpers.cpp ecaconvert_LDADD = $(libecasoundc_path) $(libkvutils_path) ecafixdc_SOURCES = ecafixdc.cpp ecicpp_helpers.cpp ecafixdc_LDADD = $(libecasoundc_path) $(libkvutils_path) ecalength_SOURCES = ecalength.c ecalength_LDADD = $(libecasoundc_path) ecanormalize_SOURCES = ecanormalize.cpp ecicpp_helpers.cpp ecanormalize_LDADD = $(libecasoundc_path) $(libkvutils_path) ecaplay_SOURCES = ecaplay.c ecaplay_LDADD = $(libecasoundc_path) ecasignalview_SOURCES = ecasignalview.cpp ecicpp_helpers.cpp ecasignalview_LDADD = $(libecasoundc_path) $(libkvutils_path) $(termcap_library) $(ncurses_library) # -- ecaconvert_debug_SOURCES = $(ecaconvert_SOURCES) ecaconvert_debug_LDADD = $(ecaconvert_LDADD) ecafixdc_debug_SOURCES = $(ecafixdc_SOURCES) ecafixdc_debug_LDADD = $(ecafixdc_LDADD) ecalength_debug_SOURCES = $(ecalength_SOURCES) ecalength_debug_LDADD = $(ecalength_LDADD) ecanormalize_debug_SOURCES = $(ecanormalize_SOURCES) ecanormalize_debug_LDADD = $(ecanormalize_LDADD) ecanormalize_debug_LDFLAGS = $(ecanormalize_LDFLAGS) ecaplay_debug_SOURCES = $(ecaplay_SOURCES) ecaplay_debug_LDADD = $(ecaplay_LDADD) ecasignalview_debug_SOURCES = $(ecasignalview_SOURCES) ecasignalview_debug_LDADD = $(ecasignalview_LDADD) # -- # special targets with dependency tracking ecainstall: $(MAKE) -C $(srcdir)/../libecasound -q 2>/dev/null || make -C $(srcdir)/../libecasound $(MAKE) -C $(srcdir)/../kvutils -q 2>/dev/null || make -C $(srcdir)/../kvutils $(MAKE) install ecasound-2.9.3/ecatools/ecalength.c0000644000076400007640000002740311337777745014221 00000000000000/* This is ecalength, a few lines of code pompously named so because they let one retrieve the length of an audio file from the command line using ecasound's engine. Limitations: - It will only work correctly if the audio file is at a sampling rate of 44100 hz, unless the file is a wave file; for other formats such as .au, .raw and .cdr that have a sr other than 44100 the format needs to be specified with the -a switch. NOTE: mp3 files do have sr information in their headers but unfortunately ecasound currently seems unable to parse this information correctly. :( - It is not foolproof, feeding it with something other than an audio file WILL result in ugly things being spewed back. (A bit better) - A thousand more that I haven't thought of. Please post back any improvement you make; I can be reached at: observer@colba.net note: Compile it with: gcc -Wall -o ecalength ecalength.c `libecasoundc-config --cflags --libs` * updated: Thu May 10 15:56:18 EDT 2001 - Now works with the new ai/ao scheme. - Switches implemented, made suitable for scripting. - Format querying/setting. - Better error handling. * updated: Wed Nov 14 23:26:19 EST 2001 - New option -su lets us return the file's length in samples. (This breaks compatibility with stable series.) - Reworked the comment above to say that basically only wave files are able to self-adjust. - Started to wondered whether my nice options structure isn't a bit too unobvious for anyone else than me. (???) - Help screen's getting a bit long, I have to scrollback to see the error message. (???) (addressed) * updated: Thu Nov 15 11:51:35 EST 2001 - Tried to format the code a bit better however hopeless it looks, tried to comment it a bit. - Tried to catch wrong switches a bit better. - Only print full help message when no other message is being spewed. * updated: Sun Jan 6 14:37:02 EST 2002 - Woo! Ecasound's internals now support quoting, had to take advantage of this. * updated: Mon Apr 29 02:41:13 EEST 2002 - Renamed to ecalength.cpp to avoid troubles with linking ecalength against uninstalled libecasoundc. * updated: Thu Oct 31 17:41:05 EET 2002 - Renamed to ecalength.c. Updated the compilation instructions. */ #include #include #include #include /* exit() */ #include "ecasoundc.h" #define FALSE 0 #define TRUE 1 void make_human(int length, unsigned int *min, unsigned char *sec); void print_help(char* name); void print_usage(char* name); struct options { char adjust; char format; char total; char script; char human; char bits; char ccount; char rate; char samples; }; int main(int argc, char *argv[]) { char cmd[512], fstring[16], status = 0, *optstr = "ftsmhbcra:u"; int curopt, curarg; unsigned char sec; float curfilelength, totlength = 0; unsigned int min; FILE *file; struct options opts; /* No surprises please */ opts.adjust = FALSE; opts.format = FALSE; opts.total = FALSE; opts.script = FALSE; opts.human = FALSE; opts.bits = FALSE; opts.ccount = FALSE; opts.rate = FALSE; opts.samples = FALSE; /* Now let's parse and set. */ while ((curopt = getopt(argc, argv, optstr)) != -1) { switch (curopt) { case 'a' : opts.adjust = TRUE; strcpy(fstring, optarg); break; case 'f' : opts.format = TRUE; break; case 't' : opts.total = TRUE; break; case 's' : opts.script = TRUE; break; case 'm' : opts.human = TRUE; break; case 'b' : opts.bits = TRUE; break; case 'c' : opts.ccount = TRUE; break; case 'r' : opts.rate = TRUE; break; case 'u' : opts.samples = TRUE; break; case 'h' : print_help(argv[0]); exit(0); case '?' : print_usage(argv[0]); exit(1); } } /* No file? */ if (argc-optind == 0) { print_help(argv[0]); exit(1); } /* Well, let's not just shut up if options are out of context, let's whine * about it a bit so that people know why they're not getting what they * expected. */ if (!opts.script) { /* If not in script mode then we should check and make sure that we warn * if script options have been set. I assume it's fine to spit to stdout * here. */ /* Local string where we store naughty switches. */ char badopts[10] = "\0"; /* Off we go. */ if (opts.format) { strcat(badopts, "f"); } if (opts.bits) { strcat(badopts, "b"); } if (opts.ccount) { strcat(badopts, "c"); } if (opts.rate) { strcat(badopts, "r"); } if (opts.human) { strcat(badopts, "m"); } if (opts.samples) { strcat(badopts, "u"); } if (strlen(badopts)) { printf("-%s :: Out of context options will be ignored.\n", badopts); } } else { /* Now, if we're in script mode we want to make sure of a few things, * we also want to warn on stderr, of course. */ char badopts[20] = "\0"; /* The whole format thing is a bit complex so I guess we want to help * out. */ if (!opts.format) { if (opts.bits) { strcat(badopts, "b"); } if (opts.ccount) { strcat(badopts, "c"); } if (opts.rate) { strcat(badopts, "r"); } if (strlen(badopts) == 1) { fprintf(stderr, "You can't specify -%s just like that, you need to enter format mode with -f.\n", badopts); } if (strlen(badopts) > 1) { fprintf(stderr, "Look out, you're not in format mode and you have more than one format specifier anyway: just use the -h switch for now.\n"); } } /* Catch-all piece of logic to filter errors. */ if ((opts.script) && (((opts.format) && (opts.human)) || ((opts.format) && (((opts.bits) && ((opts.ccount) || (opts.rate))) || ((opts.ccount) && (opts.rate)))) || (opts.samples && (opts.format || opts.human)))) { fprintf(stderr, "Error: In script mode not more than one further mode can be specified.\n"); print_usage(argv[0]); exit(1); } } /* Setting things up. */ eci_init(); eci_command("cs-add main"); eci_command("c-add main"); eci_command("ao-add null"); /* Setting the format if needed. */ if (opts.adjust) { if (strncmp(":", fstring, 1) == 0) { sprintf(cmd, "cs-set-audio-format %s", fstring+1); } else { sprintf(cmd, "cs-set-audio-format %s", fstring); } eci_command(cmd); if (strlen(eci_last_error()) != 0) { fprintf(stderr, "Argument to -a is badly formatted.\n"); print_usage(argv[0]); exit(1); } } curarg = optind; /* The real thing. */ while(curarg < argc) { if ((file = fopen(argv[curarg], "r")) != NULL) { fclose(file); sprintf(cmd, "ai-add \"%s\"", argv[curarg]); eci_command(cmd); eci_command("cs-connect"); if (strlen(eci_last_error()) == 0) { sprintf(cmd, "ai-select \"%s\"", argv[curarg]); eci_command(cmd); eci_command("ai-get-length"); curfilelength = eci_last_float(); if (opts.format) { eci_command("ai-get-format"); strcpy(fstring, eci_last_string()); } /* We wanted to print the length in samples so we've done nothing * all along; let's act now. */ if (opts.script && opts.samples) { long samplecount; eci_command("ai-get-length-samples"); samplecount = eci_last_long_integer(); printf("%li", samplecount); } /* Here cometh the cleansing. */ eci_command("cs-disconnect"); eci_command("ai-remove"); /* Need we humanize ourselves? */ if (!(opts.script) || ((opts.script && opts.human))) { make_human((int)(curfilelength+0.5), &min, &sec); } if (!(opts.script)) { printf("%s: ", argv[curarg]); } if (!(opts.script) || ((opts.script) && (!(opts.format) && !(opts.human) && !(opts.samples)))) { printf("%.3f", curfilelength); } if (!(opts.script)) { printf("s \t("); } if (!(opts.script) || ((opts.script) && (opts.human))) { printf("%im%is", min, sec); } if (!(opts.script)) { printf(")"); } if ((opts.format) && !((opts.format) && ((opts.bits) || (opts.ccount) || (opts.rate)))) { if (!(opts.script)) { printf(" \t"); } printf("%s", fstring); } if ((opts.format) && (opts.script) && (opts.bits)) { printf("%s", strtok(fstring+1, "_")); } if ((opts.script) && (opts.format) && (opts.ccount)) { strtok(fstring, ","); printf("%s", strtok(NULL, ",")); } if ((opts.format) && (opts.script) && (opts.rate)) { strtok(fstring, ","); strtok(NULL, ","); printf("%s", strtok(NULL, ",")); } printf("\n"); if ((opts.total) && !(opts.script)) { totlength += curfilelength; } } else { if (opts.script) { printf("-2\n"); } else { printf("%s: Read error.\n", argv[curarg]); } status = -2; eci_command("ai-remove"); } } else { if (opts.script) { printf("-1\n"); } else { printf("%s: fopen error.\n", argv[curarg]); } status = -1; } curarg++; } if ((opts.total) && !(opts.script)) { /* This could be made a script option as well, does anyone care? */ make_human((int)(totlength+0.5), &min, &sec); printf("Total: %.3fs \t\t(%im%is)\n", totlength, min, sec); } eci_command("cs-remove"); eci_cleanup(); exit(status); } void make_human(int length, unsigned int *min, unsigned char *sec) { *min = (length/60); *sec = (length % 60); } void print_help(char *name) { printf("Usage: %s [-ahtsfmbcru] FILE1 [FILE2] [FILEn]\n " "\t-h Prints this usage message. (help)\n" "\t-a[:]bits,channels,rate Changes the format assumed by default \n" "\t for headerless data. (adjust)\n" "\t-t Prints the summed length of all the files processed. (total)\n" "\t (Ignored if with -s) \n" "\t-s Enables script mode: One info type per file per line. (script)\n" "\t (Defaults to length in secs.) \n" "\t-f With -s will return the format string as info, alone it will \n" "\t add it to the main display. (format)\n" "\t -b If -s and -f are enabled with this the info printed will be \n" "\t the sample's bitwidth. (bits)\n" "\t -c If -s and -f are enabled with this the info printed will be \n" "\t the channel count. (channel count)\n" "\t -r If -s and -f are enabled with this the info printed will be \n" "\t the sampling rate. (rate)\n" "\t-m Will print human computable time as in main display but in \n" "\t batch fashion. (minutes)\n" "\t (Only with -s)\n" "\t-u This batchmode option returns the length of specified files \n" "\t in samples. (Smallest Unit)\n" "\t (This information is worthless if you don't know the sampling \n" "\t rate of the file.) (Only with -s)\n" "(Note that out of context options will be ignored.)\n\n", name); } void print_usage(char *name) { printf("Usage: %s [-ahtsfmbcru] FILE1 [FILE2] [FILEn]\n\n\t Use the -h switch for help or see the man page.\n\n", name); } ecasound-2.9.3/ecatools/ecasound.el0000644000076400007640000024303011753025057014222 00000000000000;;; ecasound.el --- Interactive and programmatic interface to Ecasound ;; Copyright (C) 2001, 2002, 2003 Mario Lang ;; Author: Mario Lang ;; Keywords: audio, ecasound, eci, comint, process, pcomplete ;; Version: 0.8.3 ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file 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 General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; This file implements several aspects of ecasound use: ;; ;; * A derived-major-mode, from comint mode for an inferior ecasound ;; process (ecasound-aim-mode). Complete with context sensitive ;; completion and interactive features to control the current process ;; using ECI. ;; ;; * Ecasound Control Interface (ECI) library for programmatic control ;; of a Ecasound process. This allows you to write Ecasound batch ;; jobs in Emacs-Lisp with Lisp functions and return values. Have a ;; look at eci-example and ecasound-normalize. ;; ;; * ecasound-ewf-mode, a mode for editing .ewf files. ;; ;; ;; Usage: ;; ;; You need at least ecasound 2.2.0 for this file to work properly. ;; ;; Put ecasound.el in your load-path and require it in your .emacs. ;; Set `ecasound-program' to the path to your ecasound executable. ;; ;; (setq load-path (cons "/home/user/elisp") ;; (require 'ecasound) ;; (setq ecasound-program "/home/user/bin/ecasound" ;; eci-program "/home/user/bin/ecasound") ;; ;; To set ecasound startup options use ;; ;; M-x ecasound-customize-startup RET ;; ;; Then use M-x ecasound RET to invoke an inferior ecasound process. ;; ;; For programmatic use of the ECI API, have a look at `eci-init', ;; `eci-command' and in general the eci-* namespace. ;; ;; Compatibility: ;; ;; This file is only tested with GNU Emacs 21. I've invested some minimal ;; efforts to get it working with XEmacs. However, XEmacs support ;; might be broken in some areas. Since I personally very seldomly ;; use XEmacs, I am happy about suggestions and patches. ;; ;; Todo: ;; ;; * Find a better way to do status info fetching... ;; * Add more conditions to the menu. ;; * Use map-xxx-list data in the ecasound-copp widget. This means we ;; need to merge cop-status and map-cop-list data somehow or have ;; the cop-editor fetch hints from map-cop/ladpsa/preset-list. ;; * Make `ecasound-signalview' faster, and allow to invoke it on already ;; opened sessions. ;; * Fix the case where ecasound sends output *after* the prompt. ;; This is tricky! Fixed for internal parsing, probably will leave ;; like that for interactive use, not worth the trouble... ;; * Copy documentation for ECI commands into eci-* docstrings and menu ;; :help keywords. ;; * Expand the menu. ;;; History: ;; ;; Version: 0.8.3 ;; ;; * ecasound-cli-arg:value-to-internal: Use `widget-get' instead of ;; (car (last elt)) to extract :value from :args which makes code compatible ;; to XEmacs. ;; * ecasound-cli-arg:value-to-external: Use `widget-get' instead of ;; `widget-apply' to fetch :arg-format. Makes XEmacs happy. ;; * Add "-D" to the default `ecasound-arguments'. This fixes a problem ;; with the TERM variable which only appeared in XEmacs and is a reasonable ;; default anyway. ;; * Fix `ecasound-output-filter' when "-D" is used as argument on startup. ;; * Add `comint-strip-ctrl-m' to `comint-output-filter-functions' when ;; we are running XEmacs. ;; * `defeci' cs-set-position. Bound to "M-c M-s s" and in ;; `ecasound-iam-cs-menu'. ;; * Add some more docstrings. ;; * New interactive functions `ecasound-set-mark' and `ecasound-goto-mark' ;; which implement the position marker system discussed on ecasound-list. ;; Bound to C-c C-SPC and C-c C-j respectively. ;; * New user variable `ecasound-daemon-host' which defaults to "localhost". ;; * Record the daemon port in a buffer local variable `ecasound-daemon-port' ;; and therefore allow temporarily binding `ecasound-arguments' to something ;; different via e.g. `let' before invoking `ecasound'. ;; * Fix regexp in `eci-input-filter' to be XEmacs compatible. ;; ;; Version: 0.8.2 ;; ;; * Added quite some missing docstrings. ;; * New variable `ecasound-last-command-alist'. Use that to do fancy stuff ;; to certain commands return values. ;; * New variable `ecasound-type-alist'. Normally you should not need to ;; change this, but it's nice to have it configurable. ;; * New function `eci-is-valid-p'. Rationale is that nil as return ;; value of a ECI command should indicate an error. So this function ;; with a -p suffix to use as a predicate. ;; * New variable `ecasound-parent' holds the parent buffer in a daemon buffer. ;; * New variables ecasound-timer-flag&interval. ;; * Renamed `eci-output-filter' to `ecasound-output-filter'. ;; * New variable ecasound-mode|header-line-format. ;; * `ecasound-cop-edit' now uses cop-set instead of ;; cop-select+copp-select+copp-set to update values. ;; * Fixed multiple-argument handling. They are separated with ',', not ;; with a space. ;; * New variable ecasound-sending-command, used to prevent the background ;; timer from coliding with other ECI requests. ;; ;; Version: 0.8.1 ;; ;; * Make ai|ao|cs-forward|rewind use ai|ao|cs-selected in the prompt ;; string of the interactive spec. ;; * New keymaps ecasound-audioin|audioout-map. ;; Now you can be very quick: ;; M-x ecasound RET M-i a