comparison 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
comparison
equal deleted inserted replaced
694:ad12e428785b 695:6d9624e0ac55
226 226
227 bool 227 bool
228 FlexiNoteLayer::getDisplayExtents(float &min, float &max) const 228 FlexiNoteLayer::getDisplayExtents(float &min, float &max) const
229 { 229 {
230 if (!m_model || shouldAutoAlign()) { 230 if (!m_model || shouldAutoAlign()) {
231 std::cerr << "No model or shouldAutoAlign()" << std::endl; 231 // std::cerr << "No model or shouldAutoAlign()" << std::endl;
232 return false; 232 return false;
233 } 233 }
234 234
235 if (m_verticalScale == MIDIRangeScale) { 235 if (m_verticalScale == MIDIRangeScale) {
236 min = Pitch::getFrequencyForPitch(0); 236 min = Pitch::getFrequencyForPitch(0);
856 856
857 paint.restore(); 857 paint.restore();
858 } 858 }
859 859
860 int 860 int
861 NoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const 861 FlexiNoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const
862 { 862 {
863 return 10; 863 return 10;
864 } 864 }
865 865
866 void 866 void
867 NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const 867 FlexiNoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
868 { 868 {
869 float fmin, fmax; 869 float fmin, fmax;
870 getDisplayExtents(fmin, fmax); 870 bool log;
871 QString unit;
872 if (!getValueExtents(fmin, fmax, log, unit)) return;
871 PianoScale().paintPianoVertical 873 PianoScale().paintPianoVertical
872 (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax); 874 (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax);
873 paint.drawLine(10, 0, 10, v->height()); 875 paint.drawLine(10, 0, 10, v->height());
874 } 876 }
875 877