Mercurial > hg > svgui
changeset 1057:218be6cf2d4f spectrogram-minor-refactor
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 13 Jun 2016 12:46:36 +0100 |
parents | 25b035362c44 (current diff) b4fd6c67fce5 (diff) |
children | 9a13bc339fa9 |
files | |
diffstat | 17 files changed, 697 insertions(+), 504 deletions(-) [+] |
line wrap: on
line diff
--- a/acinclude.m4 Wed Feb 03 16:51:37 2016 +0000 +++ b/acinclude.m4 Mon Jun 13 12:46:36 2016 +0100 @@ -69,6 +69,9 @@ AC_CHECK_PROG(QMAKE, qmake-qt5, $QTDIR/bin/qmake-qt5,,$QTDIR/bin/) fi if test x$QMAKE = x ; then + AC_CHECK_PROG(QMAKE, qt5-qmake, $QTDIR/bin/qt5-qmake,,$QTDIR/bin/) +fi +if test x$QMAKE = x ; then AC_CHECK_PROG(QMAKE, qmake, $QTDIR/bin/qmake,,$QTDIR/bin/) fi if test x$QMAKE = x ; then @@ -78,6 +81,9 @@ AC_CHECK_PROG(QMAKE, qmake-qt5, qmake-qt5,,$PATH) fi if test x$QMAKE = x ; then + AC_CHECK_PROG(QMAKE, qt5-qmake, qt5-qmake,,$PATH) +fi +if test x$QMAKE = x ; then AC_CHECK_PROG(QMAKE, qmake, qmake,,$PATH) fi if test x$QMAKE = x ; then
--- a/configure Wed Feb 03 16:51:37 2016 +0000 +++ b/configure Mon Jun 13 12:46:36 2016 +0100 @@ -646,16 +646,12 @@ libpulse_CFLAGS JACK_LIBS JACK_CFLAGS -portaudio_2_0_LIBS -portaudio_2_0_CFLAGS +portaudio_LIBS +portaudio_CFLAGS liblo_LIBS liblo_CFLAGS rubberband_LIBS rubberband_CFLAGS -vamphostsdk_LIBS -vamphostsdk_CFLAGS -vamp_LIBS -vamp_CFLAGS samplerate_LIBS samplerate_CFLAGS sndfile_LIBS @@ -756,16 +752,12 @@ sndfile_LIBS samplerate_CFLAGS samplerate_LIBS -vamp_CFLAGS -vamp_LIBS -vamphostsdk_CFLAGS -vamphostsdk_LIBS rubberband_CFLAGS rubberband_LIBS liblo_CFLAGS liblo_LIBS -portaudio_2_0_CFLAGS -portaudio_2_0_LIBS +portaudio_CFLAGS +portaudio_LIBS JACK_CFLAGS JACK_LIBS libpulse_CFLAGS @@ -1423,12 +1415,6 @@ C compiler flags for samplerate, overriding pkg-config samplerate_LIBS linker flags for samplerate, overriding pkg-config - vamp_CFLAGS C compiler flags for vamp, overriding pkg-config - vamp_LIBS linker flags for vamp, overriding pkg-config - vamphostsdk_CFLAGS - C compiler flags for vamphostsdk, overriding pkg-config - vamphostsdk_LIBS - linker flags for vamphostsdk, overriding pkg-config rubberband_CFLAGS C compiler flags for rubberband, overriding pkg-config rubberband_LIBS @@ -1436,10 +1422,10 @@ liblo_CFLAGS C compiler flags for liblo, overriding pkg-config liblo_LIBS linker flags for liblo, overriding pkg-config - portaudio_2_0_CFLAGS - C compiler flags for portaudio_2_0, overriding pkg-config - portaudio_2_0_LIBS - linker flags for portaudio_2_0, overriding pkg-config + portaudio_CFLAGS + C compiler flags for portaudio, overriding pkg-config + portaudio_LIBS + linker flags for portaudio, overriding pkg-config JACK_CFLAGS C compiler flags for JACK, overriding pkg-config JACK_LIBS linker flags for JACK, overriding pkg-config libpulse_CFLAGS @@ -4137,6 +4123,45 @@ fi if test x$QMAKE = x ; then + # Extract the first word of "qt5-qmake", so it can be a program name with args. +set dummy qt5-qmake; 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 : + $as_echo_n "(cached) " >&6 +else + if test -n "$QMAKE"; then + ac_cv_prog_QMAKE="$QMAKE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $QTDIR/bin/ +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_QMAKE="$QTDIR/bin/qt5-qmake" + $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 +QMAKE=$ac_cv_prog_QMAKE +if test -n "$QMAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QMAKE" >&5 +$as_echo "$QMAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test x$QMAKE = x ; then # Extract the first word of "qmake", so it can be a program name with args. set dummy qmake; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -4254,6 +4279,45 @@ fi if test x$QMAKE = x ; then + # Extract the first word of "qt5-qmake", so it can be a program name with args. +set dummy qt5-qmake; 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 : + $as_echo_n "(cached) " >&6 +else + if test -n "$QMAKE"; then + ac_cv_prog_QMAKE="$QMAKE" # 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_QMAKE="qt5-qmake" + $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 +QMAKE=$ac_cv_prog_QMAKE +if test -n "$QMAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QMAKE" >&5 +$as_echo "$QMAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test x$QMAKE = x ; then # Extract the first word of "qmake", so it can be a program name with args. set dummy qmake; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -5148,18 +5212,18 @@ fi -SV_MODULE_MODULE=vamp -SV_MODULE_VERSION_TEST="vamp >= 2.1" -SV_MODULE_HEADER=vamp/vamp.h -SV_MODULE_LIB= -SV_MODULE_FUNC= -SV_MODULE_HAVE=HAVE_$(echo vamp | tr 'a-z' 'A-Z') +SV_MODULE_MODULE=rubberband +SV_MODULE_VERSION_TEST="rubberband" +SV_MODULE_HEADER=rubberband/RubberBandStretcher.h +SV_MODULE_LIB=rubberband +SV_MODULE_FUNC=rubberband_new +SV_MODULE_HAVE=HAVE_$(echo rubberband | tr 'a-z' 'A-Z') SV_MODULE_FAILED=1 -if test -n "$vamp_LIBS" ; then +if test -n "$rubberband_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 $vamp_CFLAGS" - LIBS="$LIBS $vamp_LIBS" + CXXFLAGS="$CXXFLAGS $rubberband_CFLAGS" + LIBS="$LIBS $rubberband_LIBS" SV_MODULE_FAILED="" fi if test -z "$SV_MODULE_VERSION_TEST" ; then @@ -5168,11 +5232,11 @@ if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vamp" >&5 -$as_echo_n "checking for vamp... " >&6; } - -if test -n "$vamp_CFLAGS"; then - pkg_cv_vamp_CFLAGS="$vamp_CFLAGS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rubberband" >&5 +$as_echo_n "checking for rubberband... " >&6; } + +if test -n "$rubberband_CFLAGS"; then + pkg_cv_rubberband_CFLAGS="$rubberband_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 @@ -5180,7 +5244,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_vamp_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` + pkg_cv_rubberband_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5188,8 +5252,8 @@ else pkg_failed=untried fi -if test -n "$vamp_LIBS"; then - pkg_cv_vamp_LIBS="$vamp_LIBS" +if test -n "$rubberband_LIBS"; then + pkg_cv_rubberband_LIBS="$rubberband_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 @@ -5197,7 +5261,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_vamp_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 2>/dev/null` + pkg_cv_rubberband_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5218,12 +5282,12 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - vamp_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` + rubberband_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` else - vamp_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` + rubberband_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 "$vamp_PKG_ERRORS" >&5 + echo "$rubberband_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;} @@ -5233,11 +5297,11 @@ { $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 - vamp_CFLAGS=$pkg_cv_vamp_CFLAGS - vamp_LIBS=$pkg_cv_vamp_LIBS + rubberband_CFLAGS=$pkg_cv_rubberband_CFLAGS + rubberband_LIBS=$pkg_cv_rubberband_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $vamp_CFLAGS";LIBS="$LIBS $vamp_LIBS";SV_MODULE_FAILED="" + HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $rubberband_CFLAGS";LIBS="$LIBS $rubberband_LIBS";SV_MODULE_FAILED="" fi fi if test -n "$SV_MODULE_FAILED"; then @@ -5299,18 +5363,19 @@ fi -SV_MODULE_MODULE=vamphostsdk -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_5_present -SV_MODULE_HAVE=HAVE_$(echo vamphostsdk | tr 'a-z' 'A-Z') + +SV_MODULE_MODULE=liblo +SV_MODULE_VERSION_TEST="" +SV_MODULE_HEADER=lo/lo.h +SV_MODULE_LIB=lo +SV_MODULE_FUNC=lo_address_new +SV_MODULE_HAVE=HAVE_$(echo liblo | tr 'a-z' 'A-Z') SV_MODULE_FAILED=1 -if test -n "$vamphostsdk_LIBS" ; then +if test -n "$liblo_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 $vamphostsdk_CFLAGS" - LIBS="$LIBS $vamphostsdk_LIBS" + CXXFLAGS="$CXXFLAGS $liblo_CFLAGS" + LIBS="$LIBS $liblo_LIBS" SV_MODULE_FAILED="" fi if test -z "$SV_MODULE_VERSION_TEST" ; then @@ -5319,11 +5384,11 @@ if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vamphostsdk" >&5 -$as_echo_n "checking for vamphostsdk... " >&6; } - -if test -n "$vamphostsdk_CFLAGS"; then - pkg_cv_vamphostsdk_CFLAGS="$vamphostsdk_CFLAGS" +{ $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 \"\$SV_MODULE_VERSION_TEST\""; } >&5 @@ -5331,7 +5396,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_vamphostsdk_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` + pkg_cv_liblo_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5339,8 +5404,8 @@ else pkg_failed=untried fi -if test -n "$vamphostsdk_LIBS"; then - pkg_cv_vamphostsdk_LIBS="$vamphostsdk_LIBS" +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 \"\$SV_MODULE_VERSION_TEST\""; } >&5 @@ -5348,7 +5413,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_vamphostsdk_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 2>/dev/null` + pkg_cv_liblo_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5369,40 +5434,42 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - vamphostsdk_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` + liblo_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` else - vamphostsdk_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` + liblo_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 "$vamphostsdk_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;} + echo "$liblo_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 +$as_echo "$as_me: Failed to find optional 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 - vamphostsdk_CFLAGS=$pkg_cv_vamphostsdk_CFLAGS - vamphostsdk_LIBS=$pkg_cv_vamphostsdk_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 +$as_echo "$as_me: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&6;} +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; } - HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $vamphostsdk_CFLAGS";LIBS="$LIBS $vamphostsdk_LIBS";SV_MODULE_FAILED="" + HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $liblo_CFLAGS";LIBS="$LIBS $liblo_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` + HAVES="$HAVES $SV_MODULE_HAVE";SV_MODULE_FAILED="" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find header $SV_MODULE_HEADER for optional module $SV_MODULE_MODULE" >&5 +$as_echo "$as_me: Failed to find header $SV_MODULE_HEADER for optional module $SV_MODULE_MODULE" >&6;} +fi + + + if test -z "$SV_MODULE_FAILED"; then + 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 : @@ -5443,25 +5510,27 @@ 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 - + { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find library $SV_MODULE_LIB for optional module $SV_MODULE_MODULE" >&5 +$as_echo "$as_me: Failed to find library $SV_MODULE_LIB for optional module $SV_MODULE_MODULE" >&6;} +fi + + fi fi fi -SV_MODULE_MODULE=rubberband -SV_MODULE_VERSION_TEST="rubberband" -SV_MODULE_HEADER=rubberband/RubberBandStretcher.h -SV_MODULE_LIB=rubberband -SV_MODULE_FUNC=rubberband_new -SV_MODULE_HAVE=HAVE_$(echo rubberband | tr 'a-z' 'A-Z') +SV_MODULE_MODULE=portaudio +SV_MODULE_VERSION_TEST="portaudio-2.0 >= 19" +SV_MODULE_HEADER=portaudio.h +SV_MODULE_LIB=portaudio +SV_MODULE_FUNC=Pa_IsFormatSupported +SV_MODULE_HAVE=HAVE_$(echo portaudio | tr 'a-z' 'A-Z') SV_MODULE_FAILED=1 -if test -n "$rubberband_LIBS" ; then +if test -n "$portaudio_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 $rubberband_CFLAGS" - LIBS="$LIBS $rubberband_LIBS" + CXXFLAGS="$CXXFLAGS $portaudio_CFLAGS" + LIBS="$LIBS $portaudio_LIBS" SV_MODULE_FAILED="" fi if test -z "$SV_MODULE_VERSION_TEST" ; then @@ -5470,11 +5539,11 @@ if test -n "$SV_MODULE_FAILED" && test -n "$PKG_CONFIG"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rubberband" >&5 -$as_echo_n "checking for rubberband... " >&6; } - -if test -n "$rubberband_CFLAGS"; then - pkg_cv_rubberband_CFLAGS="$rubberband_CFLAGS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for portaudio" >&5 +$as_echo_n "checking for portaudio... " >&6; } + +if test -n "$portaudio_CFLAGS"; then + pkg_cv_portaudio_CFLAGS="$portaudio_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 @@ -5482,7 +5551,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_rubberband_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` + pkg_cv_portaudio_CFLAGS=`$PKG_CONFIG --cflags "$SV_MODULE_VERSION_TEST" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5490,8 +5559,8 @@ else pkg_failed=untried fi -if test -n "$rubberband_LIBS"; then - pkg_cv_rubberband_LIBS="$rubberband_LIBS" +if test -n "$portaudio_LIBS"; then + pkg_cv_portaudio_LIBS="$portaudio_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 @@ -5499,7 +5568,7 @@ ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_rubberband_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 2>/dev/null` + pkg_cv_portaudio_LIBS=`$PKG_CONFIG --libs "$SV_MODULE_VERSION_TEST" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -5520,164 +5589,12 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - rubberband_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` + portaudio_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` else - rubberband_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` + portaudio_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 "$rubberband_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 - rubberband_CFLAGS=$pkg_cv_rubberband_CFLAGS - rubberband_LIBS=$pkg_cv_rubberband_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $rubberband_CFLAGS";LIBS="$LIBS $rubberband_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="" -SV_MODULE_HEADER=lo/lo.h -SV_MODULE_LIB=lo -SV_MODULE_FUNC=lo_address_new -SV_MODULE_HAVE=HAVE_$(echo liblo | tr 'a-z' 'A-Z') -SV_MODULE_FAILED=1 -if test -n "$liblo_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 $liblo_CFLAGS" - LIBS="$LIBS $liblo_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 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 \"\$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_liblo_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 "$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 \"\$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_liblo_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 - liblo_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` - else - liblo_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 "$liblo_PKG_ERRORS" >&5 + echo "$portaudio_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 $as_echo "$as_me: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&6;} @@ -5687,166 +5604,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 $as_echo "$as_me: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&6;} else - liblo_CFLAGS=$pkg_cv_liblo_CFLAGS - liblo_LIBS=$pkg_cv_liblo_LIBS + portaudio_CFLAGS=$pkg_cv_portaudio_CFLAGS + portaudio_LIBS=$pkg_cv_portaudio_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $liblo_CFLAGS";LIBS="$LIBS $liblo_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";SV_MODULE_FAILED="" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find header $SV_MODULE_HEADER for optional module $SV_MODULE_MODULE" >&5 -$as_echo "$as_me: Failed to find header $SV_MODULE_HEADER for optional module $SV_MODULE_MODULE" >&6;} -fi - - - if test -z "$SV_MODULE_FAILED"; then - 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_echo "$as_me:${as_lineno-$LINENO}: Failed to find library $SV_MODULE_LIB for optional module $SV_MODULE_MODULE" >&5 -$as_echo "$as_me: Failed to find library $SV_MODULE_LIB for optional module $SV_MODULE_MODULE" >&6;} -fi - - fi - fi -fi - - -SV_MODULE_MODULE=portaudio_2_0 -SV_MODULE_VERSION_TEST="portaudio-2.0 >= 19" -SV_MODULE_HEADER=portaudio.h -SV_MODULE_LIB=portaudio -SV_MODULE_FUNC=Pa_IsFormatSupported -SV_MODULE_HAVE=HAVE_$(echo portaudio_2_0 | tr 'a-z' 'A-Z') -SV_MODULE_FAILED=1 -if test -n "$portaudio_2_0_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 $portaudio_2_0_CFLAGS" - LIBS="$LIBS $portaudio_2_0_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 portaudio_2_0" >&5 -$as_echo_n "checking for portaudio_2_0... " >&6; } - -if test -n "$portaudio_2_0_CFLAGS"; then - pkg_cv_portaudio_2_0_CFLAGS="$portaudio_2_0_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_portaudio_2_0_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 "$portaudio_2_0_LIBS"; then - pkg_cv_portaudio_2_0_LIBS="$portaudio_2_0_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_portaudio_2_0_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 - portaudio_2_0_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$SV_MODULE_VERSION_TEST" 2>&1` - else - portaudio_2_0_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 "$portaudio_2_0_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 -$as_echo "$as_me: Failed to find optional 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 optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&5 -$as_echo "$as_me: Failed to find optional module $SV_MODULE_MODULE using pkg-config, trying again by old-fashioned means" >&6;} -else - portaudio_2_0_CFLAGS=$pkg_cv_portaudio_2_0_CFLAGS - portaudio_2_0_LIBS=$pkg_cv_portaudio_2_0_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $portaudio_2_0_CFLAGS";LIBS="$LIBS $portaudio_2_0_LIBS";SV_MODULE_FAILED="" + HAVES="$HAVES $SV_MODULE_HAVE";CXXFLAGS="$CXXFLAGS $portaudio_CFLAGS";LIBS="$LIBS $portaudio_LIBS";SV_MODULE_FAILED="" fi fi if test -n "$SV_MODULE_FAILED"; then
--- a/configure.ac Wed Feb 03 16:51:37 2016 +0000 +++ b/configure.ac Mon Jun 13 12:46:36 2016 +0100 @@ -83,8 +83,6 @@ SV_MODULE_REQUIRED([fftw3f],[fftw3f >= 3.0.0],[fftw3.h],[fftw3f],[fftwf_execute]) 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.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_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new])
--- a/layer/Colour3DPlotLayer.cpp Wed Feb 03 16:51:37 2016 +0000 +++ b/layer/Colour3DPlotLayer.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -849,8 +849,12 @@ paint.save(); QFont font = paint.font(); - font.setPixelSize(int(font.pixelSize() * 0.65)); - paint.setFont(font); + if (font.pixelSize() > 0) { + int newSize = int(font.pixelSize() * 0.65); + if (newSize < 6) newSize = 6; + font.setPixelSize(newSize); + paint.setFont(font); + } int msw = paint.fontMetrics().width(maxstr); @@ -975,25 +979,27 @@ } void -Colour3DPlotLayer::fillCache(int firstBin, int lastBin) const +Colour3DPlotLayer::fillCache(int firstColumn, int lastColumn) const { + // This call requests a (perhaps partial) fill of the cache + // between model columns firstColumn and lastColumn inclusive. + // The cache itself always has size sufficient to contain the + // whole model, but its validity may be less, depending on which + // regions have been requested via calls to this function. Note + // that firstColumn and lastColumn are *model* column numbers. If + // the model starts at a frame > 0, a firstColumn of zero still + // corresponds to the first column in the model, not the first + // column on the resulting rendered layer. + Profiler profiler("Colour3DPlotLayer::fillCache", true); - sv_frame_t modelStart = m_model->getStartFrame(); - sv_frame_t modelEnd = m_model->getEndFrame(); - int modelResolution = m_model->getResolution(); - - int modelStartBin = int(modelStart / modelResolution); - int modelEndBin = int(modelEnd / modelResolution); + int cacheWidth = m_model->getWidth(); + int cacheHeight = m_model->getHeight(); #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - cerr << "Colour3DPlotLayer::fillCache: range " << firstBin << " -> " << lastBin << " of model range " << modelStartBin << " -> " << modelEndBin << " (model resolution " << modelResolution << ")" << endl; + cerr << "Colour3DPlotLayer::fillCache: range " << firstColumn << " -> " << lastColumn << " (cache size will be " << cacheWidth << " x " << cacheHeight << ")" << endl; #endif - int cacheWidth = modelEndBin - modelStartBin + 1; - if (lastBin > modelEndBin) cacheWidth = lastBin - modelStartBin + 1; - int cacheHeight = m_model->getHeight(); - if (m_cache && m_cache->height() != cacheHeight) { // height has changed: delete everything rather than resizing #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT @@ -1027,8 +1033,7 @@ #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT cerr << "Colour3DPlotLayer::fillCache: Have no cache, making one" << endl; #endif - m_cache = new QImage - (cacheWidth, cacheHeight, QImage::Format_Indexed8); + m_cache = new QImage(cacheWidth, cacheHeight, QImage::Format_Indexed8); m_cache->setColorCount(256); m_cache->fill(0); if (!m_normalizeVisibleArea) { @@ -1050,20 +1055,21 @@ << " peaks cache size = " << m_peaksCache->width() << "x" << m_peaksCache->height() << endl; #endif - if (m_cacheValidStart <= firstBin && m_cacheValidEnd >= lastBin) { + if (m_cacheValidStart <= firstColumn && m_cacheValidEnd >= lastColumn) { #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT cerr << "Cache is valid in this region already" << endl; #endif return; } - int fillStart = firstBin; - int fillEnd = lastBin; + int fillStart = firstColumn; + int fillEnd = lastColumn; - if (fillStart < modelStartBin) fillStart = modelStartBin; - if (fillStart > modelEndBin) fillStart = modelEndBin; - if (fillEnd < modelStartBin) fillEnd = modelStartBin; - if (fillEnd > modelEndBin) fillEnd = modelEndBin; + if (fillStart >= cacheWidth) fillStart = cacheWidth-1; + if (fillStart < 0) fillStart = 0; + if (fillEnd >= cacheWidth) fillEnd = cacheWidth-1; + if (fillEnd < 0) fillEnd = 0; + if (fillEnd < fillStart) fillEnd = fillStart; bool normalizeVisible = (m_normalizeVisibleArea && !m_normalizeColumns); @@ -1293,6 +1299,14 @@ return; } + if (m_model->getWidth() == 0) { +#ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT + cerr << "Colour3DPlotLayer::paint(): model width == 0, " + << "nothing to paint (yet)" << endl; +#endif + return; + } + if (m_normalizeVisibleArea && !m_normalizeColumns) rect = v->getPaintRect(); sv_frame_t modelStart = m_model->getStartFrame(); @@ -1316,6 +1330,7 @@ double srRatio = v->getViewManager()->getMainModelSampleRate() / m_model->getSampleRate(); + // the s-prefix values are source, i.e. model, column and bin numbers int sx0 = int((double(v->getFrameForX(x0)) / srRatio - double(modelStart)) / modelResolution); int sx1 = int((double(v->getFrameForX(x1)) / srRatio - double(modelStart)) @@ -1360,12 +1375,12 @@ for (int sx = sx0; sx <= sx1; ++sx) { - sv_frame_t fx = sx * modelResolution; + sv_frame_t fx = sx * modelResolution + modelStart; if (fx + modelResolution <= modelStart || fx > modelEnd) continue; - int rx0 = v->getXForFrame(int(double(fx + modelStart) * srRatio)); - int rx1 = v->getXForFrame(int(double(fx + modelStart + modelResolution + 1) * srRatio)); + int rx0 = v->getXForFrame(int(double(fx) * srRatio)); + int rx1 = v->getXForFrame(int(double(fx + modelResolution + 1) * srRatio)); int rw = rx1 - rx0; if (rw < 1) rw = 1; @@ -1422,10 +1437,12 @@ double value = m_model->getValueAt(sx, sy); snprintf(labelbuf, buflen, "%06f", value); QString text(labelbuf); - paint.setPen(v->getBackground()); - paint.drawText(rx0 + 2, - ry0 - h / sh - 1 + 2 + paint.fontMetrics().ascent(), - text); + v->drawVisibleText + (paint, + rx0 + 2, + ry0 - h / sh - 1 + 2 + paint.fontMetrics().ascent(), + text, + View::OutlinedText); } } }
--- a/layer/SpectrogramLayer.cpp Wed Feb 03 16:51:37 2016 +0000 +++ b/layer/SpectrogramLayer.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -48,7 +48,7 @@ #include <alloca.h> #endif -//#define DEBUG_SPECTROGRAM_REPAINT 1 +#define DEBUG_SPECTROGRAM_REPAINT 1 using namespace std; @@ -78,6 +78,7 @@ m_synchronous(false), m_haveDetailedScale(false), m_exiting(false), + m_peakCacheDivisor(8), m_sliceableModel(0) { QString colourConfigName = "spectrogram-colour"; @@ -582,6 +583,9 @@ void SpectrogramLayer::invalidateImageCaches() { +#ifdef DEBUG_SPECTROGRAM + cerr << "SpectrogramLayer::invalidateImageCaches called" << endl; +#endif for (ViewImageCache::iterator i = m_imageCaches.begin(); i != m_imageCaches.end(); ++i) { i->second.invalidate(); @@ -1518,7 +1522,8 @@ if (!m_peakCaches[view->getId()]) { FFTModel *f = getFFTModel(v); if (!f) return 0; - m_peakCaches[view->getId()] = new Dense3DModelPeakCache(f, 8); + m_peakCaches[view->getId()] = + new Dense3DModelPeakCache(f, m_peakCacheDivisor); } return m_peakCaches[view->getId()]; } @@ -1535,6 +1540,9 @@ void SpectrogramLayer::invalidateFFTModels() { +#ifdef DEBUG_SPECTROGRAM + cerr << "SpectrogramLayer::invalidateFFTModels called" << endl; +#endif for (ViewFFTMap::iterator i = m_fftModels.begin(); i != m_fftModels.end(); ++i) { delete i->second; @@ -1557,6 +1565,9 @@ void SpectrogramLayer::invalidateMagnitudes() { +#ifdef DEBUG_SPECTROGRAM + cerr << "SpectrogramLayer::invalidateMagnitudes called" << endl; +#endif m_viewMags.clear(); for (vector<MagnitudeRange>::iterator i = m_columnMags.begin(); i != m_columnMags.end(); ++i) { @@ -1597,7 +1608,9 @@ #ifdef DEBUG_SPECTROGRAM_REPAINT cerr << "SpectrogramLayer::updateViewMagnitudes returning from cols " - << s0 << " -> " << s1 << " inclusive" << endl; + << s0 << " -> " << s1 << " inclusive" << endl; + cerr << "SpectrogramLayer::updateViewMagnitudes: for view id " << v->getId() + << ": min is " << mag.getMin() << ", max is " << mag.getMax() << endl; #endif if (!mag.isSet()) return false; @@ -1919,7 +1932,7 @@ if (m_drawBuffer.width() < bufwid || m_drawBuffer.height() != h) { m_drawBuffer = QImage(bufwid, h, QImage::Format_Indexed8); } - usePeaksCache = (increment * 8) < zoomLevel; + usePeaksCache = (increment * m_peakCacheDivisor) < zoomLevel; if (m_colourScale == PhaseColourScale) usePeaksCache = false; } @@ -2252,12 +2265,11 @@ } else if (m_normalization == NormalizeColumns) { fft->getNormalizedMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); } else if (m_normalization == NormalizeHybrid) { - fft->getNormalizedMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); - double max = fft->getMaximumMagnitudeAt(sx); - if (max > 0.f) { - for (int i = minbin; i <= maxbin; ++i) { - values[i - minbin] = float(values[i - minbin] * log10(max)); - } + float max = fft->getNormalizedMagnitudesAt + (sx, values, minbin, maxbin - minbin + 1); + float scale = log10f(max + 1.f); + for (int i = minbin; i <= maxbin; ++i) { + values[i - minbin] *= scale; } } else { fft->getMagnitudesAt(sx, values, minbin, maxbin - minbin + 1); @@ -2369,9 +2381,9 @@ #ifdef DEBUG_SPECTROGRAM_REPAINT cerr << "SpectrogramLayer::paintDrawBuffer: Note: bin display = " << m_binDisplay << ", w = " << w << ", binforx[" << w-1 << "] = " << binforx[w-1] << ", binforx[0] = " << binforx[0] << endl; #endif - if (usePeaksCache) { //!!! + if (usePeaksCache) { sourceModel = getPeakCache(v); - divisor = 8;//!!! + divisor = m_peakCacheDivisor; minbin = 0; maxbin = sourceModel->getHeight(); } else { @@ -2424,11 +2436,13 @@ for (int x = start; x != finish; x += step) { + // x is the on-canvas pixel coord; sx (later) will be the + // source column index + ++columnCount; if (binforx[x] < 0) continue; -// float columnGain = m_gain; float columnMax = 0.f; int sx0 = binforx[x] / divisor; @@ -2460,10 +2474,9 @@ } else if (m_normalization == NormalizeColumns) { fft->getNormalizedMagnitudesAt(sx, autoarray, minbin, maxbin - minbin + 1); } else if (m_normalization == NormalizeHybrid) { - fft->getNormalizedMagnitudesAt(sx, autoarray, minbin, maxbin - minbin + 1); - float max = fft->getMaximumMagnitudeAt(sx); + float max = fft->getNormalizedMagnitudesAt + (sx, autoarray, minbin, maxbin - minbin + 1); float scale = log10f(max + 1.f); -// cout << "sx = " << sx << ", max = " << max << ", log10(max) = " << log10(max) << ", scale = " << scale << endl; for (int i = minbin; i <= maxbin; ++i) { autoarray[i - minbin] *= scale; } @@ -2575,6 +2588,13 @@ } } + // at this point we have updated m_columnMags and overallMag + // -- used elsewhere for calculating the overall view range + // for NormalizeVisibleArea mode -- and calculated "peaks" + // (the possibly scaled and interpolated value array from + // which we actually draw the column) and "columnMax" (maximum + // value used for normalisation) + for (int y = 0; y < h; ++y) { double peak = peaks[y]; @@ -3124,6 +3144,12 @@ double dBmin = AudioLevel::multiplier_to_dB(min); double dBmax = AudioLevel::multiplier_to_dB(max); +#ifdef DEBUG_SPECTROGRAM_REPAINT + cerr << "paintVerticalScale: for view id " << v->getId() + << ": min = " << min << ", max = " << max + << ", dBmin = " << dBmin << ", dBmax = " << dBmax << endl; +#endif + if (dBmax < -60.f) dBmax = -60.f; else top = QString("%1").arg(lrint(dBmax)); @@ -3465,13 +3491,29 @@ .arg(m_frequencyScale) .arg(m_binDisplay); - s += QString("normalizeColumns=\"%1\" " - "normalizeVisibleArea=\"%2\" " - "normalizeHybrid=\"%3\" ") - .arg(m_normalization == NormalizeColumns ? "true" : "false") - .arg(m_normalization == NormalizeVisibleArea ? "true" : "false") - .arg(m_normalization == NormalizeHybrid ? "true" : "false"); - + // New-style normalization attributes, allowing for more types of + // normalization in future: write out the column normalization + // type separately, and then whether we are normalizing visible + // area as well afterwards + + s += QString("columnNormalization=\"%1\" ") + .arg(m_normalization == NormalizeColumns ? "peak" : + m_normalization == NormalizeHybrid ? "hybrid" : "none"); + + // Old-style normalization attribute. We *don't* write out + // normalizeHybrid here because the only release that would accept + // it (Tony v1.0) has a totally different scale factor for + // it. We'll just have to accept that session files from Tony + // v2.0+ will look odd in Tony v1.0 + + s += QString("normalizeColumns=\"%1\" ") + .arg(m_normalization == NormalizeColumns ? "true" : "false"); + + // And this applies to both old- and new-style attributes + + s += QString("normalizeVisibleArea=\"%1\" ") + .arg(m_normalization == NormalizeVisibleArea ? "true" : "false"); + Layer::toXml(stream, indent, extraAttributes + " " + s); } @@ -3536,10 +3578,39 @@ attributes.value("binDisplay").toInt(&ok); if (ok) setBinDisplay(binDisplay); - bool normalizeColumns = - (attributes.value("normalizeColumns").trimmed() == "true"); - if (normalizeColumns) { - setNormalization(NormalizeColumns); + bool haveNewStyleNormalization = false; + + QString columnNormalization = attributes.value("columnNormalization"); + + if (columnNormalization != "") { + + haveNewStyleNormalization = true; + + if (columnNormalization == "peak") { + setNormalization(NormalizeColumns); + } else if (columnNormalization == "hybrid") { + setNormalization(NormalizeHybrid); + } else if (columnNormalization == "none") { + // do nothing + } else { + cerr << "NOTE: Unknown or unsupported columnNormalization attribute \"" + << columnNormalization << "\"" << endl; + } + } + + if (!haveNewStyleNormalization) { + + bool normalizeColumns = + (attributes.value("normalizeColumns").trimmed() == "true"); + if (normalizeColumns) { + setNormalization(NormalizeColumns); + } + + bool normalizeHybrid = + (attributes.value("normalizeHybrid").trimmed() == "true"); + if (normalizeHybrid) { + setNormalization(NormalizeHybrid); + } } bool normalizeVisibleArea = @@ -3548,10 +3619,13 @@ setNormalization(NormalizeVisibleArea); } - bool normalizeHybrid = - (attributes.value("normalizeHybrid").trimmed() == "true"); - if (normalizeHybrid) { - setNormalization(NormalizeHybrid); + if (!haveNewStyleNormalization && m_normalization == NormalizeHybrid) { + // Tony v1.0 is (and hopefully will remain!) the only released + // SV-a-like to use old-style attributes when saving sessions + // that ask for hybrid normalization. It saves them with the + // wrong gain factor, so hack in a fix for that here -- this + // gives us backward but not forward compatibility. + setGain(m_gain / float(m_fftSize / 2)); } }
--- a/layer/SpectrogramLayer.h Wed Feb 03 16:51:37 2016 +0000 +++ b/layer/SpectrogramLayer.h Mon Jun 13 12:46:36 2016 +0100 @@ -357,6 +357,7 @@ typedef std::map<int, Dense3DModelPeakCache *> PeakCacheMap; // key is view id mutable ViewFFTMap m_fftModels; mutable PeakCacheMap m_peakCaches; + const int m_peakCacheDivisor; mutable Model *m_sliceableModel; class MagnitudeRange {
--- a/svgui.pro Wed Feb 03 16:51:37 2016 +0000 +++ b/svgui.pro Mon Jun 13 12:46:36 2016 +0100 @@ -1,6 +1,9 @@ TEMPLATE = lib +INCLUDEPATH += ../vamp-plugin-sdk +DEFINES += HAVE_VAMP HAVE_VAMPHOSTSDK + exists(config.pri) { include(config.pri) } @@ -22,7 +25,7 @@ LIBS += -L../sv-dependency-builds/osx/lib } - DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_VAMP HAVE_VAMPHOSTSDK HAVE_RUBBERBAND HAVE_LIBLO HAVE_MAD HAVE_ID3TAG + DEFINES += HAVE_BZ2 HAVE_FFTW3 HAVE_FFTW3F HAVE_SNDFILE HAVE_SAMPLERATE HAVE_RUBBERBAND HAVE_LIBLO HAVE_MAD HAVE_ID3TAG } CONFIG += staticlib qt thread warn_on stl rtti exceptions c++11 @@ -91,13 +94,16 @@ layer/TimeValueLayer.cpp \ layer/WaveformLayer.cpp -HEADERS += view/Overview.h \ +HEADERS += view/AlignmentView.h \ + view/Overview.h \ view/Pane.h \ view/PaneStack.h \ view/View.h \ view/ViewManager.h \ view/ViewProxy.h -SOURCES += view/Overview.cpp \ + +SOURCES += view/AlignmentView.cpp \ + view/Overview.cpp \ view/Pane.cpp \ view/PaneStack.cpp \ view/View.cpp \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view/AlignmentView.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -0,0 +1,200 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + This file copyright 2006-2014 Chris Cannam and QMUL. + + 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. See the file + COPYING included with this distribution for more information. +*/ + +#include "AlignmentView.h" + +#include <QPainter> + +#include "data/model/SparseOneDimensionalModel.h" + +#include "layer/TimeInstantLayer.h" + +using std::vector; + +AlignmentView::AlignmentView(QWidget *w) : + View(w, false), + m_above(0), + m_below(0) +{ + setObjectName(tr("AlignmentView")); +} + +void +AlignmentView::globalCentreFrameChanged(sv_frame_t f) +{ + View::globalCentreFrameChanged(f); + update(); +} + +void +AlignmentView::viewCentreFrameChanged(View *v, sv_frame_t f) +{ + View::viewCentreFrameChanged(v, f); + if (v == m_above) { + m_centreFrame = f; + update(); + } else if (v == m_below) { + update(); + } +} + +void +AlignmentView::viewManagerPlaybackFrameChanged(sv_frame_t) +{ + update(); +} + +void +AlignmentView::viewAboveZoomLevelChanged(int level, bool) +{ + m_zoomLevel = level; + update(); +} + +void +AlignmentView::viewBelowZoomLevelChanged(int, bool) +{ + update(); +} + +void +AlignmentView::setViewAbove(View *v) +{ + if (m_above) { + disconnect(m_above, 0, this, 0); + } + + m_above = v; + + if (m_above) { + connect(m_above, + SIGNAL(zoomLevelChanged(int, bool)), + this, + SLOT(viewAboveZoomLevelChanged(int, bool))); + } +} + +void +AlignmentView::setViewBelow(View *v) +{ + if (m_below) { + disconnect(m_below, 0, this, 0); + } + + m_below = v; + + if (m_below) { + connect(m_below, + SIGNAL(zoomLevelChanged(int, bool)), + this, + SLOT(viewBelowZoomLevelChanged(int, bool))); + } +} + +void +AlignmentView::paintEvent(QPaintEvent *) +{ + if (m_above == 0 || m_below == 0 || !m_manager) return; + + bool darkPalette = false; + if (m_manager) darkPalette = m_manager->getGlobalDarkBackground(); + + QColor fg, bg; + if (darkPalette) { + fg = Qt::gray; + bg = Qt::black; + } else { + fg = Qt::black; + bg = Qt::gray; + } + + QPainter paint(this); + paint.setPen(QPen(fg, 2)); + paint.setBrush(Qt::NoBrush); + paint.setRenderHint(QPainter::Antialiasing, true); + + paint.fillRect(rect(), bg); + + vector<sv_frame_t> keyFrames = getKeyFrames(); + + foreach (sv_frame_t f, keyFrames) { + int ax = m_above->getXForFrame(f); + sv_frame_t rf = m_above->alignToReference(f); + sv_frame_t bf = m_below->alignFromReference(rf); + int bx = m_below->getXForFrame(bf); + paint.drawLine(ax, 0, bx, height()); + } + + paint.end(); +} + +vector<sv_frame_t> +AlignmentView::getKeyFrames() +{ + if (!m_above) { + return getDefaultKeyFrames(); + } + + SparseOneDimensionalModel *m = 0; + + // get the topmost such + for (int i = 0; i < m_above->getLayerCount(); ++i) { + if (qobject_cast<TimeInstantLayer *>(m_above->getLayer(i))) { + SparseOneDimensionalModel *mm = + qobject_cast<SparseOneDimensionalModel *> + (m_above->getLayer(i)->getModel()); + if (mm) m = mm; + } + } + + if (!m) { + return getDefaultKeyFrames(); + } + + vector<sv_frame_t> keyFrames; + + const SparseOneDimensionalModel::PointList pp = m->getPoints(); + for (SparseOneDimensionalModel::PointList::const_iterator pi = pp.begin(); + pi != pp.end(); ++pi) { + keyFrames.push_back(pi->frame); + } + + return keyFrames; +} + +vector<sv_frame_t> +AlignmentView::getDefaultKeyFrames() +{ + vector<sv_frame_t> keyFrames; + + if (!m_above || !m_manager) return keyFrames; + + sv_samplerate_t rate = m_manager->getMainModelSampleRate(); + if (rate == 0) return keyFrames; + + for (sv_frame_t f = m_above->getModelsStartFrame(); + f <= m_above->getModelsEndFrame(); + f += sv_frame_t(rate * 5 + 0.5)) { + keyFrames.push_back(f); + } + + return keyFrames; +} + + + + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/view/AlignmentView.h Mon Jun 13 12:46:36 2016 +0100 @@ -0,0 +1,50 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Sonic Visualiser + An audio file viewer and annotation editor. + Centre for Digital Music, Queen Mary, University of London. + This file copyright 2006-2014 Chris Cannam and QMUL. + + 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. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef ALIGNMENT_VIEW_H +#define ALIGNMENT_VIEW_H + +#include "View.h" + +class AlignmentView : public View +{ + Q_OBJECT + +public: + AlignmentView(QWidget *parent = 0); + virtual QString getPropertyContainerIconName() const { return "alignment"; } + + void setViewAbove(View *view); + void setViewBelow(View *view); + +public slots: + virtual void globalCentreFrameChanged(sv_frame_t); + virtual void viewCentreFrameChanged(View *, sv_frame_t); + virtual void viewAboveZoomLevelChanged(int, bool); + virtual void viewBelowZoomLevelChanged(int, bool); + virtual void viewManagerPlaybackFrameChanged(sv_frame_t); + +protected: + virtual void paintEvent(QPaintEvent *e); + virtual bool shouldLabelSelections() const { return false; } + + std::vector<sv_frame_t> getKeyFrames(); + std::vector<sv_frame_t> getDefaultKeyFrames(); + + View *m_above; + View *m_below; +}; + +#endif
--- a/view/LayerGeometryProvider.h Wed Feb 03 16:51:37 2016 +0000 +++ b/view/LayerGeometryProvider.h Mon Jun 13 12:46:36 2016 +0100 @@ -27,20 +27,32 @@ class LayerGeometryProvider { -public: - LayerGeometryProvider() { +protected: + static int getNextId() { static QMutex idMutex; static int nextId = 1; + static int maxId = INT_MAX; QMutexLocker locker(&idMutex); - m_id = nextId; - nextId++; - } + int id = nextId; + if (nextId == maxId) { + // we don't expect this to happen in the lifetime of a + // process, but it would be undefined behaviour if it did + // since we're using a signed int, so we should really + // guard for it... + nextId = 1; + } else { + nextId++; + } + return id; + } + +public: + LayerGeometryProvider() { } /** - * Retrieve the id of this object. Each LayerGeometryProvider has - * a separate id. + * Retrieve the id of this object. */ - int getId() const { return m_id; } + virtual int getId() const = 0; /** * Retrieve the first visible sample frame on the widget. @@ -157,9 +169,6 @@ virtual View *getView() = 0; virtual const View *getView() const = 0; - -private: - int m_id; }; #endif
--- a/view/Pane.cpp Wed Feb 03 16:51:37 2016 +0000 +++ b/view/Pane.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -717,6 +717,10 @@ void Pane::drawCentreLine(sv_samplerate_t sampleRate, QPainter &paint, bool omitLine) { + if (omitLine && m_manager->getMainModelSampleRate() == 0) { + return; + } + int fontHeight = paint.fontMetrics().height(); int fontAscent = paint.fontMetrics().ascent(); @@ -1943,7 +1947,7 @@ true, // can move horiz canTopLayerMoveVertical(), // can move vert canTopLayerMoveVertical() || (m_manager && m_manager->isPlaying()), // resist horiz - !(m_manager && m_manager->isPlaying())); // resist vert + true); // resist vert if (m_dragMode == HorizontalDrag || m_dragMode == FreeDrag) { @@ -2312,7 +2316,7 @@ m_pendingWheelAngle = 0; return; } - + while (abs(m_pendingWheelAngle) >= 120) { int sign = (m_pendingWheelAngle < 0 ? -1 : 1);
--- a/view/PaneStack.cpp Wed Feb 03 16:51:37 2016 +0000 +++ b/view/PaneStack.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -21,6 +21,7 @@ #include "widgets/ClickableLabel.h" #include "layer/Layer.h" #include "ViewManager.h" +#include "AlignmentView.h" #include <QApplication> #include <QHBoxLayout> @@ -40,6 +41,7 @@ QFrame(parent), m_currentPane(0), m_showAccessories(true), + m_showAlignmentViews(false), m_splitter(new QSplitter), m_propertyStackStack(new QStackedWidget), m_viewManager(viewManager), @@ -67,6 +69,15 @@ m_showAccessories = show; } +void +PaneStack::setShowAlignmentViews(bool show) +{ + m_showAlignmentViews = show; + foreach (const PaneRec &r, m_panes) { + r.alignmentView->setVisible(m_showAlignmentViews); + } +} + Pane * PaneStack::addPane(bool suppressPropertyBox) { @@ -112,6 +123,12 @@ layout->addWidget(pane, 0, 1, 2, 1); layout->setColumnStretch(1, 20); + AlignmentView *av = new AlignmentView(frame); + av->setFixedHeight(40);//!!! + av->setVisible(m_showAlignmentViews); + av->setViewManager(m_viewManager); + layout->addWidget(av, 2, 1); + QWidget *properties = 0; if (suppressPropertyBox) { properties = new QFrame(); @@ -139,6 +156,7 @@ rec.currentIndicator = currentIndicator; rec.frame = frame; rec.layout = layout; + rec.alignmentView = av; m_panes.push_back(rec); frame->setLayout(layout); @@ -167,11 +185,34 @@ } showOrHidePaneAccessories(); + relinkAlignmentViews(); return pane; } void +PaneStack::relinkAlignmentViews() +{ + for (int i = 0; i < (int)m_panes.size(); ++i) { + m_panes[i].alignmentView->setViewAbove(m_panes[i].pane); + if (i + 1 < (int)m_panes.size()) { + m_panes[i].alignmentView->setViewBelow(m_panes[i+1].pane); + } else { + m_panes[i].alignmentView->setViewBelow(0); + } + } +} + +void +PaneStack::unlinkAlignmentViews() +{ + for (int i = 0; i < (int)m_panes.size(); ++i) { + m_panes[i].alignmentView->setViewAbove(0); + m_panes[i].alignmentView->setViewBelow(0); + } +} + +void PaneStack::setPropertyStackMinWidth(int mw) { for (std::vector<PaneRec>::iterator i = m_panes.begin(); @@ -279,6 +320,7 @@ } emit paneAboutToBeDeleted(pane); + unlinkAlignmentViews(); cerr << "PaneStack::deletePane: about to delete parent " << pane->parent() << " of pane " << pane << endl; @@ -303,6 +345,7 @@ } showOrHidePaneAccessories(); + relinkAlignmentViews(); emit paneDeleted(); } @@ -362,6 +405,8 @@ ++i; } + relinkAlignmentViews(); + cerr << "WARNING: PaneStack::hidePane(" << pane << "): Pane not found in visible panes" << endl; } @@ -386,6 +431,8 @@ ++i; } + relinkAlignmentViews(); + cerr << "WARNING: PaneStack::showPane(" << pane << "): Pane not found in hidden panes" << endl; }
--- a/view/PaneStack.h Wed Feb 03 16:51:37 2016 +0000 +++ b/view/PaneStack.h Mon Jun 13 12:46:36 2016 +0100 @@ -34,6 +34,7 @@ class ViewManager; class PropertyContainer; class PropertyStack; +class AlignmentView; class PaneStack : public QFrame { @@ -73,6 +74,8 @@ void setShowPaneAccessories(bool show); // current indicator, close button + void setShowAlignmentViews(bool show); + void sizePanesEqually(); signals: @@ -114,18 +117,20 @@ struct PaneRec { - Pane *pane; - QWidget *propertyStack; - QPushButton *xButton; - QLabel *currentIndicator; - QFrame *frame; - QGridLayout *layout; + Pane *pane; + QWidget *propertyStack; + QPushButton *xButton; + QLabel *currentIndicator; + QFrame *frame; + QGridLayout *layout; + AlignmentView *alignmentView; }; std::vector<PaneRec> m_panes; std::vector<PaneRec> m_hiddenPanes; bool m_showAccessories; + bool m_showAlignmentViews; QSplitter *m_splitter; QStackedWidget *m_propertyStackStack; @@ -136,6 +141,9 @@ void showOrHidePaneAccessories(); + void unlinkAlignmentViews(); + void relinkAlignmentViews(); + LayoutStyle m_layoutStyle; };
--- a/view/View.cpp Wed Feb 03 16:51:37 2016 +0000 +++ b/view/View.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -51,6 +51,7 @@ View::View(QWidget *w, bool showProgress) : QFrame(w), + m_id(getNextId()), m_centreFrame(0), m_zoomLevel(1024), m_followPan(true),
--- a/view/View.h Wed Feb 03 16:51:37 2016 +0000 +++ b/view/View.h Mon Jun 13 12:46:36 2016 +0100 @@ -62,6 +62,12 @@ * be managed elsewhere (e.g. by the Document). */ virtual ~View(); + + /** + * Retrieve the id of this object. Views have their own unique + * ids, but ViewProxy objects share the id of their View. + */ + int getId() const { return m_id; } /** * Retrieve the first visible sample frame on the widget. @@ -367,7 +373,7 @@ bool globalScroll, PlaybackFollowMode followMode); - void zoomLevelChanged(int, bool); + void zoomLevelChanged(int level, bool locked); void contextHelpChanged(const QString &);
--- a/view/ViewManager.cpp Wed Feb 03 16:51:37 2016 +0000 +++ b/view/ViewManager.cpp Mon Jun 13 12:46:36 2016 +0100 @@ -741,3 +741,4 @@ if (pixels != 0 && scaled == 0) scaled = 1; return scaled; } +
--- a/view/ViewProxy.h Wed Feb 03 16:51:37 2016 +0000 +++ b/view/ViewProxy.h Mon Jun 13 12:46:36 2016 +0100 @@ -23,6 +23,9 @@ ViewProxy(View *view, int scaleFactor) : m_view(view), m_scaleFactor(scaleFactor) { } + virtual int getId() const { + return m_view->getId(); + } virtual sv_frame_t getStartFrame() const { return m_view->getStartFrame(); }