Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
0148372f
Commit
0148372f
authored
Jan 21, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimeSlider fix for #4328
parent
44c22a5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+7
-10
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+0
-1
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
0148372f
...
...
@@ -41,8 +41,8 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
QSlider
(
q
,
_parent
)
{
b_isSliding
=
false
;
lastSeeked
=
0
;
/* Timer used to fire intermediate seekTick() when sliding */
timer
=
new
QTimer
(
this
);
timer
->
setSingleShot
(
true
);
...
...
@@ -58,7 +58,7 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
setPosition
(
-
1.0
,
0
,
0
);
secstotimestr
(
psz_length
,
0
);
CONNECT
(
this
,
valueChang
ed
(
int
),
this
,
userDrag
(
int
)
);
CONNECT
(
this
,
sliderMov
ed
(
int
),
this
,
userDrag
(
int
)
);
CONNECT
(
timer
,
timeout
(),
this
,
seekTick
()
);
}
...
...
@@ -80,25 +80,24 @@ void InputSlider::setPosition( float pos, int64_t a, int b )
void
InputSlider
::
userDrag
(
int
new_value
)
{
/* Only fire one update, when sliding, every 150ms */
if
(
b_isSliding
&&
!
timer
->
isActive
()
)
timer
->
start
(
150
);
}
void
InputSlider
::
seekTick
()
{
if
(
value
()
!=
lastSeeked
)
{
lastSeeked
=
value
();
float
f_pos
=
(
float
)(
lastSeeked
)
/
1000.0
;
emit
sliderDragged
(
f_pos
);
}
float
f_pos
=
(
float
)(
value
())
/
1000.0
;
emit
sliderDragged
(
f_pos
);
/* Send new position to our video */
}
void
InputSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
timer
->
stop
();
/* We're not sliding anymore: only last seek on release */
b_isSliding
=
false
;
event
->
accept
();
QSlider
::
mouseReleaseEvent
(
event
);
seekTick
();
}
void
InputSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
...
...
@@ -116,8 +115,6 @@ void InputSlider::mousePressEvent(QMouseEvent* event)
Qt
::
MouseButtons
(
event
->
buttons
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
event
->
modifiers
()
);
QSlider
::
mousePressEvent
(
&
newEvent
);
seekTick
();
}
void
InputSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
0148372f
...
...
@@ -50,7 +50,6 @@ private:
bool
b_isSliding
;
/* Whether we are currently sliding by user action */
int
inputLength
;
/* InputLength that can change */
char
psz_length
[
MSTRTIME_MAX_SIZE
];
/* Used for the ToolTip */
int
lastSeeked
;
QTimer
*
timer
;
public
slots
:
...
...
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