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
adc35019
Commit
adc35019
authored
Sep 17, 2011
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: adv settings: Optimize synchronization panel
parent
76fa9057
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
84 deletions
+37
-84
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+28
-84
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+9
-0
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
adc35019
...
...
@@ -1463,16 +1463,31 @@ void Spatializer::addCallbacks( vlc_object_t *p_aout )
#define SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY 1
#define SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT 2
SyncWidget
::
SyncWidget
(
QWidget
*
_parent
)
:
QDoubleSpinBox
(
_parent
)
{
setAlignment
(
Qt
::
AlignRight
|
Qt
::
AlignTrailing
|
Qt
::
AlignVCenter
);
setDecimals
(
3
);
setMinimum
(
-
600.0
);
setMaximum
(
600.0
);
setSingleStep
(
0.1
);
setButtonSymbols
(
QDoubleSpinBox
::
PlusMinus
);
CONNECT
(
this
,
valueChanged
(
double
),
this
,
valueChangedHandler
(
double
)
);
}
void
SyncWidget
::
valueChangedHandler
(
double
d
)
{
if
(
d
<
0
)
setPrefix
(
qtr
(
"Hastened by "
)
);
else
if
(
d
>
0
)
setPrefix
(
qtr
(
"Delayed by "
)
);
else
setPrefix
(
""
);
}
SyncControls
::
SyncControls
(
intf_thread_t
*
_p_intf
,
QWidget
*
_parent
)
:
QWidget
(
_parent
)
,
p_intf
(
_p_intf
)
{
QGroupBox
*
AVBox
,
*
subsBox
;
QToolButton
*
moinsAV
,
*
plusAV
;
QToolButton
*
moinssubs
,
*
plussubs
;
QToolButton
*
moinssubSpeed
,
*
plussubSpeed
;
QToolButton
*
moinssubDuration
,
*
plussubDuration
;
QToolButton
*
updateButton
;
b_userAction
=
true
;
...
...
@@ -1483,81 +1498,29 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
AVBox
=
new
QGroupBox
(
qtr
(
"Audio/Video"
)
);
QGridLayout
*
AVLayout
=
new
QGridLayout
(
AVBox
);
moinsAV
=
new
QToolButton
;
moinsAV
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
moinsAV
->
setAutoRaise
(
true
);
moinsAV
->
setText
(
"-"
);
AVLayout
->
addWidget
(
moinsAV
,
0
,
1
,
1
,
1
);
plusAV
=
new
QToolButton
;
plusAV
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
plusAV
->
setAutoRaise
(
true
);
plusAV
->
setText
(
"+"
);
AVLayout
->
addWidget
(
plusAV
,
0
,
3
,
1
,
1
);
QLabel
*
AVLabel
=
new
QLabel
;
AVLabel
->
setText
(
qtr
(
"A
dd a delay to the audio track
:"
)
);
AVLabel
->
setText
(
qtr
(
"A
udio track synchronization
:"
)
);
AVLayout
->
addWidget
(
AVLabel
,
0
,
0
,
1
,
1
);
AVSpin
=
new
QDoubleSpinBox
;
AVSpin
->
setAlignment
(
Qt
::
AlignRight
|
Qt
::
AlignTrailing
|
Qt
::
AlignVCenter
);
AVSpin
->
setDecimals
(
3
);
AVSpin
->
setMinimum
(
-
600.0
);
AVSpin
->
setMaximum
(
600.0
);
AVSpin
->
setSingleStep
(
0.1
);
AVSpin
->
setToolTip
(
qtr
(
"A positive value will delay
\n
"
"the audio, when it was ahead of the video"
)
);
AVSpin
=
new
SyncWidget
(
this
);
AVSpin
->
setSuffix
(
" s"
);
AVLayout
->
addWidget
(
AVSpin
,
0
,
2
,
1
,
1
);
mainLayout
->
addWidget
(
AVBox
,
1
,
0
,
1
,
5
);
/* Subs */
subsBox
=
new
QGroupBox
(
qtr
(
"Subtitles/Video"
)
);
QGridLayout
*
subsLayout
=
new
QGridLayout
(
subsBox
);
moinssubs
=
new
QToolButton
;
moinssubs
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
moinssubs
->
setAutoRaise
(
true
);
moinssubs
->
setText
(
"-"
);
subsLayout
->
addWidget
(
moinssubs
,
0
,
1
,
1
,
1
);
plussubs
=
new
QToolButton
;
plussubs
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
plussubs
->
setAutoRaise
(
true
);
plussubs
->
setText
(
"+"
);
subsLayout
->
addWidget
(
plussubs
,
0
,
3
,
1
,
1
);
QLabel
*
subsLabel
=
new
QLabel
;
subsLabel
->
setText
(
qtr
(
"
Add a delay to the subtitle track
:"
)
);
subsLabel
->
setText
(
qtr
(
"
Subtitle track syncronization
:"
)
);
subsLayout
->
addWidget
(
subsLabel
,
0
,
0
,
1
,
1
);
subsSpin
=
new
QDoubleSpinBox
;
subsSpin
->
setAlignment
(
Qt
::
AlignRight
|
Qt
::
AlignTrailing
|
Qt
::
AlignVCenter
);
subsSpin
->
setDecimals
(
3
);
subsSpin
->
setMinimum
(
-
600.0
);
subsSpin
->
setMaximum
(
600.0
);
subsSpin
->
setSingleStep
(
0.1
);
subsSpin
->
setToolTip
(
qtr
(
"A positive value will delay the
\n
"
"subtitles, when they were ahead of the video"
)
);
subsSpin
=
new
SyncWidget
(
this
);
subsSpin
->
setSuffix
(
" s"
);
subsLayout
->
addWidget
(
subsSpin
,
0
,
2
,
1
,
1
);
moinssubSpeed
=
new
QToolButton
;
moinssubSpeed
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
moinssubSpeed
->
setAutoRaise
(
true
);
moinssubSpeed
->
setText
(
"-"
);
subsLayout
->
addWidget
(
moinssubSpeed
,
1
,
1
,
1
,
1
);
plussubSpeed
=
new
QToolButton
;
plussubSpeed
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
plussubSpeed
->
setAutoRaise
(
true
);
plussubSpeed
->
setText
(
"+"
);
subsLayout
->
addWidget
(
plussubSpeed
,
1
,
3
,
1
,
1
);
QLabel
*
subSpeedLabel
=
new
QLabel
;
subSpeedLabel
->
setText
(
qtr
(
"S
peed of the subtitles
:"
)
);
subSpeedLabel
->
setText
(
qtr
(
"S
ubtitles speed
:"
)
);
subsLayout
->
addWidget
(
subSpeedLabel
,
1
,
0
,
1
,
1
);
subSpeedSpin
=
new
QDoubleSpinBox
;
...
...
@@ -1567,20 +1530,9 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
subSpeedSpin
->
setMaximum
(
100
);
subSpeedSpin
->
setSingleStep
(
0.2
);
subSpeedSpin
->
setSuffix
(
" fps"
);
subSpeedSpin
->
setButtonSymbols
(
QDoubleSpinBox
::
PlusMinus
);
subsLayout
->
addWidget
(
subSpeedSpin
,
1
,
2
,
1
,
1
);
moinssubDuration
=
new
QToolButton
;
moinssubDuration
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
moinssubDuration
->
setAutoRaise
(
true
);
moinssubDuration
->
setText
(
"-"
);
subsLayout
->
addWidget
(
moinssubDuration
,
2
,
1
,
1
,
1
);
plussubDuration
=
new
QToolButton
;
plussubDuration
->
setToolButtonStyle
(
Qt
::
ToolButtonTextOnly
);
plussubDuration
->
setAutoRaise
(
true
);
plussubDuration
->
setText
(
"+"
);
subsLayout
->
addWidget
(
plussubDuration
,
2
,
3
,
1
,
1
);
QLabel
*
subDurationLabel
=
new
QLabel
;
subDurationLabel
->
setText
(
qtr
(
"Subtitles duration factor:"
)
);
subsLayout
->
addWidget
(
subDurationLabel
,
2
,
0
,
1
,
1
);
...
...
@@ -1591,6 +1543,7 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
subDurationSpin
->
setMinimum
(
0
);
subDurationSpin
->
setMaximum
(
20
);
subDurationSpin
->
setSingleStep
(
0.2
);
subDurationSpin
->
setButtonSymbols
(
QDoubleSpinBox
::
PlusMinus
);
subsLayout
->
addWidget
(
subDurationSpin
,
2
,
2
,
1
,
1
);
mainLayout
->
addWidget
(
subsBox
,
2
,
0
,
2
,
5
);
...
...
@@ -1599,16 +1552,7 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
updateButton
->
setAutoRaise
(
true
);
mainLayout
->
addWidget
(
updateButton
,
0
,
4
,
1
,
1
);
/* Various Connects */
CONNECT
(
moinsAV
,
clicked
(),
AVSpin
,
stepDown
()
);
CONNECT
(
plusAV
,
clicked
(),
AVSpin
,
stepUp
()
);
CONNECT
(
moinssubs
,
clicked
(),
subsSpin
,
stepDown
()
);
CONNECT
(
plussubs
,
clicked
(),
subsSpin
,
stepUp
()
);
CONNECT
(
moinssubSpeed
,
clicked
(),
subSpeedSpin
,
stepDown
()
);
CONNECT
(
plussubSpeed
,
clicked
(),
subSpeedSpin
,
stepUp
()
);
CONNECT
(
moinssubDuration
,
clicked
(),
subDurationSpin
,
stepDown
()
);
CONNECT
(
plussubDuration
,
clicked
(),
subDurationSpin
,
stepUp
()
);
CONNECT
(
AVSpin
,
valueChanged
(
double
),
this
,
advanceAudio
(
double
)
)
;
CONNECT
(
subsSpin
,
valueChanged
(
double
),
this
,
advanceSubs
(
double
)
)
;
CONNECT
(
subSpeedSpin
,
valueChanged
(
double
),
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
adc35019
...
...
@@ -168,6 +168,15 @@ private slots:
void
setInitValues
();
};
class
SyncWidget
:
public
QDoubleSpinBox
{
Q_OBJECT
public:
SyncWidget
(
QWidget
*
);
private
slots
:
void
valueChangedHandler
(
double
d
);
};
class
SyncControls
:
public
QWidget
{
Q_OBJECT
...
...
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