[vlmc-devel] [PATCH 10/12] Project: Add AudioBitrate and VideoBitrate to settings
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Wed Apr 6 11:21:41 CEST 2016
On 04/06/2016 09:58 AM, Yikai Lu wrote:
> ---
> src/Project/Project.cpp | 34 ++++++++++++++++++++++++++++++++++
> src/Project/Project.h | 4 ++++
> 2 files changed, 38 insertions(+)
>
> diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
> index 6a291fc..634e621 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"),
> + 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 );
You probably want to specify the unit in the description
> 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();
> @@ -360,6 +382,18 @@ Project::setAspectRatio( const QString &ar )
> }
>
> void
> +Project::setAudioBitrate( unsigned int rate )
> +{
> + m_settings->value( "audio/AudioBitRate" )->set( rate );
> +}
> +
> +void
> +Project::setVideoBitrate( unsigned int rate )
> +{
> + m_settings->value( "video/VideoBitRate" )->set( rate );
> +}
> +
> +void
> Project::setSampleRate( unsigned int rate )
> {
> m_settings->value( "audio/AudioSampleRate" )->set( rate );
> diff --git a/src/Project/Project.h b/src/Project/Project.h
> index 6024090..01d3727 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;
>
> @@ -88,6 +90,8 @@ class Project : public QObject
> void setWidth( unsigned int width );
> void setHeight( unsigned int height );
> void setAspectRatio( const QString& ar );
> + void setAudioBitrate( unsigned int rate );
> + void setVideoBitrate( unsigned int rate );
> void setSampleRate( unsigned int rate );
> void setNbChannels( unsigned int nbChannels );
>
>
All good otherwise, minus the setter part, since I'm not sure it belongs
in the project class
Regards,
More information about the Vlmc-devel
mailing list