X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=testingArea%2FaudioOffset.cpp;h=f71b105231abff9bf53893809ab33cd9e3d836c2;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=af248b3ed59fa271ea7dd4ec33cfd44f13e05fa6;hpb=ce68de86827a11cd0dc96465fba021b2f7ceea55;p=kdenlive diff --git a/testingArea/audioOffset.cpp b/testingArea/audioOffset.cpp index af248b3e..f71b1052 100644 --- a/testingArea/audioOffset.cpp +++ b/testingArea/audioOffset.cpp @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) bool useFFT = false; // Load arguments - foreach (QString str, args) { + foreach (const QString &str, args) { if (str.startsWith("--profile=")) { QString s = str; @@ -127,21 +127,16 @@ int main(int argc, char *argv[]) // 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); @@ -149,25 +144,23 @@ int main(int argc, char *argv[]) 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 " @@ -176,6 +169,9 @@ int main(int argc, char *argv[]) } + // Mlt::Factory::close(); + + return 0; }