# HG changeset patch # User Chris Cannam # Date 1373631028 -3600 # Node ID 54829c1e155e878bd37e931275208685c4634091 # Parent 5e9ff92ca05e1c0d5f807a1f8f79a352e29ba5d7# Parent 06c64a1c6785c3724b7bf37c84eb8532bfff65d7 Merge from the default branch diff -r 5e9ff92ca05e -r 54829c1e155e .hgtags --- a/.hgtags Thu Jun 20 13:47:35 2013 +0100 +++ b/.hgtags Fri Jul 12 13:10:28 2013 +0100 @@ -31,3 +31,7 @@ aca6e61eaea35a9c3f865a68521820b17cce7d3d sv_v2.0 383f0b9458d2910c0ad70759e1f44da39ef1b196 sonic-annotator-0.7 dc6c0e50724cc1eea8d77177f9e9a5d3c5d4cebd 2.0.1_osx +c808c57e556048f4e9bdffa09cee691cd73b6466 sonic-annotator-1.0 +67003fb58ba4d69022a4af9339e54bb60158683a sv_v2.1 +67003fb58ba4d69022a4af9339e54bb60158683a sv_v2.1 +f85050b6f5229c083f639811aa39a87c8afa7820 sv_v2.1 diff -r 5e9ff92ca05e -r 54829c1e155e acinclude.m4 --- a/acinclude.m4 Thu Jun 20 13:47:35 2013 +0100 +++ b/acinclude.m4 Fri Jul 12 13:10:28 2013 +0100 @@ -66,7 +66,7 @@ AC_REQUIRE([AC_PROG_CXX]) if test x$QMAKE = x ; then - AC_CHECK_PROG(QMAKE, qmake-qt4, $QTDIR/bin/qmake-qt4,,$QTDIR/bin/) + AC_CHECK_PROG(QMAKE, qmake-qt5, $QTDIR/bin/qmake-qt5,,$QTDIR/bin/) fi if test x$QMAKE = x ; then AC_CHECK_PROG(QMAKE, qmake, $QTDIR/bin/qmake,,$QTDIR/bin/) @@ -75,16 +75,16 @@ AC_CHECK_PROG(QMAKE, qmake.exe, $QTDIR/bin/qmake.exe,,$QTDIR/bin/) fi if test x$QMAKE = x ; then - AC_CHECK_PROG(QMAKE, qmake-qt4, qmake-qt4,,$PATH) + AC_CHECK_PROG(QMAKE, qmake-qt5, qmake-qt5,,$PATH) fi if test x$QMAKE = x ; then AC_CHECK_PROG(QMAKE, qmake, qmake,,$PATH) fi if test x$QMAKE = x ; then AC_MSG_ERROR([ -Failed to find the required qmake-qt4 or qmake program. Please -ensure you have the necessary Qt4 development files installed, and -if necessary set QTDIR to the location of your Qt4 installation. +Failed to find the required qmake-qt5 or qmake program. Please +ensure you have the necessary Qt5 development files installed, and +if necessary set QTDIR to the location of your Qt5 installation. ]) fi @@ -98,11 +98,11 @@ # QMAKE_VERSION_OUTPUT=`$QMAKE -v` case "$QMAKE_VERSION_OUTPUT" in - *2.*4.*) ;; + *5.*) ;; *) AC_MSG_WARN([ *** The version of qmake found in "$QMAKE" looks like it might be - from the wrong version of Qt (Qt4 is required). Please check - that this is the correct version of qmake for Qt4 builds. + from the wrong version of Qt (Qt5 is required). Please check + that this is the correct version of qmake for Qt5 builds. ]) esac diff -r 5e9ff92ca05e -r 54829c1e155e base/RealTime.cpp --- a/base/RealTime.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/base/RealTime.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -341,7 +341,7 @@ out << ":"; - std::cerr << "div = " << div << ", f = "<< f << std::endl; +// std::cerr << "div = " << div << ", f = "<< f << std::endl; while (div) { int d = (f / div) % 10; @@ -351,7 +351,7 @@ std::string s = out.str(); - std::cerr << "converted " << toString() << " to " << s << std::endl; +// std::cerr << "converted " << toString() << " to " << s << std::endl; return s; } diff -r 5e9ff92ca05e -r 54829c1e155e base/Window.h --- a/base/Window.h Thu Jun 20 13:47:35 2013 +0100 +++ b/base/Window.h Fri Jul 12 13:10:28 2013 +0100 @@ -41,7 +41,11 @@ { public: /** - * Construct a windower of the given type. + * Construct a windower of the given type and size. + * + * Note that the cosine windows are periodic by design, rather + * than symmetrical. (A window of size N is equivalent to a + * symmetrical window of size N+1 with the final element missing.) */ Window(WindowType type, size_t size) : m_type(type), m_size(size) { encache(); } Window(const Window &w) : m_type(w.m_type), m_size(w.m_size) { encache(); } diff -r 5e9ff92ca05e -r 54829c1e155e config.pri.in --- a/config.pri.in Thu Jun 20 13:47:35 2013 +0100 +++ b/config.pri.in Fri Jul 12 13:10:28 2013 +0100 @@ -1,17 +1,19 @@ CONFIG += @QMAKE_CONFIG@ -DEFINES += @HAVES@ +DEFINES += @HAVES@ HAVE_DATAQUAY QMAKE_CC = @CC@ QMAKE_CXX = @CXX@ QMAKE_LINK = @CXX@ QMAKE_CFLAGS += @CFLAGS@ -QMAKE_CXXFLAGS += @CXXFLAGS@ +QMAKE_CXXFLAGS += @CXXFLAGS@ +QMAKE_LFLAGS += @LDFLAGS@ linux*:LIBS += -lasound -macx*:DEFINES += HAVE_COREAUDIO +macx*:DEFINES += HAVE_COREAUDIO MACOSX_DEPLOYMENT_TARGET=1060 + macx*:LIBS += -framework CoreAudio -framework CoreMidi -framework AudioUnit -framework AudioToolbox -framework CoreFoundation -framework CoreServices LIBS += @LIBS@ diff -r 5e9ff92ca05e -r 54829c1e155e configure --- a/configure Thu Jun 20 13:47:35 2013 +0100 +++ b/configure Fri Jul 12 13:10:28 2013 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for SVcore 1.8. +# Generated by GNU Autoconf 2.69 for SVcore 2.1. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='SVcore' PACKAGE_TARNAME='svcore' -PACKAGE_VERSION='1.8' -PACKAGE_STRING='SVcore 1.8' +PACKAGE_VERSION='2.1' +PACKAGE_STRING='SVcore 2.1' PACKAGE_BUGREPORT='cannam@all-day-breakfast.com' PACKAGE_URL='' @@ -650,8 +650,6 @@ portaudio_2_0_CFLAGS liblo_LIBS liblo_CFLAGS -dataquay_LIBS -dataquay_CFLAGS rubberband_LIBS rubberband_CFLAGS vamphostsdk_LIBS @@ -763,8 +761,6 @@ vamphostsdk_LIBS rubberband_CFLAGS rubberband_LIBS -dataquay_CFLAGS -dataquay_LIBS liblo_CFLAGS liblo_LIBS portaudio_2_0_CFLAGS @@ -1323,7 +1319,7 @@ # 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 SVcore 1.8 to adapt to many kinds of systems. +\`configure' configures SVcore 2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1384,7 +1380,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of SVcore 1.8:";; + short | recursive ) echo "Configuration of SVcore 2.1:";; esac cat <<\_ACEOF @@ -1436,10 +1432,6 @@ C compiler flags for rubberband, overriding pkg-config rubberband_LIBS linker flags for rubberband, overriding pkg-config - dataquay_CFLAGS - C compiler flags for dataquay, overriding pkg-config - dataquay_LIBS - linker flags for dataquay, overriding pkg-config liblo_CFLAGS C compiler flags for liblo, overriding pkg-config liblo_LIBS linker flags for liblo, overriding pkg-config @@ -1533,7 +1525,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -SVcore configure 1.8 +SVcore configure 2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1873,7 +1865,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by SVcore $as_me 1.8, which was +It was created by SVcore $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3965,8 +3957,8 @@ if test x$QMAKE = x ; then - # Extract the first word of "qmake-qt4", so it can be a program name with args. -set dummy qmake-qt4; ac_word=$2 + # Extract the first word of "qmake-qt5", so it can be a program name with args. +set dummy qmake-qt5; 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_QMAKE+:} false; then : @@ -3982,7 +3974,7 @@ 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_QMAKE="$QTDIR/bin/qmake-qt4" + ac_cv_prog_QMAKE="$QTDIR/bin/qmake-qt5" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4082,8 +4074,8 @@ fi if test x$QMAKE = x ; then - # Extract the first word of "qmake-qt4", so it can be a program name with args. -set dummy qmake-qt4; ac_word=$2 + # Extract the first word of "qmake-qt5", so it can be a program name with args. +set dummy qmake-qt5; 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_QMAKE+:} false; then : @@ -4099,7 +4091,7 @@ 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_QMAKE="qmake-qt4" + ac_cv_prog_QMAKE="qmake-qt5" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4161,9 +4153,9 @@ fi if test x$QMAKE = x ; then as_fn_error $? " -Failed to find the required qmake-qt4 or qmake program. Please -ensure you have the necessary Qt4 development files installed, and -if necessary set QTDIR to the location of your Qt4 installation. +Failed to find the required qmake-qt5 or qmake program. Please +ensure you have the necessary Qt5 development files installed, and +if necessary set QTDIR to the location of your Qt5 installation. " "$LINENO" 5 fi @@ -4177,16 +4169,16 @@ # QMAKE_VERSION_OUTPUT=`$QMAKE -v` case "$QMAKE_VERSION_OUTPUT" in - *2.*4.*) ;; + *5.*) ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** The version of qmake found in \"$QMAKE\" looks like it might be - from the wrong version of Qt (Qt4 is required). Please check - that this is the correct version of qmake for Qt4 builds. + from the wrong version of Qt (Qt5 is required). Please check + that this is the correct version of qmake for Qt5 builds. " >&5 $as_echo "$as_me: WARNING: *** The version of qmake found in \"$QMAKE\" looks like it might be - from the wrong version of Qt (Qt4 is required). Please check - that this is the correct version of qmake for Qt4 builds. + from the wrong version of Qt (Qt5 is required). Please check + that this is the correct version of qmake for Qt5 builds. " >&2;} esac @@ -5166,10 +5158,10 @@ SV_MODULE_MODULE=vamphostsdk -SV_MODULE_VERSION_TEST="vamp-hostsdk >= 2.3.1" +SV_MODULE_VERSION_TEST="vamp-hostsdk >= 2.5" SV_MODULE_HEADER=vamp-hostsdk/PluginLoader.h SV_MODULE_LIB=vamp-hostsdk -SV_MODULE_FUNC=libvamphostsdk_v_2_3_1_present +SV_MODULE_FUNC=libvamphostsdk_v_2_5_present SV_MODULE_HAVE=HAVE_$(echo vamphostsdk | tr 'a-z' 'A-Z') SV_MODULE_FAILED=1 if test -n "$vamphostsdk_LIBS" ; then @@ -5467,157 +5459,6 @@ fi -SV_MODULE_MODULE=dataquay -SV_MODULE_VERSION_TEST="dataquay >= 0.9" -SV_MODULE_HEADER=dataquay/Uri.h -SV_MODULE_LIB=dataquay -SV_MODULE_FUNC=dataquay_v_0_9_present -SV_MODULE_HAVE=HAVE_$(echo dataquay | tr 'a-z' 'A-Z') -SV_MODULE_FAILED=1 -if test -n "$dataquay_LIBS" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: User set ${SV_MODULE_MODULE}_LIBS explicitly, skipping test for $SV_MODULE_MODULE" >&5 -$as_echo "$as_me: User set ${SV_MODULE_MODULE}_LIBS explicitly, skipping test for $SV_MODULE_MODULE" >&6;} - CXXFLAGS="$CXXFLAGS $dataquay_CFLAGS" - LIBS="$LIBS $dataquay_LIBS" - SV_MODULE_FAILED="" -fi -if test -z "$SV_MODULE_VERSION_TEST" ; then - SV_MODULE_VERSION_TEST=$SV_MODULE_MODULE -fi -if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dataquay" >&5 -$as_echo_n "checking for dataquay... " >&6; } - -if test -n "$dataquay_CFLAGS"; then - pkg_cv_dataquay_CFLAGS="$dataquay_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$SV_MODULE_VERSION_TEST\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$SV_MODULE_VERSION_TEST") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_dataquay_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$dataquay_LIBS"; then - pkg_cv_dataquay_LIBS="$dataquay_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$SV_MODULE_VERSION_TEST\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$SV_MODULE_VERSION_TEST") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_dataquay_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 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 - dataquay_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` - else - dataquay_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$dataquay_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find required module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 -$as_echo "$as_me: Failed to find required module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&6;} -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find required module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 -$as_echo "$as_me: Failed to find required module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&6;} -else - dataquay_CFLAGS=$pkg_cv_dataquay_CFLAGS - dataquay_LIBS=$pkg_cv_dataquay_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $dataquay_CFLAGS";LIBS="$LIBS $dataquay_LIBS";SV_MODULE_FAILED="" -fi -fi -if test -n "$SV_MODULE_FAILED"; then - as_ac_Header=`$as_echo "ac_cv_header_$SV_MODULE_HEADER" | $as_tr_sh` -ac_fn_cxx_check_header_mongrel "$LINENO" "$SV_MODULE_HEADER" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - HAVES="$HAVES $SV_MODULE_HAVE" -else - as_fn_error $? "Failed to find header $SV_MODULE_HEADER for required module $SV_MODULE_MODULE" "$LINENO" 5 -fi - - - if test -n "$SV_MODULE_LIB"; then - as_ac_Lib=`$as_echo "ac_cv_lib_$SV_MODULE_LIB''_$SV_MODULE_FUNC" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SV_MODULE_FUNC in -l$SV_MODULE_LIB" >&5 -$as_echo_n "checking for $SV_MODULE_FUNC in -l$SV_MODULE_LIB... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$SV_MODULE_LIB $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 $SV_MODULE_FUNC (); -int -main () -{ -return $SV_MODULE_FUNC (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LIBS="$LIBS -l$SV_MODULE_LIB" -else - as_fn_error $? "Failed to find library $SV_MODULE_LIB for required module $SV_MODULE_MODULE" "$LINENO" 5 -fi - - fi -fi - - SV_MODULE_MODULE=liblo SV_MODULE_VERSION_TEST="" @@ -7576,7 +7417,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by SVcore $as_me 1.8, which was +This file was extended by SVcore $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7629,7 +7470,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -SVcore config.status 1.8 +SVcore config.status 2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -8203,7 +8044,7 @@ fi -if ! $QMAKE -r; then +if ! $QMAKE -r svcore.pro; then as_fn_error $? "qmake failed: Command was \"$QMAKE -r\"" "$LINENO" 5 fi @@ -8215,7 +8056,7 @@ The file config.pri contains the configuration settings for qmake. If you want to adjust these by hand, edit config.pri -and run \"qmake -r\" again to regenerate the Makefile. +and run \"$QMAKE -r\" again to regenerate the Makefile. " >&5 $as_echo "$as_me: @@ -8225,5 +8066,5 @@ The file config.pri contains the configuration settings for qmake. If you want to adjust these by hand, edit config.pri -and run \"qmake -r\" again to regenerate the Makefile. +and run \"$QMAKE -r\" again to regenerate the Makefile. " >&6;} diff -r 5e9ff92ca05e -r 54829c1e155e configure.ac --- a/configure.ac Thu Jun 20 13:47:35 2013 +0100 +++ b/configure.ac Fri Jul 12 13:10:28 2013 +0100 @@ -1,5 +1,5 @@ -AC_INIT(SVcore, 1.8, cannam@all-day-breakfast.com) +AC_INIT([SVcore], [2.1], cannam@all-day-breakfast.com) AC_CONFIG_SRCDIR(base/Pitch.h) @@ -80,9 +80,8 @@ SV_MODULE_REQUIRED([sndfile],[sndfile >= 1.0.16],[sndfile.h],[sndfile],[sf_open]) SV_MODULE_REQUIRED([samplerate],[samplerate >= 0.1.2],[samplerate.h],[samplerate],[src_new]) SV_MODULE_REQUIRED([vamp],[vamp >= 2.1],[vamp/vamp.h],[],[]) -SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.3.1],[vamp-hostsdk/PluginLoader.h],[vamp-hostsdk],[libvamphostsdk_v_2_3_1_present]) +SV_MODULE_REQUIRED([vamphostsdk],[vamp-hostsdk >= 2.5],[vamp-hostsdk/PluginLoader.h],[vamp-hostsdk],[libvamphostsdk_v_2_5_present]) SV_MODULE_REQUIRED([rubberband],[rubberband],[rubberband/RubberBandStretcher.h],[rubberband],[rubberband_new]) -SV_MODULE_REQUIRED([dataquay],[dataquay >= 0.9],[dataquay/Uri.h],[dataquay],[dataquay_v_0_9_present]) SV_MODULE_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new]) SV_MODULE_OPTIONAL([portaudio_2_0],[portaudio-2.0 >= 19],[portaudio.h],[portaudio],[Pa_IsFormatSupported]) @@ -115,7 +114,7 @@ AC_OUTPUT -if ! $QMAKE -r; then +if ! $QMAKE -r svcore.pro; then AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"]) fi @@ -127,5 +126,5 @@ The file config.pri contains the configuration settings for qmake. If you want to adjust these by hand, edit config.pri -and run "qmake -r" again to regenerate the Makefile. +and run "$QMAKE -r" again to regenerate the Makefile. ]) diff -r 5e9ff92ca05e -r 54829c1e155e data/fileio/CoreAudioFileReader.cpp --- a/data/fileio/CoreAudioFileReader.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/data/fileio/CoreAudioFileReader.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -33,13 +33,14 @@ class CoreAudioFileReader::D { public: - D() : blockSize(1024) { } + D() : blockSize(1024), valid(false) { } ExtAudioFileRef file; AudioBufferList buffer; OSStatus err; AudioStreamBasicDescription asbd; int blockSize; + bool valid; }; static QString @@ -52,7 +53,7 @@ text[2] = (uerr >> 8) & 0xff; text[3] = (uerr) & 0xff; text[4] = '\0'; - return QString("%1 (%2)").arg(err).arg(QString::fromAscii(text)); + return QString("%1 (%2)").arg(err).arg(QString::fromLocal8Bit(text)); } CoreAudioFileReader::CoreAudioFileReader(FileSource source, @@ -116,6 +117,7 @@ if (m_d->err) { m_error = "CoreAudioReadStream: Error in getting basic description: code " + codestr(m_d->err); + ExtAudioFileDispose(m_d->file); return; } @@ -140,6 +142,7 @@ if (m_d->err) { m_error = "CoreAudioReadStream: Error in setting client format: code " + codestr(m_d->err); + ExtAudioFileDispose(m_d->file); return; } @@ -148,6 +151,8 @@ m_d->buffer.mBuffers[0].mDataByteSize = sizeof(float) * m_channelCount * m_d->blockSize; m_d->buffer.mBuffers[0].mData = new float[m_channelCount * m_d->blockSize]; + m_d->valid = true; + initialiseDecodeCache(); if (m_reporter) { @@ -181,15 +186,18 @@ endSerialised(); m_completion = 100; - - ExtAudioFileDispose(m_d->file); } CoreAudioFileReader::~CoreAudioFileReader() { std::cerr << "CoreAudioFileReader::~CoreAudioFileReader" << std::endl; - delete[] m_d->buffer.mBuffers[0].mData; + + if (m_d->valid) { + ExtAudioFileDispose(m_d->file); + delete[] m_d->buffer.mBuffers[0].mData; + } + delete m_d; } diff -r 5e9ff92ca05e -r 54829c1e155e data/fileio/FileSource.cpp --- a/data/fileio/FileSource.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/data/fileio/FileSource.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -20,12 +20,11 @@ #include "base/ProgressReporter.h" #include "system/System.h" -#include -#include +#include +#include #include #include #include -#include #include #include @@ -68,12 +67,13 @@ } #endif +static QNetworkAccessManager nm; + FileSource::FileSource(QString fileOrUrl, ProgressReporter *reporter, QString preferredContentType) : m_url(fileOrUrl, QUrl::StrictMode), - m_ftp(0), - m_http(0), m_localFile(0), + m_reply(0), m_preferredContentType(preferredContentType), m_ok(false), m_lastStatus(0), @@ -98,7 +98,7 @@ #endif if (!canHandleScheme(m_url)) { - SVDEBUG << "FileSource::FileSource: ERROR: Unsupported scheme in URL \"" << m_url.toString() << "\"" << endl; + std::cerr << "FileSource::FileSource: ERROR: Unsupported scheme in URL \"" << m_url.toString() << "\"" << std::endl; m_errorString = tr("Unsupported scheme in URL"); return; } @@ -110,7 +110,7 @@ #ifdef DEBUG_FILE_SOURCE std::cerr << "FileSource::FileSource: Failed to open local file with URL \"" << m_url.toString() << "\"; trying again assuming filename was encoded" << std::endl; #endif - m_url = QUrl::fromEncoded(fileOrUrl.toAscii()); + m_url = QUrl::fromEncoded(fileOrUrl.toLatin1()); init(); } @@ -138,7 +138,7 @@ // already done all the work and no request will be sent deleteCacheFile(); - m_url.setEncodedUrl(fileOrUrl.toAscii()); + m_url = QUrl::fromEncoded(fileOrUrl.toLatin1()); m_ok = false; m_done = false; @@ -153,15 +153,14 @@ } #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(string) exiting" << endl; + std::cerr << "FileSource::FileSource(string) exiting" << std::endl; #endif } FileSource::FileSource(QUrl url, ProgressReporter *reporter) : m_url(url), - m_ftp(0), - m_http(0), m_localFile(0), + m_reply(0), m_ok(false), m_lastStatus(0), m_resource(false), @@ -172,12 +171,12 @@ m_refCounted(false) { #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(" << url.toString() << ") [as url]" << endl; + std::cerr << "FileSource::FileSource(" << url.toString() << ") [as url]" << std::endl; incCount(m_url.toString()); #endif if (!canHandleScheme(m_url)) { - SVDEBUG << "FileSource::FileSource: ERROR: Unsupported scheme in URL \"" << m_url.toString() << "\"" << endl; + std::cerr << "FileSource::FileSource: ERROR: Unsupported scheme in URL \"" << m_url.toString() << "\"" << std::endl; m_errorString = tr("Unsupported scheme in URL"); return; } @@ -185,16 +184,15 @@ init(); #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(url) exiting" << endl; + std::cerr << "FileSource::FileSource(url) exiting" << std::endl; #endif } FileSource::FileSource(const FileSource &rf) : QObject(), m_url(rf.m_url), - m_ftp(0), - m_http(0), m_localFile(0), + m_reply(0), m_ok(rf.m_ok), m_lastStatus(rf.m_lastStatus), m_resource(rf.m_resource), @@ -205,12 +203,12 @@ m_refCounted(false) { #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(" << m_url.toString() << ") [copy ctor]" << endl; + std::cerr << "FileSource::FileSource(" << m_url.toString() << ") [copy ctor]" << std::endl; incCount(m_url.toString()); #endif if (!canHandleScheme(m_url)) { - SVDEBUG << "FileSource::FileSource: ERROR: Unsupported scheme in URL \"" << m_url.toString() << "\"" << endl; + std::cerr << "FileSource::FileSource: ERROR: Unsupported scheme in URL \"" << m_url.toString() << "\"" << std::endl; m_errorString = tr("Unsupported scheme in URL"); return; } @@ -220,8 +218,8 @@ } else { QMutexLocker locker(&m_mapMutex); #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(copy ctor): ref count is " - << m_refCountMap[m_url] << endl; + std::cerr << "FileSource::FileSource(copy ctor): ref count is " + << m_refCountMap[m_url] << std::endl; #endif if (m_refCountMap[m_url] > 0) { m_refCountMap[m_url]++; @@ -239,11 +237,11 @@ m_done = true; #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(" << m_url.toString() << ") [copy ctor]: note: local filename is \"" << m_localFilename << "\"" << endl; + std::cerr << "FileSource::FileSource(" << m_url.toString() << ") [copy ctor]: note: local filename is \"" << m_localFilename << "\"" << std::endl; #endif #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::FileSource(copy ctor) exiting" << endl; + std::cerr << "FileSource::FileSource(copy ctor) exiting" << std::endl; #endif } @@ -380,13 +378,11 @@ << m_url.toString() << "\", retrieving" << std::endl; #endif - if (scheme == "http") { - initHttp(); + if (scheme == "http" || scheme == "https" || scheme == "ftp") { + initRemote(); #ifdef DEBUG_FILE_SOURCE - std::cerr << "FileSource: initHttp succeeded" << std::endl; + std::cerr << "FileSource: initRemote returned" << std::endl; #endif - } else if (scheme == "ftp") { - initFtp(); } else { m_remote = false; m_ok = false; @@ -430,110 +426,35 @@ } void -FileSource::initHttp() +FileSource::initRemote() { m_ok = true; - int port = m_url.port(); - m_http = new QHttp(m_url.host(), port < 0 ? 80 : port); - connect(m_http, SIGNAL(done(bool)), this, SLOT(done(bool))); - connect(m_http, SIGNAL(dataReadProgress(int, int)), - this, SLOT(dataReadProgress(int, int))); - connect(m_http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), - this, SLOT(httpResponseHeaderReceived(const QHttpResponseHeader &))); - // I don't quite understand this. url.path() returns a path - // without percent encoding; for example, spaces appear as - // literal spaces. This generally won't work if sent to the - // server directly. You can retrieve a correctly encoded URL - // from QUrl using url.toEncoded(), but that gives you the - // whole URL; there doesn't seem to be any way to retrieve - // only an encoded path. Furthermore there doesn't seem to be - // any way to convert a retrieved path into an encoded path - // without explicitly specifying that you don't want the path - // separators ("/") to be encoded. (Besides being painful to - // manage, I don't see how this can work correctly in any case - // where a percent-encoded "/" is supposed to appear within a - // path element?) There also seems to be no way to retrieve - // the path plus query string, i.e. everything that I need to - // send to the HTTP server. And no way for QHttp to take a - // QUrl argument. I'm obviously missing something. - - // So, two ways to do this: query the bits from the URL, - // encode them individually, and glue them back together - // again... -/* - QString path = QUrl::toPercentEncoding(m_url.path(), "/"); - QList > query = m_url.queryItems(); - if (!query.empty()) { - QStringList q2; - for (QList >::iterator i = query.begin(); - i != query.end(); ++i) { - q2.push_back(QString("%1=%3") - .arg(QString(QUrl::toPercentEncoding(i->first))) - .arg(QString(QUrl::toPercentEncoding(i->second)))); - } - path = QString("%1%2%3") - .arg(path).arg("?") - .arg(q2.join("&")); - } -*/ - - // ...or, much simpler but relying on knowledge about the - // scheme://host/path/path/query etc format of the URL, we can - // get the whole URL ready-encoded and then split it on "/" as - // appropriate... - - QString path = "/" + QString(m_url.toEncoded()).section('/', 3); - -#ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource: path is \"" - << path << "\"" << endl; -#endif - - if (m_preferredContentType == "") { - m_http->get(path, m_localFile); - } else { + QNetworkRequest req; + req.setUrl(m_url); + + if (m_preferredContentType != "") { #ifdef DEBUG_FILE_SOURCE std::cerr << "FileSource: indicating preferred content type of \"" << m_preferredContentType << "\"" << std::endl; #endif - QHttpRequestHeader header("GET", path); - header.setValue("Host", m_url.host()); - header.setValue("Accept", QString("%1, */*").arg(m_preferredContentType)); - m_http->request(header, 0, m_localFile); + req.setRawHeader + ("Accept", + QString("%1, */*").arg(m_preferredContentType).toLatin1()); } -} -void -FileSource::initFtp() -{ - m_ok = true; - m_ftp = new QFtp; - connect(m_ftp, SIGNAL(done(bool)), this, SLOT(done(bool))); - connect(m_ftp, SIGNAL(commandFinished(int, bool)), - this, SLOT(ftpCommandFinished(int, bool))); - connect(m_ftp, SIGNAL(dataTransferProgress(qint64, qint64)), - this, SLOT(dataTransferProgress(qint64, qint64))); - m_ftp->connectToHost(m_url.host(), m_url.port(21)); - - QString username = m_url.userName(); - if (username == "") { - username = "anonymous"; - } - - QString password = m_url.password(); - if (password == "") { - password = QString("%1@%2").arg(getenv("USER")).arg(getenv("HOST")); - } - - m_ftp->login(username, password); - - QString dirpath = m_url.path().section('/', 0, -2); - QString filename = m_url.path().section('/', -1); - - if (dirpath == "") dirpath = "/"; - m_ftp->cd(dirpath); - m_ftp->get(filename, m_localFile); + m_reply = nm.get(req); + + connect(m_reply, SIGNAL(readyRead()), + this, SLOT(readyRead())); + connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), + this, SLOT(replyFailed(QNetworkReply::NetworkError))); + connect(m_reply, SIGNAL(finished()), + this, SLOT(replyFinished())); + connect(m_reply, SIGNAL(metaDataChanged()), + this, SLOT(metaDataChanged())); + connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), + this, SLOT(downloadProgress(qint64, qint64))); } void @@ -544,17 +465,11 @@ m_localFile = 0; } m_done = true; - if (m_http) { - QHttp *h = m_http; - m_http = 0; - h->abort(); - h->deleteLater(); - } - if (m_ftp) { - QFtp *f = m_ftp; - m_ftp = 0; - f->abort(); - f->deleteLater(); + if (m_reply) { + QNetworkReply *r = m_reply; + m_reply = 0; + r->abort(); + r->deleteLater(); } if (m_localFile) { delete m_localFile; // does not actually delete the file @@ -576,8 +491,8 @@ { // Note that a "scheme" with length 1 is probably a DOS drive letter QString scheme = url.scheme().toLower(); - return (scheme == "http" || scheme == "ftp" || - scheme == "file" || scheme == "qrc" || + return (scheme == "http" || scheme == "https" || + scheme == "ftp" || scheme == "file" || scheme == "qrc" || scheme == "" || scheme.length() == 1); } @@ -589,8 +504,8 @@ if (!m_ok) available = false; else available = (m_lastStatus / 100 == 2); #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::isAvailable: " << (available ? "yes" : "no") - << endl; + std::cerr << "FileSource::isAvailable: " << (available ? "yes" : "no") + << std::endl; #endif return available; } @@ -608,7 +523,7 @@ FileSource::waitForData() { while (m_ok && !m_done) { -// SVDEBUG << "FileSource::waitForData: calling QApplication::processEvents" << endl; +// std::cerr << "FileSource::waitForData: calling QApplication::processEvents" << std::endl; QCoreApplication::processEvents(); usleep(10000); } @@ -685,23 +600,32 @@ } void -FileSource::dataReadProgress(int done, int total) +FileSource::readyRead() { - dataTransferProgress(done, total); + m_localFile->write(m_reply->readAll()); } void -FileSource::httpResponseHeaderReceived(const QHttpResponseHeader &resp) +FileSource::metaDataChanged() { #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::httpResponseHeaderReceived" << endl; + std::cerr << "FileSource::metaDataChanged" << std::endl; #endif - if (resp.statusCode() / 100 == 3) { - QString location = resp.value("Location"); + if (!m_reply) { + std::cerr << "WARNING: FileSource::metaDataChanged() called without a reply object being known to us" << std::endl; + return; + } + + int status = + m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + + if (status / 100 == 3) { + QString location = m_reply->header + (QNetworkRequest::LocationHeader).toString(); #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::responseHeaderReceived: redirect to \"" - << location << "\" received" << endl; + std::cerr << "FileSource::metaDataChanged: redirect to \"" + << location << "\" received" << std::endl; #endif if (location != "") { QUrl newUrl(location); @@ -723,58 +647,29 @@ } } - m_lastStatus = resp.statusCode(); + m_lastStatus = status; if (m_lastStatus / 100 >= 4) { m_errorString = QString("%1 %2") - .arg(resp.statusCode()).arg(resp.reasonPhrase()); + .arg(status) + .arg(m_reply->attribute + (QNetworkRequest::HttpReasonPhraseAttribute).toString()); #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::responseHeaderReceived: " - << m_errorString << endl; + std::cerr << "FileSource::metaDataChanged: " + << m_errorString << std::endl; #endif } else { #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::responseHeaderReceived: " - << m_lastStatus << endl; + std::cerr << "FileSource::metaDataChanged: " + << m_lastStatus << std::endl; #endif - if (resp.hasContentType()) m_contentType = resp.contentType(); + m_contentType = + m_reply->header(QNetworkRequest::ContentTypeHeader).toString(); } emit statusAvailable(); } void -FileSource::ftpCommandFinished(int id, bool error) -{ -#ifdef DEBUG_FILE_SOURCE - std::cerr << "FileSource::ftpCommandFinished(" << id << ", " << error << ")" << std::endl; -#endif - - if (!m_ftp) return; - - QFtp::Command command = m_ftp->currentCommand(); - - if (!error) { -#ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::ftpCommandFinished: success for command " - << command << endl; -#endif - return; - } - - if (command == QFtp::ConnectToHost) { - m_errorString = tr("Failed to connect to FTP server"); - } else if (command == QFtp::Login) { - m_errorString = tr("Login failed"); - } else if (command == QFtp::Cd) { - m_errorString = tr("Failed to change to correct directory"); - } else if (command == QFtp::Get) { - m_errorString = tr("FTP download aborted"); - } - - m_lastStatus = 400; // for done() -} - -void -FileSource::dataTransferProgress(qint64 done, qint64 total) +FileSource::downloadProgress(qint64 done, qint64 total) { int percent = int((double(done) / double(total)) * 100.0 - 0.1); emit progress(percent); @@ -791,27 +686,17 @@ } void -FileSource::done(bool error) +FileSource::replyFinished() { emit progress(100); #ifdef DEBUG_FILE_SOURCE - std::cerr << "FileSource::done(" << error << ")" << std::endl; + std::cerr << "FileSource::replyFinished()" << std::endl; #endif if (m_done) return; - if (error) { - if (m_http) { - m_errorString = m_http->errorString(); - } else if (m_ftp) { - m_errorString = m_ftp->errorString(); - } - } - - if (m_lastStatus / 100 >= 4) { - error = true; - } + bool error = (m_lastStatus / 100 >= 4); cleanup(); @@ -840,10 +725,21 @@ } void +FileSource::replyFailed(QNetworkReply::NetworkError) +{ + emit progress(100); + m_errorString = m_reply->errorString(); + m_ok = false; + m_done = true; + cleanup(); + emit ready(); +} + +void FileSource::deleteCacheFile() { #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::deleteCacheFile(\"" << m_localFilename << "\")" << endl; + std::cerr << "FileSource::deleteCacheFile(\"" << m_localFilename << "\")" << std::endl; #endif cleanup(); @@ -884,7 +780,7 @@ #endif } else { #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::deleteCacheFile: Deleted cache file \"" << m_localFilename << "\"" << endl; + std::cerr << "FileSource::deleteCacheFile: Deleted cache file \"" << m_localFilename << "\"" << std::endl; #endif m_localFilename = ""; } @@ -901,7 +797,7 @@ QMutexLocker locker(&m_mapMutex); #ifdef DEBUG_FILE_SOURCE - SVDEBUG << "FileSource::createCacheFile: refcount is " << m_refCountMap[m_url] << endl; + std::cerr << "FileSource::createCacheFile: refcount is " << m_refCountMap[m_url] << std::endl; #endif if (m_refCountMap[m_url] > 0) { diff -r 5e9ff92ca05e -r 54829c1e155e data/fileio/FileSource.h --- a/data/fileio/FileSource.h Thu Jun 20 13:47:35 2013 +0100 +++ b/data/fileio/FileSource.h Fri Jul 12 13:10:28 2013 +0100 @@ -20,15 +20,13 @@ #include #include #include +#include #include #include "base/Debug.h" -class QFtp; -class QHttp; class QFile; -class QHttpResponseHeader; class ProgressReporter; /** @@ -210,20 +208,19 @@ void ready(); protected slots: - void dataReadProgress(int done, int total); - void httpResponseHeaderReceived(const QHttpResponseHeader &resp); - void ftpCommandFinished(int, bool); - void dataTransferProgress(qint64 done, qint64 total); - void done(bool error); + void metaDataChanged(); + void readyRead(); + void replyFailed(QNetworkReply::NetworkError); + void replyFinished(); + void downloadProgress(qint64 done, qint64 total); void cancelled(); protected: FileSource &operator=(const FileSource &); // not provided QUrl m_url; - QFtp *m_ftp; - QHttp *m_http; QFile *m_localFile; + QNetworkReply *m_reply; QString m_localFilename; QString m_errorString; QString m_contentType; @@ -244,8 +241,7 @@ bool m_refCounted; void init(); - void initHttp(); - void initFtp(); + void initRemote(); void cleanup(); diff -r 5e9ff92ca05e -r 54829c1e155e data/fileio/WavFileReader.cpp --- a/data/fileio/WavFileReader.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/data/fileio/WavFileReader.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -185,7 +185,14 @@ for (int i = 0; i < count; ++i) { info.format = i; if (!sf_command(0, SFC_GET_FORMAT_MAJOR, &info, sizeof(info))) { - extensions.insert(QString(info.extension).toLower()); + QString ext = QString(info.extension).toLower(); + extensions.insert(ext); + if (ext == "oga") { + // libsndfile is awfully proper, it says it only + // supports .oga but lots of Ogg audio files in the + // wild are .ogg and it will accept that + extensions.insert("ogg"); + } } } } diff -r 5e9ff92ca05e -r 54829c1e155e data/fileio/test/AudioFileReaderTest.h --- a/data/fileio/test/AudioFileReaderTest.h Thu Jun 20 13:47:35 2013 +0100 +++ b/data/fileio/test/AudioFileReaderTest.h Fri Jul 12 13:10:28 2013 +0100 @@ -78,7 +78,11 @@ if (bits.length() > 2) nominalDepth = bits[2].toInt(); if (!reader) { +#if ( QT_VERSION >= 0x050000 ) + QSKIP("Unsupported file, skipping"); +#else QSKIP("Unsupported file, skipping", SkipSingle); +#endif } QCOMPARE((int)reader->getChannelCount(), nominalChannels); diff -r 5e9ff92ca05e -r 54829c1e155e data/fileio/test/test.pro --- a/data/fileio/test/test.pro Thu Jun 20 13:47:35 2013 +0100 +++ b/data/fileio/test/test.pro Fri Jul 12 13:10:28 2013 +0100 @@ -1,9 +1,23 @@ TEMPLATE = app -LIBS += -L../../.. -lsvcore +LIBS += -L../../.. -L../../../../dataquay -L../../../release -L../../../../dataquay/release -lsvcore -ldataquay -include(../../../config.pri) +win32-g++ { + INCLUDEPATH += ../../../../sv-dependency-builds/win32-mingw/include + LIBS += -L../../../../sv-dependency-builds/win32-mingw/lib +} + +exists(../../../config.pri) { + include(../../../config.pri) +} + +win* { + !exists(../../../config.pri) { + DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_RUBBERBAND HAVE_DATAQUAY HAVE_LIBLO HAVE_MAD HAVE_ID3TAG HAVE_PORTAUDIO_2_0 + LIBS += -lbz2 -lrubberband -lvamp-hostsdk -lfftw3 -lfftw3f -lsndfile -lFLAC -logg -lvorbis -lvorbisenc -lvorbisfile -logg -lmad -lid3tag -lportaudio -lsamplerate -llo -lz -lsord-0 -lserd-0 -lwinmm -lws2_32 + } +} CONFIG += qt thread warn_on stl rtti exceptions console QT += network xml testlib @@ -21,7 +35,7 @@ SOURCES += main.cpp win* { -PRE_TARGETDEPS += ../../../svcore.lib +//PRE_TARGETDEPS += ../../../svcore.lib } !win* { PRE_TARGETDEPS += ../../../libsvcore.a diff -r 5e9ff92ca05e -r 54829c1e155e data/model/ModelDataTableModel.cpp --- a/data/model/ModelDataTableModel.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/data/model/ModelDataTableModel.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -129,7 +129,7 @@ QModelIndex ModelDataTableModel::index(int row, int column, const QModelIndex &parent) const { - return createIndex(row, column, 0); + return createIndex(row, column, (void *)0); } QModelIndex @@ -159,7 +159,7 @@ { if (!m_model) return createIndex(0, 0); int row = m_model->getRowForFrame(frame); - return createIndex(getSorted(row), 0, 0); + return createIndex(getSorted(row), 0, (void *)0); } size_t @@ -206,7 +206,7 @@ int current = getCurrentRow(); if (current != prevCurrent) { // std::cerr << "Current row changed from " << prevCurrent << " to " << current << " for underlying row " << m_currentRow << std::endl; - emit currentChanged(createIndex(current, 0, 0)); + emit currentChanged(createIndex(current, 0, (void *)0)); } emit layoutChanged(); } diff -r 5e9ff92ca05e -r 54829c1e155e data/model/RangeSummarisableTimeValueModel.h --- a/data/model/RangeSummarisableTimeValueModel.h Thu Jun 20 13:47:35 2013 +0100 +++ b/data/model/RangeSummarisableTimeValueModel.h Fri Jul 12 13:10:28 2013 +0100 @@ -21,6 +21,8 @@ #include "DenseTimeValueModel.h" #include "base/ZoomConstraint.h" +#include + /** * Base class for models containing dense two-dimensional data (value * against time) that may be meaningfully represented in a zoomed view diff -r 5e9ff92ca05e -r 54829c1e155e data/model/SparseModel.h --- a/data/model/SparseModel.h Thu Jun 20 13:47:35 2013 +0100 +++ b/data/model/SparseModel.h Fri Jul 12 13:10:28 2013 +0100 @@ -386,6 +386,7 @@ { m_rows.clear(); for (PointListConstIterator i = m_points.begin(); i != m_points.end(); ++i) { +// std::cerr << "rebuildRowVector: row " << m_rows.size() << " -> " << i->frame << std::endl; m_rows.push_back(i->frame); } } @@ -406,6 +407,7 @@ PointListIterator i = i0; for (i = i0; i != i1; ++i) { + if (i->frame < (int)frame) { continue; } if (indexAtFrame > 0) { --indexAtFrame; continue; } return i; } @@ -427,15 +429,22 @@ while (ri > 0 && m_rows[ri-1] == m_rows[row]) { --ri; ++indexAtFrame; } int initialIndexAtFrame = indexAtFrame; +// std::cerr << "getPointListIteratorForRow " << row << ": initialIndexAtFrame = " << initialIndexAtFrame << std::endl; + PointListConstIterator i0, i1; getPointIterators(frame, i0, i1); PointListConstIterator i = i0; for (i = i0; i != i1; ++i) { +// std::cerr << "i->frame is " << i->frame << ", wanting " << frame << std::endl; + + if (i->frame < (int)frame) { continue; } if (indexAtFrame > 0) { --indexAtFrame; continue; } return i; } +// std::cerr << "returning i with i->frame = " << i->frame << std::endl; + if (indexAtFrame > 0) { std::cerr << "WARNING: SparseModel::getPointListIteratorForRow: No iterator available for row " << row << " (frame = " << frame << ", index at frame = " << initialIndexAtFrame << ", leftover index " << indexAtFrame << ")" << std::endl; } @@ -579,7 +588,7 @@ long end = start + m_resolution; PointType startPoint(start), endPoint(end); - + startItr = m_points.lower_bound(startPoint); endItr = m_points.upper_bound(endPoint); } @@ -593,6 +602,7 @@ QMutexLocker locker(&m_mutex); if (m_resolution == 0) { +// std::cerr << "getPointIterators: resolution == 0, returning end()" << std::endl; startItr = m_points.end(); endItr = m_points.end(); return; @@ -603,6 +613,8 @@ PointType startPoint(start), endPoint(end); +// std::cerr << "getPointIterators: start frame " << start << ", end frame " << end << ", m_resolution " << m_resolution << std::endl; + startItr = m_points.lower_bound(startPoint); endItr = m_points.upper_bound(endPoint); } @@ -775,8 +787,8 @@ QString indent, QString extraAttributes) const { - std::cerr << "SparseModel::toXml: extraAttributes = \"" - << extraAttributes.toStdString() << std::endl; +// std::cerr << "SparseModel::toXml: extraAttributes = \"" +// << extraAttributes.toStdString() << std::endl; QString type = getXmlOutputType(); diff -r 5e9ff92ca05e -r 54829c1e155e svcore.pro --- a/svcore.pro Thu Jun 20 13:47:35 2013 +0100 +++ b/svcore.pro Fri Jul 12 13:10:28 2013 +0100 @@ -1,271 +1,290 @@ - -TEMPLATE = lib - -include(config.pri) - -CONFIG += staticlib qt thread warn_on stl rtti exceptions -QT += network xml -QT -= gui - -TARGET = svcore - -DEPENDPATH += . data plugin plugin/api/alsa -INCLUDEPATH += . data plugin plugin/api/alsa -OBJECTS_DIR = o -MOC_DIR = o - -# Doesn't work with this library, which contains C99 as well as C++ -PRECOMPILED_HEADER = - -# Set up suitable platform defines for RtMidi -linux*: DEFINES += __LINUX_ALSASEQ__ -macx*: DEFINES += __MACOSX_CORE__ -win*: DEFINES += __WINDOWS_MM__ -solaris*: DEFINES += __RTMIDI_DUMMY_ONLY__ - -HEADERS += base/AudioLevel.h \ - base/AudioPlaySource.h \ - base/Clipboard.h \ - base/Command.h \ - base/Debug.h \ - base/Exceptions.h \ - base/LogRange.h \ - base/Pitch.h \ - base/Playable.h \ - base/PlayParameterRepository.h \ - base/PlayParameters.h \ - base/Preferences.h \ - base/Profiler.h \ - base/ProgressPrinter.h \ - base/ProgressReporter.h \ - base/PropertyContainer.h \ - base/RangeMapper.h \ - base/RealTime.h \ - base/RecentFiles.h \ - base/Resampler.h \ - base/ResizeableBitset.h \ - base/ResourceFinder.h \ - base/RingBuffer.h \ - base/Scavenger.h \ - base/Selection.h \ - base/Serialiser.h \ - base/StorageAdviser.h \ - base/StringBits.h \ - base/TempDirectory.h \ - base/TempWriteFile.h \ - base/TextMatcher.h \ - base/Thread.h \ - base/UnitDatabase.h \ - base/ViewManagerBase.h \ - base/Window.h \ - base/XmlExportable.h \ - base/ZoomConstraint.h -SOURCES += base/AudioLevel.cpp \ - base/Clipboard.cpp \ - base/Command.cpp \ - base/Debug.cpp \ - base/Exceptions.cpp \ - base/LogRange.cpp \ - base/Pitch.cpp \ - base/PlayParameterRepository.cpp \ - base/PlayParameters.cpp \ - base/Preferences.cpp \ - base/Profiler.cpp \ - base/ProgressPrinter.cpp \ - base/ProgressReporter.cpp \ - base/PropertyContainer.cpp \ - base/RangeMapper.cpp \ - base/RealTime.cpp \ - base/RecentFiles.cpp \ - base/Resampler.cpp \ - base/ResourceFinder.cpp \ - base/Selection.cpp \ - base/Serialiser.cpp \ - base/StorageAdviser.cpp \ - base/StringBits.cpp \ - base/TempDirectory.cpp \ - base/TempWriteFile.cpp \ - base/TextMatcher.cpp \ - base/Thread.cpp \ - base/UnitDatabase.cpp \ - base/ViewManagerBase.cpp \ - base/XmlExportable.cpp - -HEADERS += data/fft/FFTapi.h \ - data/fft/FFTCacheReader.h \ - data/fft/FFTCacheStorageType.h \ - data/fft/FFTCacheWriter.h \ - data/fft/FFTDataServer.h \ - data/fft/FFTFileCacheReader.h \ - data/fft/FFTFileCacheWriter.h \ - data/fft/FFTMemoryCache.h \ - data/fileio/AudioFileReader.h \ - data/fileio/AudioFileReaderFactory.h \ - data/fileio/BZipFileDevice.h \ - data/fileio/CachedFile.h \ - data/fileio/CodedAudioFileReader.h \ - data/fileio/CSVFileReader.h \ - data/fileio/CSVFileWriter.h \ - data/fileio/CSVFormat.h \ - data/fileio/DataFileReader.h \ - data/fileio/DataFileReaderFactory.h \ - data/fileio/FileFinder.h \ - data/fileio/FileReadThread.h \ - data/fileio/FileSource.h \ - data/fileio/MatchFileReader.h \ - data/fileio/MatrixFile.h \ - data/fileio/MIDIFileReader.h \ - data/fileio/MIDIFileWriter.h \ - data/fileio/MP3FileReader.h \ - data/fileio/OggVorbisFileReader.h \ - data/fileio/PlaylistFileReader.h \ - data/fileio/QuickTimeFileReader.h \ - data/fileio/CoreAudioFileReader.h \ - data/fileio/ResamplingWavFileReader.h \ - data/fileio/WavFileReader.h \ - data/fileio/WavFileWriter.h \ - data/midi/MIDIEvent.h \ - data/midi/MIDIInput.h \ - data/midi/rtmidi/RtError.h \ - data/midi/rtmidi/RtMidi.h \ - data/model/AggregateWaveModel.h \ - data/model/AlignmentModel.h \ - data/model/Dense3DModelPeakCache.h \ - data/model/DenseThreeDimensionalModel.h \ - data/model/DenseTimeValueModel.h \ - data/model/EditableDenseThreeDimensionalModel.h \ - data/model/FFTModel.h \ - data/model/ImageModel.h \ - data/model/IntervalModel.h \ - data/model/Labeller.h \ - data/model/Model.h \ - data/model/ModelDataTableModel.h \ - data/model/NoteModel.h \ - data/model/FlexiNoteModel.h \ - data/model/PathModel.h \ - data/model/PowerOfSqrtTwoZoomConstraint.h \ - data/model/PowerOfTwoZoomConstraint.h \ - data/model/RangeSummarisableTimeValueModel.h \ - data/model/RegionModel.h \ - data/model/SparseModel.h \ - data/model/SparseOneDimensionalModel.h \ - data/model/SparseTimeValueModel.h \ - data/model/SparseValueModel.h \ - data/model/TabularModel.h \ - data/model/TextModel.h \ - data/model/WaveFileModel.h \ - data/model/WritableWaveFileModel.h \ - data/osc/OSCMessage.h \ - data/osc/OSCQueue.h -SOURCES += data/fft/FFTapi.cpp \ - data/fft/FFTDataServer.cpp \ - data/fft/FFTFileCacheReader.cpp \ - data/fft/FFTFileCacheWriter.cpp \ - data/fft/FFTMemoryCache.cpp \ - data/fileio/AudioFileReader.cpp \ - data/fileio/AudioFileReaderFactory.cpp \ - data/fileio/BZipFileDevice.cpp \ - data/fileio/CachedFile.cpp \ - data/fileio/CodedAudioFileReader.cpp \ - data/fileio/CSVFileReader.cpp \ - data/fileio/CSVFileWriter.cpp \ - data/fileio/CSVFormat.cpp \ - data/fileio/DataFileReaderFactory.cpp \ - data/fileio/FileReadThread.cpp \ - data/fileio/FileSource.cpp \ - data/fileio/MatchFileReader.cpp \ - data/fileio/MatrixFile.cpp \ - data/fileio/MIDIFileReader.cpp \ - data/fileio/MIDIFileWriter.cpp \ - data/fileio/MP3FileReader.cpp \ - data/fileio/OggVorbisFileReader.cpp \ - data/fileio/PlaylistFileReader.cpp \ - data/fileio/QuickTimeFileReader.cpp \ - data/fileio/CoreAudioFileReader.cpp \ - data/fileio/ResamplingWavFileReader.cpp \ - data/fileio/WavFileReader.cpp \ - data/fileio/WavFileWriter.cpp \ - data/midi/MIDIInput.cpp \ - data/midi/rtmidi/RtMidi.cpp \ - data/model/AggregateWaveModel.cpp \ - data/model/AlignmentModel.cpp \ - data/model/Dense3DModelPeakCache.cpp \ - data/model/DenseTimeValueModel.cpp \ - data/model/EditableDenseThreeDimensionalModel.cpp \ - data/model/FFTModel.cpp \ - data/model/Model.cpp \ - data/model/ModelDataTableModel.cpp \ - data/model/PowerOfSqrtTwoZoomConstraint.cpp \ - data/model/PowerOfTwoZoomConstraint.cpp \ - data/model/RangeSummarisableTimeValueModel.cpp \ - data/model/WaveFileModel.cpp \ - data/model/WritableWaveFileModel.cpp \ - data/osc/OSCMessage.cpp \ - data/osc/OSCQueue.cpp - -HEADERS += plugin/DSSIPluginFactory.h \ - plugin/DSSIPluginInstance.h \ - plugin/FeatureExtractionPluginFactory.h \ - plugin/LADSPAPluginFactory.h \ - plugin/LADSPAPluginInstance.h \ - plugin/PluginIdentifier.h \ - plugin/PluginXml.h \ - plugin/RealTimePluginFactory.h \ - plugin/RealTimePluginInstance.h \ - plugin/api/dssi.h \ - plugin/api/ladspa.h \ - plugin/plugins/SamplePlayer.h \ - plugin/api/alsa/asoundef.h \ - plugin/api/alsa/asoundlib.h \ - plugin/api/alsa/seq.h \ - plugin/api/alsa/seq_event.h \ - plugin/api/alsa/seq_midi_event.h \ - plugin/api/alsa/sound/asequencer.h -SOURCES += plugin/DSSIPluginFactory.cpp \ - plugin/DSSIPluginInstance.cpp \ - plugin/FeatureExtractionPluginFactory.cpp \ - plugin/LADSPAPluginFactory.cpp \ - plugin/LADSPAPluginInstance.cpp \ - plugin/PluginIdentifier.cpp \ - plugin/PluginXml.cpp \ - plugin/RealTimePluginFactory.cpp \ - plugin/RealTimePluginInstance.cpp \ - plugin/api/dssi_alsa_compat.c \ - plugin/plugins/SamplePlayer.cpp - -HEADERS += rdf/PluginRDFIndexer.h \ - rdf/PluginRDFDescription.h \ - rdf/RDFExporter.h \ - rdf/RDFFeatureWriter.h \ - rdf/RDFImporter.h \ - rdf/RDFTransformFactory.h -SOURCES += rdf/PluginRDFIndexer.cpp \ - rdf/PluginRDFDescription.cpp \ - rdf/RDFExporter.cpp \ - rdf/RDFFeatureWriter.cpp \ - rdf/RDFImporter.cpp \ - rdf/RDFTransformFactory.cpp - -HEADERS += system/Init.h \ - system/System.h -SOURCES += system/Init.cpp \ - system/System.cpp - -HEADERS += transform/CSVFeatureWriter.h \ - transform/FeatureExtractionModelTransformer.h \ - transform/FeatureWriter.h \ - transform/FileFeatureWriter.h \ - transform/RealTimeEffectModelTransformer.h \ - transform/Transform.h \ - transform/TransformDescription.h \ - transform/TransformFactory.h \ - transform/ModelTransformer.h \ - transform/ModelTransformerFactory.h -SOURCES += transform/CSVFeatureWriter.cpp \ - transform/FeatureExtractionModelTransformer.cpp \ - transform/FileFeatureWriter.cpp \ - transform/RealTimeEffectModelTransformer.cpp \ - transform/Transform.cpp \ - transform/TransformFactory.cpp \ - transform/ModelTransformer.cpp \ - transform/ModelTransformerFactory.cpp + +TEMPLATE = lib + +exists(config.pri) { + include(config.pri) +} +win* { + !exists(config.pri) { + DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_RUBBERBAND HAVE_DATAQUAY HAVE_LIBLO HAVE_MAD HAVE_ID3TAG + } +} + +CONFIG += staticlib qt thread warn_on stl rtti exceptions +QT += network xml +QT -= gui + +TARGET = svcore + +DEPENDPATH += . data plugin plugin/api/alsa +INCLUDEPATH += . data plugin plugin/api/alsa ../dataquay +OBJECTS_DIR = o +MOC_DIR = o + +win32-g++ { + INCLUDEPATH += ../sv-dependency-builds/win32-mingw/include +} +win32-msvc* { + INCLUDEPATH += ../sv-dependency-builds/win32-msvc/include +} + +# Doesn't work with this library, which contains C99 as well as C++ +PRECOMPILED_HEADER = + +# Set up suitable platform defines for RtMidi +linux*: DEFINES += __LINUX_ALSASEQ__ +macx*: DEFINES += __MACOSX_CORE__ +win*: DEFINES += __WINDOWS_MM__ +solaris*: DEFINES += __RTMIDI_DUMMY_ONLY__ + +HEADERS += base/AudioLevel.h \ + base/AudioPlaySource.h \ + base/Clipboard.h \ + base/Command.h \ + base/Debug.h \ + base/Exceptions.h \ + base/LogRange.h \ + base/Pitch.h \ + base/Playable.h \ + base/PlayParameterRepository.h \ + base/PlayParameters.h \ + base/Preferences.h \ + base/Profiler.h \ + base/ProgressPrinter.h \ + base/ProgressReporter.h \ + base/PropertyContainer.h \ + base/RangeMapper.h \ + base/RealTime.h \ + base/RecentFiles.h \ + base/Resampler.h \ + base/ResizeableBitset.h \ + base/ResourceFinder.h \ + base/RingBuffer.h \ + base/Scavenger.h \ + base/Selection.h \ + base/Serialiser.h \ + base/StorageAdviser.h \ + base/StringBits.h \ + base/TempDirectory.h \ + base/TempWriteFile.h \ + base/TextMatcher.h \ + base/Thread.h \ + base/UnitDatabase.h \ + base/ViewManagerBase.h \ + base/Window.h \ + base/XmlExportable.h \ + base/ZoomConstraint.h +SOURCES += base/AudioLevel.cpp \ + base/Clipboard.cpp \ + base/Command.cpp \ + base/Debug.cpp \ + base/Exceptions.cpp \ + base/LogRange.cpp \ + base/Pitch.cpp \ + base/PlayParameterRepository.cpp \ + base/PlayParameters.cpp \ + base/Preferences.cpp \ + base/Profiler.cpp \ + base/ProgressPrinter.cpp \ + base/ProgressReporter.cpp \ + base/PropertyContainer.cpp \ + base/RangeMapper.cpp \ + base/RealTime.cpp \ + base/RecentFiles.cpp \ + base/Resampler.cpp \ + base/ResourceFinder.cpp \ + base/Selection.cpp \ + base/Serialiser.cpp \ + base/StorageAdviser.cpp \ + base/StringBits.cpp \ + base/TempDirectory.cpp \ + base/TempWriteFile.cpp \ + base/TextMatcher.cpp \ + base/Thread.cpp \ + base/UnitDatabase.cpp \ + base/ViewManagerBase.cpp \ + base/XmlExportable.cpp + +HEADERS += data/fft/FFTapi.h \ + data/fft/FFTCacheReader.h \ + data/fft/FFTCacheStorageType.h \ + data/fft/FFTCacheWriter.h \ + data/fft/FFTDataServer.h \ + data/fft/FFTFileCacheReader.h \ + data/fft/FFTFileCacheWriter.h \ + data/fft/FFTMemoryCache.h \ + data/fileio/AudioFileReader.h \ + data/fileio/AudioFileReaderFactory.h \ + data/fileio/BZipFileDevice.h \ + data/fileio/CachedFile.h \ + data/fileio/CodedAudioFileReader.h \ + data/fileio/CSVFileReader.h \ + data/fileio/CSVFileWriter.h \ + data/fileio/CSVFormat.h \ + data/fileio/DataFileReader.h \ + data/fileio/DataFileReaderFactory.h \ + data/fileio/FileFinder.h \ + data/fileio/FileReadThread.h \ + data/fileio/FileSource.h \ + data/fileio/MatchFileReader.h \ + data/fileio/MatrixFile.h \ + data/fileio/MIDIFileReader.h \ + data/fileio/MIDIFileWriter.h \ + data/fileio/MP3FileReader.h \ + data/fileio/OggVorbisFileReader.h \ + data/fileio/PlaylistFileReader.h \ + data/fileio/QuickTimeFileReader.h \ + data/fileio/CoreAudioFileReader.h \ + data/fileio/ResamplingWavFileReader.h \ + data/fileio/WavFileReader.h \ + data/fileio/WavFileWriter.h \ + data/midi/MIDIEvent.h \ + data/midi/MIDIInput.h \ + data/midi/rtmidi/RtError.h \ + data/midi/rtmidi/RtMidi.h \ + data/model/AggregateWaveModel.h \ + data/model/AlignmentModel.h \ + data/model/Dense3DModelPeakCache.h \ + data/model/DenseThreeDimensionalModel.h \ + data/model/DenseTimeValueModel.h \ + data/model/EditableDenseThreeDimensionalModel.h \ + data/model/FFTModel.h \ + data/model/ImageModel.h \ + data/model/IntervalModel.h \ + data/model/Labeller.h \ + data/model/Model.h \ + data/model/ModelDataTableModel.h \ + data/model/NoteModel.h \ + data/model/FlexiNoteModel.h \ + data/model/PathModel.h \ + data/model/PowerOfSqrtTwoZoomConstraint.h \ + data/model/PowerOfTwoZoomConstraint.h \ + data/model/RangeSummarisableTimeValueModel.h \ + data/model/RegionModel.h \ + data/model/SparseModel.h \ + data/model/SparseOneDimensionalModel.h \ + data/model/SparseTimeValueModel.h \ + data/model/SparseValueModel.h \ + data/model/TabularModel.h \ + data/model/TextModel.h \ + data/model/WaveFileModel.h \ + data/model/WritableWaveFileModel.h \ + data/osc/OSCMessage.h \ + data/osc/OSCQueue.h +SOURCES += data/fft/FFTapi.cpp \ + data/fft/FFTDataServer.cpp \ + data/fft/FFTFileCacheReader.cpp \ + data/fft/FFTFileCacheWriter.cpp \ + data/fft/FFTMemoryCache.cpp \ + data/fileio/AudioFileReader.cpp \ + data/fileio/AudioFileReaderFactory.cpp \ + data/fileio/BZipFileDevice.cpp \ + data/fileio/CachedFile.cpp \ + data/fileio/CodedAudioFileReader.cpp \ + data/fileio/CSVFileReader.cpp \ + data/fileio/CSVFileWriter.cpp \ + data/fileio/CSVFormat.cpp \ + data/fileio/DataFileReaderFactory.cpp \ + data/fileio/FileReadThread.cpp \ + data/fileio/FileSource.cpp \ + data/fileio/MatchFileReader.cpp \ + data/fileio/MatrixFile.cpp \ + data/fileio/MIDIFileReader.cpp \ + data/fileio/MIDIFileWriter.cpp \ + data/fileio/MP3FileReader.cpp \ + data/fileio/OggVorbisFileReader.cpp \ + data/fileio/PlaylistFileReader.cpp \ + data/fileio/QuickTimeFileReader.cpp \ + data/fileio/CoreAudioFileReader.cpp \ + data/fileio/ResamplingWavFileReader.cpp \ + data/fileio/WavFileReader.cpp \ + data/fileio/WavFileWriter.cpp \ + data/midi/MIDIInput.cpp \ + data/midi/rtmidi/RtMidi.cpp \ + data/model/AggregateWaveModel.cpp \ + data/model/AlignmentModel.cpp \ + data/model/Dense3DModelPeakCache.cpp \ + data/model/DenseTimeValueModel.cpp \ + data/model/EditableDenseThreeDimensionalModel.cpp \ + data/model/FFTModel.cpp \ + data/model/Model.cpp \ + data/model/ModelDataTableModel.cpp \ + data/model/PowerOfSqrtTwoZoomConstraint.cpp \ + data/model/PowerOfTwoZoomConstraint.cpp \ + data/model/RangeSummarisableTimeValueModel.cpp \ + data/model/WaveFileModel.cpp \ + data/model/WritableWaveFileModel.cpp \ + data/osc/OSCMessage.cpp \ + data/osc/OSCQueue.cpp + +HEADERS += plugin/DSSIPluginFactory.h \ + plugin/DSSIPluginInstance.h \ + plugin/FeatureExtractionPluginFactory.h \ + plugin/LADSPAPluginFactory.h \ + plugin/LADSPAPluginInstance.h \ + plugin/PluginIdentifier.h \ + plugin/PluginXml.h \ + plugin/RealTimePluginFactory.h \ + plugin/RealTimePluginInstance.h \ + plugin/api/dssi.h \ + plugin/api/ladspa.h \ + plugin/plugins/SamplePlayer.h \ + plugin/api/alsa/asoundef.h \ + plugin/api/alsa/asoundlib.h \ + plugin/api/alsa/seq.h \ + plugin/api/alsa/seq_event.h \ + plugin/api/alsa/seq_midi_event.h \ + plugin/api/alsa/sound/asequencer.h + + +SOURCES += plugin/DSSIPluginFactory.cpp \ + plugin/DSSIPluginInstance.cpp \ + plugin/FeatureExtractionPluginFactory.cpp \ + plugin/LADSPAPluginFactory.cpp \ + plugin/LADSPAPluginInstance.cpp \ + plugin/PluginIdentifier.cpp \ + plugin/PluginXml.cpp \ + plugin/RealTimePluginFactory.cpp \ + plugin/RealTimePluginInstance.cpp \ + plugin/plugins/SamplePlayer.cpp + +!linux* { +SOURCES += plugin/api/dssi_alsa_compat.c +} + +HEADERS += rdf/PluginRDFIndexer.h \ + rdf/PluginRDFDescription.h \ + rdf/RDFExporter.h \ + rdf/RDFFeatureWriter.h \ + rdf/RDFImporter.h \ + rdf/RDFTransformFactory.h +SOURCES += rdf/PluginRDFIndexer.cpp \ + rdf/PluginRDFDescription.cpp \ + rdf/RDFExporter.cpp \ + rdf/RDFFeatureWriter.cpp \ + rdf/RDFImporter.cpp \ + rdf/RDFTransformFactory.cpp + +HEADERS += system/Init.h \ + system/System.h +SOURCES += system/Init.cpp \ + system/System.cpp + +HEADERS += transform/CSVFeatureWriter.h \ + transform/FeatureExtractionModelTransformer.h \ + transform/FeatureWriter.h \ + transform/FileFeatureWriter.h \ + transform/RealTimeEffectModelTransformer.h \ + transform/Transform.h \ + transform/TransformDescription.h \ + transform/TransformFactory.h \ + transform/ModelTransformer.h \ + transform/ModelTransformerFactory.h +SOURCES += transform/CSVFeatureWriter.cpp \ + transform/FeatureExtractionModelTransformer.cpp \ + transform/FileFeatureWriter.cpp \ + transform/RealTimeEffectModelTransformer.cpp \ + transform/Transform.cpp \ + transform/TransformFactory.cpp \ + transform/ModelTransformer.cpp \ + transform/ModelTransformerFactory.cpp diff -r 5e9ff92ca05e -r 54829c1e155e transform/FeatureExtractionModelTransformer.cpp --- a/transform/FeatureExtractionModelTransformer.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/transform/FeatureExtractionModelTransformer.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -43,8 +43,9 @@ ModelTransformer(in, transform), m_plugin(0), m_descriptor(0), - m_outputFeatureNo(0), - m_preferredOutputModel(outputmodel) + m_outputNo(0), + m_fixedRateFeatureNo(-1), // we increment before use + m_preferredOutputModel(outputmodel) { // SVDEBUG << "FeatureExtractionModelTransformer::FeatureExtractionModelTransformer: plugin " << pluginId << ", outputName " << m_transform.getOutput() << endl; @@ -158,7 +159,7 @@ // SVDEBUG << "comparing output " << i << " name \"" << outputs[i].identifier << "\" with expected \"" << m_transform.getOutput() << "\"" << endl; if (m_transform.getOutput() == "" || outputs[i].identifier == m_transform.getOutput().toStdString()) { - m_outputFeatureNo = i; + m_outputNo = i; m_descriptor = new Vamp::Plugin::OutputDescriptor(outputs[i]); break; } @@ -204,6 +205,14 @@ size_t modelRate = input->getSampleRate(); size_t modelResolution = 1; + if (m_descriptor->sampleType != + Vamp::Plugin::OutputDescriptor::OneSamplePerStep) { + if (m_descriptor->sampleRate > input->getSampleRate()) { + std::cerr << "WARNING: plugin reports output sample rate as " + << m_descriptor->sampleRate << " (can't display features with finer resolution than the input rate of " << input->getSampleRate() << ")" << std::endl; + } + } + switch (m_descriptor->sampleType) { case Vamp::Plugin::OutputDescriptor::VariableSampleRate: @@ -352,7 +361,7 @@ } Vamp::Plugin::OutputList outputs = m_plugin->getOutputDescriptors(); - model->setScaleUnits(outputs[m_outputFeatureNo].unit.c_str()); + model->setScaleUnits(outputs[m_outputNo].unit.c_str()); m_output = model; @@ -547,9 +556,8 @@ if (m_abandoned) break; - for (size_t fi = 0; fi < features[m_outputFeatureNo].size(); ++fi) { - Vamp::Plugin::Feature feature = - features[m_outputFeatureNo][fi]; + for (size_t fi = 0; fi < features[m_outputNo].size(); ++fi) { + Vamp::Plugin::Feature feature = features[m_outputNo][fi]; addFeature(blockFrame, feature); } @@ -564,9 +572,8 @@ if (!m_abandoned) { Vamp::Plugin::FeatureSet features = m_plugin->getRemainingFeatures(); - for (size_t fi = 0; fi < features[m_outputFeatureNo].size(); ++fi) { - Vamp::Plugin::Feature feature = - features[m_outputFeatureNo][fi]; + for (size_t fi = 0; fi < features[m_outputNo].size(); ++fi) { + Vamp::Plugin::Feature feature = features[m_outputNo][fi]; addFeature(blockFrame, feature); } } @@ -677,15 +684,16 @@ } else if (m_descriptor->sampleType == Vamp::Plugin::OutputDescriptor::FixedSampleRate) { - if (feature.hasTimestamp) { - //!!! warning: sampleRate may be non-integral - frame = Vamp::RealTime::realTime2Frame(feature.timestamp, -//!!! see comment above when setting up modelResolution and modelRate -// lrintf(m_descriptor->sampleRate)); - inputRate); - } else { - frame = m_output->getEndFrame(); - } + if (!feature.hasTimestamp) { + ++m_fixedRateFeatureNo; + } else { + RealTime ts(feature.timestamp.sec, feature.timestamp.nsec); + m_fixedRateFeatureNo = + lrint(ts.toDouble() * m_descriptor->sampleRate); + } + + frame = lrintf((m_fixedRateFeatureNo / m_descriptor->sampleRate) + * inputRate); } // Rather than repeat the complicated tests from the constructor diff -r 5e9ff92ca05e -r 54829c1e155e transform/FeatureExtractionModelTransformer.h --- a/transform/FeatureExtractionModelTransformer.h Thu Jun 20 13:47:35 2013 +0100 +++ b/transform/FeatureExtractionModelTransformer.h Fri Jul 12 13:10:28 2013 +0100 @@ -48,8 +48,9 @@ Vamp::Plugin *m_plugin; Vamp::Plugin::OutputDescriptor *m_descriptor; - int m_outputFeatureNo; - PreferredOutputModel m_preferredOutputModel; + int m_fixedRateFeatureNo; // to assign times to FixedSampleRate features + int m_outputNo; + PreferredOutputModel m_preferredOutputModel; void createOutputModel(); diff -r 5e9ff92ca05e -r 54829c1e155e transform/TransformFactory.cpp --- a/transform/TransformFactory.cpp Thu Jun 20 13:47:35 2013 +0100 +++ b/transform/TransformFactory.cpp Fri Jul 12 13:10:28 2013 +0100 @@ -37,6 +37,8 @@ #include "base/Thread.h" +//#define DEBUG_TRANSFORM_FACTORY 1 + using std::cerr; using std::endl; @@ -113,7 +115,7 @@ for (TransformDescriptionMap::const_iterator i = m_transforms.begin(); i != m_transforms.end(); ++i) { #ifdef DEBUG_TRANSFORM_FACTORY - SVDEBUG << "inserting transform into set: id = " << i->second.identifier << endl; + cerr << "inserting transform into set: id = " << i->second.identifier << endl; #endif dset.insert(i->second); } @@ -122,7 +124,7 @@ for (std::set::const_iterator i = dset.begin(); i != dset.end(); ++i) { #ifdef DEBUG_TRANSFORM_FACTORY - SVDEBUG << "inserting transform into list: id = " << i->identifier << endl; + cerr << "inserting transform into list: id = " << i->identifier << endl; #endif list.push_back(*i); } @@ -159,7 +161,7 @@ for (TransformDescriptionMap::const_iterator i = m_uninstalledTransforms.begin(); i != m_uninstalledTransforms.end(); ++i) { #ifdef DEBUG_TRANSFORM_FACTORY - SVDEBUG << "inserting transform into set: id = " << i->second.identifier << endl; + cerr << "inserting transform into set: id = " << i->second.identifier << endl; #endif dset.insert(i->second); } @@ -168,7 +170,7 @@ for (std::set::const_iterator i = dset.begin(); i != dset.end(); ++i) { #ifdef DEBUG_TRANSFORM_FACTORY - SVDEBUG << "inserting transform into uninstalled list: id = " << i->identifier << endl; + cerr << "inserting transform into uninstalled list: id = " << i->identifier << endl; #endif list.push_back(*i); } @@ -659,8 +661,9 @@ QString name = desc.getPluginName(); #ifdef DEBUG_TRANSFORM_FACTORY if (name == "") { - SVDEBUG << "TransformFactory::populateUninstalledTransforms: " - << "No name available for plugin " << i- << ", skipping" << endl; + cerr << "TransformFactory::populateUninstalledTransforms: " + << "No name available for plugin " << *i + << ", skipping" << endl; continue; } #endif @@ -677,7 +680,7 @@ if (m_transforms.find(tid) != m_transforms.end()) { #ifdef DEBUG_TRANSFORM_FACTORY - SVDEBUG << "TransformFactory::populateUninstalledTransforms: " + cerr << "TransformFactory::populateUninstalledTransforms: " << tid << " is installed; adding info url if appropriate, skipping rest" << endl; #endif if (infoUrl != "") { @@ -689,7 +692,7 @@ } #ifdef DEBUG_TRANSFORM_FACTORY - SVDEBUG << "TransformFactory::populateUninstalledTransforms: " + cerr << "TransformFactory::populateUninstalledTransforms: " << "adding " << tid << endl; #endif @@ -952,7 +955,7 @@ for (Vamp::PluginBase::ParameterList::const_iterator i = parameters.begin(); i != parameters.end(); ++i) { pmap[i->identifier.c_str()] = plugin->getParameter(i->identifier); -// SVDEBUG << "TransformFactory::setParametersFromPlugin: parameter " +// cerr << "TransformFactory::setParametersFromPlugin: parameter " // << i->identifier << " -> value " << // pmap[i->identifier.c_str()] << endl; } @@ -1067,7 +1070,7 @@ Vamp::PluginBase *plugin = instantiateDefaultPluginFor (t.getIdentifier(), 0); if (!plugin) { - SVDEBUG << "TransformFactory::getPluginConfigurationXml: " + cerr << "TransformFactory::getPluginConfigurationXml: " << "Unable to instantiate plugin for transform \"" << t.getIdentifier() << "\"" << endl; return xml; @@ -1089,7 +1092,7 @@ Vamp::PluginBase *plugin = instantiateDefaultPluginFor (t.getIdentifier(), 0); if (!plugin) { - SVDEBUG << "TransformFactory::setParametersFromPluginConfigurationXml: " + cerr << "TransformFactory::setParametersFromPluginConfigurationXml: " << "Unable to instantiate plugin for transform \"" << t.getIdentifier() << "\"" << endl; return; @@ -1145,7 +1148,7 @@ if (!m_uninstalledTransformsMutex.tryLock()) { // uninstalled transforms are being populated; this may take some time, // and they aren't critical, but we will speed them up if necessary - SVDEBUG << "TransformFactory::search: Uninstalled transforms mutex is held, skipping" << endl; + cerr << "TransformFactory::search: Uninstalled transforms mutex is held, skipping" << endl; m_populatingSlowly = false; return results; }