Mercurial > hg > svgui
diff layer/TimeValueLayer.cpp @ 42:1bdf285c4eac
* Add "Export Audio File" option
* Make note layer align in frequency with any spectrogram layer on the same
view (if it's set to frequency mode)
* Start to implement mouse editing for ranges of points by dragging the
selection
* First scrappy attempt at a vertical scale for time value layer
author | Chris Cannam |
---|---|
date | Mon, 27 Feb 2006 17:34:41 +0000 |
parents | c43f2c4f66f2 |
children | 78515b1e29eb |
line wrap: on
line diff
--- a/layer/TimeValueLayer.cpp Fri Feb 24 17:26:11 2006 +0000 +++ b/layer/TimeValueLayer.cpp Mon Feb 27 17:34:41 2006 +0000 @@ -543,6 +543,32 @@ paint.setRenderHint(QPainter::Antialiasing, false); } +int +TimeValueLayer::getVerticalScaleWidth(QPainter &paint) const +{ + return 100; //!!! +} + +void +TimeValueLayer::paintVerticalScale(QPainter &paint, QRect rect) const +{ + if (!m_model) return; + + float v = m_model->getValueMinimum(); + float inc = (m_model->getValueMaximum() - v) / 10; + + while (v < m_model->getValueMaximum()) { + int y = getYForValue(v); + QString label = QString("%1").arg(v); + paint.drawLine(100 - 10, y, 100, y); + paint.drawText(100 - 15 - paint.fontMetrics().width(label), + y - paint.fontMetrics().height() /2 + paint.fontMetrics().ascent(), + label); + v += inc; + } + +} + void TimeValueLayer::drawStart(QMouseEvent *e) {