Commit 462b086c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

WorkflowRenderer: Detect when something went wrong.

parent 9ec88dcd
...@@ -113,7 +113,7 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev ...@@ -113,7 +113,7 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev
self->emit snapshotTaken( event->u.media_player_snapshot_taken.psz_filename ); self->emit snapshotTaken( event->u.media_player_snapshot_taken.psz_filename );
break; break;
case libvlc_MediaPlayerEncounteredError: case libvlc_MediaPlayerEncounteredError:
qDebug() << "libvlc_MediaPlayerEncounteredError received." qDebug() << '[' << (void*)self << "] libvlc_MediaPlayerEncounteredError received."
<< "This is not looking good..."; << "This is not looking good...";
self->emit errorEncountered(); self->emit errorEncountered();
break ; break ;
......
...@@ -212,6 +212,15 @@ signals: ...@@ -212,6 +212,15 @@ signals:
* \sa stopped(); * \sa stopped();
*/ */
void endReached(); void endReached();
/**
* \brief Emited when something went wrong with the render.
*
* The cause may vary depending on the underlying renderer, though this will
* almost always be caused by a missing codec.
*/
void error();
}; };
#endif // GENERICRENDERER_H #endif // GENERICRENDERER_H
...@@ -68,6 +68,7 @@ void WorkflowRenderer::initializeRenderer() ...@@ -68,6 +68,7 @@ void WorkflowRenderer::initializeRenderer()
//Media player part: to update PreviewWidget //Media player part: to update PreviewWidget
connect( m_mediaPlayer, SIGNAL( playing() ), this, SIGNAL( playing() ), Qt::DirectConnection ); connect( m_mediaPlayer, SIGNAL( playing() ), this, SIGNAL( playing() ), Qt::DirectConnection );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SIGNAL( paused() ), Qt::DirectConnection ); connect( m_mediaPlayer, SIGNAL( paused() ), this, SIGNAL( paused() ), Qt::DirectConnection );
connect( m_mediaPlayer, SIGNAL( errorEncountered() ), this, SLOT( errorEncountered() ) );
//FIXME:: check if this doesn't require Qt::QueuedConnection //FIXME:: check if this doesn't require Qt::QueuedConnection
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SIGNAL( endReached() ) ); connect( m_mediaPlayer, SIGNAL( stopped() ), this, SIGNAL( endReached() ) );
} }
...@@ -409,3 +410,10 @@ WorkflowRenderer::mainWorkflowLenghtChanged( qint64 /*newLength*/ ) ...@@ -409,3 +410,10 @@ WorkflowRenderer::mainWorkflowLenghtChanged( qint64 /*newLength*/ )
// } // }
// m_oldLength = newLength; // m_oldLength = newLength;
} }
void
WorkflowRenderer::errorEncountered()
{
stop();
emit error();
}
...@@ -304,6 +304,13 @@ class WorkflowRenderer : public GenericRenderer ...@@ -304,6 +304,13 @@ class WorkflowRenderer : public GenericRenderer
*/ */
void mainWorkflowLenghtChanged( qint64 newLength ); void mainWorkflowLenghtChanged( qint64 newLength );
/**
* \brief Used to catch an error in the rendering part
*
* Most likely, this will be called if the required codec aren't found.
* This will stop the render and emit the error() signal.
*/
void errorEncountered();
}; };
#endif // WORKFLOWRENDERER_H #endif // WORKFLOWRENDERER_H
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