# HG changeset patch # User Chris Cannam # Date 1363015295 0 # Node ID e5e6625deb85158ad3384b4fa3f1559f160ac6b1 # Parent 2e56d73901500ad3496d5e65857284883ffc9c16 Update for Qt5 compatibility; use subrepo for dataquay diff -r 2e56d7390150 -r e5e6625deb85 .hgsub --- a/.hgsub Sat Mar 09 11:48:09 2013 +0000 +++ b/.hgsub Mon Mar 11 15:21:35 2013 +0000 @@ -1,3 +1,4 @@ svcore = https://code.soundsoftware.ac.uk/hg/svcore svgui = https://code.soundsoftware.ac.uk/hg/svgui svapp = https://code.soundsoftware.ac.uk/hg/svapp +dataquay = http://hg.breakfastquay.com/dataquay diff -r 2e56d7390150 -r e5e6625deb85 .hgsubstate --- a/.hgsubstate Sat Mar 09 11:48:09 2013 +0000 +++ b/.hgsubstate Mon Mar 11 15:21:35 2013 +0000 @@ -1,3 +1,4 @@ -8a603a0840c8cb6b756fa598a215a74c336682ac svapp -b6bb0ecb79581b27c1edf75df2e18b43dfdce12d svcore -156a120345aebfa74dcca1d02d6a7dfa26bed483 svgui +345a563df58bc7f7069727e95a267843b29c41b8 dataquay +3c236d31cccd3eb2d932b2a02d0143b2a52597d5 svapp +2b3a8ae0459703aed83b359f1508be2c14e36f22 svcore +d632a1e87018c266830b399016adb2601876d5f0 svgui diff -r 2e56d7390150 -r e5e6625deb85 main/MainWindow.cpp --- a/main/MainWindow.cpp Sat Mar 09 11:48:09 2013 +0000 +++ b/main/MainWindow.cpp Mon Mar 11 15:21:35 2013 +0000 @@ -82,7 +82,6 @@ #include "rdf/PluginRDFIndexer.h" #include "rdf/RDFExporter.h" -#include "Surveyer.h" #include "framework/VersionTester.h" // For version information @@ -307,7 +306,6 @@ TransformFactory::getInstance()->startPopulationThread(); - Surveyer *surveyer = new Surveyer(this); VersionTester *vt = new VersionTester ("sonicvisualiser.org", "/latest-version.txt", SV_VERSION); connect(vt, SIGNAL(newerVersionAvailable(QString)), @@ -1696,7 +1694,7 @@ action->setShortcut(tr("Ctrl+R")); m_keyReference->registerShortcut (tr("Re-open"), - action->shortcut(), + action->shortcut().toString(), tr("Re-open the current or most recently opened file")); } m_recentFilesMenu->addAction(action); @@ -1772,7 +1770,7 @@ ti->second->setShortcut(tr("Ctrl+T")); m_keyReference->registerShortcut (tr("Repeat Transform"), - ti->second->shortcut(), + ti->second->shortcut().toString(), tr("Re-select the most recently run transform")); } else { ti->second->setShortcut(QString("")); diff -r 2e56d7390150 -r e5e6625deb85 main/PreferencesDialog.cpp --- a/main/PreferencesDialog.cpp Sat Mar 09 11:48:09 2013 +0000 +++ b/main/PreferencesDialog.cpp Mon Mar 11 15:21:35 2013 +0000 @@ -42,8 +42,8 @@ #include "audioio/AudioTargetFactory.h" #include "base/ResourceFinder.h" -PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WFlags flags) : - QDialog(parent, flags), +PreferencesDialog::PreferencesDialog(QWidget *parent) : + QDialog(parent), m_audioDevice(0), m_changesOnRestart(false) { diff -r 2e56d7390150 -r e5e6625deb85 main/PreferencesDialog.h --- a/main/PreferencesDialog.h Sat Mar 09 11:48:09 2013 +0000 +++ b/main/PreferencesDialog.h Mon Mar 11 15:21:35 2013 +0000 @@ -31,7 +31,7 @@ Q_OBJECT public: - PreferencesDialog(QWidget *parent = 0, Qt::WFlags flags = 0); + PreferencesDialog(QWidget *parent = 0); virtual ~PreferencesDialog(); enum Tab { diff -r 2e56d7390150 -r e5e6625deb85 main/Surveyer.cpp --- a/main/Surveyer.cpp Sat Mar 09 11:48:09 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -/* -*- 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 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. -*/ - -/* - This is a modified version of a source file from the - Rosegarden MIDI and audio sequencer and notation editor. - This file copyright 2000-2009 Chris Cannam. -*/ - -#include "Surveyer.h" - -#include - -#include - -#include -#include -#include -#include -#include - -#include "version.h" - -#include "transform/TransformFactory.h" -#include "plugin/PluginIdentifier.h" - -Surveyer::Surveyer(QObject *parent) : - QObject(parent), - m_httpFailed(false) -{ - QSettings settings; - settings.beginGroup("Survey"); - if (!settings.contains("countdown")) { - settings.setValue("countdown", 15); - settings.endGroup(); - return; - } - int countdown = settings.value("countdown").toInt(); - if (countdown == 0) { - // The countdown value will now remain 0 until we have - // successfully tested for a survey and offered it to the - // user. If the survey doesn't exist any more, then we'll - // simply never present it to the user and the countdown will - // remain 0 forever. If the survey does exist, then we offer - // the user the chance to respond to it and (regardless of - // whether they want to or not) set the countdown to -1 so - // that it is never offered again. - 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("sonicvisualiser.org"); - http->get("/survey16-present.txt"); - } else if (countdown > 0) { - settings.setValue("countdown", countdown-1); - } - settings.endGroup(); -} - -Surveyer::~Surveyer() -{ -} - -void -Surveyer::httpResponseHeaderReceived(const QHttpResponseHeader &h) -{ - if (h.statusCode() / 100 != 2) m_httpFailed = true; -} - -void -Surveyer::httpDone(bool error) -{ - QHttp *http = const_cast(dynamic_cast(sender())); - if (!http) return; - http->deleteLater(); -// if (error || m_httpFailed) return; - - QByteArray responseData = http->readAll(); - QString str = QString::fromUtf8(responseData.data()); - QStringList lines = str.split('\n', QString::SkipEmptyParts); - if (lines.empty()) return; - - QString response = lines[0]; -// if (response != "yes") return; - - QString title = "Sonic Visualiser - User Survey"; - QString text = "

