# HG changeset patch # User Chris Cannam # Date 1368531451 -3600 # Node ID 32d8084f8543e6fd47f2516ab339eaac834a7b8b # Parent ce71d2d9bdb71089346c0aa20b45a0f06ddea1e9# Parent 472bc9c4dd8fe2fa976bffb9ae642a1ddeca4ae6 Merge from branch "qt5". This revision actually builds with Qt4 (late releases) or Qt5, though it will warn on configure with Qt4. diff -r ce71d2d9bdb7 -r 32d8084f8543 acinclude.m4 --- a/acinclude.m4 Mon Apr 15 18:01:44 2013 +0100 +++ b/acinclude.m4 Tue May 14 12:37:31 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 ce71d2d9bdb7 -r 32d8084f8543 configure --- a/configure Mon Apr 15 18:01:44 2013 +0100 +++ b/configure Tue May 14 12:37:31 2013 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for SVapp 1.8. +# Generated by GNU Autoconf 2.69 for SVapp 2.1. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='SVapp' PACKAGE_TARNAME='svapp' -PACKAGE_VERSION='1.8' -PACKAGE_STRING='SVapp 1.8' +PACKAGE_VERSION='2.1' +PACKAGE_STRING='SVapp 2.1' PACKAGE_BUGREPORT='cannam@all-day-breakfast.com' PACKAGE_URL='' @@ -1319,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 SVapp 1.8 to adapt to many kinds of systems. +\`configure' configures SVapp 2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1380,7 +1380,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of SVapp 1.8:";; + short | recursive ) echo "Configuration of SVapp 2.1:";; esac cat <<\_ACEOF @@ -1525,7 +1525,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -SVapp configure 1.8 +SVapp configure 2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1865,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 SVapp $as_me 1.8, which was +It was created by SVapp $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3957,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 : @@ -3974,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 @@ -4074,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 : @@ -4091,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 @@ -4153,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 @@ -4169,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 @@ -5158,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 @@ -7417,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 SVapp $as_me 1.8, which was +This file was extended by SVapp $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7470,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="\\ -SVapp config.status 1.8 +SVapp config.status 2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -8044,7 +8044,7 @@ fi -if ! $QMAKE -r; then +if ! $QMAKE -r svapp.pro; then as_fn_error $? "qmake failed: Command was \"$QMAKE -r\"" "$LINENO" 5 fi @@ -8056,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: @@ -8066,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 ce71d2d9bdb7 -r 32d8084f8543 configure.ac --- a/configure.ac Mon Apr 15 18:01:44 2013 +0100 +++ b/configure.ac Tue May 14 12:37:31 2013 +0100 @@ -1,5 +1,5 @@ -AC_INIT(SVapp, 1.8, cannam@all-day-breakfast.com) +AC_INIT([SVapp], [2.1], cannam@all-day-breakfast.com) AC_CONFIG_SRCDIR(framework/Document.h) @@ -80,7 +80,7 @@ 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_OPTIONAL([liblo],[],[lo/lo.h],[lo],[lo_address_new]) @@ -114,7 +114,7 @@ AC_OUTPUT -if ! $QMAKE -r; then +if ! $QMAKE -r svapp.pro; then AC_MSG_ERROR([qmake failed: Command was "$QMAKE -r"]) fi @@ -126,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 ce71d2d9bdb7 -r 32d8084f8543 framework/VersionTester.cpp --- a/framework/VersionTester.cpp Mon Apr 15 18:01:44 2013 +0100 +++ b/framework/VersionTester.cpp Tue May 14 12:37:31 2013 +0100 @@ -23,24 +23,30 @@ #include -#include +#include + +static QNetworkAccessManager nm; VersionTester::VersionTester(QString hostname, QString versionFilePath, QString myVersion) : - m_httpFailed(false), - m_myVersion(myVersion) + m_myVersion(myVersion), + m_reply(0), + m_httpFailed(false) { - QHttp *http = new QHttp(); - connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), - this, SLOT(httpResponseHeaderReceived(const QHttpResponseHeader &))); - connect(http, SIGNAL(done(bool)), - this, SLOT(httpDone(bool))); - http->setHost(hostname); - http->get(versionFilePath); + QUrl url(QString("http://%1/%2").arg(hostname).arg(versionFilePath)); + std::cerr << "VersionTester: URL is " << url << std::endl; + m_reply = nm.get(QNetworkRequest(url)); + connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), + this, SLOT(error(QNetworkReply::NetworkError))); + connect(m_reply, SIGNAL(finished()), this, SLOT(finished())); } VersionTester::~VersionTester() { + if (m_reply) { + m_reply->abort(); + m_reply->deleteLater(); + } } bool @@ -69,20 +75,25 @@ } void -VersionTester::httpResponseHeaderReceived(const QHttpResponseHeader &h) +VersionTester::error(QNetworkReply::NetworkError) { - if (h.statusCode() / 100 != 2) m_httpFailed = true; + std::cerr << "VersionTester: error: " << m_reply->errorString() << std::endl; + m_httpFailed = true; } void -VersionTester::httpDone(bool error) +VersionTester::finished() { - QHttp *http = const_cast(dynamic_cast(sender())); - if (!http) return; - http->deleteLater(); - if (error || m_httpFailed) return; + m_reply->deleteLater(); + if (m_httpFailed) return; - QByteArray responseData = http->readAll(); + int status = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); + if (status / 100 != 2) { + std::cerr << "VersionTester: error: http status = " << status << std::endl; + return; + } + + QByteArray responseData = m_reply->readAll(); QString str = QString::fromUtf8(responseData.data()); QStringList lines = str.split('\n', QString::SkipEmptyParts); if (lines.empty()) return; diff -r ce71d2d9bdb7 -r 32d8084f8543 framework/VersionTester.h --- a/framework/VersionTester.h Mon Apr 15 18:01:44 2013 +0100 +++ b/framework/VersionTester.h Tue May 14 12:37:31 2013 +0100 @@ -24,8 +24,7 @@ #include #include #include - -class QHttpResponseHeader; +#include class VersionTester : public QObject { @@ -41,12 +40,13 @@ void newerVersionAvailable(QString); protected slots: - void httpResponseHeaderReceived(const QHttpResponseHeader &); - void httpDone(bool); + void finished(); + void error(QNetworkReply::NetworkError); private: + QString m_myVersion; + QNetworkReply *m_reply; bool m_httpFailed; - QString m_myVersion; }; #endif diff -r ce71d2d9bdb7 -r 32d8084f8543 svapp.pro --- a/svapp.pro Mon Apr 15 18:01:44 2013 +0100 +++ b/svapp.pro Tue May 14 12:37:31 2013 +0100 @@ -1,46 +1,60 @@ - -TEMPLATE = lib - -include(config.pri) - -CONFIG += staticlib qt thread warn_on stl rtti exceptions -QT += network xml gui - -TARGET = svapp - -DEPENDPATH += . ../svcore ../svgui -INCLUDEPATH += . ../svcore ../svgui -OBJECTS_DIR = o -MOC_DIR = o - -HEADERS += audioio/AudioCallbackPlaySource.h \ - audioio/AudioCallbackPlayTarget.h \ - audioio/AudioCoreAudioTarget.h \ - audioio/AudioGenerator.h \ - audioio/AudioJACKTarget.h \ - audioio/AudioPortAudioTarget.h \ - audioio/AudioPulseAudioTarget.h \ - audioio/AudioTargetFactory.h \ - audioio/PlaySpeedRangeMapper.h -SOURCES += audioio/AudioCallbackPlaySource.cpp \ - audioio/AudioCallbackPlayTarget.cpp \ - audioio/AudioCoreAudioTarget.cpp \ - audioio/AudioGenerator.cpp \ - audioio/AudioJACKTarget.cpp \ - audioio/AudioPortAudioTarget.cpp \ - audioio/AudioPulseAudioTarget.cpp \ - audioio/AudioTargetFactory.cpp \ - audioio/PlaySpeedRangeMapper.cpp - -HEADERS += framework/Document.h \ - framework/MainWindowBase.h \ - framework/SVFileReader.h \ - framework/TransformUserConfigurator.h \ - framework/VersionTester.h - -SOURCES += framework/Document.cpp \ - framework/MainWindowBase.cpp \ - framework/SVFileReader.cpp \ - framework/TransformUserConfigurator.cpp \ - framework/VersionTester.cpp - + +TEMPLATE = lib + +exists(config.pri) { + include(config.pri) +} +win* { + !exists(config.pri) { + DEFINES += HAVE_PORTAUDIO_2_0 + } +} + +CONFIG += staticlib qt thread warn_on stl rtti exceptions +QT += network xml gui widgets + +TARGET = svapp + +DEPENDPATH += . ../svcore ../svgui +INCLUDEPATH += . ../svcore ../svgui +OBJECTS_DIR = o +MOC_DIR = o + +win32-g++ { + INCLUDEPATH += ../sv-dependency-builds/win32-mingw/include +} +win32-msvc* { + INCLUDEPATH += ../sv-dependency-builds/win32-msvc/include +} + +HEADERS += audioio/AudioCallbackPlaySource.h \ + audioio/AudioCallbackPlayTarget.h \ + audioio/AudioCoreAudioTarget.h \ + audioio/AudioGenerator.h \ + audioio/AudioJACKTarget.h \ + audioio/AudioPortAudioTarget.h \ + audioio/AudioPulseAudioTarget.h \ + audioio/AudioTargetFactory.h \ + audioio/PlaySpeedRangeMapper.h +SOURCES += audioio/AudioCallbackPlaySource.cpp \ + audioio/AudioCallbackPlayTarget.cpp \ + audioio/AudioCoreAudioTarget.cpp \ + audioio/AudioGenerator.cpp \ + audioio/AudioJACKTarget.cpp \ + audioio/AudioPortAudioTarget.cpp \ + audioio/AudioPulseAudioTarget.cpp \ + audioio/AudioTargetFactory.cpp \ + audioio/PlaySpeedRangeMapper.cpp + +HEADERS += framework/Document.h \ + framework/MainWindowBase.h \ + framework/SVFileReader.h \ + framework/TransformUserConfigurator.h \ + framework/VersionTester.h + +SOURCES += framework/Document.cpp \ + framework/MainWindowBase.cpp \ + framework/SVFileReader.cpp \ + framework/TransformUserConfigurator.cpp \ + framework/VersionTester.cpp +