changeset 290:a3fcaad1a269 tonioni

Merge from the default branch
author Chris Cannam
date Fri, 12 Jul 2013 13:26:41 +0100
parents cba1e2a3d14b (current diff) 2925a4bbca5e (diff)
children bc78f88a66f5
files framework/MainWindowBase.cpp
diffstat 9 files changed, 144 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Apr 19 15:37:27 2013 +0100
+++ b/.hgtags	Fri Jul 12 13:26:41 2013 +0100
@@ -24,3 +24,6 @@
 64dfa7d6171d3ebe036f2676ab0a8556b56a41b4 sv_v1.8
 eaef94d9f9bfb39440dc7b837bd1e8cd502428da sv_v1.9
 7ee215c095dd6466ad5409b72841608cebfba147 sv_v2.0
+32d8084f8543e6fd47f2516ab339eaac834a7b8b sv_v2.1
+32d8084f8543e6fd47f2516ab339eaac834a7b8b sv_v2.1
+8cb01cd2441d1009fce5c1234ecbe033ce45484a sv_v2.1
--- a/acinclude.m4	Fri Apr 19 15:37:27 2013 +0100
+++ b/acinclude.m4	Fri Jul 12 13:26:41 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
 
--- a/configure	Fri Apr 19 15:37:27 2013 +0100
+++ b/configure	Fri Jul 12 13:26:41 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 <cannam@all-day-breakfast.com>.
 #
@@ -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;}
--- a/configure.ac	Fri Apr 19 15:37:27 2013 +0100
+++ b/configure.ac	Fri Jul 12 13:26:41 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.
 ])
--- a/framework/MainWindowBase.cpp	Fri Apr 19 15:37:27 2013 +0100
+++ b/framework/MainWindowBase.cpp	Fri Jul 12 13:26:41 2013 +0100
@@ -447,6 +447,7 @@
     emit canReplaceMainAudio(haveMainModel);
     emit canImportLayer(haveMainModel && haveCurrentPane);
     emit canExportAudio(haveMainModel);
+    emit canChangeSessionTemplate(haveMainModel);
     emit canExportLayer(haveMainModel &&
                         (haveCurrentEditableLayer || haveCurrentColour3DPlot));
     emit canExportImage(haveMainModel && haveCurrentPane);
--- a/framework/MainWindowBase.h	Fri Apr 19 15:37:27 2013 +0100
+++ b/framework/MainWindowBase.h	Fri Jul 12 13:26:41 2013 +0100
@@ -120,6 +120,7 @@
     void canImportMoreAudio(bool);
     void canReplaceMainAudio(bool);
     void canImportLayer(bool);
+    void canChangeSessionTemplate(bool);
     void canExportAudio(bool);
     void canExportLayer(bool);
     void canExportImage(bool);
--- a/framework/VersionTester.cpp	Fri Apr 19 15:37:27 2013 +0100
+++ b/framework/VersionTester.cpp	Fri Jul 12 13:26:41 2013 +0100
@@ -23,24 +23,31 @@
 
 #include <iostream>
 
-#include <QHttp>
+#include <QNetworkAccessManager>
+
 
 VersionTester::VersionTester(QString hostname, QString versionFilePath,
 			     QString myVersion) :
+    m_myVersion(myVersion),
+    m_reply(0),
     m_httpFailed(false),
-    m_myVersion(myVersion)
+    m_nm(new QNetworkAccessManager)
 {
-    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 = m_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();
+    }
+    delete m_nm;
 }
 
 bool
@@ -69,20 +76,28 @@
 }
 
 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<QHttp *>(dynamic_cast<const QHttp *>(sender()));
-    if (!http) return;
-    http->deleteLater();
-    if (error || m_httpFailed) return;
+    QNetworkReply *r = m_reply;
+    m_reply = 0;
 
-    QByteArray responseData = http->readAll();
+    r->deleteLater();
+    if (m_httpFailed) return;
+
+    int status = r->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+    if (status / 100 != 2) {
+        std::cerr << "VersionTester: error: http status = " << status << std::endl;
+        return;
+    }
+
+    QByteArray responseData = r->readAll();
     QString str = QString::fromUtf8(responseData.data());
     QStringList lines = str.split('\n', QString::SkipEmptyParts);
     if (lines.empty()) return;
--- a/framework/VersionTester.h	Fri Apr 19 15:37:27 2013 +0100
+++ b/framework/VersionTester.h	Fri Jul 12 13:26:41 2013 +0100
@@ -24,8 +24,9 @@
 #include <QStringList>
 #include <QString>
 #include <QObject>
+#include <QNetworkReply>
 
-class QHttpResponseHeader;
+class QNetworkAccessManager;
 
 class VersionTester : public QObject
 {
@@ -41,12 +42,14 @@
     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;
+    QNetworkAccessManager *m_nm;
 };
 
 #endif
--- a/svapp.pro	Fri Apr 19 15:37:27 2013 +0100
+++ b/svapp.pro	Fri Jul 12 13:26:41 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
+