[vlmc-devel] [PATCH 4/5] Project: Add AudioBitrate and VideoBitrate to settings
Yikai Lu
luyikei.qmltu at gmail.com
Wed Apr 6 14:01:14 CEST 2016
---
src/Project/Project.cpp | 22 ++++++++++++++++++++++
src/Project/Project.h | 2 ++
2 files changed, 24 insertions(+)
diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index 7e01e4b..3310576 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -207,6 +207,16 @@ Project::initSettings()
QT_TRANSLATE_NOOP( "PreferenceWidget", "Output project audio samplerate"),
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 (kbps)"),
+ 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;
--
1.9.1
More information about the Vlmc-devel
mailing list