Commit 128c2325 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Seek working in clip

parent 93eeed79
......@@ -40,6 +40,9 @@ PreviewWidget::PreviewWidget( QWidget *parent ) :
int vlc_argc = sizeof( vlc_argv ) / sizeof( *vlc_argv );
setAcceptDrops(true);
m_currentInstance = new LibVLCpp::Instance( vlc_argc, vlc_argv );
connect( m_ui->seekSlider, SIGNAL( sliderMoved(int) ),
this, SLOT( seekSliderMoved(int) ) );
}
PreviewWidget::~PreviewWidget()
......@@ -90,7 +93,15 @@ void PreviewWidget::videoTimeChanged()
{
if ( m_currentMedia )
{
m_ui->seekSlider->setMaximum( m_currentMedia->getLength() / 1000 );
m_ui->seekSlider->setSliderPosition( m_currentMedia->getTime() / 1000 );
m_ui->seekSlider->setMaximum( m_currentMedia->getLength() / 100 );
m_ui->seekSlider->setSliderPosition( m_currentMedia->getTime() / 100 );
}
}
void PreviewWidget::seekSliderMoved( int value )
{
if ( m_currentMedia )
{
m_currentMedia->setTime( m_ui->seekSlider->value() * 100 );
}
}
......@@ -47,6 +47,7 @@ protected:
private slots:
void videoTimeChanged();
void seekSliderMoved( int value );
private:
Ui::PreviewWidget* m_ui;
......
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