#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
-#define VER_LAMEXP_MINOR_LO 3
-#define VER_LAMEXP_TYPE Final
-#define VER_LAMEXP_PATCH 2
-#define VER_LAMEXP_BUILD 774
+#define VER_LAMEXP_MINOR_LO 4
+#define VER_LAMEXP_TYPE Alpha
+#define VER_LAMEXP_PATCH 1
+#define VER_LAMEXP_BUILD 777
///////////////////////////////////////////////////////////////////////////////
// Tools versions
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp("\\s+Time:\\s+(\\d+):(\\d+)\\.(\\d+)\\s+\\[(\\d+):(\\d+)\\.(\\d+)\\],");
int timeLeft = (60 * values[3]) + values[4];
if(timeDone > 0 || timeLeft > 0)
{
- statusUpdated(static_cast<int>((static_cast<double>(timeDone) / static_cast<double>(timeDone + timeLeft)) * 100.0));
+ int newProgress = qRound((static_cast<double>(timeDone) / static_cast<double>(timeDone + timeLeft)) * 100.0);
+ if(newProgress > prevProgress)
+ {
+ emit statusUpdated(newProgress);
+ prevProgress = qMin(newProgress + 2, 99);
+ }
}
}
else if(!text.isEmpty())
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp(" (\\d+)% decoded.");
{
bool ok = false;
int progress = regExp.cap(1).toInt(&ok);
- if(ok) emit statusUpdated(progress);
+ if(ok && (progress > prevProgress))
+ {
+ emit statusUpdated(progress);
+ prevProgress = qMin(progress + 2, 99);
+ }
}
else if(!text.isEmpty())
{
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
+
QRegExp regExp("Processed\\s+(\\d+)\\s+seconds");
QRegExp regExp_pass1("First\\s+pass:\\s+processed\\s+(\\d+)\\s+seconds");
int progress = regExp_pass1.cap(1).toInt(&ok);
if(ok && metaInfo.fileDuration() > 0)
{
- emit statusUpdated(static_cast<int>((static_cast<double>(progress) / static_cast<double>(metaInfo.fileDuration())) * 50.0));
+ int newProgress = qRound((static_cast<double>(progress) / static_cast<double>(metaInfo.fileDuration())) * 50.0);
+ if(newProgress > prevProgress)
+ {
+ emit statusUpdated(newProgress);
+ prevProgress = qMin(newProgress + 2, 99);
+ }
}
}
else if(regExp_pass2.lastIndexIn(text) >= 0)
int progress = regExp_pass2.cap(1).toInt(&ok);
if(ok && metaInfo.fileDuration() > 0)
{
- emit statusUpdated(static_cast<int>((static_cast<double>(progress) / static_cast<double>(metaInfo.fileDuration())) * 50.0) + 50);
+ int newProgress = qRound((static_cast<double>(progress) / static_cast<double>(metaInfo.fileDuration())) * 50.0) + 50;
+ if(newProgress > prevProgress)
+ {
+ emit statusUpdated(newProgress);
+ prevProgress = qMin(newProgress + 2, 99);
+ }
}
}
else if(regExp.lastIndexIn(text) >= 0)
int progress = regExp.cap(1).toInt(&ok);
if(ok && metaInfo.fileDuration() > 0)
{
- emit statusUpdated(static_cast<int>((static_cast<double>(progress) / static_cast<double>(metaInfo.fileDuration())) * 100.0));
+ int newProgress = qRound((static_cast<double>(progress) / static_cast<double>(metaInfo.fileDuration())) * 100.0);
+ if(newProgress > prevProgress)
+ {
+ emit statusUpdated(newProgress);
+ prevProgress = qMin(newProgress + 2, 99);
+ }
}
}
else if(!text.isEmpty())
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp("Progress:\\s*(\\d+)%");
{
bool ok = false;
int progress = regExp.cap(1).toInt(&ok);
- if(ok) emit statusUpdated(progress);
+ if(ok && (progress > prevProgress))
+ {
+ emit statusUpdated(progress);
+ prevProgress = qMin(progress + 2, 99);
+ }
}
else if(!text.isEmpty())
{
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp("progress:(\\s+)(\\d+)%(\\s+)\\|");
{
bool ok = false;
int progress = regExp.cap(2).toInt(&ok);
- if(ok) emit statusUpdated(progress);
+ if(ok && (progress > prevProgress))
+ {
+ emit statusUpdated(progress);
+ prevProgress = qMin(progress + 2, 99);
+ }
}
else if(!text.isEmpty())
{
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp("\\s(\\d+)% complete");
{
bool ok = false;
int progress = regExp.cap(1).toInt(&ok);
- if(ok) emit statusUpdated(progress);
+ if(ok && (progress > prevProgress))
+ {
+ emit statusUpdated(progress);
+ prevProgress = qMin(progress + 2, 99);
+ }
}
else if(!text.isEmpty())
{
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp("\\(.*(\\d+)%\\)\\|");
{
bool ok = false;
int progress = regExp.cap(1).toInt(&ok);
- if(ok) emit statusUpdated(progress);
+ if(ok && (progress > prevProgress))
+ {
+ emit statusUpdated(progress);
+ prevProgress = qMin(progress + 2, 99);
+ }
}
else if(!text.isEmpty())
{
bool bTimeout = false;
bool bAborted = false;
+ int prevProgress = -1;
QRegExp regExp("\\[.*(\\d+)[.,](\\d+)%\\]");
{
bool ok = false;
int progress = regExp.cap(1).toInt(&ok);
- if(ok) emit statusUpdated(progress);
+ if(ok && (progress > prevProgress))
+ {
+ emit statusUpdated(progress);
+ prevProgress = qMin(progress + 2, 99);
+ }
}
else if(!text.isEmpty())
{
bSuccess = fileInfo.exists() && fileInfo.isFile() && (fileInfo.size() > 0);
}
+ QThread::msleep(500);
+
//Report result
emit processStateChanged(m_jobId, (bSuccess ? tr("Done.") : (m_aborted ? tr("Aborted!") : tr("Failed!"))), (bSuccess ? ProgressModel::JobComplete : ProgressModel::JobFailed));
emit processStateFinished(m_jobId, outFileName, bSuccess);
void ProcessThread::handleUpdate(int progress)
{
+ //printf("Progress: %d\n", progress);
+
switch(m_currentStep)
{
case EncodingStep:
// EVENTS
////////////////////////////////////////////////////////////
-/*NONE*/
+/*NONE*/
\ No newline at end of file