comparison src/Analyser.cpp @ 432:6e8e85edfd48

Extend models to have nominal end time matching that of the audio, so that the export-fill option continues to fill to end of audio time
author Chris Cannam
date Tue, 31 Mar 2015 12:28:17 +0100
parents 2bbec2dfe9f6
children 093c1fb2fb31
comparison
equal deleted inserted replaced
431:29869c476572 432:6e8e85edfd48
191 191
192 void 192 void
193 Analyser::layerCompletionChanged() 193 Analyser::layerCompletionChanged()
194 { 194 {
195 if (getInitialAnalysisCompletion() == 100) { 195 if (getInitialAnalysisCompletion() == 100) {
196
196 emit initialAnalysisCompleted(); 197 emit initialAnalysisCompleted();
198
199 if (m_layers[Audio]) {
200
201 // Extend pitch-track and note layers so as to nominally
202 // end at the same time as the audio. This affects any
203 // time-filling done on export etc.
204
205 sv_frame_t endFrame = m_layers[Audio]->getModel()->getEndFrame();
206
207 if (m_layers[PitchTrack]) {
208 SparseTimeValueModel *model = qobject_cast<SparseTimeValueModel *>
209 (m_layers[PitchTrack]->getModel());
210 if (model) {
211 model->extendEndFrame(endFrame);
212 }
213 }
214 if (m_layers[Notes]) {
215 NoteModel *model = qobject_cast<NoteModel *>
216 (m_layers[Notes]->getModel());
217 if (model) {
218 model->extendEndFrame(endFrame);
219 }
220 }
221 }
197 } 222 }
198 } 223 }
199 224
200 QString 225 QString
201 Analyser::addVisualisations() 226 Analyser::addVisualisations()