comparison layer/NoteLayer.h @ 287:cd2492c5fe45

* Add SingleColourLayer to manage colours for layers that have a single predominant colour (i.e. most of them).
author Chris Cannam
date Thu, 12 Jul 2007 16:14:59 +0000
parents e175ade2d6b0
children c0b9eec70639
comparison
equal deleted inserted replaced
286:7554ae119882 287:cd2492c5fe45
14 */ 14 */
15 15
16 #ifndef _NOTE_LAYER_H_ 16 #ifndef _NOTE_LAYER_H_
17 #define _NOTE_LAYER_H_ 17 #define _NOTE_LAYER_H_
18 18
19 #include "Layer.h" 19 #include "SingleColourLayer.h"
20 #include "data/model/NoteModel.h" 20 #include "data/model/NoteModel.h"
21 21
22 #include <QObject> 22 #include <QObject>
23 #include <QColor> 23 #include <QColor>
24 24
25 class View; 25 class View;
26 class QPainter; 26 class QPainter;
27 27
28 class NoteLayer : public Layer 28 class NoteLayer : public SingleColourLayer
29 { 29 {
30 Q_OBJECT 30 Q_OBJECT
31 31
32 public: 32 public:
33 NoteLayer(); 33 NoteLayer();
69 int *min, int *max, int *deflt) const; 69 int *min, int *max, int *deflt) const;
70 virtual QString getPropertyValueLabel(const PropertyName &, 70 virtual QString getPropertyValueLabel(const PropertyName &,
71 int value) const; 71 int value) const;
72 virtual void setProperty(const PropertyName &, int value); 72 virtual void setProperty(const PropertyName &, int value);
73 73
74 void setBaseColour(QColor);
75 QColor getBaseColour() const { return m_colour; }
76
77 enum VerticalScale { 74 enum VerticalScale {
78 AutoAlignScale, 75 AutoAlignScale,
79 LinearScale, 76 LinearScale,
80 LogScale, 77 LogScale,
81 MIDIRangeScale 78 MIDIRangeScale
104 void getScaleExtents(View *, float &min, float &max, bool &log) const; 101 void getScaleExtents(View *, float &min, float &max, bool &log) const;
105 int getYForValue(View *v, float value) const; 102 int getYForValue(View *v, float value) const;
106 float getValueForY(View *v, int y) const; 103 float getValueForY(View *v, int y) const;
107 bool shouldConvertMIDIToHz() const; 104 bool shouldConvertMIDIToHz() const;
108 105
106 virtual int getDefaultColourHint(bool dark, bool &impose);
107
109 NoteModel::PointList getLocalPoints(View *v, int) const; 108 NoteModel::PointList getLocalPoints(View *v, int) const;
110 109
111 NoteModel *m_model; 110 NoteModel *m_model;
112 bool m_editing; 111 bool m_editing;
113 NoteModel::Point m_originalPoint; 112 NoteModel::Point m_originalPoint;
114 NoteModel::Point m_editingPoint; 113 NoteModel::Point m_editingPoint;
115 NoteModel::EditCommand *m_editingCommand; 114 NoteModel::EditCommand *m_editingCommand;
116 QColor m_colour;
117 VerticalScale m_verticalScale; 115 VerticalScale m_verticalScale;
118 }; 116 };
119 117
120 #endif 118 #endif
121 119