[vlmc-devel] Project: Apply fps to Backend when changed

Yikai Lu git at videolan.org
Thu Jun 30 16:33:12 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Thu Jun 30 18:16:22 2016 +0900| [38a13d66647123f34b7c968dff42be7399fe0620] | committer: Yikai Lu

Project: Apply fps to Backend when changed

> https://code.videolan.org/videolan/vlmc/commit/38a13d66647123f34b7c968dff42be7399fe0620
---

 src/Gui/timeline/TracksRuler.cpp | 3 ---
 src/Project/Project.cpp          | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Gui/timeline/TracksRuler.cpp b/src/Gui/timeline/TracksRuler.cpp
index 216f4ed..3b96de5 100644
--- a/src/Gui/timeline/TracksRuler.cpp
+++ b/src/Gui/timeline/TracksRuler.cpp
@@ -34,9 +34,6 @@ const int TracksRuler::comboScale[] = { 1, 2, 5, 10, 25, 50, 125, 250, 500, 725,
 TracksRuler::TracksRuler( TracksView* tracksView, QWidget* parent )
     : QWidget( parent ), m_tracksView( tracksView ), m_duration ( 0 ), m_offset( 0 )
 {
-
-    //TODO We should really get that from the
-    // workflow and not directly from the settings.
     m_fps = qRound( Core::instance()->project()->fps() );
 
     m_factor = 1;
diff --git a/src/Project/Project.cpp b/src/Project/Project.cpp
index e016e0d..2f19542 100644
--- a/src/Project/Project.cpp
+++ b/src/Project/Project.cpp
@@ -28,6 +28,7 @@
 
 
 #include "Backend/IBackend.h"
+#include "Backend/IProfile.h"
 #include "Project.h"
 #include "RecentProjects.h"
 #include "Settings/Settings.h"
@@ -216,6 +217,9 @@ Project::initSettings()
                                     QT_TRANSLATE_NOOP( "PreferenceWidget", "The project name" ),
                                     SettingValue::NotEmpty );
     connect( pName, SIGNAL( changed( QVariant ) ), this, SLOT( projectNameChanged( QVariant ) ) );
+    connect( fps, &SettingValue::changed, this,
+             [this]( const QVariant& var ){ Backend::instance()->profile().setFrameRate( var.toDouble() * 100, 100 ); }
+    );
 }
 
 void



More information about the Vlmc-devel mailing list