Commit 13965bee authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding a GenericRenderer::getFps() method

parent 91ffce77
......@@ -218,6 +218,13 @@ qint64 ClipRenderer::getCurrentFrame() const
return m_mediaPlayer->getPosition() * ( m_end - m_begin ) - m_begin;
}
float ClipRenderer::getFps() const
{
if ( m_selectedMedia != NULL )
return m_selectedMedia->getFps();
return 0.0f;
}
/////////////////////////////////////////////////////////////////////
/////SLOTS :
/////////////////////////////////////////////////////////////////////
......
......@@ -46,6 +46,7 @@ public:
virtual void previousFrame();
virtual qint64 getLengthMs() const;
virtual qint64 getCurrentFrame() const;
virtual float getFps() const;
private:
void startPreview();
......
......@@ -63,6 +63,7 @@ public:
virtual void setPosition( float newPos ) = 0;
virtual qint64 getLengthMs() const = 0;
virtual qint64 getCurrentFrame() const = 0;
virtual float getFps() const = 0;
bool isPaused() const
{
......
......@@ -265,6 +265,22 @@ void WorkflowRenderer::stop()
m_mainWorkflow->stop();
}
qint64 WorkflowRenderer::getCurrentFrame() const
{
return m_mainWorkflow->getCurrentFrame();
}
qint64 WorkflowRenderer::getLengthMs() const
{
return m_mainWorkflow->getLengthFrame() * OUTPUT_FPS * 1000;
}
float WorkflowRenderer::getFps() const
{
//Sigh :'(
return static_cast<float>( OUTPUT_FPS );
}
/////////////////////////////////////////////////////////////////////
/////SLOTS :
/////////////////////////////////////////////////////////////////////
......@@ -312,12 +328,3 @@ void WorkflowRenderer::timelineCursorChanged( qint64 newFrame )
m_mainWorkflow->setCurrentFrame( newFrame );
}
qint64 WorkflowRenderer::getCurrentFrame() const
{
return m_mainWorkflow->getCurrentFrame();
}
qint64 WorkflowRenderer::getLengthMs() const
{
return m_mainWorkflow->getLengthFrame() * OUTPUT_FPS * 1000;
}
......@@ -57,6 +57,7 @@ class WorkflowRenderer : public GenericRenderer
virtual void previousFrame();
virtual qint64 getLengthMs() const;
virtual qint64 getCurrentFrame() const;
virtual float getFps() const;
static void* lock( void* datas );
static void* lockAudio( void* datas );
......
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