# HG changeset patch # User Chris Cannam # Date 1405678060 -3600 # Node ID f7590917177cca082dbee5a84ac42baab06bce4d # Parent 22fe9bcb720666ae0dbc16c532fca0a31db8bffe# Parent 2d4af227fd32bea8cdf1b70859a2c0f26c3d5451 Merge from default branch diff -r 2d4af227fd32 -r f7590917177c layer/FlexiNoteLayer.cpp --- a/layer/FlexiNoteLayer.cpp Thu Jul 17 14:50:31 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Fri Jul 18 11:07:40 2014 +0100 @@ -797,11 +797,10 @@ // Profiler profiler("FlexiNoteLayer::paint", true); - int x0 = rect.left(), x1 = rect.right(); - int frame0 = v->getFrameForX(x0); + int x1 = rect.right(); int frame1 = v->getFrameForX(x1); - FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1)); + FlexiNoteModel::PointList points(m_model->getPoints(0, frame1)); if (points.empty()) return; paint.setPen(getBaseQColor()); @@ -828,9 +827,12 @@ paint.save(); paint.setRenderHint(QPainter::Antialiasing, false); + int noteNumber = 0; + for (FlexiNoteModel::PointList::const_iterator i = points.begin(); i != points.end(); ++i) { + ++noteNumber; const FlexiNoteModel::Point &p(*i); int x = v->getXForFrame(p.frame); @@ -882,6 +884,11 @@ x, y + h + 2 + paint.fontMetrics().descent(), llabel, View::OutlinedText); + QString nlabel = QString("%1").arg(noteNumber); + v->drawVisibleText(paint, + x + paint.fontMetrics().averageCharWidth() / 2, + y + h/2 - paint.fontMetrics().descent(), + nlabel, View::OutlinedText); } paint.drawRect(x, y - h/2, w, h); diff -r 2d4af227fd32 -r f7590917177c view/Pane.h --- a/view/Pane.h Thu Jul 17 14:50:31 2014 +0100 +++ b/view/Pane.h Fri Jul 18 11:07:40 2014 +0100 @@ -62,6 +62,12 @@ static void registerShortcuts(KeyReference &kr); + enum PaneType { + Normal = 0, + TonyMain = 1, + TonySelection = 2 + }; + signals: void paneInteractedWith(); void rightButtonMenuRequested(QPoint position); diff -r 2d4af227fd32 -r f7590917177c view/ViewManager.cpp --- a/view/ViewManager.cpp Thu Jul 17 14:50:31 2014 +0100 +++ b/view/ViewManager.cpp Fri Jul 18 11:07:40 2014 +0100 @@ -48,6 +48,7 @@ m_showCentreLine(true), m_illuminateLocalFeatures(true), m_showWorkTitle(false), + m_showDuration(true), m_lightPalette(QApplication::palette()), m_darkPalette(QApplication::palette()) { diff -r 2d4af227fd32 -r f7590917177c view/ViewManager.h --- a/view/ViewManager.h Thu Jul 17 14:50:31 2014 +0100 +++ b/view/ViewManager.h Fri Jul 18 11:07:40 2014 +0100 @@ -158,6 +158,7 @@ void setIlluminateLocalFeatures(bool i) { m_illuminateLocalFeatures = i; } void setShowWorkTitle(bool show) { m_showWorkTitle = show; } + void setShowDuration(bool show) { m_showDuration = show; } /** * The sample rate that is used for playback. This is usually the @@ -196,7 +197,7 @@ bool shouldShowCentreLine() const { return m_showCentreLine; } bool shouldShowDuration() const { - return m_overlayMode != NoOverlays; + return m_overlayMode != NoOverlays && m_showDuration; } bool shouldShowFrameCount() const { return m_showCentreLine && shouldShowDuration(); @@ -350,6 +351,7 @@ bool m_showCentreLine; bool m_illuminateLocalFeatures; bool m_showWorkTitle; + bool m_showDuration; QPalette m_lightPalette; QPalette m_darkPalette;