Mercurial > hg > svgui
diff layer/NoteLayer.cpp @ 105:571805759a66
* 1502816 file export is too slow and memory-hungry
Use text stream when writing to file instead of accumulating into a string.
* 1500625 Auto-align in MIDI layer confusing
Make value extents convert to Hz in return value
* 1494623: Duplicate display of frame 0 from vamp plugin output
author | Chris Cannam |
---|---|
date | Thu, 15 Jun 2006 15:48:05 +0000 |
parents | 0f36cdf407a6 |
children | 4a6e6aedf632 |
line wrap: on
line diff
--- a/layer/NoteLayer.cpp Thu Jun 15 12:28:47 2006 +0000 +++ b/layer/NoteLayer.cpp Thu Jun 15 15:48:05 2006 +0000 @@ -225,8 +225,11 @@ min = m_model->getValueMinimum(); max = m_model->getValueMaximum(); - if (shouldConvertMIDIToHz()) unit = "Hz"; - else unit = m_model->getScaleUnits(); + if (shouldConvertMIDIToHz()) { + unit = "Hz"; + min = Pitch::getFrequencyForPitch(lrintf(min)); + max = Pitch::getFrequencyForPitch(lrintf(max + 1)); + } else unit = m_model->getScaleUnits(); if (m_verticalScale == MIDIRangeScale || m_verticalScale == LogScale) logarithmic = true; @@ -478,12 +481,15 @@ max = Pitch::getFrequencyForPitch(lrintf(max + 1)); } + std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl; + } else if (log) { -// std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl; - min = (min < 0.0) ? -log10(-min) : (min == 0.0) ? 0.0 : log10(min); max = (max < 0.0) ? -log10(-max) : (max == 0.0) ? 0.0 : log10(max); + + std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl; + } } else {