Mercurial > hg > svapp
diff align/TransformAligner.cpp @ 753:31289e8592c7 pitch-align
Switch to using the pulled-out TransformAligner and ExternalProgramAligner
author | Chris Cannam |
---|---|
date | Fri, 24 Apr 2020 14:38:22 +0100 |
parents | 32654e402f8b |
children | 6429a164b7e1 |
line wrap: on
line diff
--- a/align/TransformAligner.cpp Thu Apr 23 17:11:26 2020 +0100 +++ b/align/TransformAligner.cpp Fri Apr 24 14:38:22 2020 +0100 @@ -189,12 +189,12 @@ ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance(); QString message; - ModelId tuningDiffOutputModelId = mtf->transform(transform, - m_aggregateModel, - message); + m_tuningDiffOutputModel = mtf->transform(transform, + m_aggregateModel, + message); auto tuningDiffOutputModel = - ModelById::getAs<SparseTimeValueModel>(tuningDiffOutputModelId); + ModelById::getAs<SparseTimeValueModel>(m_tuningDiffOutputModel); if (!tuningDiffOutputModel) { SVCERR << "Align::alignModel: ERROR: Failed to create tuning-difference output model (no Tuning Difference plugin?)" << endl; error = message; @@ -227,8 +227,9 @@ { if (tuningDiffOutputModelId != m_tuningDiffOutputModel) { SVCERR << "WARNING: TransformAligner::tuningDifferenceCompletionChanged: Model " - << tuningDiffOutputModelId - << " is not ours!" << endl; + << tuningDiffOutputModelId + << " is not ours! (ours is " + << m_tuningDiffOutputModel << ")" << endl; return; } @@ -289,6 +290,9 @@ { TransformId id = getAlignmentTransformName(); + SVDEBUG << "TransformAligner::beginAlignmentPhase: transform is " + << id << endl; + TransformFactory *tf = TransformFactory::getInstance(); auto aggregateModel = @@ -327,24 +331,24 @@ alignmentModel->setRelativePitch(cents); - SVDEBUG << "Align::alignModel: Alignment transform step size " + SVDEBUG << "TransformAligner: Alignment transform step size " << transform.getStepSize() << ", block size " << transform.getBlockSize() << endl; ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance(); QString message; - ModelId pathOutputModelId = mtf->transform + m_pathOutputModel = mtf->transform (transform, m_aggregateModel, message); - if (pathOutputModelId.isNone()) { + if (m_pathOutputModel.isNone()) { transform.setStepSize(0); - pathOutputModelId = mtf->transform + m_pathOutputModel = mtf->transform (transform, m_aggregateModel, message); } auto pathOutputModel = - ModelById::getAs<SparseTimeValueModel>(pathOutputModelId); + ModelById::getAs<SparseTimeValueModel>(m_pathOutputModel); //!!! callers will need to be updated to get error from //!!! alignment model after initial call @@ -369,8 +373,9 @@ { if (alignmentModelId != m_alignmentModel) { SVCERR << "WARNING: TransformAligner::alignmentCompletionChanged: Model " - << alignmentModelId - << " is not ours!" << endl; + << alignmentModelId + << " is not ours! (ours is " + << m_alignmentModel << ")" << endl; return; }