diff layer/NoteLayer.h @ 706:97ea68f62c1f imaf_enc

Merge from default branch
author Chris Cannam
date Thu, 05 Dec 2013 09:47:02 +0000
parents 084f65094203
children 1d526ba11a24
line wrap: on
line diff
--- a/layer/NoteLayer.h	Mon Nov 04 17:12:32 2013 +0000
+++ b/layer/NoteLayer.h	Thu Dec 05 09:47:02 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
 
@@ -34,6 +37,9 @@
 
     virtual void paint(View *v, QPainter &paint, QRect rect) const;
 
+    virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const;
+    virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const;
+
     virtual QString getFeatureDescription(View *v, QPoint &) const;
 
     virtual bool snapToFeatureFrame(View *v, int &frame,
@@ -102,8 +108,6 @@
     virtual void setVerticalZoomStep(int);
     virtual RangeMapper *getNewVerticalZoomRangeMapper() const;
 
-    virtual int getVerticalScaleWidth(View *, bool, QPainter &) const { return 0; }
-
     /**
      * Add a note-on.  Used when recording MIDI "live".  The note will
      * not be finally added to the layer until the corresponding
@@ -127,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);