Sonic Visualiser: Take part in our survey!

We at Queen Mary, University of London are running a short survey for users of Sonic Visualiser. We are trying to find out how useful Sonic Visualiser is to people, and what we can do to improve it.

We do not ask for any personal information, and it should only take five minutes.

Would you like to take part?

"; - - QMessageBox mb(dynamic_cast(parent())); - mb.setWindowTitle(title); - mb.setText(text); - - QPushButton *yes = mb.addButton(tr("Yes! Take me to the survey"), QMessageBox::ActionRole); - mb.addButton(tr("No, thanks"), QMessageBox::RejectRole); - - mb.exec(); - - QSettings settings; - settings.beginGroup("Survey"); - settings.setValue("countdown", -1); - settings.endGroup(); - - if (mb.clickedButton() == yes) { - QString svarg = SV_VERSION; - QString platformarg = "unknown"; -#ifdef _WIN32 - platformarg = "win32"; -#else -#ifdef __APPLE__ - platformarg = "osx"; -#else - platformarg = "posix"; -#endif -#endif - QString plugsarg; - TransformFactory *tf = TransformFactory::getInstance(); - if (tf) { - TransformList tl = tf->getAllTransformDescriptions(); - std::set packages; - for (size_t i = 0; i < tl.size(); ++i) { - TransformId id = tl[i].identifier; - Transform t; - t.setIdentifier(id); - QString plugid = t.getPluginIdentifier(); - QString type, soname, label; - PluginIdentifier::parseIdentifier(plugid, type, soname, label); - if (type == "vamp") packages.insert(soname); - } - for (std::set::const_iterator i = packages.begin(); - i != packages.end(); ++i) { - if (plugsarg != "") plugsarg = plugsarg + ","; - plugsarg = plugsarg + *i; - } - } - QDesktopServices::openUrl(QUrl(QString("http://sonicvisualiser.org/survey16.php?sv=%1&plugs=%2&platform=%3").arg(svarg).arg(plugsarg).arg(platformarg))); - } -} - - diff -r 2e56d7390150 -r e5e6625deb85 main/Surveyer.h --- a/main/Surveyer.h Sat Mar 09 11:48:09 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -*- 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 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. -*/ - -/* - This is a modified version of a source file from the - Rosegarden MIDI and audio sequencer and notation editor. - This file copyright 2000-2009 Chris Cannam. -*/ - -#ifndef _SURVEYER_H_ -#define _SURVEYER_H_ - -#include -#include -#include - -class QHttpResponseHeader; - -class Surveyer : public QObject -{ - Q_OBJECT - -public: - Surveyer(QObject *parent = 0); - virtual ~Surveyer(); - -protected slots: - void httpResponseHeaderReceived(const QHttpResponseHeader &); - void httpDone(bool); - -private: - bool m_httpFailed; -}; - -#endif - diff -r 2e56d7390150 -r e5e6625deb85 sonic-visualiser.pro --- a/sonic-visualiser.pro Sat Mar 09 11:48:09 2013 +0000 +++ b/sonic-visualiser.pro Mon Mar 11 15:21:35 2013 +0000 @@ -1,5 +1,5 @@ TEMPLATE = subdirs -SUBDIRS = svcore svgui svapp sub_sv svcore/data/fileio/test +SUBDIRS = dataquay svcore svgui svapp sub_sv svcore/data/fileio/test sub_sv.file = sv.pro diff -r 2e56d7390150 -r e5e6625deb85 sv.pro --- a/sv.pro Sat Mar 09 11:48:09 2013 +0000 +++ b/sv.pro Mon Mar 11 15:21:35 2013 +0000 @@ -4,7 +4,7 @@ include(config.pri) CONFIG += qt thread warn_on stl rtti exceptions -QT += network xml gui +QT += network xml gui widgets TARGET = "Sonic Visualiser" linux*:TARGET = sonic-visualiser @@ -23,29 +23,35 @@ contains(DEFINES, BUILD_STATIC):LIBS -= -ljack -LIBS = -Lsvapp -Lsvgui -Lsvcore -lsvapp -lsvgui -lsvcore $$LIBS +MY_LIBS = -Lsvapp -Lsvgui -Lsvcore -Ldataquay -lsvapp -lsvgui -lsvcore -ldataquay + +linux* { +MY_LIBS = -Wl,-Bstatic $$MY_LIBS -Wl,-Bdynamic +} + +LIBS = $$MY_LIBS $$LIBS win* { PRE_TARGETDEPS += svapp/svapp.lib \ svgui/svgui.lib \ - svcore/svcore.lib + svcore/svcore.lib \ + dataquay/dataquay.lib } !win* { PRE_TARGETDEPS += svapp/libsvapp.a \ svgui/libsvgui.a \ - svcore/libsvcore.a + svcore/libsvcore.a \ + dataquay/libdataquay.a } RESOURCES += sonic-visualiser.qrc HEADERS += main/MainWindow.h \ - main/PreferencesDialog.h \ - main/Surveyer.h + main/PreferencesDialog.h SOURCES += main/main.cpp \ main/OSCHandler.cpp \ main/MainWindow.cpp \ - main/PreferencesDialog.cpp \ - main/Surveyer.cpp + main/PreferencesDialog.cpp # for mac integration QMAKE_INFO_PLIST = deploy/osx/Info.plist