changeset 695:6d9624e0ac55 tonioni

Toward getting piano scale showing properly
author Chris Cannam
date Tue, 03 Dec 2013 18:06:44 +0000
parents ad12e428785b
children e77b1673e17e
files layer/FlexiNoteLayer.cpp layer/NoteLayer.cpp
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp	Tue Dec 03 17:58:40 2013 +0000
+++ b/layer/FlexiNoteLayer.cpp	Tue Dec 03 18:06:44 2013 +0000
@@ -228,7 +228,7 @@
 FlexiNoteLayer::getDisplayExtents(float &min, float &max) const
 {
     if (!m_model || shouldAutoAlign()) {
-        std::cerr << "No model or shouldAutoAlign()" << std::endl;
+//        std::cerr << "No model or shouldAutoAlign()" << std::endl;
         return false;
     }
 
@@ -858,16 +858,18 @@
 }
 
 int
-NoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const
+FlexiNoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const
 {
     return 10;
 }
 
 void
-NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
+FlexiNoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
 {
     float fmin, fmax;
-    getDisplayExtents(fmin, fmax);
+    bool log;
+    QString unit;
+    if (!getValueExtents(fmin, fmax, log, unit)) return;
     PianoScale().paintPianoVertical
         (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax);
     paint.drawLine(10, 0, 10, v->height());
--- a/layer/NoteLayer.cpp	Tue Dec 03 17:58:40 2013 +0000
+++ b/layer/NoteLayer.cpp	Tue Dec 03 18:06:44 2013 +0000
@@ -824,7 +824,9 @@
 NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
 {
     float fmin, fmax;
-    getDisplayExtents(fmin, fmax);
+    bool log;
+    QString unit;
+    if (!getValueExtents(fmin, fmax, log, unit)) return;
     PianoScale().paintPianoVertical
         (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax);
     paint.drawLine(10, 0, 10, v->height());