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

PreviewWidget is functionnal again !

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