Commit 953f29bc authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

PreviewWidget is functionnal again !

parent 2ad2f026
......@@ -29,7 +29,7 @@
PreviewWidget::PreviewWidget( QWidget *parent ) :
QDialog( parent ),
m_ui( new Ui::PreviewWidget )
m_ui( new Ui::PreviewWidget ), m_clipLoaded( false )
{
m_ui->setupUi( this );
m_ui->groupBoxButton->hide();
......@@ -97,22 +97,34 @@ void PreviewWidget::dropEvent( QDropEvent* event )
this,
SLOT( positionChanged() ) );
//TODO: add EndReached event.
m_mediaPlayer->play();
m_clipLoaded = true;
}
void PreviewWidget::positionChanged()
{
//TODO
if ( m_clipLoaded == false)
return ;
m_ui->seekSlider->setValue( (int)( m_mediaPlayer->getPosition() * 1000.0 ) );
}
void PreviewWidget::seekSliderMoved( int )
{
//TODO
if ( m_clipLoaded == false)
return ;
m_mediaPlayer->setPosition( (float)m_ui->seekSlider->value() / 1000.0 );
}
void PreviewWidget::on_pushButtonPlay_clicked()
{
//TODO
if ( m_clipLoaded == false)
return ;
if ( m_mediaPlayer->isPlaying() )
m_mediaPlayer->pause();
else
m_mediaPlayer->play();
}
void PreviewWidget::videoPaused()
......
......@@ -57,6 +57,7 @@ private:
//TODO: Is this really useful now ?!
LibVLCpp::Instance* m_currentInstance;
LibVLCpp::MediaPlayer* m_mediaPlayer;
bool m_clipLoaded;
};
#endif // PREVIEWWIDGET_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