comparison framework/Align.cpp @ 430:adfb2948fabf alignment_view

Wait for source files to be ready
author Chris Cannam
date Fri, 28 Nov 2014 10:33:25 +0000
parents b23db4cef02f
children 51befd6165a3
comparison
equal deleted inserted replaced
429:a9141963b580 430:adfb2948fabf
27 #include "transform/ModelTransformerFactory.h" 27 #include "transform/ModelTransformerFactory.h"
28 #include "transform/FeatureExtractionModelTransformer.h" 28 #include "transform/FeatureExtractionModelTransformer.h"
29 29
30 #include <QProcess> 30 #include <QProcess>
31 #include <QSettings> 31 #include <QSettings>
32 #include <QApplication>
32 33
33 bool 34 bool
34 Align::alignModel(Model *ref, Model *other) 35 Align::alignModel(Model *ref, Model *other)
35 { 36 {
36 QSettings settings; 37 QSettings settings;
172 WaveFileModel *reference = qobject_cast<WaveFileModel *>(ref); 173 WaveFileModel *reference = qobject_cast<WaveFileModel *>(ref);
173 WaveFileModel *rm = qobject_cast<WaveFileModel *>(other); 174 WaveFileModel *rm = qobject_cast<WaveFileModel *>(other);
174 175
175 if (!rm) return false; // but this should have been tested already 176 if (!rm) return false; // but this should have been tested already
176 177
178 while (!reference->isReady(0) || !rm->isReady(0)) {
179 qApp->processEvents();
180 }
181
177 // Run an external program, passing to it paths to the main 182 // Run an external program, passing to it paths to the main
178 // model's audio file and the new model's audio file. It returns 183 // model's audio file and the new model's audio file. It returns
179 // the path in CSV form through stdout. 184 // the path in CSV form through stdout.
180 185
181 QString refPath = reference->getLocalFilename(); 186 QString refPath = reference->getLocalFilename();