Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.cpp @ 819:a9731b49745a tonioni
adding no spectrogram and no sonification options
author | matthiasm |
---|---|
date | Tue, 15 Jul 2014 15:42:20 +0100 |
parents | 40c6c9344ff6 |
children | 22fe9bcb7206 |
comparison
equal
deleted
inserted
replaced
810:b68af2be4545 | 819:a9731b49745a |
---|---|
799 | 799 |
800 int x0 = rect.left(), x1 = rect.right(); | 800 int x0 = rect.left(), x1 = rect.right(); |
801 int frame0 = v->getFrameForX(x0); | 801 int frame0 = v->getFrameForX(x0); |
802 int frame1 = v->getFrameForX(x1); | 802 int frame1 = v->getFrameForX(x1); |
803 | 803 |
804 FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1)); | 804 FlexiNoteModel::PointList points(m_model->getPoints(0, frame1)); |
805 if (points.empty()) return; | 805 if (points.empty()) return; |
806 | 806 |
807 paint.setPen(getBaseQColor()); | 807 paint.setPen(getBaseQColor()); |
808 | 808 |
809 QColor brushColour(getBaseQColor()); | 809 QColor brushColour(getBaseQColor()); |
826 } | 826 } |
827 | 827 |
828 paint.save(); | 828 paint.save(); |
829 paint.setRenderHint(QPainter::Antialiasing, false); | 829 paint.setRenderHint(QPainter::Antialiasing, false); |
830 | 830 |
831 int noteNumber = 0; | |
832 | |
831 for (FlexiNoteModel::PointList::const_iterator i = points.begin(); | 833 for (FlexiNoteModel::PointList::const_iterator i = points.begin(); |
832 i != points.end(); ++i) { | 834 i != points.end(); ++i) { |
833 | 835 |
836 ++noteNumber; | |
834 const FlexiNoteModel::Point &p(*i); | 837 const FlexiNoteModel::Point &p(*i); |
835 | 838 |
836 int x = v->getXForFrame(p.frame); | 839 int x = v->getXForFrame(p.frame); |
837 int y = getYForValue(v, p.value); | 840 int y = getYForValue(v, p.value); |
838 int w = v->getXForFrame(p.frame + p.duration) - x; | 841 int w = v->getXForFrame(p.frame + p.duration) - x; |
880 QString llabel = QString("%1").arg(p.label); | 883 QString llabel = QString("%1").arg(p.label); |
881 v->drawVisibleText(paint, | 884 v->drawVisibleText(paint, |
882 x, | 885 x, |
883 y + h + 2 + paint.fontMetrics().descent(), | 886 y + h + 2 + paint.fontMetrics().descent(), |
884 llabel, View::OutlinedText); | 887 llabel, View::OutlinedText); |
888 QString nlabel = QString("%1").arg(noteNumber); | |
889 v->drawVisibleText(paint, | |
890 x + paint.fontMetrics().averageCharWidth() / 2, | |
891 y + h/2 - paint.fontMetrics().descent(), | |
892 nlabel, View::OutlinedText); | |
885 } | 893 } |
886 | 894 |
887 paint.drawRect(x, y - h/2, w, h); | 895 paint.drawRect(x, y - h/2, w, h); |
888 } | 896 } |
889 | 897 |