Mercurial > hg > svgui
changeset 793:bb1f2a20f7db tonioni
flexinote now displays frequency, duration and text above/below the note
author | matthiasm |
---|---|
date | Thu, 12 Jun 2014 15:03:21 +0100 |
parents | 0ba792bb235b |
children | 9c272d39c3e3 |
files | layer/FlexiNoteLayer.cpp |
diffstat | 1 files changed, 17 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Thu Jun 12 14:31:48 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Thu Jun 12 15:03:21 2014 +0100 @@ -859,19 +859,30 @@ paint.setPen(v->getForeground()); // paint.setBrush(v->getForeground()); - QString vlabel = QString("%1%2").arg(p.value).arg(m_model->getScaleUnits()); + QString vlabel = QString("freq: %1%2").arg(p.value).arg(m_model->getScaleUnits()); + // v->drawVisibleText(paint, + // x - paint.fontMetrics().width(vlabel) - 2, + // y + paint.fontMetrics().height()/2 + // - paint.fontMetrics().descent(), + // vlabel, View::OutlinedText); v->drawVisibleText(paint, - x - paint.fontMetrics().width(vlabel) - 2, - y + paint.fontMetrics().height()/2 + x, + y - h/2 - 2 - paint.fontMetrics().height() - paint.fontMetrics().descent(), vlabel, View::OutlinedText); - - QString hlabel = RealTime::frame2RealTime - (p.duration, m_model->getSampleRate()).toText(true).c_str(); + + QString hlabel = "dur: " + QString(RealTime::frame2RealTime + (p.duration, m_model->getSampleRate()).toText(true).c_str()); v->drawVisibleText(paint, x, y - h/2 - paint.fontMetrics().descent() - 2, hlabel, View::OutlinedText); + + QString llabel = QString("%1").arg(p.label); + v->drawVisibleText(paint, + x, + y + h + 2 + paint.fontMetrics().descent(), + llabel, View::OutlinedText); } paint.drawRect(x, y - h/2, w, h);