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
0147fb79
Commit
0147fb79
authored
Feb 22, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: renaming variables and simple cleanups in seekslider
parent
8cef4081
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
23 deletions
+24
-23
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+16
-16
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+8
-7
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
0147fb79
...
...
@@ -58,7 +58,7 @@
SeekSlider
::
SeekSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
)
:
QSlider
(
q
,
_parent
)
{
b_
isSliding
=
false
;
isSliding
=
false
;
f_buffering
=
1.0
;
mHandleOpacity
=
1.0
;
chapters
=
NULL
;
...
...
@@ -128,12 +128,12 @@ void SeekSlider::setPosition( float pos, int64_t time, int length )
if
(
pos
==
-
1.0
)
{
setEnabled
(
false
);
b_
isSliding
=
false
;
isSliding
=
false
;
}
else
setEnabled
(
true
);
if
(
!
b_
isSliding
)
if
(
!
isSliding
)
setValue
(
(
int
)(
pos
*
1000.0
)
);
inputLength
=
length
;
...
...
@@ -142,7 +142,7 @@ void SeekSlider::setPosition( float pos, int64_t time, int length )
void
SeekSlider
::
startSeekTimer
()
{
/* Only fire one update, when sliding, every 150ms */
if
(
b_
isSliding
&&
!
seekLimitTimer
->
isActive
()
)
if
(
isSliding
&&
!
seekLimitTimer
->
isActive
()
)
seekLimitTimer
->
start
(
150
);
}
...
...
@@ -161,12 +161,12 @@ void SeekSlider::updateBuffering( float f_buffering_ )
void
SeekSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
event
->
accept
();
b_
isSliding
=
false
;
isSliding
=
false
;
bool
b_seekPending
=
seekLimitTimer
->
isActive
();
seekLimitTimer
->
stop
();
/* We're not sliding anymore: only last seek on release */
if
(
b_is_j
umping
)
if
(
isJ
umping
)
{
b_is_j
umping
=
false
;
isJ
umping
=
false
;
return
;
}
QSlider
::
mouseReleaseEvent
(
event
);
...
...
@@ -184,7 +184,7 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
return
;
}
b_is_j
umping
=
false
;
isJ
umping
=
false
;
/* handle chapter clicks */
int
i_width
=
size
().
width
();
if
(
chapters
&&
inputLength
&&
i_width
)
...
...
@@ -215,14 +215,14 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
{
chapters
->
jumpTo
(
i_selected
);
event
->
accept
();
b_is_j
umping
=
true
;
isJ
umping
=
true
;
return
;
}
}
}
}
b_
isSliding
=
true
;
isSliding
=
true
;
setValue
(
QStyle
::
sliderValueFromPosition
(
MINIMUM
,
MAXIMUM
,
event
->
x
(),
width
(),
false
)
);
emit
sliderMoved
(
value
()
);
event
->
accept
();
...
...
@@ -230,7 +230,7 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
void
SeekSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
if
(
b_
isSliding
)
if
(
isSliding
)
{
setValue
(
QStyle
::
sliderValueFromPosition
(
MINIMUM
,
MAXIMUM
,
event
->
x
(),
width
(),
false
)
);
emit
sliderMoved
(
value
()
);
...
...
@@ -271,7 +271,7 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
void
SeekSlider
::
wheelEvent
(
QWheelEvent
*
event
)
{
/* Don't do anything if we are for somehow reason sliding */
if
(
!
b_
isSliding
)
if
(
!
isSliding
)
{
setValue
(
value
()
+
event
->
delta
()
/
12
);
/* 12 = 8 * 15 / 10
Since delta is in 1/8 of ° and mouse have steps of 15 °
...
...
@@ -573,7 +573,7 @@ SoundSlider::SoundSlider( QWidget *_parent, int _i_step, bool b_hard,
f_step
=
(
_i_step
*
100
)
/
AOUT_VOLUME_MAX
;
setRange
(
SOUNDMIN
,
b_hard
?
(
2
*
SOUNDMAX
)
:
SOUNDMAX
);
setMouseTracking
(
true
);
b_
isSliding
=
false
;
isSliding
=
false
;
b_mouseOutside
=
true
;
b_isMuted
=
false
;
...
...
@@ -652,7 +652,7 @@ void SoundSlider::mousePressEvent( QMouseEvent *event )
if
(
event
->
button
()
!=
Qt
::
RightButton
)
{
/* We enter the sliding mode */
b_
isSliding
=
true
;
isSliding
=
true
;
i_oldvalue
=
value
();
emit
sliderPressed
();
changeValue
(
event
->
x
()
-
paddingL
);
...
...
@@ -670,14 +670,14 @@ void SoundSlider::mouseReleaseEvent( QMouseEvent *event )
setValue
(
value
()
);
emit
sliderMoved
(
value
()
);
}
b_
isSliding
=
false
;
isSliding
=
false
;
b_mouseOutside
=
false
;
}
}
void
SoundSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
if
(
b_
isSliding
)
if
(
isSliding
)
{
QRect
rect
(
paddingL
-
15
,
-
1
,
WLENGTH
+
15
*
2
,
WHEIGHT
+
5
);
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
0147fb79
...
...
@@ -50,7 +50,7 @@ class SeekSlider : public QSlider
Q_OBJECT
Q_PROPERTY
(
qreal
handleOpacity
READ
handleOpacity
WRITE
setHandleOpacity
)
public:
SeekSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
);
SeekSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
=
0
);
~
SeekSlider
();
void
setChapters
(
SeekPoints
*
);
...
...
@@ -67,16 +67,17 @@ protected:
virtual
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
QSize
handleSize
()
const
;
QSize
sizeHint
()
const
;
virtual
QSize
sizeHint
()
const
;
bool
isAnimationRunning
()
const
;
qreal
handleOpacity
()
const
;
void
setHandleOpacity
(
qreal
opacity
);
private:
bool
b_isSliding
;
/* Whether we are currently sliding by user action */
bool
b_is_jumping
;
/* if we requested a jump to another chapter */
int
inputLength
;
/* InputLength that can change */
char
psz_length
[
MSTRTIME_MAX_SIZE
];
/* Used for the ToolTip */
bool
isSliding
;
/* Whether we are currently sliding by user action */
bool
isJumping
;
/* if we requested a jump to another chapter */
int
inputLength
;
/* InputLength that can change */
char
psz_length
[
MSTRTIME_MAX_SIZE
];
/* Used for the ToolTip */
QTimer
*
seekLimitTimer
;
TimeTooltip
*
mTimeTooltip
;
float
f_buffering
;
...
...
@@ -122,7 +123,7 @@ protected:
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
);
private:
bool
b_
isSliding
;
/* Whether we are currently sliding by user action */
bool
isSliding
;
/* Whether we are currently sliding by user action */
bool
b_mouseOutside
;
/* Whether the mouse is outside or inside the Widget */
int
i_oldvalue
;
/* Store the old Value before changing */
float
f_step
;
/* How much do we increase each time we wheel */
...
...
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