Mercurial > hg > svgui
comparison layer/FlexiNoteLayer.h @ 651:76c5dfe333ee tonioni
introduced horizongal note editing constraints; debugged note edit
author | matthiasm |
---|---|
date | Mon, 17 Jun 2013 18:00:24 +0100 |
parents | 2ad082c5a090 |
children | c572a0705223 |
comparison
equal
deleted
inserted
replaced
649:2ad082c5a090 | 651:76c5dfe333ee |
---|---|
14 */ | 14 */ |
15 | 15 |
16 #ifndef _FLEXINOTE_LAYER_H_ | 16 #ifndef _FLEXINOTE_LAYER_H_ |
17 #define _FLEXINOTE_LAYER_H_ | 17 #define _FLEXINOTE_LAYER_H_ |
18 | 18 |
19 #define NOTE_HEIGHT 8 | 19 #define NOTE_HEIGHT 16 |
20 | 20 |
21 #include "SingleColourLayer.h" | 21 #include "SingleColourLayer.h" |
22 #include "data/model/FlexiNoteModel.h" | 22 #include "data/model/FlexiNoteModel.h" |
23 | 23 |
24 #include <QObject> | 24 #include <QObject> |
89 MIDIRangeScale | 89 MIDIRangeScale |
90 }; | 90 }; |
91 | 91 |
92 //GF: Tonioni: context sensitive note edit actions (denoted clockwise from top). | 92 //GF: Tonioni: context sensitive note edit actions (denoted clockwise from top). |
93 enum EditMode { | 93 enum EditMode { |
94 dragNote, | 94 DragNote, |
95 rightBoundary, | 95 RightBoundary, |
96 splitNote, | 96 SplitNote, |
97 leftBoundary | 97 LeftBoundary |
98 }; | 98 }; |
99 | 99 |
100 void setVerticalScale(VerticalScale scale); | 100 void setVerticalScale(VerticalScale scale); |
101 VerticalScale getVerticalScale() const { return m_verticalScale; } | 101 VerticalScale getVerticalScale() const { return m_verticalScale; } |
102 | 102 |
139 | 139 |
140 virtual void toXml(QTextStream &stream, QString indent = "", | 140 virtual void toXml(QTextStream &stream, QString indent = "", |
141 QString extraAttributes = "") const; | 141 QString extraAttributes = "") const; |
142 | 142 |
143 void setProperties(const QXmlAttributes &attributes); | 143 void setProperties(const QXmlAttributes &attributes); |
144 | |
145 void setVerticalRangeToNoteRange(); | |
144 | 146 |
145 protected: | 147 protected: |
146 void getScaleExtents(View *, float &min, float &max, bool &log) const; | 148 void getScaleExtents(View *, float &min, float &max, bool &log) const; |
147 int getYForValue(View *v, float value) const; | 149 int getYForValue(View *v, float value) const; |
148 float getValueForY(View *v, int y) const; | 150 float getValueForY(View *v, int y) const; |
162 int m_dragPointY; | 164 int m_dragPointY; |
163 int m_dragStartX; | 165 int m_dragStartX; |
164 int m_dragStartY; | 166 int m_dragStartY; |
165 FlexiNoteModel::Point m_originalPoint; | 167 FlexiNoteModel::Point m_originalPoint; |
166 FlexiNoteModel::Point m_editingPoint; | 168 FlexiNoteModel::Point m_editingPoint; |
169 long m_greatestLeftNeighbourFrame; | |
170 long m_smallestRightNeighbourFrame; | |
167 FlexiNoteModel::EditCommand *m_editingCommand; | 171 FlexiNoteModel::EditCommand *m_editingCommand; |
168 VerticalScale m_verticalScale; | 172 VerticalScale m_verticalScale; |
169 EditMode m_editMode; | 173 EditMode m_editMode; |
170 | 174 |
171 typedef std::set<FlexiNoteModel::Point, FlexiNoteModel::Point::Comparator> FlexiNoteSet; | 175 typedef std::set<FlexiNoteModel::Point, FlexiNoteModel::Point::Comparator> FlexiNoteSet; |