| 205 | |
| 206 | |
| 207 | Note * Pattern::addNote( const Note & _new_note, const bool _quant_pos ) |
| 208 | { |
| 209 | Note * new_note = new Note( _new_note ); |
| 210 | if( _quant_pos && gui->pianoRoll() ) |
| 211 | { |
| 212 | new_note->quantizePos( gui->pianoRoll()->quantization() ); |
| 213 | } |
| 214 | |
| 215 | instrumentTrack()->lock(); |
| 216 | m_notes.insert(std::upper_bound(m_notes.begin(), m_notes.end(), new_note, Note::lessThan), new_note); |
| 217 | instrumentTrack()->unlock(); |
| 218 | |
| 219 | checkType(); |
| 220 | updateLength(); |
| 221 | |
| 222 | emit dataChanged(); |
| 223 | |
| 224 | return new_note; |
| 225 | } |
| 226 | |
| 227 | |
| 228 | |