Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
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
Show 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 ) :
...
@@ -41,8 +41,8 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
QSlider
(
q
,
_parent
)
QSlider
(
q
,
_parent
)
{
{
b_isSliding
=
false
;
b_isSliding
=
false
;
lastSeeked
=
0
;
/* Timer used to fire intermediate seekTick() when sliding */
timer
=
new
QTimer
(
this
);
timer
=
new
QTimer
(
this
);
timer
->
setSingleShot
(
true
);
timer
->
setSingleShot
(
true
);
...
@@ -58,7 +58,7 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
...
@@ -58,7 +58,7 @@ InputSlider::InputSlider( Qt::Orientation q, QWidget *_parent ) :
setPosition
(
-
1.0
,
0
,
0
);
setPosition
(
-
1.0
,
0
,
0
);
secstotimestr
(
psz_length
,
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
()
);
CONNECT
(
timer
,
timeout
(),
this
,
seekTick
()
);
}
}
...
@@ -80,25 +80,24 @@ void InputSlider::setPosition( float pos, int64_t a, int b )
...
@@ -80,25 +80,24 @@ void InputSlider::setPosition( float pos, int64_t a, int b )
void
InputSlider
::
userDrag
(
int
new_value
)
void
InputSlider
::
userDrag
(
int
new_value
)
{
{
/* Only fire one update, when sliding, every 150ms */
if
(
b_isSliding
&&
!
timer
->
isActive
()
)
if
(
b_isSliding
&&
!
timer
->
isActive
()
)
timer
->
start
(
150
);
timer
->
start
(
150
);
}
}
void
InputSlider
::
seekTick
()
void
InputSlider
::
seekTick
()
{
{
if
(
value
()
!=
lastSeeked
)
float
f_pos
=
(
float
)(
value
())
/
1000.0
;
{
emit
sliderDragged
(
f_pos
);
/* Send new position to our video */
lastSeeked
=
value
();
float
f_pos
=
(
float
)(
lastSeeked
)
/
1000.0
;
emit
sliderDragged
(
f_pos
);
}
}
}
void
InputSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
void
InputSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
{
timer
->
stop
();
/* We're not sliding anymore: only last seek on release */
b_isSliding
=
false
;
b_isSliding
=
false
;
event
->
accept
();
event
->
accept
();
QSlider
::
mouseReleaseEvent
(
event
);
QSlider
::
mouseReleaseEvent
(
event
);
seekTick
();
}
}
void
InputSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
void
InputSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
...
@@ -116,8 +115,6 @@ void InputSlider::mousePressEvent(QMouseEvent* event)
...
@@ -116,8 +115,6 @@ void InputSlider::mousePressEvent(QMouseEvent* event)
Qt
::
MouseButtons
(
event
->
buttons
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
Qt
::
MouseButtons
(
event
->
buttons
()
^
Qt
::
LeftButton
^
Qt
::
MidButton
),
event
->
modifiers
()
);
event
->
modifiers
()
);
QSlider
::
mousePressEvent
(
&
newEvent
);
QSlider
::
mousePressEvent
(
&
newEvent
);
seekTick
();
}
}
void
InputSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
void
InputSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
0148372f
...
@@ -50,7 +50,6 @@ private:
...
@@ -50,7 +50,6 @@ private:
bool
b_isSliding
;
/* Whether we are currently sliding by user action */
bool
b_isSliding
;
/* Whether we are currently sliding by user action */
int
inputLength
;
/* InputLength that can change */
int
inputLength
;
/* InputLength that can change */
char
psz_length
[
MSTRTIME_MAX_SIZE
];
/* Used for the ToolTip */
char
psz_length
[
MSTRTIME_MAX_SIZE
];
/* Used for the ToolTip */
int
lastSeeked
;
QTimer
*
timer
;
QTimer
*
timer
;
public
slots
:
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