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
76ab0c70
Commit
76ab0c70
authored
Dec 09, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: SeekPoints / Input Slider: fix behaviour for 0 timed seekpoint
parent
ea5c435f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
modules/gui/qt4/adapters/seekpoints.cpp
modules/gui/qt4/adapters/seekpoints.cpp
+9
-4
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+8
-2
No files found.
modules/gui/qt4/adapters/seekpoints.cpp
View file @
76ab0c70
...
...
@@ -53,10 +53,15 @@ void SeekPoints::update()
/* lock here too, as update event is triggered by an external thread */
if
(
!
access
()
)
return
;
pointsList
.
clear
();
for
(
int
i
=
0
;
i
<
p_title
->
i_seekpoint
;
i
++
)
if
(
p_title
->
seekpoint
[
i
]
->
i_time_offset
>
0
)
pointsList
<<
SeekPoint
(
p_title
->
seekpoint
[
i
]
);
if
(
p_title
->
i_seekpoint
>
0
)
{
/* first check the last point to see if we have filled time offsets (> 0) */
if
(
p_title
->
seekpoint
[
p_title
->
i_seekpoint
-
1
]
->
i_time_offset
>
0
)
{
for
(
int
i
=
0
;
i
<
p_title
->
i_seekpoint
;
i
++
)
pointsList
<<
SeekPoint
(
p_title
->
seekpoint
[
i
]
);
}
}
vlc_input_title_Delete
(
p_title
);
release
();
}
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
76ab0c70
...
...
@@ -200,6 +200,9 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
{
QList
<
SeekPoint
>
points
=
chapters
->
getPoints
();
int
i_selected
=
-
1
;
bool
b_startsnonzero
=
false
;
/* as we always starts at 1 */
if
(
points
.
count
()
>
0
)
/* do we need an extra offset ? */
b_startsnonzero
=
(
points
.
at
(
0
).
time
>
0
);
int
i_min_diff
=
i_width
+
1
;
for
(
int
i
=
0
;
i
<
points
.
count
()
;
i
++
)
{
...
...
@@ -208,7 +211,7 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
if
(
diff_x
<
i_min_diff
)
{
i_min_diff
=
diff_x
;
i_selected
=
i
;
i_selected
=
i
+
(
(
b_startsnonzero
)
?
1
:
0
)
;
}
else
break
;
}
if
(
i_selected
&&
i_min_diff
<
4
)
// max 4px around mark
...
...
@@ -248,11 +251,14 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
{
QList
<
SeekPoint
>
points
=
chapters
->
getPoints
();
int
i_selected
=
-
1
;
bool
b_startsnonzero
=
false
;
if
(
points
.
count
()
>
0
)
b_startsnonzero
=
(
points
.
at
(
0
).
time
>
0
);
for
(
int
i
=
0
;
i
<
points
.
count
()
;
i
++
)
{
int
x
=
points
.
at
(
i
).
time
/
1000000.0
/
inputLength
*
size
().
width
();
if
(
event
->
x
()
>=
x
)
i_selected
=
i
;
i_selected
=
i
+
(
(
b_startsnonzero
)
?
1
:
0
)
;
}
if
(
i_selected
>=
0
)
chapterLabel
=
points
.
at
(
i_selected
).
name
;
...
...
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