Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.h @ 1469:11a150e65ee1 by-id
Some work on updating layers for ModelId bits
author | Chris Cannam |
---|---|
date | Thu, 27 Jun 2019 13:16:25 +0100 |
parents | f792a5001d80 |
children | 696e569ff21b |
comparison
equal
deleted
inserted
replaced
1468:de41a11cabc2 | 1469:11a150e65ee1 |
---|---|
79 | 79 |
80 void splitNotesAt(LayerGeometryProvider *v, sv_frame_t frame); | 80 void splitNotesAt(LayerGeometryProvider *v, sv_frame_t frame); |
81 void snapSelectedNotesToPitchTrack(LayerGeometryProvider *v, Selection s); | 81 void snapSelectedNotesToPitchTrack(LayerGeometryProvider *v, Selection s); |
82 void mergeNotes(LayerGeometryProvider *v, Selection s, bool inclusive); | 82 void mergeNotes(LayerGeometryProvider *v, Selection s, bool inclusive); |
83 | 83 |
84 const Model *getModel() const override { return m_model; } | 84 ModelId getModel() const override { return m_model; } |
85 void setModel(NoteModel *model); | 85 void setModel(ModelId model); // a NoteModel please |
86 | 86 |
87 PropertyList getProperties() const override; | 87 PropertyList getProperties() const override; |
88 QString getPropertyLabel(const PropertyName &) const override; | 88 QString getPropertyLabel(const PropertyName &) const override; |
89 PropertyType getPropertyType(const PropertyName &) const override; | 89 PropertyType getPropertyType(const PropertyName &) const override; |
90 QString getPropertyGroupName(const PropertyName &) const override; | 90 QString getPropertyGroupName(const PropertyName &) const override; |
116 | 116 |
117 bool isLayerScrollable(const LayerGeometryProvider *v) const override; | 117 bool isLayerScrollable(const LayerGeometryProvider *v) const override; |
118 | 118 |
119 bool isLayerEditable() const override { return true; } | 119 bool isLayerEditable() const override { return true; } |
120 | 120 |
121 int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } | 121 int getCompletion(LayerGeometryProvider *) const override; |
122 | 122 |
123 bool getValueExtents(double &min, double &max, | 123 bool getValueExtents(double &min, double &max, |
124 bool &log, QString &unit) const override; | 124 bool &log, QString &unit) const override; |
125 | 125 |
126 bool getDisplayExtents(double &min, double &max) const override; | 126 bool getDisplayExtents(double &min, double &max) const override; |
127 bool setDisplayExtents(double min, double max) override; | 127 bool setDisplayExtents(double min, double max) override; |
128 | 128 |
129 int getVerticalZoomSteps(int &defaultStep) const override; | 129 int getVerticalZoomSteps(int &defaultStep) const override; |
174 EventVector getLocalPoints(LayerGeometryProvider *v, int) const; | 174 EventVector getLocalPoints(LayerGeometryProvider *v, int) const; |
175 | 175 |
176 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, Event &) const; | 176 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, Event &) const; |
177 bool getNoteToEdit(LayerGeometryProvider *v, int x, int y, Event &) const; | 177 bool getNoteToEdit(LayerGeometryProvider *v, int x, int y, Event &) const; |
178 void getRelativeMousePosition(LayerGeometryProvider *v, Event ¬e, int x, int y, bool &closeToLeft, bool &closeToRight, bool &closeToTop, bool &closeToBottom) const; | 178 void getRelativeMousePosition(LayerGeometryProvider *v, Event ¬e, int x, int y, bool &closeToLeft, bool &closeToRight, bool &closeToTop, bool &closeToBottom) const; |
179 SparseTimeValueModel *getAssociatedPitchModel(LayerGeometryProvider *v) const; | 179 ModelId getAssociatedPitchModel(LayerGeometryProvider *v) const; |
180 bool updateNoteValueFromPitchCurve(LayerGeometryProvider *v, Event ¬e) const; | 180 bool updateNoteValueFromPitchCurve(LayerGeometryProvider *v, Event ¬e) const; |
181 void splitNotesAt(LayerGeometryProvider *v, sv_frame_t frame, QMouseEvent *e); | 181 void splitNotesAt(LayerGeometryProvider *v, sv_frame_t frame, QMouseEvent *e); |
182 | 182 |
183 NoteModel *m_model; | 183 ModelId m_model; |
184 bool m_editing; | 184 bool m_editing; |
185 bool m_intelligentActions; | 185 bool m_intelligentActions; |
186 int m_dragPointX; | 186 int m_dragPointX; |
187 int m_dragPointY; | 187 int m_dragPointY; |
188 int m_dragStartX; | 188 int m_dragStartX; |
189 int m_dragStartY; | 189 int m_dragStartY; |
190 Event m_originalPoint; | 190 Event m_originalPoint; |
191 Event m_editingPoint; | 191 Event m_editingPoint; |
192 sv_frame_t m_greatestLeftNeighbourFrame; | 192 sv_frame_t m_greatestLeftNeighbourFrame; |
193 sv_frame_t m_smallestRightNeighbourFrame; | 193 sv_frame_t m_smallestRightNeighbourFrame; |
194 ChangeEventsCommand *m_editingCommand; | 194 ChangeEventsCommand<Model> *m_editingCommand; |
195 VerticalScale m_verticalScale; | 195 VerticalScale m_verticalScale; |
196 EditMode m_editMode; | 196 EditMode m_editMode; |
197 | 197 |
198 typedef std::set<Event> NoteSet; | 198 typedef std::set<Event> NoteSet; |
199 NoteSet m_pendingNoteOns; | 199 NoteSet m_pendingNoteOns; |
201 mutable double m_scaleMinimum; | 201 mutable double m_scaleMinimum; |
202 mutable double m_scaleMaximum; | 202 mutable double m_scaleMaximum; |
203 | 203 |
204 bool shouldAutoAlign() const; | 204 bool shouldAutoAlign() const; |
205 | 205 |
206 void finish(ChangeEventsCommand *command) { | 206 void finish(ChangeEventsCommand<Model> *command) { |
207 Command *c = command->finish(); | 207 Command *c = command->finish(); |
208 if (c) CommandHistory::getInstance()->addCommand(c, false); | 208 if (c) CommandHistory::getInstance()->addCommand(c, false); |
209 } | 209 } |
210 }; | 210 }; |
211 | 211 |