comparison layer/FlexiNoteLayer.h @ 620:fde7e2fae256 tonioni

updated names in FlexiNote source -- will need to make new FlexiNoteModel source
author matthiasm
date Tue, 26 Mar 2013 14:15:42 +0000
parents aa141d619142
children 5c9dcec5f3e9
comparison
equal deleted inserted replaced
619:aa141d619142 620:fde7e2fae256
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _NOTE_LAYER_H_ 16 #ifndef _FLEXINOTE_LAYER_H_
17 #define _NOTE_LAYER_H_ 17 #define _FLEXINOTE_LAYER_H_
18 18
19 #include "SingleColourLayer.h" 19 #include "SingleColourLayer.h"
20 #include "data/model/NoteModel.h" 20 #include "data/model/FlexiNoteModel.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 SingleColourLayer 28 class FlexiNoteLayer : public SingleColourLayer
29 { 29 {
30 Q_OBJECT 30 Q_OBJECT
31 31
32 public: 32 public:
33 NoteLayer(); 33 FlexiNoteLayer();
34 34
35 virtual void paint(View *v, QPainter &paint, QRect rect) const; 35 virtual void paint(View *v, QPainter &paint, QRect rect) const;
36 36
37 virtual QString getFeatureDescription(View *v, QPoint &) const; 37 virtual QString getFeatureDescription(View *v, QPoint &) const;
38 38
61 virtual void copy(View *v, Selection s, Clipboard &to); 61 virtual void copy(View *v, Selection s, Clipboard &to);
62 virtual bool paste(View *v, const Clipboard &from, int frameOffset, 62 virtual bool paste(View *v, const Clipboard &from, int frameOffset,
63 bool interactive); 63 bool interactive);
64 64
65 virtual const Model *getModel() const { return m_model; } 65 virtual const Model *getModel() const { return m_model; }
66 void setModel(NoteModel *model); 66 void setModel(FlexiNoteModel *model);
67 67
68 virtual PropertyList getProperties() const; 68 virtual PropertyList getProperties() const;
69 virtual QString getPropertyLabel(const PropertyName &) const; 69 virtual QString getPropertyLabel(const PropertyName &) const;
70 virtual PropertyType getPropertyType(const PropertyName &) const; 70 virtual PropertyType getPropertyType(const PropertyName &) const;
71 virtual QString getPropertyGroupName(const PropertyName &) const; 71 virtual QString getPropertyGroupName(const PropertyName &) const;
133 float getValueForY(View *v, int y) const; 133 float getValueForY(View *v, int y) const;
134 bool shouldConvertMIDIToHz() const; 134 bool shouldConvertMIDIToHz() const;
135 135
136 virtual int getDefaultColourHint(bool dark, bool &impose); 136 virtual int getDefaultColourHint(bool dark, bool &impose);
137 137
138 NoteModel::PointList getLocalPoints(View *v, int) const; 138 FlexiNoteModel::PointList getLocalPoints(View *v, int) const;
139 139
140 bool getPointToDrag(View *v, int x, int y, NoteModel::Point &) const; 140 bool getPointToDrag(View *v, int x, int y, FlexiNoteModel::Point &) const;
141 141
142 NoteModel *m_model; 142 FlexiNoteModel *m_model;
143 bool m_editing; 143 bool m_editing;
144 int m_dragPointX; 144 int m_dragPointX;
145 int m_dragPointY; 145 int m_dragPointY;
146 int m_dragStartX; 146 int m_dragStartX;
147 int m_dragStartY; 147 int m_dragStartY;
148 NoteModel::Point m_originalPoint; 148 FlexiNoteModel::Point m_originalPoint;
149 NoteModel::Point m_editingPoint; 149 FlexiNoteModel::Point m_editingPoint;
150 NoteModel::EditCommand *m_editingCommand; 150 FlexiNoteModel::EditCommand *m_editingCommand;
151 VerticalScale m_verticalScale; 151 VerticalScale m_verticalScale;
152 152
153 typedef std::set<NoteModel::Point, NoteModel::Point::Comparator> NoteSet; 153 typedef std::set<FlexiNoteModel::Point, FlexiNoteModel::Point::Comparator> FlexiNoteSet;
154 NoteSet m_pendingNoteOns; 154 FlexiNoteSet m_pendingNoteOns;
155 155
156 mutable float m_scaleMinimum; 156 mutable float m_scaleMinimum;
157 mutable float m_scaleMaximum; 157 mutable float m_scaleMaximum;
158 158
159 bool shouldAutoAlign() const; 159 bool shouldAutoAlign() const;
160 160
161 void finish(NoteModel::EditCommand *command) { 161 void finish(FlexiNoteModel::EditCommand *command) {
162 Command *c = command->finish(); 162 Command *c = command->finish();
163 if (c) CommandHistory::getInstance()->addCommand(c, false); 163 if (c) CommandHistory::getInstance()->addCommand(c, false);
164 } 164 }
165 }; 165 };
166 166