Merge branch 'master' of github.com:lordmulder/LameXP

This commit is contained in:
LoRd_MuldeR 2011-11-11 18:08:58 +01:00
commit cf87eab613
25 changed files with 156 additions and 89 deletions

View File

@ -66,7 +66,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;/MANIFESTDEPENDENCY:type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos; processorArchitecture=&apos;*&apos;&quot;"
AdditionalDependencies="qtmaind.lib QtCored4.lib QtGuid4.lib Winmm.lib Shlwapi.lib Wininet.lib psapi.lib"
AdditionalDependencies="qtmaind.lib QtCored4.lib QtGuid4.lib Winmm.lib Shlwapi.lib Wininet.lib psapi.lib PowrProf.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(QTDIR)\lib&quot;;&quot;$(QTDIR)\plugins\imageformats&quot;"
GenerateDebugInformation="true"
@ -155,7 +155,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;/MANIFESTDEPENDENCY:type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos; processorArchitecture=&apos;*&apos;&quot;"
AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib Winmm.lib Shlwapi.lib Wininet.lib"
AdditionalDependencies="qtmain.lib QtCore4.lib QtGui4.lib Winmm.lib Shlwapi.lib Wininet.lib PowrProf.lib"
ShowProgress="2"
Version=""
LinkIncremental="1"
@ -253,7 +253,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="&quot;/MANIFESTDEPENDENCY:type=&apos;win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos; processorArchitecture=&apos;*&apos;&quot;"
AdditionalDependencies="qtmain.lib QtCore.lib QtGui.lib QtSvg.lib qsvg.lib qico.lib Winmm.lib imm32.lib ws2_32.lib Shlwapi.lib Wininet.lib"
AdditionalDependencies="qtmain.lib QtCore.lib QtGui.lib QtSvg.lib qsvg.lib qico.lib Winmm.lib imm32.lib ws2_32.lib Shlwapi.lib Wininet.lib PowrProf.lib"
ShowProgress="2"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(SolutionDir)\etc\Prerequisites\qt4_static\lib&quot;;&quot;$(SolutionDir)\etc\Prerequisites\qt4_static\plugins\imageformats&quot;"
@ -520,6 +520,10 @@
RelativePath=".\src\ShellIntegration.cpp"
>
</File>
<File
RelativePath=".\src\Thread_CPUObserver.cpp"
>
</File>
<File
RelativePath=".\src\Thread_CueSplitter.cpp"
>
@ -548,6 +552,10 @@
RelativePath=".\src\Thread_Process.cpp"
>
</File>
<File
RelativePath=".\src\Thread_RAMObserver.cpp"
>
</File>
<File
RelativePath=".\src\Tool_Abstract.cpp"
>
@ -1047,7 +1055,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -1057,7 +1065,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -1067,7 +1075,7 @@
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -1580,6 +1588,40 @@
RelativePath=".\src\Targetver.h"
>
</File>
<File
RelativePath=".\src\Thread_CPUObserver.h"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Static|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\Thread_CueSplitter.h"
>
@ -1818,6 +1860,40 @@
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\Thread_RAMObserver.h"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Static|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="MOC &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; -o &quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot; &quot;$(InputPath)&quot;"
Outputs="&quot;$(SolutionDir)tmp\MOC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\Tool_Abstract.h"
>
@ -1970,6 +2046,10 @@
RelativePath=".\tmp\MOC_ShellIntegration.cpp"
>
</File>
<File
RelativePath=".\tmp\MOC_Thread_CPUObserver.cpp"
>
</File>
<File
RelativePath=".\tmp\MOC_Thread_CueSplitter.cpp"
>
@ -1998,6 +2078,10 @@
RelativePath=".\tmp\MOC_Thread_Process.cpp"
>
</File>
<File
RelativePath=".\tmp\MOC_Thread_RAMObserver.cpp"
>
</File>
<File
RelativePath=".\tmp\MOC_Tool_Abstract.cpp"
>
@ -2228,7 +2312,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2238,7 +2322,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2248,7 +2332,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2262,7 +2346,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2272,7 +2356,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2282,7 +2366,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2296,7 +2380,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2306,7 +2390,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>
@ -2316,7 +2400,7 @@
<Tool
Name="VCCustomBuildTool"
Description="RCC &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;"
CommandLine="&quot;$(QTDIR)\bin\rcc.exe&quot; -o &quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot; -name &quot;$(SafeInputName)&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="&quot;$(SolutionDir)tmp\QRC_$(SafeInputName).cpp&quot;"
/>
</FileConfiguration>

