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
757c699e
Commit
757c699e
authored
Mar 03, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: use float for rate and fix a bug when mouseWheeling
parent
9ac719c3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
19 deletions
+19
-19
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.cpp
+7
-7
modules/gui/qt4/components/interface_widgets.hpp
modules/gui/qt4/components/interface_widgets.hpp
+2
-2
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+8
-8
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+2
-2
No files found.
modules/gui/qt4/components/interface_widgets.cpp
View file @
757c699e
...
@@ -426,11 +426,11 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
...
@@ -426,11 +426,11 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
speedControlMenu
->
addAction
(
widgetAction
);
speedControlMenu
->
addAction
(
widgetAction
);
/* Change the SpeedRate in the Status Bar */
/* Change the SpeedRate in the Status Bar */
CONNECT
(
THEMIM
->
getIM
(),
rateChanged
(
int
),
this
,
setRate
(
in
t
)
);
CONNECT
(
THEMIM
->
getIM
(),
rateChanged
(
float
),
this
,
setRate
(
floa
t
)
);
DCONNECT
(
THEMIM
,
inputChanged
(
input_thread_t
*
),
DCONNECT
(
THEMIM
,
inputChanged
(
input_thread_t
*
),
speedControl
,
activateOnState
()
);
speedControl
,
activateOnState
()
);
setRate
(
INPUT_RATE_DEFAULT
/
var_InheritFloat
(
p_intf
,
"rate"
)
);
setRate
(
var_InheritFloat
(
p_intf
,
"rate"
)
);
}
}
SpeedLabel
::~
SpeedLabel
()
SpeedLabel
::~
SpeedLabel
()
...
@@ -449,10 +449,10 @@ void SpeedLabel::showSpeedMenu( QPoint pos )
...
@@ -449,10 +449,10 @@ void SpeedLabel::showSpeedMenu( QPoint pos )
+
QPoint
(
0
,
height
()
)
);
+
QPoint
(
0
,
height
()
)
);
}
}
void
SpeedLabel
::
setRate
(
in
t
rate
)
void
SpeedLabel
::
setRate
(
floa
t
rate
)
{
{
QString
str
;
QString
str
;
str
.
setNum
(
(
1000
/
(
double
)
rate
)
,
'f'
,
2
);
str
.
setNum
(
rate
,
'f'
,
2
);
str
.
append
(
"x"
);
str
.
append
(
"x"
);
setText
(
str
);
setText
(
str
);
setToolTip
(
str
);
setToolTip
(
str
);
...
@@ -480,7 +480,7 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent )
...
@@ -480,7 +480,7 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent )
speedSlider
->
setPageStep
(
1
);
speedSlider
->
setPageStep
(
1
);
speedSlider
->
setTickInterval
(
17
);
speedSlider
->
setTickInterval
(
17
);
CONNECT
(
speedSlider
,
sliderMov
ed
(
int
),
this
,
updateRate
(
int
)
);
CONNECT
(
speedSlider
,
valueChang
ed
(
int
),
this
,
updateRate
(
int
)
);
QToolButton
*
normalSpeedButton
=
new
QToolButton
(
this
);
QToolButton
*
normalSpeedButton
=
new
QToolButton
(
this
);
normalSpeedButton
->
setMaximumSize
(
QSize
(
26
,
20
)
);
normalSpeedButton
->
setMaximumSize
(
QSize
(
26
,
20
)
);
...
@@ -504,7 +504,7 @@ void SpeedControlWidget::activateOnState()
...
@@ -504,7 +504,7 @@ void SpeedControlWidget::activateOnState()
speedSlider
->
setEnabled
(
THEMIM
->
getIM
()
->
hasInput
()
);
speedSlider
->
setEnabled
(
THEMIM
->
getIM
()
->
hasInput
()
);
}
}
void
SpeedControlWidget
::
updateControls
(
in
t
rate
)
void
SpeedControlWidget
::
updateControls
(
floa
t
rate
)
{
{
if
(
speedSlider
->
isSliderDown
()
)
if
(
speedSlider
->
isSliderDown
()
)
{
{
...
@@ -512,7 +512,7 @@ void SpeedControlWidget::updateControls( int rate )
...
@@ -512,7 +512,7 @@ void SpeedControlWidget::updateControls( int rate )
return
;
return
;
}
}
double
value
=
17
*
log
(
(
double
)
INPUT_RATE_DEFAULT
/
rate
)
/
log
(
2
);
double
value
=
17
*
log
(
rate
)
/
log
(
2
);
int
sliderValue
=
(
int
)
(
(
value
>
0
)
?
value
+
.5
:
value
-
.5
);
int
sliderValue
=
(
int
)
(
(
value
>
0
)
?
value
+
.5
:
value
-
.5
);
if
(
sliderValue
<
speedSlider
->
minimum
()
)
if
(
sliderValue
<
speedSlider
->
minimum
()
)
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
757c699e
...
@@ -172,7 +172,7 @@ protected:
...
@@ -172,7 +172,7 @@ protected:
}
}
private
slots
:
private
slots
:
void
showSpeedMenu
(
QPoint
);
void
showSpeedMenu
(
QPoint
);
void
setRate
(
in
t
);
void
setRate
(
floa
t
);
private:
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
QMenu
*
speedControlMenu
;
QMenu
*
speedControlMenu
;
...
@@ -185,7 +185,7 @@ class SpeedControlWidget : public QFrame
...
@@ -185,7 +185,7 @@ class SpeedControlWidget : public QFrame
Q_OBJECT
Q_OBJECT
public:
public:
SpeedControlWidget
(
intf_thread_t
*
,
QWidget
*
);
SpeedControlWidget
(
intf_thread_t
*
,
QWidget
*
);
void
updateControls
(
in
t
);
void
updateControls
(
floa
t
);
private:
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
QSlider
*
speedSlider
;
QSlider
*
speedSlider
;
...
...
modules/gui/qt4/input_manager.cpp
View file @
757c699e
...
@@ -79,7 +79,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
...
@@ -79,7 +79,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
artUrl
=
""
;
artUrl
=
""
;
p_input
=
NULL
;
p_input
=
NULL
;
p_input_vbi
=
NULL
;
p_input_vbi
=
NULL
;
i
_rate
=
0
;
f
_rate
=
0
;
p_item
=
NULL
;
p_item
=
NULL
;
b_video
=
false
;
b_video
=
false
;
timeA
=
0
;
timeA
=
0
;
...
@@ -111,14 +111,14 @@ void InputManager::setInput( input_thread_t *_p_input )
...
@@ -111,14 +111,14 @@ void InputManager::setInput( input_thread_t *_p_input )
UpdateVout
();
UpdateVout
();
addCallbacks
();
addCallbacks
();
p_item
=
input_GetItem
(
p_input
);
p_item
=
input_GetItem
(
p_input
);
emit
rateChanged
(
INPUT_RATE_DEFAULT
/
var_GetFloat
(
p_input
,
"rate"
)
);
emit
rateChanged
(
var_GetFloat
(
p_input
,
"rate"
)
);
}
}
else
else
{
{
p_input
=
NULL
;
p_input
=
NULL
;
p_item
=
NULL
;
p_item
=
NULL
;
assert
(
!
p_input_vbi
);
assert
(
!
p_input_vbi
);
emit
rateChanged
(
INPUT_RATE_DEFAULT
/
var_InheritFloat
(
p_intf
,
"rate"
)
);
emit
rateChanged
(
var_InheritFloat
(
p_intf
,
"rate"
)
);
}
}
}
}
...
@@ -149,7 +149,7 @@ void InputManager::delInput()
...
@@ -149,7 +149,7 @@ void InputManager::delInput()
p_input
=
NULL
;
p_input
=
NULL
;
emit
positionUpdated
(
-
1.0
,
0
,
0
);
emit
positionUpdated
(
-
1.0
,
0
,
0
);
emit
rateChanged
(
INPUT_RATE_DEFAULT
/
var_InheritFloat
(
p_intf
,
"rate"
)
);
emit
rateChanged
(
var_InheritFloat
(
p_intf
,
"rate"
)
);
emit
nameChanged
(
""
);
emit
nameChanged
(
""
);
emit
chapterChanged
(
0
);
emit
chapterChanged
(
0
);
emit
titleChanged
(
0
);
emit
titleChanged
(
0
);
...
@@ -431,12 +431,12 @@ void InputManager::UpdateStatus()
...
@@ -431,12 +431,12 @@ void InputManager::UpdateStatus()
void
InputManager
::
UpdateRate
()
void
InputManager
::
UpdateRate
()
{
{
/* Update Rate */
/* Update Rate */
int
i_new_rate
=
INPUT_RATE_DEFAULT
/
var_GetFloat
(
p_input
,
"rate"
);
float
f_new_rate
=
var_GetFloat
(
p_input
,
"rate"
);
if
(
i_new_rate
!=
i
_rate
)
if
(
f_new_rate
!=
f
_rate
)
{
{
i_rate
=
i
_new_rate
;
f_rate
=
f
_new_rate
;
/* Update rate */
/* Update rate */
emit
rateChanged
(
i
_rate
);
emit
rateChanged
(
f
_rate
);
}
}
}
}
...
...
modules/gui/qt4/input_manager.hpp
View file @
757c699e
...
@@ -144,7 +144,7 @@ private:
...
@@ -144,7 +144,7 @@ private:
int
i_old_playing_status
;
int
i_old_playing_status
;
QString
oldName
;
QString
oldName
;
QString
artUrl
;
QString
artUrl
;
int
i
_rate
;
float
f
_rate
;
float
f_cache
;
float
f_cache
;
bool
b_video
;
bool
b_video
;
mtime_t
timeA
,
timeB
;
mtime_t
timeA
,
timeB
;
...
@@ -204,7 +204,7 @@ signals:
...
@@ -204,7 +204,7 @@ signals:
/// Send new position, new time and new length
/// Send new position, new time and new length
void
positionUpdated
(
float
,
int64_t
,
int
);
void
positionUpdated
(
float
,
int64_t
,
int
);
void
seekRequested
(
float
pos
);
void
seekRequested
(
float
pos
);
void
rateChanged
(
in
t
);
void
rateChanged
(
floa
t
);
void
nameChanged
(
const
QString
&
);
void
nameChanged
(
const
QString
&
);
/// Used to signal whether we should show navigation buttons
/// Used to signal whether we should show navigation buttons
void
titleChanged
(
bool
);
void
titleChanged
(
bool
);
...
...
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