// add missing files
if (anIndexList.count() > 1) {
- QString aFFile = aDirPath + QDir::separator() + aBaseName;
+ QString aFFile = aDirPath + "/" + aBaseName;
aFFile += QString("_%1.jpeg");
int aStartIndex = anIndexList[0], anEndIndex;
for (int i = 1; i < anIndexList.count(); i++) {
anEndIndex = anIndexList[i];
QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustified(8, '0'));
QStringList aCommands;
+ QString aSeparator;
for (int j = aStartIndex+1; j < anEndIndex; j++) {
QString aFile = aFFile.arg(QString::number(j).rightJustified(8, '0'));
+#ifndef WIN32
aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
+ aSeparator = QString(" ; \\\n");
+#else
+ aCommands.append(QString("COPY /Y %1 %2 > NUL").arg(QString(aCurFile).replace("/","\\\\")).arg(QString(aFile).replace("/","\\\\")));
+ aSeparator = QString(" & ");
+#endif
}
- system(aCommands.join(" ; \\\n").toLatin1().data());
+ system(aCommands.join(aSeparator).toLatin1().data());
aStartIndex = anEndIndex;
}
}
// make AVI file
- QString aPattern = aDirPath + QDir::separator() + aBaseName;
+ QString aPattern = aDirPath + "/" + aBaseName;
aPattern += "_\%08d.jpeg";
QString aCmd = myAVIMaker;
aCmd += QString(" -f %1").arg(aFPS);
// aCmd += QString(" -n %1").arg(aNbFiles);
aCmd += QString(" -n %1").arg(myFileIndex+1);
- aCmd += QString(" -j %1").arg(aPattern);
+ aCmd += QString(" -j \"%1\"").arg(aPattern);
aCmd += " | yuv2lav";
- aCmd += QString(" -o %1").arg(myDumpPath);
+ aCmd += QString(" -o \"%1\"").arg(myDumpPath);
+ #ifdef WIN32
+ aCmd += " -f aA";
+ #endif
system(aCmd.toLatin1().data());
// remove temporary jpeg files
+#ifndef WIN32
aCmd = "( ";
aCmd += QString("cd %1").arg(aDirPath);
aCmd += "; ls";
aCmd += QString(" | egrep '%1_[0-9]*.jpeg'").arg(aBaseName);
aCmd += " | xargs rm";
aCmd += " )";
+#else
+ QString tmpFile = QString("_") + aBaseName + "_tempfile";
+ QString diskName = aDirPath.split("/")[0];
+ aCmd = diskName + " && (cd " + aDirPath.replace("/","\\\\") +
+ " && ((dir /b | findstr " + aBaseName + "_[0-9]*.jpeg > " + tmpFile +
+ ") & (for /f %i in (" + tmpFile + ") do (del \"%i\")) & (del " + tmpFile + "))) > NUL";
+#endif
system(aCmd.toLatin1().data());
}
aDumpFormats.indexOf("jpeg") < 0)
return false;
- QString aCmd("which ");
- aCmd += myAVIMaker;
- aCmd += " >& /dev/null";
+ QString aCmd;
+#ifndef WIN32
+ aCmd = "which " + myAVIMaker + " >& /dev/null";
+#else
+ aCmd = "setlocal & set P2=.;%PATH% & (for %e in (%PATHEXT%) do @for %i in (" + myAVIMaker + "%e) do @if NOT \"%~$P2:i\"==\"\" exit /b 0) & exit /b 1";
+#endif
int iErr = system(aCmd.toLatin1().data());
return (iErr == 0);
}