Commit 8edb932f authored by luyikei's avatar luyikei

Timeline: Apply the new fps if it's changed by Project's settings

parent 3adf9b08
......@@ -514,6 +514,11 @@ Rectangle {
Connections {
target: workflow
onFpsChanged: {
page.fps = fps;
}
onLengthChanged: {
if ( page.length < length ) {
page.length = length;
......
......@@ -58,6 +58,7 @@ Core::Core()
QObject::connect( m_currentProject, &Project::projectLoaded, m_recentProjects, &RecentProjects::projectLoaded );
QObject::connect( m_currentProject, &Project::projectClosed, m_library, &Library::clear );
QObject::connect( m_currentProject, &Project::projectClosed, m_workflow, &MainWorkflow::clear );
QObject::connect( m_currentProject, &Project::fpsChanged, m_workflow, &MainWorkflow::fpsChanged );
m_timer.start();
}
......
......@@ -217,9 +217,7 @@ 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 ); }
);
connect( fps, &SettingValue::changed, this, [this]( const QVariant& var ){ emit fpsChanged( var.toDouble() ); } );
}
void
......
......@@ -124,6 +124,7 @@ class Project : public QObject
void projectClosed();
void backupProjectLoaded();
void outdatedBackupFileFound();
void fpsChanged( double fps );
private:
QFile* m_projectFile;
......
......@@ -132,6 +132,13 @@ MainWorkflow::setPosition( qint64 newFrame )
m_renderer->setPosition( newFrame );
}
void
MainWorkflow::setFps( double fps )
{
Backend::instance()->profile().setFrameRate( fps * 100, 100 );
emit fpsChanged( fps );
}
AbstractRenderer*
MainWorkflow::renderer()
{
......
......@@ -206,6 +206,8 @@ class MainWorkflow : public QObject
void setPosition( qint64 newFrame );
void setFps( double fps );
signals:
/**
* \brief Used to notify a change to the timeline and preview widget cursor
......@@ -239,6 +241,8 @@ class MainWorkflow : public QObject
*/
void lengthChanged( qint64 length );
void fpsChanged( double fps );
void clipAdded( const QString& uuid );
void clipResized( const QString& uuid );
void clipRemoved( const QString& uuid );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment