# HG changeset patch # User Chris Cannam # Date 1386094004 0 # Node ID 6d9624e0ac55e10e0d02add2766651ac5bf6e1b5 # Parent ad12e428785b4d13306e20b749bc08a207f63694 Toward getting piano scale showing properly diff -r ad12e428785b -r 6d9624e0ac55 layer/FlexiNoteLayer.cpp --- 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()); diff -r ad12e428785b -r 6d9624e0ac55 layer/NoteLayer.cpp --- 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());