comparison layer/NoteLayer.cpp @ 1317:c2fa7bb1eca9 import-audio-data

Merge from default branch
author Chris Cannam
date Tue, 04 Sep 2018 13:19:32 +0100
parents 1d7921b1852f
children c39f2d439d59
comparison
equal deleted inserted replaced
1312:fcc1f45f7bd5 1317:c2fa7bb1eca9
59 m_editingCommand(0), 59 m_editingCommand(0),
60 m_verticalScale(AutoAlignScale), 60 m_verticalScale(AutoAlignScale),
61 m_scaleMinimum(0), 61 m_scaleMinimum(0),
62 m_scaleMaximum(0) 62 m_scaleMaximum(0)
63 { 63 {
64 SVDEBUG << "constructed NoteLayer" << endl; 64 SVDEBUG << "constructed NoteLayer" << endl;
65 } 65 }
66 66
67 void 67 void
68 NoteLayer::setModel(NoteModel *model) 68 NoteLayer::setModel(NoteModel *model)
69 { 69 {
831 } 831 }
832 832
833 int 833 int
834 NoteLayer::getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &paint) const 834 NoteLayer::getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &paint) const
835 { 835 {
836 if (!m_model || shouldAutoAlign()) { 836 if (!m_model) {
837 return 0; 837 return 0;
838 } else { 838 }
839 if (m_verticalScale == LogScale || m_verticalScale == MIDIRangeScale) { 839
840 return LogNumericalScale().getWidth(v, paint) + 10; // for piano 840 if (shouldAutoAlign() && !valueExtentsMatchMine(v)) {
841 } else { 841 return 0;
842 return LinearNumericalScale().getWidth(v, paint); 842 }
843 } 843
844 if (m_verticalScale == LogScale || m_verticalScale == MIDIRangeScale) {
845 return LogNumericalScale().getWidth(v, paint) + 10; // for piano
846 } else {
847 return LinearNumericalScale().getWidth(v, paint);
844 } 848 }
845 } 849 }
846 850
847 void 851 void
848 NoteLayer::paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect) const 852 NoteLayer::paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect) const