annotate framework/Align.cpp @ 677:4d26b66931f8

Abandon aggregate models on deletion (e.g. when document is replaced during processing)
author Chris Cannam
date Tue, 11 Jun 2019 13:39:50 +0100
parents b375fdbb74bc
children 16c1077da62c
rev   line source
Chris@420 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@420 2
Chris@420 3 /*
Chris@420 4 Sonic Visualiser
Chris@420 5 An audio file viewer and annotation editor.
Chris@420 6 Centre for Digital Music, Queen Mary, University of London.
Chris@420 7
Chris@420 8 This program is free software; you can redistribute it and/or
Chris@420 9 modify it under the terms of the GNU General Public License as
Chris@420 10 published by the Free Software Foundation; either version 2 of the
Chris@420 11 License, or (at your option) any later version. See the file
Chris@420 12 COPYING included with this distribution for more information.
Chris@420 13 */
Chris@420 14
Chris@420 15 #include "Align.h"
Chris@665 16 #include "Document.h"
Chris@420 17
Chris@420 18 #include "data/model/WaveFileModel.h"
Chris@515 19 #include "data/model/ReadOnlyWaveFileModel.h"
Chris@420 20 #include "data/model/AggregateWaveModel.h"
Chris@420 21 #include "data/model/RangeSummarisableTimeValueModel.h"
Chris@420 22 #include "data/model/SparseTimeValueModel.h"
Chris@420 23 #include "data/model/AlignmentModel.h"
Chris@420 24
Chris@420 25 #include "data/fileio/CSVFileReader.h"
Chris@420 26
Chris@420 27 #include "transform/TransformFactory.h"
Chris@420 28 #include "transform/ModelTransformerFactory.h"
Chris@420 29 #include "transform/FeatureExtractionModelTransformer.h"
Chris@420 30
Chris@420 31 #include <QProcess>
Chris@422 32 #include <QSettings>
Chris@430 33 #include <QApplication>
Chris@422 34
Chris@422 35 bool
Chris@670 36 Align::alignModel(Document *doc, Model *ref, Model *other, QString &error)
Chris@422 37 {
Chris@422 38 QSettings settings;
Chris@422 39 settings.beginGroup("Preferences");
Chris@422 40 bool useProgram = settings.value("use-external-alignment", false).toBool();
Chris@422 41 QString program = settings.value("external-alignment-program", "").toString();
Chris@422 42 settings.endGroup();
Chris@422 43
Chris@422 44 if (useProgram && (program != "")) {
Chris@670 45 return alignModelViaProgram(doc, ref, other, program, error);
Chris@422 46 } else {
Chris@670 47 return alignModelViaTransform(doc, ref, other, error);
Chris@422 48 }
Chris@422 49 }
Chris@420 50
Chris@428 51 QString
Chris@428 52 Align::getAlignmentTransformName()
Chris@428 53 {
Chris@428 54 QSettings settings;
Chris@428 55 settings.beginGroup("Alignment");
Chris@428 56 TransformId id =
Chris@428 57 settings.value("transform-id",
Chris@428 58 "vamp:match-vamp-plugin:match:path").toString();
Chris@428 59 settings.endGroup();
Chris@428 60 return id;
Chris@428 61 }
Chris@428 62
Chris@670 63 QString
Chris@670 64 Align::getTuningDifferenceTransformName()
Chris@670 65 {
Chris@670 66 QSettings settings;
Chris@670 67 settings.beginGroup("Alignment");
Chris@670 68 bool performPitchCompensation =
Chris@670 69 settings.value("align-pitch-aware", false).toBool();
Chris@670 70 QString id = "";
Chris@671 71 if (performPitchCompensation) {
Chris@670 72 id = settings.value
Chris@670 73 ("tuning-difference-transform-id",
Chris@670 74 "vamp:tuning-difference:tuning-difference:tuningfreq")
Chris@670 75 .toString();
Chris@671 76 }
Chris@670 77 settings.endGroup();
Chris@670 78 return id;
Chris@670 79 }
Chris@670 80
Chris@428 81 bool
Chris@428 82 Align::canAlign()
Chris@428 83 {
Chris@670 84 TransformFactory *factory = TransformFactory::getInstance();
Chris@428 85 TransformId id = getAlignmentTransformName();
Chris@670 86 TransformId tdId = getTuningDifferenceTransformName();
Chris@670 87 return factory->haveTransform(id) &&
Chris@670 88 (tdId == "" || factory->haveTransform(tdId));
Chris@428 89 }
Chris@428 90
Chris@420 91 bool
Chris@670 92 Align::alignModelViaTransform(Document *doc, Model *ref, Model *other,
Chris@670 93 QString &error)
Chris@420 94 {
Chris@670 95 QMutexLocker locker (&m_mutex);
Chris@670 96
Chris@420 97 RangeSummarisableTimeValueModel *reference = qobject_cast
Chris@420 98 <RangeSummarisableTimeValueModel *>(ref);
Chris@420 99
Chris@420 100 RangeSummarisableTimeValueModel *rm = qobject_cast
Chris@420 101 <RangeSummarisableTimeValueModel *>(other);
Chris@420 102
Chris@420 103 if (!reference || !rm) return false; // but this should have been tested already
Chris@420 104
Chris@670 105 // This involves creating either three or four new models:
Chris@672 106 //
Chris@420 107 // 1. an AggregateWaveModel to provide the mixdowns of the main
Chris@420 108 // model and the new model in its two channels, as input to the
Chris@420 109 // MATCH plugin
Chris@672 110 //
Chris@670 111 // 2a. a SparseTimeValueModel which will be automatically created
Chris@670 112 // by FeatureExtractionModelTransformer when running the
Chris@670 113 // TuningDifference plugin to receive the relative tuning of the
Chris@670 114 // second model (if pitch-aware alignment is enabled in the
Chris@670 115 // preferences)
Chris@672 116 //
Chris@670 117 // 2b. a SparseTimeValueModel which will be automatically created
Chris@670 118 // by FeatureExtractionPluginTransformer when running the MATCH
Chris@670 119 // plugin to perform alignment (so containing the alignment path)
Chris@672 120 //
Chris@420 121 // 3. an AlignmentModel, which stores the path model and carries
Chris@420 122 // out alignment lookups on it.
Chris@672 123 //
Chris@670 124 // The AggregateWaveModel [1] is registered with the document,
Chris@670 125 // which deletes it when it is invalidated (when one of its
Chris@670 126 // components is deleted). The SparseTimeValueModel [2a] is reused
Chris@670 127 // by us when starting the alignment process proper, and is then
Chris@670 128 // deleted by us. The SparseTimeValueModel [2b] is passed to the
Chris@670 129 // AlignmentModel, which takes ownership of it. The AlignmentModel
Chris@670 130 // is attached to the new model we are aligning, which also takes
Chris@670 131 // ownership of it. The only one of these models that we need to
Chris@670 132 // delete here is the SparseTimeValueModel [2a].
Chris@672 133 //
Chris@672 134 // (We also create a sneaky additional SparseTimeValueModel
Chris@672 135 // temporarily so we can attach completion information to it -
Chris@672 136 // this is quite unnecessary from the perspective of simply
Chris@672 137 // producing the results.)
Chris@420 138
Chris@420 139 AggregateWaveModel::ChannelSpecList components;
Chris@420 140
Chris@420 141 components.push_back(AggregateWaveModel::ModelChannelSpec
Chris@420 142 (reference, -1));
Chris@420 143
Chris@420 144 components.push_back(AggregateWaveModel::ModelChannelSpec
Chris@420 145 (rm, -1));
Chris@420 146
Chris@665 147 AggregateWaveModel *aggregateModel = new AggregateWaveModel(components);
Chris@665 148 doc->addAggregateModel(aggregateModel);
Chris@670 149
Chris@670 150 AlignmentModel *alignmentModel =
Chris@670 151 new AlignmentModel(reference, other, nullptr);
Chris@670 152
Chris@670 153 TransformId tdId = getTuningDifferenceTransformName();
Chris@670 154
Chris@670 155 if (tdId == "") {
Chris@670 156
Chris@670 157 if (beginTransformDrivenAlignment(aggregateModel, alignmentModel)) {
Chris@670 158 rm->setAlignment(alignmentModel);
Chris@670 159 } else {
Chris@670 160 error = alignmentModel->getError();
Chris@670 161 delete alignmentModel;
Chris@670 162 return false;
Chris@670 163 }
Chris@670 164
Chris@670 165 } else {
Chris@670 166
Chris@670 167 // Have a tuning-difference transform id, so run it
Chris@670 168 // asynchronously first
Chris@670 169
Chris@670 170 TransformFactory *tf = TransformFactory::getInstance();
Chris@670 171
Chris@670 172 Transform transform = tf->getDefaultTransformFor
Chris@670 173 (tdId, aggregateModel->getSampleRate());
Chris@670 174
Chris@671 175 transform.setParameter("maxduration", 50);
Chris@671 176 transform.setParameter("maxrange", 5);
Chris@671 177
Chris@670 178 SVDEBUG << "Align::alignModel: Tuning difference transform step size " << transform.getStepSize() << ", block size " << transform.getBlockSize() << endl;
Chris@670 179
Chris@670 180 ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance();
Chris@670 181
Chris@670 182 QString message;
Chris@670 183 Model *transformOutput = mtf->transform(transform, aggregateModel, message);
Chris@670 184
Chris@670 185 SparseTimeValueModel *tdout = dynamic_cast<SparseTimeValueModel *>
Chris@670 186 (transformOutput);
Chris@670 187
Chris@670 188 if (!tdout) {
Chris@670 189 SVCERR << "Align::alignModel: ERROR: Failed to create tuning-difference output model (no Tuning Difference plugin?)" << endl;
Chris@670 190 delete tdout;
Chris@670 191 error = message;
Chris@670 192 return false;
Chris@670 193 }
Chris@670 194
Chris@670 195 rm->setAlignment(alignmentModel);
Chris@665 196
Chris@670 197 connect(tdout, SIGNAL(completionChanged()),
Chris@670 198 this, SLOT(tuningDifferenceCompletionChanged()));
Chris@420 199
Chris@671 200 TuningDiffRec rec;
Chris@671 201 rec.input = aggregateModel;
Chris@671 202 rec.alignment = alignmentModel;
Chris@671 203
Chris@677 204 connect(aggregateModel, SIGNAL(aboutToBeDeleted()),
Chris@677 205 this, SLOT(aggregateModelAboutToBeDeleted()));
Chris@677 206
Chris@671 207 // This model exists only so that the AlignmentModel can get a
Chris@671 208 // completion value from somewhere while the tuning difference
Chris@671 209 // calculation is going on
Chris@671 210 rec.preparatory = new SparseTimeValueModel
Chris@671 211 (aggregateModel->getSampleRate(), 1);;
Chris@671 212 rec.preparatory->setCompletion(0);
Chris@671 213 alignmentModel->setPathFrom(rec.preparatory);
Chris@671 214
Chris@671 215 m_pendingTuningDiffs[tdout] = rec;
Chris@670 216 }
Chris@670 217
Chris@670 218 return true;
Chris@670 219 }
Chris@670 220
Chris@671 221 void
Chris@677 222 Align::aggregateModelAboutToBeDeleted()
Chris@677 223 {
Chris@677 224 SVCERR << "Align::aggregateModelAboutToBeDeleted" << endl;
Chris@677 225
Chris@677 226 QObject *s = sender();
Chris@677 227 AggregateWaveModel *awm = qobject_cast<AggregateWaveModel *>(s);
Chris@677 228 if (!awm) return;
Chris@677 229 QMutexLocker locker(&m_mutex);
Chris@677 230
Chris@677 231 SVCERR << "Align::aggregateModelAboutToBeDeleted: awm = " << awm
Chris@677 232 << endl;
Chris@677 233
Chris@677 234 for (const auto &p : m_pendingTuningDiffs) {
Chris@677 235 if (p.second.input == awm) {
Chris@677 236 SVCERR << "we have a record of this, getting rid of it" << endl;
Chris@677 237 m_pendingTuningDiffs.erase(p.first);
Chris@677 238 return;
Chris@677 239 }
Chris@677 240 }
Chris@677 241 }
Chris@677 242
Chris@677 243 void
Chris@671 244 Align::tuningDifferenceCompletionChanged()
Chris@671 245 {
Chris@671 246 QMutexLocker locker (&m_mutex);
Chris@671 247
Chris@671 248 SparseTimeValueModel *td = qobject_cast<SparseTimeValueModel *>(sender());
Chris@671 249 if (!td) return;
Chris@671 250
Chris@671 251 if (m_pendingTuningDiffs.find(td) == m_pendingTuningDiffs.end()) {
Chris@671 252 SVCERR << "ERROR: Align::tuningDifferenceCompletionChanged: Model "
Chris@671 253 << td << " not found in pending tuning diff map!" << endl;
Chris@671 254 return;
Chris@671 255 }
Chris@671 256
Chris@671 257 TuningDiffRec rec = m_pendingTuningDiffs[td];
Chris@671 258
Chris@671 259 int completion = 0;
Chris@671 260 bool done = td->isReady(&completion);
Chris@671 261
Chris@674 262 // SVCERR << "Align::tuningDifferenceCompletionChanged: done = " << done << ", completion = " << completion << endl;
Chris@671 263
Chris@671 264 if (!done) {
Chris@671 265 // This will be the completion the alignment model reports,
Chris@671 266 // before the alignment actually begins. It goes up from 0 to
Chris@671 267 // 99 (not 100!) and then back to 0 again when we start
Chris@671 268 // calculating the actual path in the following phase
Chris@671 269 int clamped = (completion == 100 ? 99 : completion);
Chris@674 270 // SVCERR << "Align::tuningDifferenceCompletionChanged: setting rec.preparatory completion to " << clamped << endl;
Chris@671 271 rec.preparatory->setCompletion(clamped);
Chris@671 272 return;
Chris@671 273 }
Chris@671 274
Chris@671 275 float tuningFrequency = 440.f;
Chris@671 276
Chris@671 277 if (!td->isEmpty()) {
Chris@671 278 tuningFrequency = td->getAllEvents()[0].getValue();
Chris@671 279 SVCERR << "Align::tuningDifferenceCompletionChanged: Reported tuning frequency = " << tuningFrequency << endl;
Chris@671 280 } else {
Chris@671 281 SVCERR << "Align::tuningDifferenceCompletionChanged: No tuning frequency reported" << endl;
Chris@671 282 }
Chris@671 283
Chris@671 284 m_pendingTuningDiffs.erase(td);
Chris@671 285 td->aboutToDelete();
Chris@671 286 delete td;
Chris@671 287
Chris@671 288 rec.alignment->setPathFrom(nullptr);
Chris@671 289
Chris@671 290 beginTransformDrivenAlignment
Chris@671 291 (rec.input, rec.alignment, tuningFrequency);
Chris@671 292 }
Chris@671 293
Chris@670 294 bool
Chris@670 295 Align::beginTransformDrivenAlignment(AggregateWaveModel *aggregateModel,
Chris@670 296 AlignmentModel *alignmentModel,
Chris@670 297 float tuningFrequency)
Chris@670 298 {
Chris@428 299 TransformId id = getAlignmentTransformName();
Chris@420 300
Chris@420 301 TransformFactory *tf = TransformFactory::getInstance();
Chris@420 302
Chris@420 303 Transform transform = tf->getDefaultTransformFor
Chris@420 304 (id, aggregateModel->getSampleRate());
Chris@420 305
Chris@420 306 transform.setStepSize(transform.getBlockSize()/2);
Chris@420 307 transform.setParameter("serialise", 1);
Chris@420 308 transform.setParameter("smooth", 0);
Chris@420 309
Chris@670 310 if (tuningFrequency != 0.f) {
Chris@670 311 transform.setParameter("freq2", tuningFrequency);
Chris@670 312 }
Chris@670 313
Chris@420 314 SVDEBUG << "Align::alignModel: Alignment transform step size " << transform.getStepSize() << ", block size " << transform.getBlockSize() << endl;
Chris@420 315
Chris@420 316 ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance();
Chris@420 317
Chris@420 318 QString message;
Chris@670 319 Model *transformOutput = mtf->transform
Chris@670 320 (transform, aggregateModel, message);
Chris@420 321
Chris@420 322 if (!transformOutput) {
Chris@420 323 transform.setStepSize(0);
Chris@670 324 transformOutput = mtf->transform
Chris@670 325 (transform, aggregateModel, message);
Chris@420 326 }
Chris@420 327
Chris@420 328 SparseTimeValueModel *path = dynamic_cast<SparseTimeValueModel *>
Chris@420 329 (transformOutput);
Chris@420 330
Chris@670 331 //!!! callers will need to be updated to get error from
Chris@670 332 //!!! alignment model after initial call
Chris@670 333
Chris@420 334 if (!path) {
Chris@649 335 SVCERR << "Align::alignModel: ERROR: Failed to create alignment path (no MATCH plugin?)" << endl;
Chris@420 336 delete transformOutput;
Chris@670 337 alignmentModel->setError(message);
Chris@420 338 return false;
Chris@420 339 }
Chris@420 340
Chris@420 341 path->setCompletion(0);
Chris@670 342 alignmentModel->setPathFrom(path);
Chris@420 343
Chris@428 344 connect(alignmentModel, SIGNAL(completionChanged()),
Chris@428 345 this, SLOT(alignmentCompletionChanged()));
Chris@420 346
Chris@420 347 return true;
Chris@420 348 }
Chris@420 349
Chris@428 350 void
Chris@428 351 Align::alignmentCompletionChanged()
Chris@428 352 {
Chris@670 353 QMutexLocker locker (&m_mutex);
Chris@670 354
Chris@428 355 AlignmentModel *am = qobject_cast<AlignmentModel *>(sender());
Chris@428 356 if (!am) return;
Chris@428 357 if (am->isReady()) {
Chris@428 358 disconnect(am, SIGNAL(completionChanged()),
Chris@428 359 this, SLOT(alignmentCompletionChanged()));
Chris@428 360 emit alignmentComplete(am);
Chris@428 361 }
Chris@428 362 }
Chris@428 363
Chris@420 364 bool
Chris@670 365 Align::alignModelViaProgram(Document *, Model *ref, Model *other,
Chris@670 366 QString program, QString &error)
Chris@420 367 {
Chris@670 368 QMutexLocker locker (&m_mutex);
Chris@670 369
Chris@420 370 WaveFileModel *reference = qobject_cast<WaveFileModel *>(ref);
Chris@420 371 WaveFileModel *rm = qobject_cast<WaveFileModel *>(other);
Chris@420 372
Chris@515 373 if (!reference || !rm) {
Chris@515 374 return false; // but this should have been tested already
Chris@515 375 }
Chris@420 376
Chris@636 377 while (!reference->isReady(nullptr) || !rm->isReady(nullptr)) {
Chris@430 378 qApp->processEvents();
Chris@430 379 }
Chris@430 380
Chris@420 381 // Run an external program, passing to it paths to the main
Chris@420 382 // model's audio file and the new model's audio file. It returns
Chris@420 383 // the path in CSV form through stdout.
Chris@420 384
Chris@515 385 ReadOnlyWaveFileModel *roref = qobject_cast<ReadOnlyWaveFileModel *>(reference);
Chris@515 386 ReadOnlyWaveFileModel *rorm = qobject_cast<ReadOnlyWaveFileModel *>(rm);
Chris@515 387 if (!roref || !rorm) {
Chris@649 388 SVCERR << "ERROR: Align::alignModelViaProgram: Can't align non-read-only models via program (no local filename available)" << endl;
Chris@515 389 return false;
Chris@515 390 }
Chris@515 391
Chris@515 392 QString refPath = roref->getLocalFilename();
Chris@515 393 QString otherPath = rorm->getLocalFilename();
Chris@420 394
Chris@420 395 if (refPath == "" || otherPath == "") {
Chris@670 396 error = "Failed to find local filepath for wave-file model";
Chris@595 397 return false;
Chris@420 398 }
Chris@420 399
Chris@665 400 AlignmentModel *alignmentModel =
Chris@665 401 new AlignmentModel(reference, other, nullptr);
Chris@423 402 rm->setAlignment(alignmentModel);
Chris@423 403
Chris@423 404 QProcess *process = new QProcess;
Chris@420 405 QStringList args;
Chris@420 406 args << refPath << otherPath;
Chris@423 407
Chris@423 408 connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
Chris@423 409 this, SLOT(alignmentProgramFinished(int, QProcess::ExitStatus)));
Chris@420 410
Chris@670 411 m_pendingProcesses[process] = alignmentModel;
Chris@423 412 process->start(program, args);
Chris@420 413
Chris@423 414 bool success = process->waitForStarted();
Chris@423 415
Chris@423 416 if (!success) {
Chris@649 417 SVCERR << "ERROR: Align::alignModelViaProgram: Program did not start"
Chris@649 418 << endl;
Chris@670 419 error = "Alignment program could not be started";
Chris@670 420 m_pendingProcesses.erase(process);
Chris@636 421 rm->setAlignment(nullptr); // deletes alignmentModel as well
Chris@423 422 delete process;
Chris@423 423 }
Chris@423 424
Chris@423 425 return success;
Chris@423 426 }
Chris@423 427
Chris@423 428 void
Chris@423 429 Align::alignmentProgramFinished(int exitCode, QProcess::ExitStatus status)
Chris@423 430 {
Chris@670 431 QMutexLocker locker (&m_mutex);
Chris@670 432
Chris@649 433 SVCERR << "Align::alignmentProgramFinished" << endl;
Chris@423 434
Chris@423 435 QProcess *process = qobject_cast<QProcess *>(sender());
Chris@423 436
Chris@670 437 if (m_pendingProcesses.find(process) == m_pendingProcesses.end()) {
Chris@649 438 SVCERR << "ERROR: Align::alignmentProgramFinished: Process " << process
Chris@649 439 << " not found in process model map!" << endl;
Chris@423 440 return;
Chris@423 441 }
Chris@423 442
Chris@670 443 AlignmentModel *alignmentModel = m_pendingProcesses[process];
Chris@423 444
Chris@423 445 if (exitCode == 0 && status == 0) {
Chris@420 446
Chris@595 447 CSVFormat format;
Chris@595 448 format.setModelType(CSVFormat::TwoDimensionalModel);
Chris@595 449 format.setTimingType(CSVFormat::ExplicitTiming);
Chris@595 450 format.setTimeUnits(CSVFormat::TimeSeconds);
Chris@595 451 format.setColumnCount(2);
Chris@425 452 // The output format has time in the reference file first, and
Chris@425 453 // time in the "other" file in the second column. This is a
Chris@425 454 // more natural approach for a command-line alignment tool,
Chris@425 455 // but it's the opposite of what we expect for native
Chris@425 456 // alignment paths, which map from "other" file to
Chris@425 457 // reference. These column purpose settings reflect that.
Chris@595 458 format.setColumnPurpose(1, CSVFormat::ColumnStartTime);
Chris@595 459 format.setColumnPurpose(0, CSVFormat::ColumnValue);
Chris@595 460 format.setAllowQuoting(false);
Chris@595 461 format.setSeparator(',');
Chris@420 462
Chris@595 463 CSVFileReader reader(process, format, alignmentModel->getSampleRate());
Chris@595 464 if (!reader.isOK()) {
Chris@649 465 SVCERR << "ERROR: Align::alignmentProgramFinished: Failed to parse output"
Chris@649 466 << endl;
Chris@670 467 alignmentModel->setError
Chris@670 468 (QString("Failed to parse output of program: %1")
Chris@670 469 .arg(reader.getError()));
Chris@423 470 goto done;
Chris@595 471 }
Chris@420 472
Chris@595 473 Model *csvOutput = reader.load();
Chris@420 474
Chris@595 475 SparseTimeValueModel *path = qobject_cast<SparseTimeValueModel *>(csvOutput);
Chris@595 476 if (!path) {
Chris@649 477 SVCERR << "ERROR: Align::alignmentProgramFinished: Output did not convert to sparse time-value model"
Chris@649 478 << endl;
Chris@670 479 alignmentModel->setError
Chris@670 480 ("Output of program did not produce sparse time-value model");
Chris@423 481 goto done;
Chris@595 482 }
Chris@420 483
Chris@649 484 if (path->isEmpty()) {
Chris@649 485 SVCERR << "ERROR: Align::alignmentProgramFinished: Output contained no mappings"
Chris@649 486 << endl;
Chris@670 487 alignmentModel->setError
Chris@670 488 ("Output of alignment program contained no mappings");
Chris@423 489 goto done;
Chris@595 490 }
Chris@420 491
Chris@649 492 SVCERR << "Align::alignmentProgramFinished: Setting alignment path ("
Chris@650 493 << path->getEventCount() << " point(s))" << endl;
Chris@650 494
Chris@423 495 alignmentModel->setPathFrom(path);
Chris@420 496
Chris@428 497 emit alignmentComplete(alignmentModel);
Chris@428 498
Chris@420 499 } else {
Chris@649 500 SVCERR << "ERROR: Align::alignmentProgramFinished: Aligner program "
Chris@649 501 << "failed: exit code " << exitCode << ", status " << status
Chris@649 502 << endl;
Chris@670 503 alignmentModel->setError
Chris@670 504 ("Aligner process returned non-zero exit status");
Chris@420 505 }
Chris@420 506
Chris@423 507 done:
Chris@670 508 m_pendingProcesses.erase(process);
Chris@423 509 delete process;
Chris@420 510 }
Chris@420 511