Some code refactoring.

This commit is contained in:
LoRd_MuldeR 2017-10-13 21:16:14 +02:00
parent d3d009bb94
commit 863bae0985
16 changed files with 2886 additions and 2865 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
<context>
<name>MainWindow</name>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="830"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="859"/>
<source>%n file(s) have been rejected, because read access was not granted!</source>
<translation>
<numerusform>%n file have been rejected, because read access was not granted!</numerusform>
@ -39,7 +39,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="834"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="863"/>
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
<translation>
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
@ -47,7 +47,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="838"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="867"/>
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
<translation>
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
@ -55,7 +55,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="842"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="871"/>
<source>%n file(s) have been rejected, because the file format could not be recognized!</source>
<translation>
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
@ -63,7 +63,7 @@
</translation>
</message>
<message numerus="yes">
<location filename="../../src/Dialog_MainWindow.cpp" line="4238"/>
<location filename="../../src/Dialog_MainWindow.cpp" line="4259"/>
<source>%n Instance(s)</source>
<translation>
<numerusform>%n Instance</numerusform>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 6
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 5
#define VER_LAMEXP_BUILD 2022
#define VER_LAMEXP_BUILD 2023
#define VER_LAMEXP_CONFG 2002
///////////////////////////////////////////////////////////////////////////////

View File

@ -221,6 +221,32 @@ static QList<T>& INVERT_LIST(QList<T> &list)
return list;
}
static quint32 encodeInstances(quint32 instances)
{
if (instances > 16U)
{
instances -= (instances - 16U) / 2U;
if (instances > 24U)
{
instances -= (instances - 24U) / 2U;
}
}
return instances;
}
static quint32 decodeInstances(quint32 instances)
{
if (instances > 16U)
{
instances += instances - 16U;
if (instances > 32U)
{
instances += instances - 32U;
}
}
return instances;
}
////////////////////////////////////////////////////////////
// Helper Classes
////////////////////////////////////////////////////////////
@ -475,7 +501,10 @@ MainWindow::MainWindow(MUtils::IPCChannel *const ipcChannel, FileListModel *cons
//--------------------------------
ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQuality());
if(m_settings->maximumInstances() > 0) ui->sliderMaxInstances->setValue(m_settings->maximumInstances());
if (m_settings->maximumInstances() > 0U)
{
ui->sliderMaxInstances->setValue(static_cast<int>(encodeInstances(m_settings->maximumInstances())));
}
ui->spinBoxBitrateManagementMin ->setValue(m_settings->bitrateManagementMinRate());
ui->spinBoxBitrateManagementMax ->setValue(m_settings->bitrateManagementMaxRate());
@ -4225,17 +4254,9 @@ void MainWindow::forceStereoDownmixEnabledChanged(bool checked)
*/
void MainWindow::updateMaximumInstances(const int value)
{
quint32 instances = qBound(1U, static_cast<quint32>(value), 32U);
if (instances > 16U)
{
instances += instances - 16U;
if (instances > 32U)
{
instances += instances - 32U;
}
}
const quint32 instances = decodeInstances(qBound(1U, static_cast<quint32>(value), 32U));
m_settings->maximumInstances(ui->checkBoxAutoDetectInstances->isChecked() ? 0U : instances);
ui->labelMaxInstances->setText(tr("%n Instance(s)", "", instances));
ui->labelMaxInstances->setText(tr("%n Instance(s)", "", static_cast<int>(instances)));
}
/*
@ -4243,7 +4264,7 @@ void MainWindow::updateMaximumInstances(const int value)
*/
void MainWindow::autoDetectInstancesChanged(const bool checked)
{
m_settings->maximumInstances(checked ? 0U : ui->sliderMaxInstances->value());
m_settings->maximumInstances(checked ? 0U : decodeInstances(qBound(1U, static_cast<quint32>(ui->sliderMaxInstances->value()), 32U)));
}
/*