Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.cpp @ 670:47735c9518e7 tonioni
Merge from default branch
author | Chris Cannam |
---|---|
date | Tue, 16 Jul 2013 17:59:01 +0100 |
parents | layer/NoteLayer.cpp@2727bc3aab59 layer/NoteLayer.cpp@123ebecd12e6 |
children | 917039d333bb |
comparison
equal
deleted
inserted
replaced
669:123ebecd12e6 | 670:47735c9518e7 |
---|---|
247 if (shouldConvertMIDIToHz()) { | 247 if (shouldConvertMIDIToHz()) { |
248 min = Pitch::getFrequencyForPitch(lrintf(min)); | 248 min = Pitch::getFrequencyForPitch(lrintf(min)); |
249 max = Pitch::getFrequencyForPitch(lrintf(max + 1)); | 249 max = Pitch::getFrequencyForPitch(lrintf(max + 1)); |
250 } | 250 } |
251 | 251 |
252 #ifdef DEBUG_NOTE_LAYER | |
253 std::cerr << "NoteLayer::getDisplayExtents: min = " << min << ", max = " << max << " (m_scaleMinimum = " << m_scaleMinimum << ", m_scaleMaximum = " << m_scaleMaximum << ")" << std::endl; | |
254 #endif | |
255 | |
252 return true; | 256 return true; |
253 } | 257 } |
254 | 258 |
255 bool | 259 bool |
256 FlexiNoteLayer::setDisplayExtents(float min, float max) | 260 FlexiNoteLayer::setDisplayExtents(float min, float max) |
266 } | 270 } |
267 | 271 |
268 m_scaleMinimum = min; | 272 m_scaleMinimum = min; |
269 m_scaleMaximum = max; | 273 m_scaleMaximum = max; |
270 | 274 |
271 // SVDEBUG << "FlexiNoteLayer::setDisplayExtents: min = " << min << ", max = " << max << endl; | 275 #ifdef DEBUG_NOTE_LAYER |
276 std::cerr << "FlexiNoteLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl; | |
277 #endif | |
272 | 278 |
273 emit layerParametersChanged(); | 279 emit layerParametersChanged(); |
274 return true; | 280 return true; |
275 } | 281 } |
276 | 282 |
347 } | 353 } |
348 if (newmax > max) { | 354 if (newmax > max) { |
349 newmax = max; | 355 newmax = max; |
350 } | 356 } |
351 | 357 |
352 SVDEBUG << "FlexiNoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl; | 358 #ifdef DEBUG_NOTE_LAYER |
359 std::cerr << "FlexiNoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl; | |
360 #endif | |
353 | 361 |
354 setDisplayExtents(newmin, newmax); | 362 setDisplayExtents(newmin, newmax); |
355 } | 363 } |
356 | 364 |
357 RangeMapper * | 365 RangeMapper * |
1577 attributes.value("verticalScale").toInt(&ok); | 1585 attributes.value("verticalScale").toInt(&ok); |
1578 if (ok) setVerticalScale(scale); | 1586 if (ok) setVerticalScale(scale); |
1579 | 1587 |
1580 float min = attributes.value("scaleMinimum").toFloat(&ok); | 1588 float min = attributes.value("scaleMinimum").toFloat(&ok); |
1581 float max = attributes.value("scaleMaximum").toFloat(&alsoOk); | 1589 float max = attributes.value("scaleMaximum").toFloat(&alsoOk); |
1582 // if (ok && alsoOk) setDisplayExtents(min, max); | 1590 // if (ok && alsoOk && min != max) setDisplayExtents(min, max); |
1583 } | 1591 } |
1584 | 1592 |
1585 void | 1593 void |
1586 FlexiNoteLayer::setVerticalRangeToNoteRange(View *v) | 1594 FlexiNoteLayer::setVerticalRangeToNoteRange(View *v) |
1587 { | 1595 { |