///////////////////////////////////////////////////////////////////////////////
// Simple x264 Launcher
-// Copyright (C) 2004-2015 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2016 LoRd_MuldeR <MuldeR2@GMX.de>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
#include <QLocale>
// ------------------------------------------------------------
-// Helper Macros
-// ------------------------------------------------------------
-
-#define APPEND_AND_CLEAR(LIST, STR) do \
-{ \
- if(!((STR).isEmpty())) \
- { \
- (LIST) << (STR); \
- (STR).clear(); \
- } \
-} \
-while(0)
-
-// ------------------------------------------------------------
// Constructor & Destructor
// ------------------------------------------------------------
// Utilities
// ------------------------------------------------------------
-QStringList AbstractEncoder::splitParams(const QString ¶ms, const QString &sourceFile, const QString &outputFile)
-{
- QStringList list;
- bool ignoreWhitespaces = false;
- QString temp;
-
- for(int i = 0; i < params.length(); i++)
- {
- const QChar c = params.at(i);
-
- if(c == QChar::fromLatin1('"'))
- {
- ignoreWhitespaces = (!ignoreWhitespaces);
- continue;
- }
- else if((!ignoreWhitespaces) && (c == QChar::fromLatin1(' ')))
- {
- APPEND_AND_CLEAR(list, temp);
- continue;
- }
-
- temp.append(c);
- }
-
- APPEND_AND_CLEAR(list, temp);
-
- list.replaceInStrings("$(INPUT)", QDir::toNativeSeparators(sourceFile), Qt::CaseInsensitive);
- list.replaceInStrings("$(OUTPUT)", QDir::toNativeSeparators(outputFile), Qt::CaseInsensitive);
-
- return list;
-}
-
double AbstractEncoder::estimateSize(const QString &fileName, const double &progress)
{
double estimatedSize = 0.0;