changeset 825:f7590917177c tonioni

Merge from default branch
author Chris Cannam
date Fri, 18 Jul 2014 11:07:40 +0100
parents 22fe9bcb7206 (diff) 2d4af227fd32 (current diff)
children 43256b925e15
files
diffstat 4 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp	Thu Jul 17 14:50:31 2014 +0100
+++ b/layer/FlexiNoteLayer.cpp	Fri Jul 18 11:07:40 2014 +0100
@@ -797,11 +797,10 @@
 
 //    Profiler profiler("FlexiNoteLayer::paint", true);
 
-    int x0 = rect.left(), x1 = rect.right();
-    int frame0 = v->getFrameForX(x0);
+    int x1 = rect.right();
     int frame1 = v->getFrameForX(x1);
 
-    FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1));
+    FlexiNoteModel::PointList points(m_model->getPoints(0, frame1));
     if (points.empty()) return;
 
     paint.setPen(getBaseQColor());
@@ -828,9 +827,12 @@
     paint.save();
     paint.setRenderHint(QPainter::Antialiasing, false);
     
+    int noteNumber = 0;
+
     for (FlexiNoteModel::PointList::const_iterator i = points.begin();
          i != points.end(); ++i) {
 
+        ++noteNumber;
         const FlexiNoteModel::Point &p(*i);
 
         int x = v->getXForFrame(p.frame);
@@ -882,6 +884,11 @@
                                    x,
                                    y + h + 2 + paint.fontMetrics().descent(),
                                    llabel, View::OutlinedText);
+                QString nlabel = QString("%1").arg(noteNumber);
+                v->drawVisibleText(paint, 
+                                   x + paint.fontMetrics().averageCharWidth() / 2,
+                                   y + h/2 - paint.fontMetrics().descent(),
+                                   nlabel, View::OutlinedText);
         }
     
         paint.drawRect(x, y - h/2, w, h);
--- a/view/Pane.h	Thu Jul 17 14:50:31 2014 +0100
+++ b/view/Pane.h	Fri Jul 18 11:07:40 2014 +0100
@@ -62,6 +62,12 @@
 
     static void registerShortcuts(KeyReference &kr);
 
+    enum PaneType {
+        Normal = 0,
+        TonyMain = 1,
+        TonySelection = 2
+    };
+
 signals:
     void paneInteractedWith();
     void rightButtonMenuRequested(QPoint position);
--- a/view/ViewManager.cpp	Thu Jul 17 14:50:31 2014 +0100
+++ b/view/ViewManager.cpp	Fri Jul 18 11:07:40 2014 +0100
@@ -48,6 +48,7 @@
     m_showCentreLine(true),
     m_illuminateLocalFeatures(true),
     m_showWorkTitle(false),
+    m_showDuration(true),
     m_lightPalette(QApplication::palette()),
     m_darkPalette(QApplication::palette())
 {
--- a/view/ViewManager.h	Thu Jul 17 14:50:31 2014 +0100
+++ b/view/ViewManager.h	Fri Jul 18 11:07:40 2014 +0100
@@ -158,6 +158,7 @@
 
     void setIlluminateLocalFeatures(bool i) { m_illuminateLocalFeatures = i; }
     void setShowWorkTitle(bool show) { m_showWorkTitle = show; }
+    void setShowDuration(bool show) { m_showDuration = show; }
 
     /**
      * The sample rate that is used for playback.  This is usually the
@@ -196,7 +197,7 @@
     bool shouldShowCentreLine() const { return m_showCentreLine; }
 
     bool shouldShowDuration() const {
-        return m_overlayMode != NoOverlays;
+        return m_overlayMode != NoOverlays && m_showDuration;
     }
     bool shouldShowFrameCount() const {
         return m_showCentreLine && shouldShowDuration();
@@ -350,6 +351,7 @@
     bool m_showCentreLine;
     bool m_illuminateLocalFeatures;
     bool m_showWorkTitle;
+    bool m_showDuration;
 
     QPalette m_lightPalette;
     QPalette m_darkPalette;