comparison layer/NoteLayer.h @ 507:efe0f232685f

* Make it possible to record live MIDI to a note layer. Now we're a proper MIDI sequencer. Ha, ha.
author Chris Cannam
date Wed, 25 Feb 2009 12:02:53 +0000
parents 681542f0c8c5
children d666f5f8b154
comparison
equal deleted inserted replaced
506:33572f3ad62b 507:efe0f232685f
100 virtual int getVerticalZoomSteps(int &defaultStep) const; 100 virtual int getVerticalZoomSteps(int &defaultStep) const;
101 virtual int getCurrentVerticalZoomStep() const; 101 virtual int getCurrentVerticalZoomStep() const;
102 virtual void setVerticalZoomStep(int); 102 virtual void setVerticalZoomStep(int);
103 virtual RangeMapper *getNewVerticalZoomRangeMapper() const; 103 virtual RangeMapper *getNewVerticalZoomRangeMapper() const;
104 104
105 /**
106 * Add a note-on. Used when recording MIDI "live". The note will
107 * not be finally added to the layer until the corresponding
108 * note-off.
109 */
110 void addNoteOn(long frame, int pitch, int velocity);
111
112 /**
113 * Add a note-off. This will cause a note to appear, if and only
114 * if there is a matching pending note-on.
115 */
116 void addNoteOff(long frame, int pitch);
117
118 /**
119 * Abandon all pending note-on events.
120 */
121 void abandonNoteOns();
122
105 virtual void toXml(QTextStream &stream, QString indent = "", 123 virtual void toXml(QTextStream &stream, QString indent = "",
106 QString extraAttributes = "") const; 124 QString extraAttributes = "") const;
107 125
108 void setProperties(const QXmlAttributes &attributes); 126 void setProperties(const QXmlAttributes &attributes);
109 127
122 NoteModel::Point m_originalPoint; 140 NoteModel::Point m_originalPoint;
123 NoteModel::Point m_editingPoint; 141 NoteModel::Point m_editingPoint;
124 NoteModel::EditCommand *m_editingCommand; 142 NoteModel::EditCommand *m_editingCommand;
125 VerticalScale m_verticalScale; 143 VerticalScale m_verticalScale;
126 144
145 typedef std::set<NoteModel::Point, NoteModel::Point::Comparator> NoteSet;
146 NoteSet m_pendingNoteOns;
147
127 mutable float m_scaleMinimum; 148 mutable float m_scaleMinimum;
128 mutable float m_scaleMaximum; 149 mutable float m_scaleMaximum;
129 150
130 bool shouldAutoAlign() const; 151 bool shouldAutoAlign() const;
131 152