Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
afd03903
Commit
afd03903
authored
Jun 12, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: display buffering in SeekSlider
parent
9abb97d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.cpp
+2
-0
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+18
-1
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+2
-0
No files found.
modules/gui/qt4/components/controller.cpp
View file @
afd03903
...
...
@@ -347,6 +347,8 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
/* And update the IM, when the position has changed */
CONNECT
(
slider
,
sliderDragged
(
float
),
THEMIM
->
getIM
(),
sliderUpdate
(
float
)
);
CONNECT
(
THEMIM
->
getIM
(),
cachingChanged
(
float
),
slider
,
updateBuffering
(
float
)
);
widget
=
slider
;
}
break
;
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
afd03903
...
...
@@ -51,6 +51,7 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
:
QSlider
(
q
,
_parent
)
{
b_isSliding
=
false
;
f_buffering
=
1.0
;
/* Timer used to fire intermediate updatePos() when sliding */
seekLimitTimer
=
new
QTimer
(
this
);
...
...
@@ -74,7 +75,6 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
CONNECT
(
this
,
sliderMoved
(
int
),
this
,
startSeekTimer
()
);
CONNECT
(
seekLimitTimer
,
timeout
(),
this
,
updatePos
()
);
mTimeTooltip
->
installEventFilter
(
this
);
}
...
...
@@ -114,6 +114,12 @@ void SeekSlider::updatePos()
emit
sliderDragged
(
f_pos
);
/* Send new position to VLC's core */
}
void
SeekSlider
::
updateBuffering
(
float
f_buffering_
)
{
f_buffering
=
f_buffering_
;
repaint
();
}
void
SeekSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
event
->
accept
();
...
...
@@ -312,6 +318,17 @@ void SeekSlider::paintEvent( QPaintEvent *event )
painter
.
drawRoundedRect
(
valueRect
,
barCorner
,
barCorner
);
}
// draw buffering overlay
if
(
f_buffering
<
1.0
)
{
QRect
innerRect
=
barRect
.
adjusted
(
1
,
1
,
barRect
.
width
()
*
(
-
1.0
+
f_buffering
)
-
1
,
0
);
QColor
overlayColor
=
QColor
(
"Orange"
);
overlayColor
.
setAlpha
(
128
);
painter
.
setBrush
(
overlayColor
);
painter
.
drawRoundedRect
(
innerRect
,
barCorner
,
barCorner
);
}
// draw handle
if
(
option
.
state
&
QStyle
::
State_MouseOver
)
{
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
afd03903
...
...
@@ -66,9 +66,11 @@ private:
char
psz_length
[
MSTRTIME_MAX_SIZE
];
/* Used for the ToolTip */
QTimer
*
seekLimitTimer
;
TimeTooltip
*
mTimeTooltip
;
float
f_buffering
;
public
slots
:
void
setPosition
(
float
,
int64_t
,
int
);
void
updateBuffering
(
float
);
private
slots
:
void
startSeekTimer
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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