Mercurial > hg > tony
changeset 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 | 29869c476572 |
children | 093c1fb2fb31 |
files | .hgsubstate src/Analyser.cpp |
diffstat | 2 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate Tue Mar 31 12:12:31 2015 +0100 +++ b/.hgsubstate Tue Mar 31 12:28:17 2015 +0100 @@ -3,5 +3,5 @@ 1629209f5bf21fc926bb6abd5ab786e78c5d7677 pyin 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds ba789baf642bd57b845d77872bcfce33ae26c96e svapp -0fd3661bcfffc7002c399bd9b7b6c8579f42be3a svcore +9fc8823a73e99aa15796140579f0ab94611f4926 svcore 2564d0865febbedaef98be605aa1db241c34e794 svgui
--- a/src/Analyser.cpp Tue Mar 31 12:12:31 2015 +0100 +++ b/src/Analyser.cpp Tue Mar 31 12:28:17 2015 +0100 @@ -193,7 +193,32 @@ Analyser::layerCompletionChanged() { if (getInitialAnalysisCompletion() == 100) { + emit initialAnalysisCompleted(); + + if (m_layers[Audio]) { + + // Extend pitch-track and note layers so as to nominally + // end at the same time as the audio. This affects any + // time-filling done on export etc. + + sv_frame_t endFrame = m_layers[Audio]->getModel()->getEndFrame(); + + if (m_layers[PitchTrack]) { + SparseTimeValueModel *model = qobject_cast<SparseTimeValueModel *> + (m_layers[PitchTrack]->getModel()); + if (model) { + model->extendEndFrame(endFrame); + } + } + if (m_layers[Notes]) { + NoteModel *model = qobject_cast<NoteModel *> + (m_layers[Notes]->getModel()); + if (model) { + model->extendEndFrame(endFrame); + } + } + } } }