diff layer/FlexiNoteLayer.cpp @ 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
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());