Commit 075d4367 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Corrected behaviour for pause/stop/play again in ClipPreviewWidget

parent 9054c492
......@@ -42,7 +42,7 @@ void ClipPreviewWidget::startPreview( Media* media )
m_mediaPlayer->setMedia( m_vlcMedia );
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( __videoPaused() ) );
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( __videoStopped() ) );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ) );
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ) );
connect( m_mediaPlayer, SIGNAL( positionChanged() ), this, SLOT( __positionChanged() ) );
......@@ -75,16 +75,16 @@ void ClipPreviewWidget::togglePlayPause( bool forcePause )
{
if ( m_clipLoaded == false)
return ;
if ( m_isRendering == false )
m_isRendering = true;
if ( m_paused == false )
if ( m_paused == false && m_isRendering == true )
{
m_mediaPlayer->pause();
m_paused = true;
}
else if ( forcePause == false )
{
if ( m_isRendering == false )
m_isRendering = true;
m_mediaPlayer->play();
m_paused = false;
}
......@@ -116,6 +116,11 @@ void ClipPreviewWidget::__videoPaused()
emit paused();
}
void ClipPreviewWidget::__videoStopped()
{
emit stopped();
}
void ClipPreviewWidget::__videoPlaying()
{
emit playing();
......
......@@ -56,6 +56,7 @@ public slots:
void __videoPaused();
void __videoPlaying();
void __endReached();
void __videoStopped();
};
#endif // CLIPPREVIEWWIDGET_H
......@@ -81,7 +81,7 @@ void PreviewWidget::connectPreview( GenericPreviewWidget* target )
{
//WARNING: the slots must NOT be virtual, since this is called from the constructor
// which would be unsafe... if not fatal...
connect( target, SIGNAL( stopped() ), this, SLOT( videoPaused() ) );
connect( target, SIGNAL( stopped() ), this, SLOT( videoStopped() ) );
connect( target, SIGNAL( paused() ), this, SLOT( videoPaused() ) );
connect( target, SIGNAL( playing() ), this, SLOT( videoPlaying() ) );
connect( target, SIGNAL( positionChanged(float) ), this, SLOT( positionChanged(float) ) );
......@@ -200,6 +200,12 @@ void PreviewWidget::videoPaused()
m_ui->pushButtonPlay->setIcon( QIcon( ":/images/play" ) );
}
void PreviewWidget::videoStopped()
{
m_ui->pushButtonPlay->setIcon( QIcon( ":/images/play" ) );
m_ui->seekSlider->setValue( 0 );
}
void PreviewWidget::videoPlaying()
{
m_ui->pushButtonPlay->setIcon( QIcon( ":/images/pause" ) );
......
......@@ -75,6 +75,7 @@ private slots:
void seekSliderReleased();
void videoPaused();
void videoPlaying();
void videoStopped();
void endReached();
void changedTab( int );
......
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