Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
3a081b6a
Commit
3a081b6a
authored
Apr 12, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SeekSlider: clean the code
parent
7ab98f85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+13
-9
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+9
-9
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
3a081b6a
/*****************************************************************************
* input_
manager.cpp : Manage an input and interact with its GUI elements
* input_
slider.cpp : VolumeSlider and SeekSlider
****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2006
-2011
the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
...
...
@@ -26,6 +26,8 @@
# include "config.h"
#endif
#include "qt4.hpp"
#include "util/input_slider.hpp"
#include <QPaintEvent>
...
...
@@ -34,7 +36,7 @@
#include <QPainter>
#include <QStyleOptionSlider>
#include <QLinearGradient>
#include <QTimer>
#define MINIMUM 0
#define MAXIMUM 1000
...
...
@@ -45,7 +47,7 @@ SeekSlider::SeekSlider( QWidget *_parent ) : QSlider( _parent )
}
SeekSlider
::
SeekSlider
(
Qt
::
Orientation
q
,
QWidget
*
_parent
)
:
QSlider
(
q
,
_parent
)
:
QSlider
(
q
,
_parent
)
{
b_isSliding
=
false
;
...
...
@@ -70,9 +72,13 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent )
}
/***
* \brief Public interface, like setValue, but disabling the slider too
* \brief Main public method, superseeding setValue. Disabling the slider when neeeded
*
* \param pos Position, between 0 and 1. -1 disables the slider
* \param time Elapsed time. Unused
* \param legnth Duration time.
***/
void
SeekSlider
::
setPosition
(
float
pos
,
int64_t
a
,
int
b
)
void
SeekSlider
::
setPosition
(
float
pos
,
int64_t
time
,
int
length
)
{
if
(
pos
==
-
1.0
)
{
...
...
@@ -85,7 +91,7 @@ void SeekSlider::setPosition( float pos, int64_t a, int b )
if
(
!
b_isSliding
)
setValue
(
(
int
)(
pos
*
1000.0
)
);
inputLength
=
b
;
inputLength
=
length
;
}
void
SeekSlider
::
startSeekTimer
(
int
new_value
)
...
...
@@ -149,8 +155,6 @@ void SeekSlider::wheelEvent( QWheelEvent *event)
increment of position */
emit
sliderDragged
(
value
()
/
1000.0
);
}
/* We do accept because for we don't want the parent to change the sound
vol */
event
->
accept
();
}
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
3a081b6a
/*****************************************************************************
* input_slider.hpp :
A slider that controls an input
* input_slider.hpp :
VolumeSlider and SeekSlider
****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2006
-2011
the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
...
...
@@ -18,20 +18,20 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
* along with this program; if not, write to the Free Software
Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _INPUTSLIDER_H_
#define _INPUTSLIDER_H_
#include "qt4.hpp"
#include <QSlider>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QTimer>
#define MSTRTIME_MAX_SIZE 22
class
QMouseEvent
;
class
QWheelEvent
;
class
QTimer
;
/* Input Slider derived from QSlider */
class
SeekSlider
:
public
QSlider
...
...
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