# HG changeset patch # User Chris Cannam # Date 1409671428 -3600 # Node ID 35b05cac32d0cb96080316cc36f852c83cc3bb18 # Parent 5f7b509a441a518ecda57da7ba804f3d6f281bdb# Parent f5810f1270ae64d2a814c55f7d56cc7cfe11192b Update subrepos and merge from default branch diff -r 5f7b509a441a -r 35b05cac32d0 base/Debug.cpp --- a/base/Debug.cpp Fri Jul 18 11:07:30 2014 +0100 +++ b/base/Debug.cpp Tue Sep 02 16:23:48 2014 +0100 @@ -24,27 +24,33 @@ #include #include #include +#include #include +static QThreadStorage debugs; +static QMutex mutex; +static char *prefix = 0; + QDebug & getSVDebug() { - static QFile *logFile = 0; - static QDebug *debug = 0; - static QMutex mutex; - static char *prefix; - mutex.lock(); - if (!debug) { + QDebug *debug = 0; + + QString pfx = ResourceFinder().getUserResourcePrefix(); + QDir logdir(QString("%1/%2").arg(pfx).arg("log")); + + if (!prefix) { prefix = new char[20]; sprintf(prefix, "[%lu]", (unsigned long)QCoreApplication::applicationPid()); - QString pfx = ResourceFinder().getUserResourcePrefix(); - QDir logdir(QString("%1/%2").arg(pfx).arg("log")); if (!logdir.exists()) logdir.mkpath(logdir.path()); - logFile = new QFile(logdir.path() + "/sv-debug.log"); - if (logFile->open(QIODevice::WriteOnly | QIODevice::Truncate)) { + } + + if (!debugs.hasLocalData()) { + QFile *logFile = new QFile(logdir.path() + "/sv-debug.log"); + if (logFile->open(QIODevice::WriteOnly | QIODevice::Append)) { QDebug(QtDebugMsg) << (const char *)prefix << "Opened debug log file " << logFile->fileName(); @@ -54,18 +60,22 @@ << "Failed to open debug log file " << logFile->fileName() << " for writing, using console debug instead"; - debug = new QDebug(QtDebugMsg); delete logFile; logFile = 0; + debug = new QDebug(QtDebugMsg); } + debugs.setLocalData(debug); *debug << endl << (const char *)prefix << "Log started at " << QDateTime::currentDateTime().toString(); + } else { + debug = debugs.localData(); } + mutex.unlock(); + QDebug &dref = *debug; dref << endl << (const char *)prefix; - mutex.unlock(); return dref; } diff -r 5f7b509a441a -r 35b05cac32d0 base/PlayParameterRepository.cpp --- a/base/PlayParameterRepository.cpp Fri Jul 18 11:07:30 2014 +0100 +++ b/base/PlayParameterRepository.cpp Tue Sep 02 16:23:48 2014 +0100 @@ -49,6 +49,9 @@ params->setPlayClipId (playable->getDefaultPlayClipId()); + + params->setPlayAudible + (playable->getDefaultPlayAudible()); connect(params, SIGNAL(playParametersChanged()), this, SLOT(playParametersChanged())); diff -r 5f7b509a441a -r 35b05cac32d0 base/Playable.h --- a/base/Playable.h Fri Jul 18 11:07:30 2014 +0100 +++ b/base/Playable.h Tue Sep 02 16:23:48 2014 +0100 @@ -25,6 +25,7 @@ virtual bool canPlay() const { return false; } virtual QString getDefaultPlayClipId() const { return ""; } + virtual bool getDefaultPlayAudible() const { return true; } }; #endif diff -r 5f7b509a441a -r 35b05cac32d0 data/model/Model.cpp --- a/data/model/Model.cpp Fri Jul 18 11:07:30 2014 +0100 +++ b/data/model/Model.cpp Tue Sep 02 16:23:48 2014 +0100 @@ -109,6 +109,7 @@ int Model::alignToReference(int frame) const { +// cerr << "Model(" << this << ")::alignToReference(" << frame << ")" << endl; if (!m_alignment) { if (m_sourceModel) return m_sourceModel->alignToReference(frame); else return frame; @@ -116,18 +117,21 @@ int refFrame = m_alignment->toReference(frame); const Model *m = m_alignment->getReferenceModel(); if (m && refFrame > m->getEndFrame()) refFrame = m->getEndFrame(); +// cerr << "have alignment, aligned is " << refFrame << endl; return refFrame; } int Model::alignFromReference(int refFrame) const { +// cerr << "Model(" << this << ")::alignFromReference(" << refFrame << ")" << endl; if (!m_alignment) { if (m_sourceModel) return m_sourceModel->alignFromReference(refFrame); else return refFrame; } int frame = m_alignment->fromReference(refFrame); if (frame > getEndFrame()) frame = getEndFrame(); +// cerr << "have alignment, aligned is " << frame << endl; return frame; } diff -r 5f7b509a441a -r 35b05cac32d0 data/model/SparseTimeValueModel.h --- a/data/model/SparseTimeValueModel.h Fri Jul 18 11:07:30 2014 +0100 +++ b/data/model/SparseTimeValueModel.h Tue Sep 02 16:23:48 2014 +0100 @@ -111,6 +111,7 @@ QString getTypeName() const { return tr("Sparse Time-Value"); } virtual bool canPlay() const { return true; } + virtual bool getDefaultPlayAudible() const { return false; } // user must unmute /** * TabularModel methods. diff -r 5f7b509a441a -r 35b05cac32d0 plugin/DSSIPluginFactory.cpp --- a/plugin/DSSIPluginFactory.cpp Fri Jul 18 11:07:30 2014 +0100 +++ b/plugin/DSSIPluginFactory.cpp Tue Sep 02 16:23:48 2014 +0100 @@ -274,6 +274,9 @@ #else baseUri = "http://dssi.sourceforge.net/ontology#"; #endif +#else + // avoid unused parameter + baseUri = ""; #endif return lrdfPaths; diff -r 5f7b509a441a -r 35b05cac32d0 plugin/LADSPAPluginFactory.cpp --- a/plugin/LADSPAPluginFactory.cpp Fri Jul 18 11:07:30 2014 +0100 +++ b/plugin/LADSPAPluginFactory.cpp Tue Sep 02 16:23:48 2014 +0100 @@ -621,6 +621,8 @@ } baseUri = LADSPA_BASE; +#else + baseUri = ""; #endif return lrdfPaths; @@ -877,6 +879,10 @@ } lrdf_free_uris(uris); } +#else + // avoid unused parameter + (void)uri; + (void)base; #endif }