[vlmc-devel] ProjectWizard: Set proper values to sample/bitrate settingvalues

Yikai Lu git at videolan.org
Tue Apr 12 14:10:23 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Apr 10 23:25:28 2016 +0900| [0b146ee1d9a104ae9c9cd8bbf7fe75b8b4affeff] | committer: Hugo Beauzée-Luyssen

ProjectWizard: Set proper values to sample/bitrate settingvalues

For QComboBox, just doing field( "samplerate" ) will get the currentIndex, which is wrong.

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/0b146ee1d9a104ae9c9cd8bbf7fe75b8b4affeff
---

 src/Gui/wizard/ProjectWizard.cpp | 4 ++--
 src/Gui/wizard/VideoPage.cpp     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Gui/wizard/ProjectWizard.cpp b/src/Gui/wizard/ProjectWizard.cpp
index 5607b29..f1ba18a 100644
--- a/src/Gui/wizard/ProjectWizard.cpp
+++ b/src/Gui/wizard/ProjectWizard.cpp
@@ -113,8 +113,8 @@ ProjectWizard::accept()
         projectPreferences->setValue( "video/VideoProjectWidth", field( "width" ) );
         projectPreferences->setValue( "video/AspectRatio", field( "aspectratio" ) );
         projectPreferences->setValue( "video/VideoBitRate", field( "vbitrate" ) );
-        projectPreferences->setValue( "audio/AudioSampleRate", field( "samplerate" ) );
-        projectPreferences->setValue( "audio/AudioBitRate", field( "abitrate" ) );
+        projectPreferences->setValue( "audio/AudioSampleRate", field( "samplerate" ).toString().replace( " Hz", "" ) );
+        projectPreferences->setValue( "audio/AudioBitRate", field( "abitrate" ).toString().replace( " Kbps", "" ) );
         projectPreferences->setValue( "audio/NbChannels", field( "samplerate" ) );
     }
     QDialog::accept();
diff --git a/src/Gui/wizard/VideoPage.cpp b/src/Gui/wizard/VideoPage.cpp
index b997c3c..53c2b05 100644
--- a/src/Gui/wizard/VideoPage.cpp
+++ b/src/Gui/wizard/VideoPage.cpp
@@ -41,9 +41,9 @@ VideoPage::VideoPage( QWidget* parent ) :
     registerField( "width", ui.spinBoxVideoWidth );
     registerField( "height", ui.spinBoxVideoHeight );
     registerField( "aspectratio", ui.lineEditVideoAspectRatio );
-    registerField( "samplerate", ui.comboBoxAudioSamplerate );
+    registerField( "samplerate", ui.comboBoxAudioSamplerate, "currentText" );
     registerField( "channels", ui.spinBoxAudioChannels );
-    registerField( "abitrate", ui.comboBoxAudioBitrate );
+    registerField( "abitrate", ui.comboBoxAudioBitrate, "currentText" );
     registerField( "vbitrate", ui.spinBoxVideoBitrate );
 }
 



More information about the Vlmc-devel mailing list