Commit 2ce6b602 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Using preferences values for FPS in renderers

parent d609e910
/*****************************************************************************
* WorkflowFileRenderer.cpp: Output the workflow to a file
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Hugo Beauzee-Luyssen <hugo@vlmc.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "WorkflowFileRenderer.h"
#include "SettingsManager.h"
WorkflowFileRenderer::WorkflowFileRenderer( const QString& outputFileName ) :
m_outputFileName( outputFileName )
......@@ -41,6 +64,7 @@ void WorkflowFileRenderer::run()
m_isRendering = true;
m_stopping = false;
m_outputFps = SettingsManager::getInstance()->getValue( "default", "VLMCOutPutFPS" ).toDouble();
m_mainWorkflow->setFullSpeedRender( true );
m_mainWorkflow->startRender();
......@@ -62,3 +86,8 @@ void WorkflowFileRenderer::cancelButtonClicked()
{
stop();
}
float WorkflowFileRenderer::getFps() const
{
return m_outputFps;
}
......@@ -41,6 +41,7 @@ public:
static void unlock( void* datas );
void run();
virtual float getFps() const;
private:
const QString m_outputFileName;
WorkflowFileRendererDialog* m_dialog;
......
......@@ -26,9 +26,7 @@
#include "vlmc.h"
#include "WorkflowRenderer.h"
#include "Timeline.h"
//FIXME: remove this...
#define OUTPUT_FPS 30
#include "SettingsManager.h"
WorkflowRenderer::WorkflowRenderer() :
m_mainWorkflow( MainWorkflow::getInstance() ),
......@@ -173,6 +171,7 @@ void WorkflowRenderer::startPreview()
m_isRendering = true;
m_paused = false;
m_stopping = false;
m_outputFps = SettingsManager::getInstance()->getValue( "default", "VLMCPreviewFPS" ).toDouble();
}
void WorkflowRenderer::setPosition( float newPos )
......@@ -276,13 +275,12 @@ qint64 WorkflowRenderer::getCurrentFrame() const
qint64 WorkflowRenderer::getLengthMs() const
{
return m_mainWorkflow->getLengthFrame() * OUTPUT_FPS * 1000;
return m_mainWorkflow->getLengthFrame() * getFps() * 1000;
}
float WorkflowRenderer::getFps() const
{
//Sigh :'(
return static_cast<float>( OUTPUT_FPS );
return m_outputFps;
}
/////////////////////////////////////////////////////////////////////
......
......@@ -74,6 +74,7 @@ class WorkflowRenderer : public GenericRenderer
MainWorkflow* m_mainWorkflow;
LibVLCpp::Media* m_media;
bool m_stopping;
float m_outputFps;
private:
unsigned char* m_renderVideoFrame;
......
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