diff layer/NoteLayer.h @ 701:084f65094203

Extend numerical and colour scales (and piano where applicable) to note and region layers
author Chris Cannam
date Wed, 04 Dec 2013 13:39:41 +0000
parents 4dcf10bd2863
children 1d526ba11a24
line wrap: on
line diff
--- a/layer/NoteLayer.h	Wed Dec 04 13:12:09 2013 +0000
+++ b/layer/NoteLayer.h	Wed Dec 04 13:39:41 2013 +0000
@@ -17,6 +17,8 @@
 #define _NOTE_LAYER_H_
 
 #include "SingleColourLayer.h"
+#include "VerticalScaleLayer.h"
+
 #include "data/model/NoteModel.h"
 
 #include <QObject>
@@ -25,7 +27,8 @@
 class View;
 class QPainter;
 
-class NoteLayer : public SingleColourLayer
+class NoteLayer : public SingleColourLayer,
+                  public VerticalScaleLayer
 {
     Q_OBJECT
 
@@ -128,10 +131,13 @@
 
     void setProperties(const QXmlAttributes &attributes);
 
+    /// VerticalScaleLayer methods
+    virtual int getYForValue(View *v, float value) const;
+    virtual float getValueForY(View *v, int y) const;
+    virtual QString getScaleUnits() const;
+
 protected:
     void getScaleExtents(View *, float &min, float &max, bool &log) const;
-    int getYForValue(View *v, float value) const;
-    float getValueForY(View *v, int y) const;
     bool shouldConvertMIDIToHz() const;
 
     virtual int getDefaultColourHint(bool dark, bool &impose);