comparison data/model/Model.cpp @ 340:516819f2b97b

* Add Erase tool and mode * Add icons for Normalize buttons in property boxes, and for Show Peaks * Add support for velocity in notes -- not yet reflected in display or editable in the note edit dialog, but they are imported from MIDI, played, and exported * Begin work on making pastes align pasted times (subtler than I thought)
author Chris Cannam
date Fri, 23 Nov 2007 16:48:23 +0000
parents 1afaf98dbf11
children 700cd3350391
comparison
equal deleted inserted replaced
339:ba30f4a3e3be 340:516819f2b97b
111 if (!m_alignment) { 111 if (!m_alignment) {
112 if (m_sourceModel) return m_sourceModel->alignToReference(frame); 112 if (m_sourceModel) return m_sourceModel->alignToReference(frame);
113 else return frame; 113 else return frame;
114 } 114 }
115 size_t refFrame = m_alignment->toReference(frame); 115 size_t refFrame = m_alignment->toReference(frame);
116 //!!! this should be totally wrong, but because alignToReference and 116 const Model *m = m_alignment->getReferenceModel();
117 // alignFromReference are the wrong way around, it's right... *sigh* 117 if (m && refFrame > m->getEndFrame()) refFrame = m->getEndFrame();
118 if (refFrame > getEndFrame()) refFrame = getEndFrame();
119 return refFrame; 118 return refFrame;
120 } 119 }
121 120
122 size_t 121 size_t
123 Model::alignFromReference(size_t refFrame) const 122 Model::alignFromReference(size_t refFrame) const
125 if (!m_alignment) { 124 if (!m_alignment) {
126 if (m_sourceModel) return m_sourceModel->alignFromReference(refFrame); 125 if (m_sourceModel) return m_sourceModel->alignFromReference(refFrame);
127 else return refFrame; 126 else return refFrame;
128 } 127 }
129 size_t frame = m_alignment->fromReference(refFrame); 128 size_t frame = m_alignment->fromReference(refFrame);
129 if (frame > getEndFrame()) frame = getEndFrame();
130 return frame; 130 return frame;
131 } 131 }
132 132
133 int 133 int
134 Model::getAlignmentCompletion() const 134 Model::getAlignmentCompletion() const