comparison layer/NoteLayer.h @ 997:296ccd36f626 tony-2.0-integration

Merge through to branch for Tony 2.0
author Chris Cannam
date Thu, 20 Aug 2015 14:54:21 +0100
parents 4fe7a09be0fe
children a34a2a25907c
comparison
equal deleted inserted replaced
943:788b7623bfca 997:296ccd36f626
33 Q_OBJECT 33 Q_OBJECT
34 34
35 public: 35 public:
36 NoteLayer(); 36 NoteLayer();
37 37
38 virtual void paint(View *v, QPainter &paint, QRect rect) const; 38 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
39 39
40 virtual int getVerticalScaleWidth(View *v, bool, QPainter &) const; 40 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool, QPainter &) const;
41 virtual void paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const; 41 virtual void paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const;
42 42
43 virtual QString getFeatureDescription(View *v, QPoint &) const; 43 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const;
44 44
45 virtual bool snapToFeatureFrame(View *v, sv_frame_t &frame, 45 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
46 int &resolution, 46 int &resolution,
47 SnapType snap) const; 47 SnapType snap) const;
48 48
49 virtual void drawStart(View *v, QMouseEvent *); 49 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *);
50 virtual void drawDrag(View *v, QMouseEvent *); 50 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *);
51 virtual void drawEnd(View *v, QMouseEvent *); 51 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *);
52 52
53 virtual void eraseStart(View *v, QMouseEvent *); 53 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *);
54 virtual void eraseDrag(View *v, QMouseEvent *); 54 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *);
55 virtual void eraseEnd(View *v, QMouseEvent *); 55 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *);
56 56
57 virtual void editStart(View *v, QMouseEvent *); 57 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *);
58 virtual void editDrag(View *v, QMouseEvent *); 58 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *);
59 virtual void editEnd(View *v, QMouseEvent *); 59 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *);
60 60
61 virtual bool editOpen(View *v, QMouseEvent *); 61 virtual bool editOpen(LayerGeometryProvider *v, QMouseEvent *);
62 62
63 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); 63 virtual void moveSelection(Selection s, sv_frame_t newStartFrame);
64 virtual void resizeSelection(Selection s, Selection newSize); 64 virtual void resizeSelection(Selection s, Selection newSize);
65 virtual void deleteSelection(Selection s); 65 virtual void deleteSelection(Selection s);
66 66
67 virtual void copy(View *v, Selection s, Clipboard &to); 67 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to);
68 virtual bool paste(View *v, const Clipboard &from, sv_frame_t frameOffset, 68 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset,
69 bool interactive); 69 bool interactive);
70 70
71 virtual const Model *getModel() const { return m_model; } 71 virtual const Model *getModel() const { return m_model; }
72 void setModel(NoteModel *model); 72 void setModel(NoteModel *model);
73 73
89 }; 89 };
90 90
91 void setVerticalScale(VerticalScale scale); 91 void setVerticalScale(VerticalScale scale);
92 VerticalScale getVerticalScale() const { return m_verticalScale; } 92 VerticalScale getVerticalScale() const { return m_verticalScale; }
93 93
94 virtual bool isLayerScrollable(const View *v) const; 94 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const;
95 95
96 virtual bool isLayerEditable() const { return true; } 96 virtual bool isLayerEditable() const { return true; }
97 97
98 virtual int getCompletion(View *) const { return m_model->getCompletion(); } 98 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); }
99 99
100 virtual bool getValueExtents(double &min, double &max, 100 virtual bool getValueExtents(double &min, double &max,
101 bool &log, QString &unit) const; 101 bool &log, QString &unit) const;
102 102
103 virtual bool getDisplayExtents(double &min, double &max) const; 103 virtual bool getDisplayExtents(double &min, double &max) const;
130 QString extraAttributes = "") const; 130 QString extraAttributes = "") const;
131 131
132 void setProperties(const QXmlAttributes &attributes); 132 void setProperties(const QXmlAttributes &attributes);
133 133
134 /// VerticalScaleLayer methods 134 /// VerticalScaleLayer methods
135 virtual int getYForValue(View *v, double value) const; 135 virtual int getYForValue(LayerGeometryProvider *v, double value) const;
136 virtual double getValueForY(View *v, int y) const; 136 virtual double getValueForY(LayerGeometryProvider *v, int y) const;
137 virtual QString getScaleUnits() const; 137 virtual QString getScaleUnits() const;
138 138
139 protected: 139 protected:
140 void getScaleExtents(View *, double &min, double &max, bool &log) const; 140 void getScaleExtents(LayerGeometryProvider *, double &min, double &max, bool &log) const;
141 bool shouldConvertMIDIToHz() const; 141 bool shouldConvertMIDIToHz() const;
142 142
143 virtual int getDefaultColourHint(bool dark, bool &impose); 143 virtual int getDefaultColourHint(bool dark, bool &impose);
144 144
145 NoteModel::PointList getLocalPoints(View *v, int) const; 145 NoteModel::PointList getLocalPoints(LayerGeometryProvider *v, int) const;
146 146
147 bool getPointToDrag(View *v, int x, int y, NoteModel::Point &) const; 147 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, NoteModel::Point &) const;
148 148
149 NoteModel *m_model; 149 NoteModel *m_model;
150 bool m_editing; 150 bool m_editing;
151 int m_dragPointX; 151 int m_dragPointX;
152 int m_dragPointY; 152 int m_dragPointY;