bool useFFT = false;
// Load arguments
- foreach (QString str, args) {
+ foreach (const QString &str, args) {
if (str.startsWith("--profile=")) {
QString s = str;
// Build the audio envelopes for the correlation
- AudioEnvelope *envelopeMain = new AudioEnvelope(&prodMain);
+ AudioEnvelope *envelopeMain = new AudioEnvelope(fileMain.c_str(), &prodMain);
envelopeMain->loadEnvelope();
envelopeMain->loadStdDev();
envelopeMain->dumpInfo();
- AudioEnvelope *envelopeSub = new AudioEnvelope(&prodSub);
+ AudioEnvelope *envelopeSub = new AudioEnvelope(fileSub.c_str(), &prodSub);
envelopeSub->loadEnvelope();
envelopeSub->loadStdDev();
envelopeSub->dumpInfo();
-
-
-
-
-
// Calculate the correlation and hereby the audio shift
AudioCorrelation corr(envelopeMain);
int index = corr.addChild(envelopeSub, useFFT);
int shift = corr.getShift(index);
std::cout << " Should be shifted by " << shift << " frames: " << fileSub << std::endl
<< "\trelative to " << fileMain << std::endl
- << "\tin a " << prodMain.get_fps() << " fps profile (" << profile << ")." << std::endl
- ;
+ << "\tin a " << prodMain.get_fps() << " fps profile (" << profile << ")." << std::endl;
if (saveImages) {
- QString outImg;
- outImg = QString("envelope-main-%1.png")
+ QString outImg = QString::fromLatin1("envelope-main-%1.png")
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh:mm:ss"));
envelopeMain->drawEnvelope().save(outImg);
std::cout << "Saved volume envelope as "
<< QFileInfo(outImg).absoluteFilePath().toStdString()
<< std::endl;
- outImg = QString("envelope-sub-%1.png")
+ outImg = QString::fromLatin1("envelope-sub-%1.png")
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh:mm:ss"));
envelopeSub->drawEnvelope().save(outImg);
std::cout << "Saved volume envelope as "
<< QFileInfo(outImg).absoluteFilePath().toStdString()
<< std::endl;
- outImg = QString("correlation-%1.png")
+ outImg = QString::fromLatin1("correlation-%1.png")
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd-hh:mm:ss"));
corr.info(index)->toImage().save(outImg);
std::cout << "Saved correlation image as "
}
+ // Mlt::Factory::close();
+
+
return 0;
}