# HG changeset patch # User Chris Cannam # Date 1386092926 0 # Node ID 5674950ed82ab54fb0cbe7f3387c824f4d384d01 # Parent 8072264dc61f2ac9dfae1eec3de92800dca3df78 Add piano to time-value layer too diff -r 8072264dc61f -r 5674950ed82a layer/TimeValueLayer.cpp --- a/layer/TimeValueLayer.cpp Tue Dec 03 17:32:25 2013 +0000 +++ b/layer/TimeValueLayer.cpp Tue Dec 03 17:48:46 2013 +0000 @@ -30,6 +30,7 @@ #include "widgets/ListInputDialog.h" #include "ColourMapper.h" +#include "PianoScale.h" #include #include @@ -1179,9 +1180,11 @@ ++pointCount; } - if ((m_plotStyle == PlotCurve || m_plotStyle == PlotDiscreteCurves || - m_plotStyle == PlotLines) - && !path.isEmpty()) { + if (m_plotStyle == PlotDiscreteCurves) { + paint.setRenderHint(QPainter::Antialiasing, true); + paint.drawPath(path); + } else if ((m_plotStyle == PlotCurve || m_plotStyle == PlotLines) + && !path.isEmpty()) { paint.setRenderHint(QPainter::Antialiasing, pointCount <= v->width()); paint.drawPath(path); } @@ -1336,6 +1339,16 @@ paint.drawText(5, 5 + paint.fontMetrics().ascent(), m_model->getScaleUnits()); } + + if (logarithmic && + (m_model->getScaleUnits() == "Hz") && + (m_plotStyle != PlotSegmentation)) { + float fmin, fmax; + getDisplayExtents(fmin, fmax); + PianoScale().paintPianoVertical + (v, paint, QRect(w, 0, 10, h), fmin, fmax); + paint.drawLine(w + 10, 0, w + 10, h); + } } void