View File

@ -30,7 +30,7 @@
#define VER_LAMEXP_MINOR_LO 4
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 769
#define VER_LAMEXP_BUILD 770
///////////////////////////////////////////////////////////////////////////////
// Tools versions

View File

@ -99,7 +99,7 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta
const QString copyrightStr = QString().sprintf
(
"Copyright (C) 2004-%04d LoRd_MuldeR &lt;MuldeR2@GMX.de&gt;. Some rights reserved.",
max(lamexp_version_date().year(), QDate::currentDate().year())
qMax(lamexp_version_date().year(), QDate::currentDate().year())
);
for(int i = 0; i < 4; i++)
@ -116,12 +116,12 @@ AboutDialog::AboutDialog(SettingsModel *settings, QWidget *parent, bool firstSta
if(LAMEXP_DEBUG)
{
int daysLeft = max(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(QString("!!! --- DEBUG BUILD --- Expires at: %1 &middot; Days left: %2 --- DEBUG BUILD --- !!!").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
}
else if(lamexp_version_demo())
{
int daysLeft = max(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
int daysLeft = qMax(QDate::currentDate().daysTo(lamexp_version_expires()), 0);
aboutText += QString("<hr><font color=\"crimson\">%1</font>").arg(NOBR(tr("Note: This demo (pre-release) version of LameXP will expire at %1. Still %2 days left.").arg(lamexp_version_expires().toString(Qt::ISODate), QString::number(daysLeft))));
}
@ -539,7 +539,7 @@ void AboutDialog::moveDisque(void)
if(m_disqueDelay != _I64_MAX)
{
const double delay = static_cast<double>(perfCount.QuadPart) - static_cast<double>(m_disqueDelay);
delta = max(1, min(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
delta = qMax(1, qMin(128, static_cast<int>(ceil(delay / static_cast<double>(perfFrequ.QuadPart) / 0.00512))));
}
m_disqueDelay = perfCount.QuadPart;
}

View File

@ -164,7 +164,7 @@ void CueImportDialog::browseButtonClicked(void)
while(QDir(currentDir).exists())
{
int pos = max(currentDir.lastIndexOf(QChar('\\')), currentDir.lastIndexOf(QChar('/')));
int pos = qMax(currentDir.lastIndexOf(QChar('\\')), currentDir.lastIndexOf(QChar('/')));
if(pos > 0) currentDir.left(pos - 1); else break;
}

View File

@ -188,8 +188,8 @@ void DropBox::mouseMoveEvent(QMouseEvent *event)
const int max_x = screenGeometry.width() - frameGeometry().width() + screenGeometry.left();
const int max_y = screenGeometry.height() - frameGeometry().height() + screenGeometry.top();
int new_x = min(max_x, max(screenGeometry.left(), m_windowReferencePoint.x() - delta_x));
int new_y = min(max_y, max(screenGeometry.top(), m_windowReferencePoint.y() - delta_y));
int new_x = qMin(max_x, qMax(screenGeometry.left(), m_windowReferencePoint.x() - delta_x));
int new_y = qMin(max_y, qMax(screenGeometry.top(), m_windowReferencePoint.y() - delta_y));
if(new_x < magnetic)
{

View File

@ -2583,7 +2583,7 @@ void MainWindow::updateBitrate(int value)
labelBitrate->setText(tr("Compression %1").arg(value));
break;
case SettingsModel::AC3Encoder:
labelBitrate->setText(tr("Quality Level %1").arg(min(1024, max(0, value * 64))));
labelBitrate->setText(tr("Quality Level %1").arg(qMin(1024, qMax(0, value * 64))));
break;
case SettingsModel::PCMEncoder:
labelBitrate->setText(tr("Uncompressed"));
@ -2609,7 +2609,7 @@ void MainWindow::updateBitrate(int value)
labelBitrate->setText(tr("Uncompressed"));
break;
default:
labelBitrate->setText(QString("&asymp; %1 kbps").arg(min(500, value * 8)));
labelBitrate->setText(QString("&asymp; %1 kbps").arg(qMin(500, value * 8)));
break;
}
break;
@ -2629,7 +2629,7 @@ void MainWindow::updateBitrate(int value)
labelBitrate->setText(tr("Uncompressed"));
break;
default:
labelBitrate->setText(QString("%1 kbps").arg(min(500, value * 8)));
labelBitrate->setText(QString("%1 kbps").arg(qMin(500, value * 8)));
break;
}
break;

View File

@ -66,10 +66,10 @@
////////////////////////////////////////////////////////////
//Maximum number of parallel instances
#define MAX_INSTANCES 16
#define MAX_INSTANCES 16U
//Maximum number of CPU cores for auto-detection
#define MAX_CPU_COUNT 4
#define MAX_CPU_COUNT 4U
////////////////////////////////////////////////////////////
@ -357,20 +357,20 @@ void ProcessingDialog::initEncoding(void)
m_ramObserver->start();
}
int maximumInstances = max(min(m_settings->maximumInstances(), MAX_INSTANCES), 0);
unsigned int maximumInstances = qBound(0U, m_settings->maximumInstances(), MAX_INSTANCES);
if(maximumInstances < 1)
{
lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features();
maximumInstances = max(min(cpuFeatures.count, MAX_CPU_COUNT), 1);
maximumInstances = qBound(1U, static_cast<unsigned int>(cpuFeatures.count), MAX_CPU_COUNT);
}
int parallelThreadCount = max(min(maximumInstances, m_pendingJobs.count()), 1);
unsigned int parallelThreadCount = qBound(1U, maximumInstances, static_cast<unsigned int>(m_pendingJobs.count()));
if(parallelThreadCount > 1)
{
m_progressModel->addSystemMessage(tr("Multi-threading enabled: Running %1 instances in parallel!").arg(QString::number(parallelThreadCount)));
}
for(int i = 0; i < parallelThreadCount; i++)
for(unsigned int i = 0; i < parallelThreadCount; i++)
{
startNextJob();
}
@ -537,7 +537,7 @@ void ProcessingDialog::logViewSectionSizeChanged(int logicalIndex, int oldSize,
{
if(QHeaderView *hdr = view_log->horizontalHeader())
{
hdr->setMinimumSectionSize(max(hdr->minimumSectionSize(), hdr->sectionSize(1)));
hdr->setMinimumSectionSize(qMax(hdr->minimumSectionSize(), hdr->sectionSize(1)));
}
}
}

View File

@ -27,9 +27,6 @@
#include <QProcess>
#include <QDir>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
AACEncoder::AACEncoder(void)
:
m_binary_enc(lamexp_lookup_tool("neroAacEnc.exe")),
@ -57,13 +54,13 @@ bool AACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaInf
switch(m_configRCMode)
{
case SettingsModel::VBRMode:
args << "-q" << QString().sprintf("%.2f", min(1.0, max(0.0, static_cast<double>(m_configBitrate * 5) / 100.0)));
args << "-q" << QString().sprintf("%.2f", qMin(1.0, qMax(0.0, static_cast<double>(m_configBitrate * 5) / 100.0)));
break;
case SettingsModel::ABRMode:
args << "-br" << QString::number(max(32, min(500, (m_configBitrate * 8))) * 1000);
args << "-br" << QString::number(qMax(32, qMin(500, (m_configBitrate * 8))) * 1000);
break;
case SettingsModel::CBRMode:
args << "-cbr" << QString::number(max(32, min(500, (m_configBitrate * 8))) * 1000);
args << "-cbr" << QString::number(qMax(32, qMin(500, (m_configBitrate * 8))) * 1000);
break;
default:
throw "Bad rate-control mode!";

View File

@ -28,9 +28,6 @@
#include <QProcess>
#include <QDir>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
FHGAACEncoder::FHGAACEncoder(void)
:
m_binary_enc(lamexp_lookup_tool("fhgaacenc.exe")),
@ -76,7 +73,7 @@ bool FHGAACEncoder::encode(const QString &sourceFile, const AudioFileModel &meta
switch(m_configRCMode)
{
case SettingsModel::CBRMode:
args << "--cbr" << QString::number(max(32, min(maxBitrate, (m_configBitrate * 8))));
args << "--cbr" << QString::number(qMax(32, qMin(maxBitrate, (m_configBitrate * 8))));
break;
case SettingsModel::VBRMode:
args << "--vbr" << QString::number(qRound(static_cast<double>(m_configBitrate) / 5.0) + 1);

View File

@ -27,9 +27,6 @@
#include <QProcess>
#include <QDir>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
AC3Encoder::AC3Encoder(void)
:
m_binary(lamexp_lookup_tool("aften.exe"))
@ -57,10 +54,10 @@ bool AC3Encoder::encode(const QString &sourceFile, const AudioFileModel &metaInf
switch(m_configRCMode)
{
case SettingsModel::VBRMode:
args << "-q" << QString::number(max(0, min(1023, m_configBitrate * 64)));
args << "-q" << QString::number(qMax(0, qMin(1023, m_configBitrate * 64)));
break;
case SettingsModel::CBRMode:
args << "-b" << QString::number(SettingsModel::ac3Bitrates[max(0, min(18, m_configBitrate))]);
args << "-b" << QString::number(SettingsModel::ac3Bitrates[qMax(0, qMin(18, m_configBitrate))]);
break;
default:
throw "Bad rate-control mode!";
@ -154,17 +151,17 @@ bool AC3Encoder::encode(const QString &sourceFile, const AudioFileModel &metaInf
void AC3Encoder::setAudioCodingMode(int value)
{
m_configAudioCodingMode = min(8, max(0, value));
m_configAudioCodingMode = qMin(8, qMax(0, value));
}
void AC3Encoder::setDynamicRangeCompression(int value)
{
m_configDynamicRangeCompression = min(5, max(0, value));
m_configDynamicRangeCompression = qMin(5, qMax(0, value));
}
void AC3Encoder::setExponentSearchSize(int value)
{
m_configExponentSearchSize = min(32, max(1, value));
m_configExponentSearchSize = qMin(32, qMax(1, value));
}
void AC3Encoder::setFastBitAllocation(bool value)

View File

@ -38,8 +38,8 @@ AbstractEncoder::~AbstractEncoder(void)
* Setters
*/
void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = max(0, bitrate); }
void AbstractEncoder::setRCMode(int mode) { m_configRCMode = max(0, mode); }
void AbstractEncoder::setBitrate(int bitrate) { m_configBitrate = qMax(0, bitrate); }
void AbstractEncoder::setRCMode(int mode) { m_configRCMode = qMax(0, mode); }
void AbstractEncoder::setCustomParams(const QString &customParams) { m_configCustomParams = customParams; }
/*

View File

@ -27,9 +27,6 @@
#include <QProcess>
#include <QDir>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
FLACEncoder::FLACEncoder(void)
:
m_binary(lamexp_lookup_tool("flac.exe"))
@ -49,7 +46,7 @@ bool FLACEncoder::encode(const QString &sourceFile, const AudioFileModel &metaIn
QProcess process;
QStringList args;
args << QString("-%1").arg(QString::number(max(0, min(8, m_configBitrate))));
args << QString("-%1").arg(QString::number(qMax(0, qMin(8, m_configBitrate))));
if(!metaInfo.fileName().isEmpty()) args << "-T" << QString("title=%1").arg(metaInfo.fileName());
if(!metaInfo.fileArtist().isEmpty()) args << "-T" << QString("artist=%1").arg(metaInfo.fileArtist());

View File

@ -61,14 +61,14 @@ bool MP3Encoder::encode(const QString &sourceFile, const AudioFileModel &metaInf
switch(m_configRCMode)
{
case SettingsModel::VBRMode:
args << "-V" << QString::number(9 - min(9, m_configBitrate));
args << "-V" << QString::number(9 - qMin(9, m_configBitrate));
break;
case SettingsModel::ABRMode:
args << "--abr" << QString::number(SettingsModel::mp3Bitrates[max(0, min(13, m_configBitrate))]);
args << "--abr" << QString::number(SettingsModel::mp3Bitrates[qMax(0, qMin(13, m_configBitrate))]);
break;
case SettingsModel::CBRMode:
args << "--cbr";
args << "-b" << QString::number(SettingsModel::mp3Bitrates[max(0, min(13, m_configBitrate))]);
args << "-b" << QString::number(SettingsModel::mp3Bitrates[qMax(0, qMin(13, m_configBitrate))]);
break;
default:
throw "Bad rate-control mode!";
@ -254,7 +254,7 @@ void MP3Encoder::setChannelMode(int value)
int MP3Encoder::clipBitrate(int bitrate)
{
int targetBitrate = min(max(bitrate, 32), 320);
int targetBitrate = qMin(qMax(bitrate, 32), 320);
int minDiff = INT_MAX;
int minIndx = -1;

View File

@ -27,9 +27,6 @@
#include <QProcess>
#include <QDir>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
VorbisEncoder::VorbisEncoder(void)
:
m_binary(lamexp_lookup_tool("oggenc2.exe"))
@ -57,10 +54,10 @@ bool VorbisEncoder::encode(const QString &sourceFile, const AudioFileModel &meta
switch(m_configRCMode)
{
case SettingsModel::VBRMode:
args << "-q" << QString::number(max(-2, min(10, m_configBitrate)));
args << "-q" << QString::number(qMax(-2, qMin(10, m_configBitrate)));
break;
case SettingsModel::ABRMode:
args << "-b" << QString::number(max(32, min(500, (m_configBitrate * 8))));
args << "-b" << QString::number(qMax(32, qMin(500, (m_configBitrate * 8))));
break;
default:
throw "Bad rate-control mode!";
@ -69,8 +66,8 @@ bool VorbisEncoder::encode(const QString &sourceFile, const AudioFileModel &meta
if((m_configBitrateMaximum > 0) && (m_configBitrateMinimum > 0) && (m_configBitrateMinimum <= m_configBitrateMaximum))
{
args << "--min-bitrate" << QString::number(min(max(m_configBitrateMinimum, 32), 500));
args << "--max-bitrate" << QString::number(min(max(m_configBitrateMaximum, 32), 500));
args << "--min-bitrate" << QString::number(qMin(qMax(m_configBitrateMinimum, 32), 500));
args << "--max-bitrate" << QString::number(qMin(qMax(m_configBitrateMaximum, 32), 500));
}
if(m_configSamplingRate > 0)

View File

@ -27,8 +27,6 @@
#include <QDir>
#include <Shellapi.h>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define FIX_SEPARATORS(STR) for(int i = 0; STR[i]; i++) { if(STR[i] == L'/') STR[i] = L'\\'; }
WaveEncoder::WaveEncoder(void)

View File

@ -36,8 +36,8 @@ NormalizeFilter::NormalizeFilter(int peakVolume, int equalizationMode)
throw "Error initializing SoX filter. Tool 'sox.exe' is not registred!";
}
m_peakVolume = min(-50, max(-3200, peakVolume));
m_equalizationMode = min(2, max(0, equalizationMode));
m_peakVolume = qMin(-50, qMax(-3200, peakVolume));
m_equalizationMode = qMin(2, qMax(0, equalizationMode));
}
NormalizeFilter::~NormalizeFilter(void)

View File

@ -36,7 +36,7 @@ ResampleFilter::ResampleFilter(int samplingRate)
throw "Error initializing SoX filter. Tool 'sox.exe' is not registred!";
}
m_samplingRate = min(192000, max(8000, samplingRate));
m_samplingRate = qMin(192000, qMax(8000, samplingRate));
}
ResampleFilter::~ResampleFilter(void)

View File

@ -37,8 +37,8 @@ ToneAdjustFilter::ToneAdjustFilter(int bass, int treble)
throw "Error initializing SoX filter. Tool 'sox.exe' is not registred!";
}
m_bass = max(-2000, min(2000, bass));
m_treble = max(-2000, min(2000, treble));
m_bass = qMax(-2000, qMin(2000, bass));
m_treble = qMax(-2000, qMin(2000, treble));
}
ToneAdjustFilter::~ToneAdjustFilter(void)

View File

@ -569,7 +569,7 @@ lamexp_cpu_t lamexp_detect_cpu_features(int argc, char **argv)
}
__cpuid(CPUInfo, 0x80000000);
int nExIds = max(min(CPUInfo[0], 0x80000004), 0x80000000);
int nExIds = qMax<int>(qMin<int>(CPUInfo[0], 0x80000004), 0x80000000);
for(int i = 0x80000002; i <= nExIds; ++i)
{

View File

@ -55,7 +55,7 @@ static int lamexp_main(int argc, char* argv[])
//Print version info
qDebug("LameXP - Audio Encoder Front-End v%d.%02d %s (Build #%03d)", lamexp_version_major(), lamexp_version_minor(), lamexp_version_release(), lamexp_version_build());
qDebug("Copyright (c) 2004-%04d LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved.", max(lamexp_version_date().year(),QDate::currentDate().year()));
qDebug("Copyright (c) 2004-%04d LoRd_MuldeR <mulder2@gmx.de>. Some rights reserved.", qMax(lamexp_version_date().year(),QDate::currentDate().year()));
qDebug("Built on %s at %s with %s for Win-%s.\n", lamexp_version_date().toString(Qt::ISODate).toLatin1().constData(), lamexp_version_time(), lamexp_version_compiler(), lamexp_version_arch());
//print license info

View File

@ -825,7 +825,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
CueSheetTrack *currentTrack = currentFile->track(j);
CueSheetTrack *previousTrack = currentFile->track(j-1);
double duration = currentTrack->startIndex() - previousTrack->startIndex();
previousTrack->setDuration(max(0.0, duration));
previousTrack->setDuration(qMax(0.0, duration));
}
}
}

View File

@ -336,7 +336,7 @@ void CueSplitter::splitFile(const QString &output, const int trackNo, const QStr
int progress = rxProgress.cap(1).toInt(&ok);
if(ok)
{
maxProgress = max(maxProgress, progress);
maxProgress = qMax(maxProgress, progress);
emit fileSelected(QString("%1 [%2%]").arg(baseName, QString::number(maxProgress)));
}
}
@ -372,7 +372,7 @@ void CueSplitter::splitFile(const QString &output, const int trackNo, const QStr
qDebug("Duration updated from SoX info!");
int duration = intputLen - static_cast<int>(floor(offset + 0.5));
if(duration < 0) qWarning("Track is out of bounds: Track offset exceeds input file duration!");
outFileInfo.setFileDuration(max(0, duration));
outFileInfo.setFileDuration(qMax(0, duration));
}
else
{

View File

@ -80,7 +80,7 @@ void DiskObserverThread::observe(void)
{
qWarning("Free diskspace on '%s' dropped below %s MB, only %s MB free!", m_path.toUtf8().constData(), QString::number(minimumSpace / 1048576ui64).toUtf8().constData(), QString::number(freeSpace / 1048576ui64).toUtf8().constData());
emit messageLogged(tr("Low diskspace on drive '%1' detected (only %2 MB are free), problems can occur!").arg(QDir::toNativeSeparators(m_path), QString::number(freeSpace / 1048576ui64)), true);
minimumSpace = min(freeSpace, (minimumSpace >> 1));
minimumSpace = qMin(freeSpace, (minimumSpace >> 1));
}
if(freeSpace != previousSpace)
{

View File

@ -475,25 +475,25 @@ unsigned int FileAnalyzer::parseDuration(const QString &str)
time = QTime::fromString(str, "z'ms'");
if(time.isValid())
{
return max(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
return qMax(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
}
time = QTime::fromString(str, "s's 'z'ms'");
if(time.isValid())
{
return max(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
return qMax(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
}
time = QTime::fromString(str, "m'mn 's's'");
if(time.isValid())
{
return max(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
return qMax(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
}
time = QTime::fromString(str, "h'h 'm'mn'");
if(time.isValid())
{
return max(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
return qMax(1, (time.hour() * 60 * 60) + (time.minute() * 60) + time.second());
}
return 0;

View File

@ -360,10 +360,10 @@ void InitializationThread::initNeroAac(void)
if(versionTokens.count() == 4)
{
neroVersion = 0;
neroVersion += min(9, max(0, versionTokens.at(3).toInt()));
neroVersion += min(9, max(0, versionTokens.at(2).toInt())) * 10;
neroVersion += min(9, max(0, versionTokens.at(1).toInt())) * 100;
neroVersion += min(9, max(0, versionTokens.at(0).toInt())) * 1000;
neroVersion += qMin(9, qMax(0, versionTokens.at(3).toInt()));
neroVersion += qMin(9, qMax(0, versionTokens.at(2).toInt())) * 10;
neroVersion += qMin(9, qMax(0, versionTokens.at(1).toInt())) * 100;
neroVersion += qMin(9, qMax(0, versionTokens.at(0).toInt())) * 1000;
}
}
}