changeset 349:ff00432761ce

Single-click to move pointer needs to wait for double-click timeout (so it knows you're not starting a double-click)
author Chris Cannam
date Mon, 16 Jun 2014 12:50:27 +0100
parents 80f2cd8a30f7
children fc0c4cfad044
files .hgsubstate src/Analyser.cpp
diffstat 2 files changed, 47 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Mon Jun 16 11:49:05 2014 +0100
+++ b/.hgsubstate	Mon Jun 16 12:50:27 2014 +0100
@@ -4,4 +4,4 @@
 553a5f65ef64811747a6613f759622d655db63c1 sv-dependency-builds
 f5c914661f6fdc7f05c2c980b0d21350d5933428 svapp
 3efc20c59a947a137ed7fc715b2a3b0de6c02200 svcore
-8be221f1831388b523b88a74fb2e3d30d2d23291 svgui
+584b11df8e4f3447484153ed6bc391e370856933 svgui
--- a/src/Analyser.cpp	Mon Jun 16 11:49:05 2014 +0100
+++ b/src/Analyser.cpp	Mon Jun 16 12:50:27 2014 +0100
@@ -537,56 +537,58 @@
                         vector<Layer *> primary,
                         vector<Layer *> additional)
 {
-    QMutexLocker locker(&m_asyncMutex);
+    {
+        QMutexLocker locker(&m_asyncMutex);
 
-    if (handle != m_currentAsyncHandle || 
-        m_reAnalysingSelection == Selection()) {
-        // We don't want these!
+        if (handle != m_currentAsyncHandle || 
+            m_reAnalysingSelection == Selection()) {
+            // We don't want these!
+            for (int i = 0; i < (int)primary.size(); ++i) {
+                m_document->deleteLayer(primary[i]);
+            }
+            for (int i = 0; i < (int)additional.size(); ++i) {
+                m_document->deleteLayer(additional[i]);
+            }
+            return;
+        }
+        m_currentAsyncHandle = 0;
+
+        CommandHistory::getInstance()->startCompoundOperation
+            (tr("Re-Analyse Selection"), true);
+
+        m_reAnalysisCandidates.clear();
+
+        vector<Layer *> all;
         for (int i = 0; i < (int)primary.size(); ++i) {
-            m_document->deleteLayer(primary[i]);
+            all.push_back(primary[i]);
         }
         for (int i = 0; i < (int)additional.size(); ++i) {
-            m_document->deleteLayer(additional[i]);
+            all.push_back(additional[i]);
         }
-        return;
+
+        for (int i = 0; i < (int)all.size(); ++i) {
+            TimeValueLayer *t = qobject_cast<TimeValueLayer *>(all[i]);
+            if (t) {
+                PlayParameters *params = t->getPlayParameters();
+                if (params) {
+                    params->setPlayAudible(false);
+                }
+                t->setBaseColour
+                    (ColourDatabase::getInstance()->getColourIndex(tr("Bright Orange")));
+                t->setPresentationName("candidate");
+                m_document->addLayerToView(m_pane, t);
+                m_reAnalysisCandidates.push_back(t);
+            }
+        }
+
+        if (!all.empty()) {
+            bool show = m_candidatesVisible;
+            m_candidatesVisible = !show; // to ensure the following takes effect
+            showPitchCandidates(show);
+        }
+
+        CommandHistory::getInstance()->endCompoundOperation();
     }
-    m_currentAsyncHandle = 0;
-
-    CommandHistory::getInstance()->startCompoundOperation
-        (tr("Re-Analyse Selection"), true);
-
-    m_reAnalysisCandidates.clear();
-
-    vector<Layer *> all;
-    for (int i = 0; i < (int)primary.size(); ++i) {
-        all.push_back(primary[i]);
-    }
-    for (int i = 0; i < (int)additional.size(); ++i) {
-        all.push_back(additional[i]);
-    }
-
-    for (int i = 0; i < (int)all.size(); ++i) {
-        TimeValueLayer *t = qobject_cast<TimeValueLayer *>(all[i]);
-        if (t) {
-            PlayParameters *params = t->getPlayParameters();
-            if (params) {
-                params->setPlayAudible(false);
-            }
-            t->setBaseColour
-                (ColourDatabase::getInstance()->getColourIndex(tr("Bright Orange")));
-            t->setPresentationName("candidate");
-            m_document->addLayerToView(m_pane, t);
-            m_reAnalysisCandidates.push_back(t);
-        }
-    }
-
-    if (!all.empty()) {
-        bool show = m_candidatesVisible;
-        m_candidatesVisible = !show; // to ensure the following takes effect
-        showPitchCandidates(show);
-    }
-
-    CommandHistory::getInstance()->endCompoundOperation();
 
     emit layersChanged();
 }