comparison layer/PianoScale.h @ 1238:4d0ca1ab4cd0

Some work to make spectrum layers (and slice layers generally) zoomable in the frequency axis. Also fixes a number of view id mixups in SliceLayer which broke offset calculations for the x axis scale.
author Chris Cannam
date Tue, 07 Feb 2017 14:55:19 +0000
parents 4fe7a09be0fe
children b4cb11ca8233
comparison
equal deleted inserted replaced
1237:2cc9e0e5df51 1238:4d0ca1ab4cd0
24 class PianoScale 24 class PianoScale
25 { 25 {
26 public: 26 public:
27 void paintPianoVertical 27 void paintPianoVertical
28 (LayerGeometryProvider *v, QPainter &paint, QRect rect, double minf, double maxf); 28 (LayerGeometryProvider *v, QPainter &paint, QRect rect, double minf, double maxf);
29
30 class HorizontalScaleProvider {
31 public:
32 virtual double getFrequencyForX(const LayerGeometryProvider *, double x) const = 0;
33 virtual double getXForFrequency(const LayerGeometryProvider *, double freq) const = 0;
34 };
35
36 void paintPianoHorizontal
37 (LayerGeometryProvider *v, const HorizontalScaleProvider *p,
38 QPainter &paint, QRect rect);
29 }; 39 };
30 40
31 #endif 41 #endif
32 42
33 43