diff --git a/doc/Changelog.html b/doc/Changelog.html
index d6b5579b..9df5c04b 100644
--- a/doc/Changelog.html
+++ b/doc/Changelog.html
@@ -4,6 +4,7 @@
LameXP - Version History
Changes between v4.00 and v4.01:
+- Added an option to manually specify the number of parallel instances
- Updated LAME encoder to v3.99.0.12 (2011-02-13), compiled with ICL 12.0.2
- Updated Vorbis encoder to v2.87 using aoTuV Beta-6.01 (2011-02-22), compiled with ICL 11.1 and MSVC 9.0
- Updated language files (big "thank you" to all contributors !!!)
diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts
index 8add5035..8299ea30 100644
--- a/etc/Translation/Blank.ts
+++ b/etc/Translation/Blank.ts
@@ -605,6 +605,22 @@
Warning: Custom parameters won't be checked at all. Use them at your own risk !!!
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ Fewer Instances
+
+
+
+ More Instances
+
+
Reset Advanced Options
@@ -1057,6 +1073,10 @@
Poor Quality (Very Fast)
+
+ %1 Instance(s)
+
+
Do you really want to disable the update reminder?
diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts
index f7b87cf2..767b2a9c 100644
--- a/etc/Translation/LameXP_DE.ts
+++ b/etc/Translation/LameXP_DE.ts
@@ -1146,6 +1146,26 @@
Warning: Custom parameters won't be checked at all. Use them at your own risk !!!
Achtung: Benutzerdefinierte Parameter werden nicht überprüft. Benutzung auf eigene Gefahr !!!
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+ Anzahl der parallelen Instanzen entsprechend der Anzahl der CPU Kerne festlegen (Empfohlen)
+
+
+ Fewer Instances
+ Weniger Instanzen
+
+
+ More Instances
+ Mehr Instanzen
+
+
+ %1 Instance(s)
+ %1 Instanz(en)
+
MetaInfo
diff --git a/etc/Translation/LameXP_ES.ts b/etc/Translation/LameXP_ES.ts
index a9d1a674..78ffb6e5 100644
--- a/etc/Translation/LameXP_ES.ts
+++ b/etc/Translation/LameXP_ES.ts
@@ -1145,6 +1145,26 @@
Warning: Custom parameters won't be checked at all. Use them at your own risk !!!
Aviso: Los parámetros personalizados no se comprobarán en absoluto. ¡¡¡ Úselos bajo su propio riesgo !!!
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ Fewer Instances
+
+
+
+ More Instances
+
+
+
+ %1 Instance(s)
+
+
MetaInfo
diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts
index a405d9fa..6d3a6cd0 100644
--- a/etc/Translation/LameXP_FR.ts
+++ b/etc/Translation/LameXP_FR.ts
@@ -1154,6 +1154,26 @@ Sélection automatique (par défaut)
Warning: Custom parameters won't be checked at all. Use them at your own risk !!!
Avertissement : Les paramètres personnalisés ne peuvent pas être entièrement vérifiés. Vous les utilisez à votre propre risque !!!
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ Fewer Instances
+
+
+
+ More Instances
+
+
+
+ %1 Instance(s)
+
+
MetaInfo
diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts
index b85f01e9..bceed85b 100644
--- a/etc/Translation/LameXP_IT.ts
+++ b/etc/Translation/LameXP_IT.ts
@@ -1146,6 +1146,26 @@
Warning: Custom parameters won't be checked at all. Use them at your own risk !!!
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ Fewer Instances
+
+
+
+ More Instances
+
+
+
+ %1 Instance(s)
+
+
MetaInfo
diff --git a/etc/Translation/LameXP_RU.ts b/etc/Translation/LameXP_RU.ts
index 634477eb..c65d5b68 100644
--- a/etc/Translation/LameXP_RU.ts
+++ b/etc/Translation/LameXP_RU.ts
@@ -1148,6 +1148,26 @@
The LameXP shell integration has been re-enabled.
Интегрирование в контекстное меню включено.
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ Fewer Instances
+
+
+
+ More Instances
+
+
+
+ %1 Instance(s)
+
+
MetaInfo
diff --git a/etc/Translation/LameXP_UK.ts b/etc/Translation/LameXP_UK.ts
index a3414878..c9b4341a 100644
--- a/etc/Translation/LameXP_UK.ts
+++ b/etc/Translation/LameXP_UK.ts
@@ -1145,6 +1145,26 @@
Warning: Custom parameters won't be checked at all. Use them at your own risk !!!
+
+ Multi-Threading
+
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ Fewer Instances
+
+
+
+ More Instances
+
+
+
+ %1 Instance(s)
+
+
MetaInfo
diff --git a/gui/MainWindow.ui b/gui/MainWindow.ui
index 041030bf..8e6a8cbb 100644
--- a/gui/MainWindow.ui
+++ b/gui/MainWindow.ui
@@ -1058,7 +1058,7 @@
0
0
604
- 812
+ 965
@@ -1223,7 +1223,7 @@
-
-
-
+
-
Qt::Horizontal
@@ -1239,7 +1239,7 @@
- -
+
-
Qt::Horizontal
@@ -1255,14 +1255,14 @@
- -
+
-
Faster Processing
- -
+
-
@@ -1278,7 +1278,7 @@
- -
+
-
Better quality
@@ -1288,7 +1288,7 @@
- -
+
-
Qt::Vertical
@@ -1304,7 +1304,7 @@
- -
+
-
4
@@ -2211,6 +2211,170 @@
+ -
+
+
+
+ 50
+ false
+
+
+
+ Multi-Threading
+
+
+
-
+
+
-
+
+
+ 1
+
+
+ 16
+
+
+ 1
+
+
+ 4
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksBelow
+
+
+ 1
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 10
+ 20
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 10
+ 20
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 8
+ 8
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 8
+
+
+
+
+ -
+
+
+ Choose the number of parallel instances based on the number of CPU cores (Recommended)
+
+
+
+ -
+
+
+ Fewer Instances
+
+
+
+ -
+
+
+
+ 75
+ true
+
+
+
+ (VALUE)
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ More Instances
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 12
+
+
+
+
+
+
+
+
+
-
@@ -2790,6 +2954,12 @@
+
+
+
+
+
+
@@ -2835,8 +3005,8 @@
-1
- 67
- 460
+ 81
+ 382
@@ -2851,8 +3021,8 @@
253
- 587
- 460
+ 641
+ 382
@@ -2863,8 +3033,8 @@
setDisabled(bool)
- 327
- 465
+ 341
+ 380
327
@@ -2879,8 +3049,8 @@
setDisabled(bool)
- 327
- 465
+ 341
+ 380
327
@@ -2895,12 +3065,12 @@
setDisabled(bool)
- 344
- 465
+ 358
+ 380
- 215
- 430
+ 408
+ 346
@@ -2911,12 +3081,12 @@
setDisabled(bool)
- 344
- 465
+ 358
+ 380
- 84
- 430
+ 98
+ 346
@@ -2927,12 +3097,12 @@
setDisabled(bool)
- 344
- 465
+ 358
+ 380
- 603
- 430
+ 641
+ 346
@@ -2943,12 +3113,12 @@
setDisabled(bool)
- 344
- 465
+ 358
+ 380
- 214
- 430
+ 276
+ 346
@@ -2963,8 +3133,8 @@
-1
- 255
- 460
+ 300
+ 382
@@ -2975,8 +3145,8 @@
setEnabled(bool)
- 177
- 285
+ 201
+ 372
336
@@ -2991,12 +3161,12 @@
setEnabled(bool)
- 183
- 465
+ 207
+ 372
- 596
- 404
+ 632
+ 315
@@ -3007,12 +3177,12 @@
setEnabled(bool)
- 183
- 465
+ 207
+ 372
- 299
- 404
+ 344
+ 315
@@ -3023,12 +3193,12 @@
setEnabled(bool)
- 183
- 465
+ 207
+ 372
- 39
- 404
+ 47
+ 315
@@ -3039,12 +3209,12 @@
setEnabled(bool)
- 183
- 465
+ 207
+ 372
- 500
- 404
+ 536
+ 315
@@ -3055,12 +3225,12 @@
setDisabled(bool)
- 70
- 79
+ 84
+ 380
- 70
- 79
+ 397
+ 372
@@ -3071,12 +3241,12 @@
click()
- 70
- 79
+ 93
+ 159
- 65
- 79
+ 599
+ 315
@@ -3087,12 +3257,12 @@
setDisabled(bool)
- 70
- 79
+ 84
+ 380
- 70
- 79
+ 459
+ 380
@@ -3103,8 +3273,8 @@
setEnabled(bool)
- 123
- 214
+ 163
+ 231
256
@@ -3119,8 +3289,8 @@
setEnabled(bool)
- 123
- 214
+ 163
+ 231
465
@@ -3135,8 +3305,8 @@
setEnabled(bool)
- 123
- 214
+ 163
+ 231
360
@@ -3151,8 +3321,8 @@
setEnabled(bool)
- 123
- 214
+ 163
+ 231
569
@@ -3192,5 +3362,69 @@
+
+ checkBoxAutoDetectInstances
+ clicked(bool)
+ sliderMaxInstances
+ setDisabled(bool)
+
+
+ 363
+ 953
+
+
+ 363
+ 897
+
+
+
+
+ checkBoxAutoDetectInstances
+ clicked(bool)
+ labelMaxInstances
+ setDisabled(bool)
+
+
+ 363
+ 953
+
+
+ 409
+ 916
+
+
+
+
+ checkBoxAutoDetectInstances
+ clicked(bool)
+ labelMaxInstancesFewer
+ setDisabled(bool)
+
+
+ 363
+ 953
+
+
+ 185
+ 916
+
+
+
+
+ checkBoxAutoDetectInstances
+ clicked(bool)
+ labelMaxInstancesMore
+ setDisabled(bool)
+
+
+ 363
+ 953
+
+
+ 588
+ 916
+
+
+
diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm
index a11f6ae3..167a10c2 100644
Binary files a/res/localization/LameXP_DE.qm and b/res/localization/LameXP_DE.qm differ
diff --git a/src/Config.h b/src/Config.h
index 05c23b3e..26988fd3 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -25,7 +25,7 @@
#define VER_LAMEXP_MAJOR 4
#define VER_LAMEXP_MINOR_HI 0
#define VER_LAMEXP_MINOR_LO 1
-#define VER_LAMEXP_BUILD 332
+#define VER_LAMEXP_BUILD 334
#define VER_LAMEXP_SUFFIX Beta-1
/*
diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp
index 260b2305..aa4a8654 100644
--- a/src/Dialog_MainWindow.cpp
+++ b/src/Dialog_MainWindow.cpp
@@ -207,6 +207,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
//Setup "Advanced Options" tab
sliderLameAlgoQuality->setValue(m_settings->lameAlgoQuality());
+ if(m_settings->maximumInstances() > 0) sliderMaxInstances->setValue(m_settings->maximumInstances());
spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRate());
spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRate());
spinBoxNormalizationFilter->setValue(static_cast(m_settings->normalizationFilterMaxVolume()) / 100.0);
@@ -218,6 +219,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
while(checkBoxBitrateManagement->isChecked() != m_settings->bitrateManagementEnabled()) checkBoxBitrateManagement->click();
while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2Pass()) checkBoxNeroAAC2PassMode->click();
while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabled()) checkBoxNormalizationFilter->click();
+ while(checkBoxAutoDetectInstances->isChecked() != (m_settings->maximumInstances() < 1)) checkBoxAutoDetectInstances->click();
lineEditCustomParamLAME->setText(m_settings->customParametersLAME());
lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEnc());
lineEditCustomParamNeroAAC->setText(m_settings->customParametersNeroAAC());
@@ -239,8 +241,11 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
connect(lineEditCustomParamOggEnc, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(lineEditCustomParamNeroAAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
connect(lineEditCustomParamFLAC, SIGNAL(editingFinished()), this, SLOT(customParamsChanged()));
+ connect(sliderMaxInstances, SIGNAL(valueChanged(int)), this, SLOT(updateMaximumInstances(int)));
+ connect(checkBoxAutoDetectInstances, SIGNAL(clicked(bool)), this, SLOT(autoDetectInstancesChanged(bool)));
connect(buttonResetAdvancedOptions, SIGNAL(clicked()), this, SLOT(resetAdvancedOptionsButtonClicked()));
updateLameAlgoQuality(sliderLameAlgoQuality->value());
+ updateMaximumInstances(sliderMaxInstances->value());
toneAdjustTrebleChanged(spinBoxToneAdjustTreble->value());
toneAdjustBassChanged(spinBoxToneAdjustBass->value());
customParamsChanged();
@@ -607,6 +612,7 @@ void MainWindow::changeEvent(QEvent *e)
m_metaInfoModel->setData(m_metaInfoModel->index(4, 1), m_settings->metaInfoPosition());
updateEncoder(m_settings->compressionEncoder());
updateLameAlgoQuality(sliderLameAlgoQuality->value());
+ updateMaximumInstances(sliderMaxInstances->value());
//Re-install shell integration
if(m_settings->shellIntegrationEnabled())
@@ -1924,6 +1930,23 @@ void MainWindow::customParamsChanged(void)
m_settings->customParametersFLAC(lineEditCustomParamFLAC->text());
}
+/*
+ * Maximum number of instances changed
+ */
+void MainWindow::updateMaximumInstances(int value)
+{
+ labelMaxInstances->setText(tr("%1 Instance(s)").arg(QString::number(value)));
+ m_settings->maximumInstances(checkBoxAutoDetectInstances->isChecked() ? NULL : value);
+}
+
+/*
+ * Auto-detect number of instances
+ */
+void MainWindow::autoDetectInstancesChanged(bool checked)
+{
+ m_settings->maximumInstances(checked ? NULL : sliderMaxInstances->value());
+}
+
/*
* Reset all advanced options to their defaults
*/
@@ -1941,6 +1964,7 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
while(checkBoxBitrateManagement->isChecked() != m_settings->bitrateManagementEnabledDefault()) checkBoxBitrateManagement->click();
while(checkBoxNeroAAC2PassMode->isChecked() != m_settings->neroAACEnable2PassDefault()) checkBoxNeroAAC2PassMode->click();
while(checkBoxNormalizationFilter->isChecked() != m_settings->normalizationFilterEnabledDefault()) checkBoxNormalizationFilter->click();
+ while(checkBoxAutoDetectInstances->isChecked() != (m_settings->maximumInstancesDefault() < 1)) checkBoxAutoDetectInstances->click();
lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault());
lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault());
lineEditCustomParamNeroAAC->setText(m_settings->customParametersNeroAACDefault());
diff --git a/src/Dialog_MainWindow.h b/src/Dialog_MainWindow.h
index 090c5211..f1693adc 100644
--- a/src/Dialog_MainWindow.h
+++ b/src/Dialog_MainWindow.h
@@ -93,6 +93,8 @@ private slots:
void toneAdjustTrebleChanged(double value);
void toneAdjustTrebleReset(void);
void customParamsChanged(void);
+ void updateMaximumInstances(int value);
+ void autoDetectInstancesChanged(bool checked);
void resetAdvancedOptionsButtonClicked(void);
void sourceModelChanged(void);
void metaTagsEnabledChanged(void);
diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp
index 6723bc91..228edab1 100644
--- a/src/Dialog_Processing.cpp
+++ b/src/Dialog_Processing.cpp
@@ -267,9 +267,14 @@ void ProcessingDialog::initEncoding(void)
WinSevenTaskbar::setTaskbarProgress(this, 0, m_pendingJobs.count());
WinSevenTaskbar::setOverlayIcon(this, &QIcon(":/icons/control_play_blue.png"));
- lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features();
- int parallelThreadCount = max(min(min(cpuFeatures.count, m_pendingJobs.count()), 4), 1);
+ int maximumInstances = max(min(m_settings->maximumInstances(), 16), 0);
+ if(maximumInstances < 1)
+ {
+ lamexp_cpu_t cpuFeatures = lamexp_detect_cpu_features();
+ maximumInstances = max(min(cpuFeatures.count, 4), 1);
+ }
+ int parallelThreadCount = max(min(maximumInstances, m_pendingJobs.count()), 1);
if(parallelThreadCount > 1)
{
m_progressModel->addSystemMessage(tr("Multi-threading enabled: Running %1 instances in parallel!").arg(QString::number(parallelThreadCount)));
diff --git a/src/Model_Settings.cpp b/src/Model_Settings.cpp
index 46962aa0..f6b91798 100644
--- a/src/Model_Settings.cpp
+++ b/src/Model_Settings.cpp
@@ -100,6 +100,7 @@ MAKE_ID(customParametersOggEnc, "AdvancedOptions/CustomParameters/OggEnc");
MAKE_ID(customParametersNeroAAC, "AdvancedOptions/CustomParameters/NeroAAC");
MAKE_ID(customParametersFLAC, "AdvancedOptions/CustomParameters/FLAC");
MAKE_ID(metaInfoPosition, "MetaInformation/PlaylistPosition");
+MAKE_ID(maximumInstances, "AdvancedOptions/Threading/MaximumInstances");
//LUT
const int SettingsModel::mp3Bitrates[15] = {32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1};
@@ -258,3 +259,4 @@ MAKE_OPTION2(customParametersOggEnc, QString());
MAKE_OPTION2(customParametersNeroAAC, QString());
MAKE_OPTION2(customParametersFLAC, QString());
MAKE_OPTION4(metaInfoPosition, UINT_MAX);
+MAKE_OPTION4(maximumInstances, 0);
diff --git a/src/Model_Settings.h b/src/Model_Settings.h
index 7c4b5c92..032a92f0 100644
--- a/src/Model_Settings.h
+++ b/src/Model_Settings.h
@@ -110,6 +110,7 @@ public:
MAKE_OPTION_DEC2(customParametersNeroAAC);
MAKE_OPTION_DEC2(customParametersFLAC);
MAKE_OPTION_DEC4(metaInfoPosition);
+ MAKE_OPTION_DEC4(maximumInstances);
//Misc
void validate(void);