Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.cpp @ 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 | 54efa0a4f728 |
comparison
equal
deleted
inserted
replaced
792:0ba792bb235b | 793:bb1f2a20f7db |
---|---|
857 paint.drawLine(x+w, -1, x+w, v->height() + 1); | 857 paint.drawLine(x+w, -1, x+w, v->height() + 1); |
858 | 858 |
859 paint.setPen(v->getForeground()); | 859 paint.setPen(v->getForeground()); |
860 // paint.setBrush(v->getForeground()); | 860 // paint.setBrush(v->getForeground()); |
861 | 861 |
862 QString vlabel = QString("%1%2").arg(p.value).arg(m_model->getScaleUnits()); | 862 QString vlabel = QString("freq: %1%2").arg(p.value).arg(m_model->getScaleUnits()); |
863 // v->drawVisibleText(paint, | |
864 // x - paint.fontMetrics().width(vlabel) - 2, | |
865 // y + paint.fontMetrics().height()/2 | |
866 // - paint.fontMetrics().descent(), | |
867 // vlabel, View::OutlinedText); | |
863 v->drawVisibleText(paint, | 868 v->drawVisibleText(paint, |
864 x - paint.fontMetrics().width(vlabel) - 2, | 869 x, |
865 y + paint.fontMetrics().height()/2 | 870 y - h/2 - 2 - paint.fontMetrics().height() |
866 - paint.fontMetrics().descent(), | 871 - paint.fontMetrics().descent(), |
867 vlabel, View::OutlinedText); | 872 vlabel, View::OutlinedText); |
868 | 873 |
869 QString hlabel = RealTime::frame2RealTime | 874 QString hlabel = "dur: " + QString(RealTime::frame2RealTime |
870 (p.duration, m_model->getSampleRate()).toText(true).c_str(); | 875 (p.duration, m_model->getSampleRate()).toText(true).c_str()); |
871 v->drawVisibleText(paint, | 876 v->drawVisibleText(paint, |
872 x, | 877 x, |
873 y - h/2 - paint.fontMetrics().descent() - 2, | 878 y - h/2 - paint.fontMetrics().descent() - 2, |
874 hlabel, View::OutlinedText); | 879 hlabel, View::OutlinedText); |
880 | |
881 QString llabel = QString("%1").arg(p.label); | |
882 v->drawVisibleText(paint, | |
883 x, | |
884 y + h + 2 + paint.fontMetrics().descent(), | |
885 llabel, View::OutlinedText); | |
875 } | 886 } |
876 | 887 |
877 paint.drawRect(x, y - h/2, w, h); | 888 paint.drawRect(x, y - h/2, w, h); |
878 } | 889 } |
879 | 890 |