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
0bfccfad
Commit
0bfccfad
authored
May 31, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First benefits of QT ! A slider ! (Refs:#80)
parent
8f973a0b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
4 deletions
+24
-4
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+2
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+7
-1
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+2
-0
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+10
-2
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+3
-1
No files found.
modules/gui/qt4/input_manager.cpp
View file @
0bfccfad
...
...
@@ -65,4 +65,6 @@ void InputManager::update()
void
InputManager
::
sliderUpdate
(
float
new_pos
)
{
fprintf
(
stderr
,
"Seek to %f
\n
"
,
new_pos
);
var_SetFloat
(
p_input
,
"position"
,
new_pos
);
}
modules/gui/qt4/main_interface.cpp
View file @
0bfccfad
...
...
@@ -22,6 +22,7 @@
#include "main_interface.hpp"
#include "input_manager.hpp"
#include "util/input_slider.hpp"
#include "dialogs_provider.hpp"
#include <QCloseEvent>
#include <assert.h>
...
...
@@ -32,6 +33,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) :
fprintf
(
stderr
,
"QT Main interface
\n
"
);
/* Init UI */
slider
=
new
InputSlider
(
Qt
::
Horizontal
,
this
);
slider
->
init
();
/* Init input manager */
p_input
=
NULL
;
...
...
@@ -48,7 +50,11 @@ void MainInterface::init()
main_input_manager
,
SLOT
(
setInput
(
input_thread_t
*
)
)
);
/* Connect the slider and the input manager */
// both ways
QObject
::
connect
(
main_input_manager
,
SIGNAL
(
positionUpdated
(
float
,
int
,
int
)
),
slider
,
SLOT
(
setPosition
(
float
,
int
,
int
)
)
);
QObject
::
connect
(
slider
,
SIGNAL
(
sliderDragged
(
float
)
),
main_input_manager
,
SLOT
(
sliderUpdate
(
float
)
)
);
/* Connect the display and the input manager */
}
...
...
modules/gui/qt4/main_interface.hpp
View file @
0bfccfad
...
...
@@ -28,6 +28,7 @@
class
InputManager
;
class
QCloseEvent
;
class
InputSlider
;
class
MainInterface
:
public
QWidget
{
...
...
@@ -40,6 +41,7 @@ protected:
void
closeEvent
(
QCloseEvent
*
);
private:
InputManager
*
main_input_manager
;
InputSlider
*
slider
;
intf_thread_t
*
p_intf
;
/// Main input associated to the playlist
input_thread_t
*
p_input
;
...
...
modules/gui/qt4/util/input_slider.cpp
View file @
0bfccfad
...
...
@@ -25,10 +25,11 @@
void
InputSlider
::
init
()
{
mymove
=
false
;
setMinimum
(
0
);
setMaximum
(
1000
);
setSingleStep
(
2
);
setPageStep
(
100
);
setPageStep
(
100
0
);
setTracking
(
true
);
QObject
::
connect
(
this
,
SIGNAL
(
valueChanged
(
int
)
),
this
,
SLOT
(
userDrag
(
int
)
)
);
...
...
@@ -36,11 +37,18 @@ void InputSlider::init()
void
InputSlider
::
setPosition
(
float
pos
,
int
a
,
int
b
)
{
fprintf
(
stderr
,
"Set pos %f
\n
"
,
pos
);
mymove
=
true
;
setValue
(
(
int
)(
pos
*
1000.0
)
);
mymove
=
false
;
}
void
InputSlider
::
userDrag
(
int
new_value
)
{
float
f_pos
=
(
float
)(
new_value
)
/
1000.0
;
emit
positionUpdated
(
f_pos
);
if
(
!
mymove
)
{
fprintf
(
stderr
,
"Emitting %f
\n
"
,
f_pos
);
emit
sliderDragged
(
f_pos
);
}
}
modules/gui/qt4/util/input_slider.hpp
View file @
0bfccfad
...
...
@@ -34,11 +34,13 @@ public:
{};
virtual
~
InputSlider
()
{};
void
init
();
private:
bool
mymove
;
public
slots
:
void
setPosition
(
float
,
int
,
int
);
private
slots
:
void
userDrag
(
int
);
signals:
void
positionUpdat
ed
(
float
);
void
sliderDragg
ed
(
float
);
};
#endif
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