Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.cpp @ 623:49afde2dd704 tonioni
put the FlexiNote layer before the note layer to see what happens -- not much
author | matthiasm |
---|---|
date | Tue, 26 Mar 2013 20:14:08 +0000 |
parents | 765bb3774c4f |
children | 1336439dc055 |
comparison
equal
deleted
inserted
replaced
622:765bb3774c4f | 623:49afde2dd704 |
---|---|
43 m_model(0), | 43 m_model(0), |
44 m_editing(false), | 44 m_editing(false), |
45 m_originalPoint(0, 0.0, 0, 1.f, tr("New Point")), | 45 m_originalPoint(0, 0.0, 0, 1.f, tr("New Point")), |
46 m_editingPoint(0, 0.0, 0, 1.f, tr("New Point")), | 46 m_editingPoint(0, 0.0, 0, 1.f, tr("New Point")), |
47 m_editingCommand(0), | 47 m_editingCommand(0), |
48 m_verticalScale(AutoAlignScale), | 48 m_verticalScale(MIDIRangeScale), |
49 m_scaleMinimum(0), | 49 m_scaleMinimum(34), |
50 m_scaleMaximum(0) | 50 m_scaleMaximum(77) |
51 { | 51 { |
52 | |
53 } | 52 } |
54 | 53 |
55 void | 54 void |
56 FlexiNoteLayer::setModel(FlexiNoteModel *model) | 55 FlexiNoteLayer::setModel(FlexiNoteModel *model) |
57 { | 56 { |
211 } | 210 } |
212 | 211 |
213 bool | 212 bool |
214 FlexiNoteLayer::getDisplayExtents(float &min, float &max) const | 213 FlexiNoteLayer::getDisplayExtents(float &min, float &max) const |
215 { | 214 { |
216 if (!m_model || shouldAutoAlign()) return false; | 215 if (!m_model || shouldAutoAlign()) { |
216 std::cerr << "No model or shouldAutoAlign()" << std::endl; | |
217 return false; | |
218 } | |
217 | 219 |
218 if (m_verticalScale == MIDIRangeScale) { | 220 if (m_verticalScale == MIDIRangeScale) { |
219 min = Pitch::getFrequencyForPitch(0); | 221 min = Pitch::getFrequencyForPitch(0); |
220 max = Pitch::getFrequencyForPitch(127); | 222 max = Pitch::getFrequencyForPitch(70); |
221 return true; | 223 return true; |
222 } | 224 } |
223 | 225 |
224 if (m_scaleMinimum == m_scaleMaximum) { | 226 if (m_scaleMinimum == m_scaleMaximum) { |
225 min = m_model->getValueMinimum(); | 227 min = m_model->getValueMinimum(); |
629 | 631 |
630 getDisplayExtents(min, max); | 632 getDisplayExtents(min, max); |
631 | 633 |
632 if (m_verticalScale == MIDIRangeScale) { | 634 if (m_verticalScale == MIDIRangeScale) { |
633 min = Pitch::getFrequencyForPitch(0); | 635 min = Pitch::getFrequencyForPitch(0); |
634 max = Pitch::getFrequencyForPitch(127); | 636 max = Pitch::getFrequencyForPitch(70); |
635 } else if (shouldConvertMIDIToHz()) { | 637 } else if (shouldConvertMIDIToHz()) { |
636 min = Pitch::getFrequencyForPitch(lrintf(min)); | 638 min = Pitch::getFrequencyForPitch(lrintf(min)); |
637 max = Pitch::getFrequencyForPitch(lrintf(max + 1)); | 639 max = Pitch::getFrequencyForPitch(lrintf(max + 1)); |
638 } | 640 } |
639 | 641 |