From 0ba4df406c608c512b6cdbd115a97a8e25a5c9e0 Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sat, 29 Apr 2017 16:14:33 +0200 Subject: [PATCH] Add the option to enable variable bit rates to the export dialog If the variables bit rate is not enabled the nominal bit rate will be used for the minimum and maximum bit rate in the encoder. If the variable bit rate is enabled the current implementation will compute the minimum bitrate by subtracting 64 kBit/s from the nominal bit rate. The maximum bit rate is computed by adding 64 kBit/s to it. Example: The nominal bit rate is set to 160 kBit/s and variable bit rate is enabled in the export dialog. The minimum bit rate is then set to 96 kBit/s and the maximum bit rate to 224 kBit/s. --- src/gui/ExportProjectDialog.cpp | 4 +++- src/gui/dialogs/export_project.ui | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/ExportProjectDialog.cpp b/src/gui/ExportProjectDialog.cpp index 8c55e382f..c4f7696b8 100644 --- a/src/gui/ExportProjectDialog.cpp +++ b/src/gui/ExportProjectDialog.cpp @@ -140,7 +140,9 @@ void ExportProjectDialog::startExport() const int samplerates[5] = { 44100, 48000, 88200, 96000, 192000 }; const bitrate_t bitrates[6] = { 64, 128, 160, 192, 256, 320 }; - OutputSettings::BitRateSettings bitRateSettings(bitrates[ bitrateCB->currentIndex() ], false); + bool useVariableBitRate = checkBoxVariableBitRate->isChecked(); + + OutputSettings::BitRateSettings bitRateSettings(bitrates[ bitrateCB->currentIndex() ], useVariableBitRate); OutputSettings os = OutputSettings( samplerates[ samplerateCB->currentIndex() ], bitRateSettings, diff --git a/src/gui/dialogs/export_project.ui b/src/gui/dialogs/export_project.ui index 2225a6495..c3f77df94 100644 --- a/src/gui/dialogs/export_project.ui +++ b/src/gui/dialogs/export_project.ui @@ -174,6 +174,13 @@ + + + + Use variable bitrate + + +