Commit 1c191aaa authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Deactivate connection betwin vlc_position_changed_event and the slider

...while moving the slider to change the video position.
parent de5b1ac7
......@@ -40,8 +40,9 @@ PreviewWidget::PreviewWidget( QWidget *parent ) :
setAcceptDrops( true );
connect( m_ui->seekSlider, SIGNAL( sliderPosChanged(int) ), this, SLOT( seekSliderMoved(int) ) );
connect( m_ui->seekSlider, SIGNAL( sliderReleased() ), this, SLOT( seekSliderReleased() ) );
connect( m_ui->seekSlider, SIGNAL( sliderPressed() ), this, SLOT( seekSliderPressed() ) );
connect( m_ui->seekSlider, SIGNAL( sliderPosChanged(int) ), this, SLOT( seekSliderMoved(int) ) );
connect( m_ui->seekSlider, SIGNAL( sliderReleased() ), this, SLOT( seekSliderReleased() ) );
m_mediaPlayer = new LibVLCpp::MediaPlayer();
m_mediaPlayer->setDrawable( m_ui->clipRenderWidget->winId() );
......@@ -103,6 +104,12 @@ void PreviewWidget::positionChanged()
m_ui->seekSlider->setValue( (int)( m_mediaPlayer->getPosition() * 1000.0 ) );
}
void PreviewWidget::seekSliderPressed()
{
disconnect( m_mediaPlayer, SIGNAL( positionChanged() ), this, SLOT( positionChanged() ) );
}
void PreviewWidget::seekSliderMoved( int )
{
if ( m_clipLoaded == false)
......@@ -123,6 +130,7 @@ void PreviewWidget::seekSliderReleased()
m_mediaPlayer->setPosition( (float)m_ui->seekSlider->maximum() / 1000.0 );
m_endReached = false;
}
connect( m_mediaPlayer, SIGNAL( positionChanged() ), this, SLOT( positionChanged() ) );
}
void PreviewWidget::on_pushButtonPlay_clicked()
......@@ -150,3 +158,4 @@ void PreviewWidget::endReached()
m_mediaPlayer->stop();
m_ui->seekSlider->setValue( 0 );
}
......@@ -50,6 +50,7 @@ protected:
private slots:
void on_pushButtonPlay_clicked();
void positionChanged();
void seekSliderPressed();
void seekSliderMoved( int value );
void seekSliderReleased();
void videoPaused();
......
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