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
7def61c8
Commit
7def61c8
authored
Jun 25, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: add chapters to SeekSlider
parent
f2038037
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
modules/gui/qt4/components/controller.cpp
modules/gui/qt4/components/controller.cpp
+5
-0
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+37
-1
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+4
-0
No files found.
modules/gui/qt4/components/controller.cpp
View file @
7def61c8
...
...
@@ -42,6 +42,8 @@
#include "util/input_slider.hpp"
/* SeekSlider */
#include "util/customwidgets.hpp"
/* qEventToKey */
#include "adapters/seekpoints.hpp"
#include <QToolButton>
#include <QHBoxLayout>
#include <QRegion>
...
...
@@ -340,6 +342,9 @@ QWidget *AbstractController::createWidget( buttonType_e button, int options )
break
;
case
INPUT_SLIDER
:
{
SeekSlider
*
slider
=
new
SeekSlider
(
Qt
::
Horizontal
,
NULL
);
SeekPoints
*
chapters
=
new
SeekPoints
(
this
,
p_intf
);
CONNECT
(
THEMIM
->
getIM
(),
titleChanged
(
bool
),
chapters
,
update
()
);
slider
->
setChapters
(
chapters
);
/* Update the position when the IM has changed */
CONNECT
(
THEMIM
->
getIM
(),
positionUpdated
(
float
,
int64_t
,
int
),
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
7def61c8
...
...
@@ -29,6 +29,7 @@
#include "qt4.hpp"
#include "util/input_slider.hpp"
#include "adapters/seekpoints.hpp"
#include <QPaintEvent>
#include <QPainter>
...
...
@@ -52,6 +53,7 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
{
b_isSliding
=
false
;
f_buffering
=
1.0
;
chapters
=
NULL
;
/* Timer used to fire intermediate updatePos() when sliding */
seekLimitTimer
=
new
QTimer
(
this
);
...
...
@@ -78,6 +80,23 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
mTimeTooltip
->
installEventFilter
(
this
);
}
SeekSlider
::~
SeekSlider
()
{
delete
chapters
;
}
/***
* \brief Sets the chapters seekpoints adapter
*
* \params SeekPoints initilized with current intf thread
***/
void
SeekSlider
::
setChapters
(
SeekPoints
*
chapters_
)
{
delete
chapters
;
chapters
=
chapters_
;
chapters
->
setParent
(
this
);
}
/***
* \brief Main public method, superseeding setValue. Disabling the slider when neeeded
*
...
...
@@ -330,9 +349,26 @@ void SeekSlider::paintEvent( QPaintEvent *event )
painter
.
drawRoundedRect
(
innerRect
,
barCorner
,
barCorner
);
}
// draw handle
if
(
option
.
state
&
QStyle
::
State_MouseOver
)
{
/* draw chapters tickpoints */
if
(
chapters
&&
inputLength
&&
size
().
width
()
)
{
if
(
orientation
()
==
Qt
::
Horizontal
)
/* TODO: vertical */
{
QList
<
SeekPoint
>
points
=
chapters
->
getPoints
();
foreach
(
SeekPoint
point
,
points
)
{
int
x
=
point
.
time
/
1000000.0
/
inputLength
*
size
().
width
();
painter
.
setPen
(
QColor
(
80
,
80
,
80
)
);
painter
.
setBrush
(
Qt
::
NoBrush
);
painter
.
drawLine
(
x
,
0
,
x
,
3
);
painter
.
drawLine
(
x
,
height
(),
x
,
height
()
-
3
);
}
}
}
// draw handle
if
(
sliderPos
!=
-
1
)
{
const
int
margin
=
0
;
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
7def61c8
...
...
@@ -36,6 +36,7 @@ class QMouseEvent;
class
QWheelEvent
;
class
QHideEvent
;
class
QTimer
;
class
SeekPoints
;
/* Input Slider derived from QSlider */
class
SeekSlider
:
public
QSlider
...
...
@@ -44,6 +45,8 @@ class SeekSlider : public QSlider
public:
SeekSlider
(
QWidget
*
_parent
);
SeekSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
);
~
SeekSlider
();
void
setChapters
(
SeekPoints
*
);
protected:
virtual
void
mouseMoveEvent
(
QMouseEvent
*
event
);
...
...
@@ -67,6 +70,7 @@ private:
QTimer
*
seekLimitTimer
;
TimeTooltip
*
mTimeTooltip
;
float
f_buffering
;
SeekPoints
*
chapters
;
public
slots
:
void
setPosition
(
float
,
int64_t
,
int
);
...
...
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