diff data/model/SparseOneDimensionalModel.h @ 1660:b234d4d011df single-point

We do need haveTextLabels; restore it
author Chris Cannam
date Thu, 21 Mar 2019 13:33:30 +0000
parents 8bf3a52a1604
children 353a2d15f213
line wrap: on
line diff
--- a/data/model/SparseOneDimensionalModel.h	Thu Mar 21 11:35:30 2019 +0000
+++ b/data/model/SparseOneDimensionalModel.h	Thu Mar 21 13:33:30 2019 +0000
@@ -47,6 +47,7 @@
                               bool notifyOnAdd = true) :
         m_sampleRate(sampleRate),
         m_resolution(resolution),
+        m_haveTextLabels(false),
         m_notifier(this,
                    notifyOnAdd ?
                    DeferredNotifier::NOTIFY_ALWAYS :
@@ -79,6 +80,8 @@
     bool canPlay() const override { return true; }
     QString getDefaultPlayClipId() const override { return "tap"; }
     
+    bool hasTextLabels() const { return m_haveTextLabels; }
+    
     int getCompletion() const { return m_completion; }
 
     void setCompletion(int completion, bool update = true) {
@@ -148,6 +151,10 @@
 
         {   QMutexLocker locker(&m_mutex);
             m_events.add(e.withoutValue().withoutDuration());
+
+            if (e.getLabel() != "") {
+                m_haveTextLabels = true;
+            }
         }
         
         m_notifier.update(e.getFrame(), m_resolution);
@@ -290,6 +297,7 @@
     sv_samplerate_t m_sampleRate;
     int m_resolution;
 
+    bool m_haveTextLabels;
     DeferredNotifier m_notifier;
     int m_completion;