changeset 954:35b05cac32d0 tonioni

Update subrepos and merge from default branch
author Chris Cannam
date Tue, 02 Sep 2014 16:23:48 +0100
parents 5f7b509a441a (current diff) f5810f1270ae (diff)
children 6e6da0636e5e
files
diffstat 7 files changed, 40 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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 <QDir>
 #include <QCoreApplication>
 #include <QDateTime>
+#include <QThreadStorage>
 
 #include <cstdio>
 
+static QThreadStorage<QDebug *> 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;
 }
 
--- 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()));
--- 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
--- 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;
 }
 
--- 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.  
--- 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;
--- 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
 }