[vlmc-devel] Project: Add AudioBitrate and VideoBitrate to settings

Yikai Lu git at videolan.org
Wed Apr 6 14:39:53 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Wed Apr  6 20:59:05 2016 +0900| [5d0ee750e5d4ce5f22681d3d98196d5b3bafc00d] | committer: Hugo Beauzée-Luyssen

Project: Add AudioBitrate and VideoBitrate to settings

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

> https://code.videolan.org/videolan/vlmc/commit/5d0ee750e5d4ce5f22681d3d98196d5b3bafc00d
---

 src/Project/Project.cpp | 24 +++++++++++++++++++++++-
 src/Project/Project.h   |  2 ++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index 7e01e4b..5aeec8f 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -204,9 +204,19 @@ Project::initSettings()
                                 SettingValue::Nothing );
     SettingValue    *sampleRate = m_settings->createVar( SettingValue::Double, "audio/AudioSampleRate", 44100,
                              QT_TRANSLATE_NOOP( "PreferenceWidget", "Audio samplerate" ),
-                             QT_TRANSLATE_NOOP( "PreferenceWidget", "Output project audio samplerate"),
+                             QT_TRANSLATE_NOOP( "PreferenceWidget", "Output project audio samplerate (kbps)"),
                              SettingValue::Clamped );
     sampleRate->setLimits( 11025, 48000 );
+    SettingValue    *aBitRate = m_settings->createVar( SettingValue::Int, "audio/AudioBitRate", 256,
+                             QT_TRANSLATE_NOOP( "PreferenceWidget", "Audio bitrate" ),
+                             QT_TRANSLATE_NOOP( "PreferenceWidget", "Output project audio bitrate (kbps)"),
+                             SettingValue::Clamped );
+    aBitRate->setLimits( 8, 512 );
+    SettingValue    *vBitRate = m_settings->createVar( SettingValue::Int, "video/VideoBitRate", 4000,
+                             QT_TRANSLATE_NOOP( "PreferenceWidget", "Video bitrate" ),
+                             QT_TRANSLATE_NOOP( "PreferenceWidget", "Output project Video bitrate"),
+                             SettingValue::Clamped );
+    vBitRate->setLimits( 8, 8192 );
     SettingValue    *audioChannel = m_settings->createVar( SettingValue::Int, "audio/NbChannels", 2,
                                                              QT_TRANSLATE_NOOP("PreferenceWidget", "Audio channels" ),
                                                              QT_TRANSLATE_NOOP("PreferenceWidget", "Number of audio channels" ),
@@ -318,6 +328,18 @@ Project::aspectRatio() const
 }
 
 unsigned int
+Project::audioBitrate() const
+{
+    return m_settings->value( "audio/AudioBitRate" )->get().toUInt();
+}
+
+unsigned int
+Project::videoBitrate() const
+{
+    return m_settings->value( "video/VideoBitRate" )->get().toUInt();
+}
+
+unsigned int
 Project::sampleRate() const
 {
     return m_settings->value( "audio/AudioSampleRate" )->get().toUInt();
diff --git a/src/Project/Project.h b/src/Project/Project.h
index 108d985..d7ab887 100644
--- a/src/Project/Project.h
+++ b/src/Project/Project.h
@@ -79,6 +79,8 @@ class Project : public QObject
         unsigned int    width() const;
         unsigned int    height() const;
         QString         aspectRatio() const;
+        unsigned int    audioBitrate() const;
+        unsigned int    videoBitrate() const;
         unsigned int    sampleRate() const;
         unsigned int    nbChannels() const;
 



More information about the Vlmc-devel mailing list