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
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
Hide 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 )
speedControlMenu
->
addAction
(
widgetAction
);
/* 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
*
),
speedControl
,
activateOnState
()
);
setRate
(
INPUT_RATE_DEFAULT
/
var_InheritFloat
(
p_intf
,
"rate"
)
);
setRate
(
var_InheritFloat
(
p_intf
,
"rate"
)
);
}
SpeedLabel
::~
SpeedLabel
()
...
...
@@ -449,10 +449,10 @@ void SpeedLabel::showSpeedMenu( QPoint pos )
+
QPoint
(
0
,
height
()
)
);
}
void
SpeedLabel
::
setRate
(
in
t
rate
)
void
SpeedLabel
::
setRate
(
floa
t
rate
)
{
QString
str
;
str
.
setNum
(
(
1000
/
(
double
)
rate
)
,
'f'
,
2
);
str
.
setNum
(
rate
,
'f'
,
2
);
str
.
append
(
"x"
);
setText
(
str
);
setToolTip
(
str
);
...
...
@@ -480,7 +480,7 @@ SpeedControlWidget::SpeedControlWidget( intf_thread_t *_p_i, QWidget *_parent )
speedSlider
->
setPageStep
(
1
);
speedSlider
->
setTickInterval
(
17
);
CONNECT
(
speedSlider
,
sliderMov
ed
(
int
),
this
,
updateRate
(
int
)
);
CONNECT
(
speedSlider
,
valueChang
ed
(
int
),
this
,
updateRate
(
int
)
);
QToolButton
*
normalSpeedButton
=
new
QToolButton
(
this
);
normalSpeedButton
->
setMaximumSize
(
QSize
(
26
,
20
)
);
...
...
@@ -504,7 +504,7 @@ void SpeedControlWidget::activateOnState()
speedSlider
->
setEnabled
(
THEMIM
->
getIM
()
->
hasInput
()
);
}
void
SpeedControlWidget
::
updateControls
(
in
t
rate
)
void
SpeedControlWidget
::
updateControls
(
floa
t
rate
)
{
if
(
speedSlider
->
isSliderDown
()
)
{
...
...
@@ -512,7 +512,7 @@ void SpeedControlWidget::updateControls( int rate )
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
);
if
(
sliderValue
<
speedSlider
->
minimum
()
)
...
...
modules/gui/qt4/components/interface_widgets.hpp
View file @
757c699e
...
...
@@ -172,7 +172,7 @@ protected:
}
private
slots
:
void
showSpeedMenu
(
QPoint
);
void
setRate
(
in
t
);
void
setRate
(
floa
t
);
private:
intf_thread_t
*
p_intf
;
QMenu
*
speedControlMenu
;
...
...
@@ -185,7 +185,7 @@ class SpeedControlWidget : public QFrame
Q_OBJECT
public:
SpeedControlWidget
(
intf_thread_t
*
,
QWidget
*
);
void
updateControls
(
in
t
);
void
updateControls
(
floa
t
);
private:
intf_thread_t
*
p_intf
;
QSlider
*
speedSlider
;
...
...
modules/gui/qt4/input_manager.cpp
View file @
757c699e
...
...
@@ -79,7 +79,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
artUrl
=
""
;
p_input
=
NULL
;
p_input_vbi
=
NULL
;
i
_rate
=
0
;
f
_rate
=
0
;
p_item
=
NULL
;
b_video
=
false
;
timeA
=
0
;
...
...
@@ -111,14 +111,14 @@ void InputManager::setInput( input_thread_t *_p_input )
UpdateVout
();
addCallbacks
();
p_item
=
input_GetItem
(
p_input
);
emit
rateChanged
(
INPUT_RATE_DEFAULT
/
var_GetFloat
(
p_input
,
"rate"
)
);
emit
rateChanged
(
var_GetFloat
(
p_input
,
"rate"
)
);
}
else
{
p_input
=
NULL
;
p_item
=
NULL
;
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()
p_input
=
NULL
;
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
chapterChanged
(
0
);
emit
titleChanged
(
0
);
...
...
@@ -431,12 +431,12 @@ void InputManager::UpdateStatus()
void
InputManager
::
UpdateRate
()
{
/* Update Rate */
int
i_new_rate
=
INPUT_RATE_DEFAULT
/
var_GetFloat
(
p_input
,
"rate"
);
if
(
i_new_rate
!=
i
_rate
)
float
f_new_rate
=
var_GetFloat
(
p_input
,
"rate"
);
if
(
f_new_rate
!=
f
_rate
)
{
i_rate
=
i
_new_rate
;
f_rate
=
f
_new_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:
int
i_old_playing_status
;
QString
oldName
;
QString
artUrl
;
int
i
_rate
;
float
f
_rate
;
float
f_cache
;
bool
b_video
;
mtime_t
timeA
,
timeB
;
...
...
@@ -204,7 +204,7 @@ signals:
/// Send new position, new time and new length
void
positionUpdated
(
float
,
int64_t
,
int
);
void
seekRequested
(
float
pos
);
void
rateChanged
(
in
t
);
void
rateChanged
(
floa
t
);
void
nameChanged
(
const
QString
&
);
/// Used to signal whether we should show navigation buttons
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