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
self->emit snapshotTaken( event->u.media_player_snapshot_taken.psz_filename );
break;
case libvlc_MediaPlayerEncounteredError:
qDebug() << "libvlc_MediaPlayerEncounteredError received."
qDebug() << '[' << (void*)self << "] libvlc_MediaPlayerEncounteredError received."
<< "This is not looking good...";
self->emit errorEncountered();
break ;
......
......@@ -212,6 +212,15 @@ signals:
* \sa stopped();
*/
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
......@@ -68,6 +68,7 @@ void WorkflowRenderer::initializeRenderer()
//Media player part: to update PreviewWidget
connect( m_mediaPlayer, SIGNAL( playing() ), this, SIGNAL( playing() ), 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
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SIGNAL( endReached() ) );
}
......@@ -409,3 +410,10 @@ WorkflowRenderer::mainWorkflowLenghtChanged( qint64 /*newLength*/ )
// }
// m_oldLength = newLength;
}
void
WorkflowRenderer::errorEncountered()
{
stop();
emit error();
}
......@@ -304,6 +304,13 @@ class WorkflowRenderer : public GenericRenderer
*/
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
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