[vlmc-devel] [PATCH 05/12] Project: Add setters of settings
Yikai Lu
luyikei.qmltu at gmail.com
Wed Apr 6 09:58:18 CEST 2016
---
src/Project/Project.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++
src/Project/Project.h | 9 +++++++++
2 files changed, 52 insertions(+)
diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index 7e01e4b..6a291fc 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -329,6 +329,49 @@ Project::nbChannels() const
return m_settings->value( "audio/NbChannels" )->get().toUInt();
}
+void
+Project::setName( const QString& name )
+{
+ m_settings->value( "vlmc/ProjectName" )->set( name );
+}
+
+void
+Project::setFps( double fps )
+{
+ m_settings->value( "video/VLMCOutputFPS" )->set( fps );
+}
+
+void
+Project::setWidth( unsigned int width )
+{
+ m_settings->value( "video/VideoProjectWidth" )->set( width );
+}
+
+void
+Project::setHeight( unsigned int height )
+{
+ m_settings->value( "video/VideoProjectHeight" )->set( height );
+}
+
+void
+Project::setAspectRatio( const QString &ar )
+{
+ m_settings->value( "video/AspectRatio" )->set( ar );
+}
+
+void
+Project::setSampleRate( unsigned int rate )
+{
+ m_settings->value( "audio/AudioSampleRate" )->set( rate );
+}
+
+void
+Project::setNbChannels( unsigned int nbChannels )
+{
+ m_settings->value( "audio/NbChannels" )->set( nbChannels );
+
+}
+
QFile* Project::emergencyBackupFile()
{
const QString lastProject = Core::instance()->settings()->value( "private/EmergencyBackup" )->get().toString();
diff --git a/src/Project/Project.h b/src/Project/Project.h
index 108d985..6024090 100644
--- a/src/Project/Project.h
+++ b/src/Project/Project.h
@@ -82,6 +82,15 @@ class Project : public QObject
unsigned int sampleRate() const;
unsigned int nbChannels() const;
+ // Settings setters
+ void setName( const QString& name );
+ void setFps( double fps );
+ void setWidth( unsigned int width );
+ void setHeight( unsigned int height );
+ void setAspectRatio( const QString& ar );
+ void setSampleRate( unsigned int rate );
+ void setNbChannels( unsigned int nbChannels );
+
public:
static QFile* emergencyBackupFile();
--
1.9.1
More information about the Vlmc-devel
mailing list