Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
41937ff2
Commit
41937ff2
authored
Apr 03, 2009
by
Ludovic Fauvet
Browse files
The slider under the clip preview is seeking while the video plays
parent
42af462b
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/InputMedia.h
View file @
41937ff2
...
...
@@ -29,6 +29,7 @@
#include
<QThread>
#include
"Media.h"
#include
"VLCMediaPlayer.h"
#include
"Image.h"
...
...
@@ -59,8 +60,13 @@ public:
* Return the length (duration) of a Media
*/
qint64
getLength
();
/**
* Return the current time of the media
*/
qint64
getTime
();
/**
* Change the current time of the media
*/
void
setTime
(
qint64
time
);
/**
...
...
@@ -72,6 +78,7 @@ public:
virtual
void
pause
();
virtual
void
stop
();
void
setDrawable
(
WId
handle
);
LibVLCpp
::
MediaPlayer
*
mediaPlayer
()
{
return
m_vlcMediaPlayer
;
}
private:
QImage
*
m_snapshot
;
...
...
src/LibVLCpp/VLCMediaPlayer.cpp
View file @
41937ff2
...
...
@@ -36,6 +36,7 @@ MediaPlayer::MediaPlayer( Media* media, bool playStop /* = true*/ )
// Register the callback
libvlc_event_attach
(
p_em
,
libvlc_MediaPlayerSnapshotTaken
,
callbacks
,
this
,
m_ex
);
libvlc_event_attach
(
p_em
,
libvlc_MediaPlayerTimeChanged
,
callbacks
,
this
,
m_ex
);
}
/**
...
...
@@ -62,7 +63,9 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev
// case libvlc_MediaPlayerBackward:
// case libvlc_MediaPlayerEndReached:
// case libvlc_MediaPlayerEncounteredError:
// case libvlc_MediaPlayerTimeChanged:
case
libvlc_MediaPlayerTimeChanged
:
self
->
emit
timeChanged
();
break
;
// case libvlc_MediaPlayerPositionChanged:
// case libvlc_MediaPlayerSeekableChanged:
// case libvlc_MediaPlayerPausableChanged:
...
...
src/LibVLCpp/VLCMediaPlayer.h
View file @
41937ff2
...
...
@@ -59,6 +59,7 @@ namespace LibVLCpp
signals:
void
snapshotTaken
();
void
timeChanged
();
};
}
...
...
src/gui/PreviewWidget.cpp
View file @
41937ff2
...
...
@@ -3,7 +3,7 @@
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Geoffroy Lacarrire <geoffroylaca@gmail.com>
* Authors: Geoffroy Lacarri
è
re <geoffroylaca@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -79,4 +79,17 @@ void PreviewWidget::dropEvent( QDropEvent* event )
m_currentMedia
->
setupMedia
();
m_currentMedia
->
setDrawable
(
m_ui
->
clipRenderWidget
->
winId
()
);
m_currentMedia
->
play
();
connect
(
m_currentMedia
->
mediaPlayer
(),
SIGNAL
(
timeChanged
()
),
this
,
SLOT
(
videoTimeChanged
()
)
);
}
void
PreviewWidget
::
videoTimeChanged
()
{
if
(
m_currentMedia
)
{
m_ui
->
seekSlider
->
setMaximum
(
m_currentMedia
->
getLength
()
/
1000
);
m_ui
->
seekSlider
->
setSliderPosition
(
m_currentMedia
->
getTime
()
/
1000
);
}
}
src/gui/PreviewWidget.h
View file @
41937ff2
...
...
@@ -3,7 +3,7 @@
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Geoffroy Lacarrire <geoffroylaca@gmail.com>
* Authors: Geoffroy Lacarri
è
re <geoffroylaca@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -45,6 +45,9 @@ protected:
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dropEvent
(
QDropEvent
*
event
);
private
slots
:
void
videoTimeChanged
();
private:
Ui
::
PreviewWidget
*
m_ui
;
InputMedia
*
m_currentMedia
;
...
...
src/gui/ui/PreviewWidget.ui
View file @
41937ff2
...
...
@@ -70,7 +70,7 @@
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QSlider"
name=
"
horizontal
Slider"
>
<widget
class=
"QSlider"
name=
"
seek
Slider"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment