diff layer/NoteLayer.cpp @ 692:4dcf10bd2863

Add piano scale to note layer as well (need to handle the auto-align case properly)
author Chris Cannam
date Tue, 03 Dec 2013 17:55:37 +0000
parents 1a0dfcbffaf1
children ad12e428785b 26b1ffe412f9
line wrap: on
line diff
--- a/layer/NoteLayer.cpp	Tue Dec 03 17:48:46 2013 +0000
+++ b/layer/NoteLayer.cpp	Tue Dec 03 17:55:37 2013 +0000
@@ -23,6 +23,7 @@
 #include "base/RangeMapper.h"
 #include "ColourDatabase.h"
 #include "view/View.h"
+#include "PianoScale.h"
 
 #include "data/model/NoteModel.h"
 
@@ -813,6 +814,22 @@
     paint.restore();
 }
 
+int
+NoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const
+{
+    return 10;
+}
+
+void
+NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
+{
+    float fmin, fmax;
+    getDisplayExtents(fmin, fmax);
+    PianoScale().paintPianoVertical
+        (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax);
+    paint.drawLine(10, 0, 10, v->height());
+}
+
 void
 NoteLayer::drawStart(View *v, QMouseEvent *e)
 {