Commit d969d03d authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding a getCurrentFrame getter for all renderers.

parent fa3541d4
......@@ -183,7 +183,7 @@ void ClipRenderer::previousFrame()
}
}
qint64 ClipRenderer::length()
qint64 ClipRenderer::length() const
{
if ( m_clipLoaded )
return qMax( m_end - m_begin, (qint64)0 );
......@@ -211,6 +211,13 @@ void ClipRenderer::setSnapshotVisibility( bool val )
m_renderWidget->setVisible( !val );
}
qint64 ClipRenderer::getCurrentFrame() const
{
if ( m_clipLoaded == false || m_isRendering == false || m_selectedMedia == NULL )
return 0;
return length() * m_selectedMedia->getFps();
}
/////////////////////////////////////////////////////////////////////
/////SLOTS :
/////////////////////////////////////////////////////////////////////
......
......@@ -44,7 +44,8 @@ public:
virtual void stop();
virtual void nextFrame();
virtual void previousFrame();
virtual qint64 length();
virtual qint64 length() const;
virtual qint64 getCurrentFrame() const;
private:
void startPreview();
......
......@@ -61,7 +61,8 @@ public:
virtual void previousFrame() = 0;
virtual void stop() = 0;
virtual void setPosition( float newPos ) = 0;
virtual qint64 length() = 0;
virtual qint64 length() const = 0;
virtual qint64 getCurrentFrame() const = 0;
bool isPaused() const
{
......
......@@ -308,3 +308,8 @@ void WorkflowRenderer::timelineCursorChanged( qint64 newFrame )
{
m_mainWorkflow->setCurrentFrame( newFrame );
}
qint64 WorkflowRenderer::getCurrentFrame() const
{
return m_mainWorkflow->getCurrentFrame();
}
......@@ -55,7 +55,8 @@ class WorkflowRenderer : public GenericRenderer
virtual void stop();
virtual void nextFrame();
virtual void previousFrame();
virtual qint64 length() { return 0; }
virtual qint64 length() const { return 0; }
virtual qint64 getCurrentFrame() 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