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
6d1a4bca
Commit
6d1a4bca
authored
Mar 29, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interface to delay subtitles and audio. Most of ##1491
parent
5a6c9e94
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
2 deletions
+47
-2
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/extended_panels.cpp
+44
-2
modules/gui/qt4/components/extended_panels.hpp
modules/gui/qt4/components/extended_panels.hpp
+3
-0
No files found.
modules/gui/qt4/components/extended_panels.cpp
View file @
6d1a4bca
...
...
@@ -37,6 +37,7 @@
#include "dialogs/preferences.hpp"
#include "dialogs_provider.hpp"
#include "qt4.hpp"
#include "input_manager.hpp"
#include "../../audio_filter/equalizer_presets.h"
#include <vlc_aout.h>
...
...
@@ -1168,6 +1169,8 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
QToolButton
*
moinssubs
,
*
plussubs
;
int64_t
i_delay
;
QVBoxLayout
*
vboxLayout
=
new
QVBoxLayout
(
this
);
AVBox
=
new
QGroupBox
(
qtr
(
"Audio/Video"
)
);
...
...
@@ -1197,7 +1200,7 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
AVSpin
->
setSingleStep
(
0.1
);
AVSpin
->
setToolTip
(
qtr
(
"A positive value means that
\n
"
"the audio is ahead of the video"
)
);
AVSpin
->
setSuffix
(
"
m
s"
);
AVSpin
->
setSuffix
(
"s"
);
gridLayout
->
addWidget
(
AVSpin
,
1
,
1
,
1
,
1
);
vboxLayout
->
addWidget
(
AVBox
);
...
...
@@ -1229,9 +1232,48 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
subsSpin
->
setSingleStep
(
0.1
);
subsSpin
->
setToolTip
(
qtr
(
"A positive value means that
\n
"
"the subtitles are ahead of the video"
)
);
subsSpin
->
setSuffix
(
"
m
s"
);
subsSpin
->
setSuffix
(
"s"
);
subsLayout
->
addWidget
(
subsSpin
,
1
,
1
,
1
,
1
);
vboxLayout
->
addWidget
(
subsBox
);
/* Various Connects */
CONNECT
(
moinsAV
,
clicked
(),
AVSpin
,
stepDown
()
);
CONNECT
(
plusAV
,
clicked
(),
AVSpin
,
stepUp
()
);
CONNECT
(
moinssubs
,
clicked
(),
subsSpin
,
stepDown
()
);
CONNECT
(
plussubs
,
clicked
(),
subsSpin
,
stepUp
()
);
CONNECT
(
AVSpin
,
valueChanged
(
double
),
this
,
advanceAudio
(
double
)
)
;
CONNECT
(
subsSpin
,
valueChanged
(
double
),
this
,
advanceSubs
(
double
)
)
;
/* Set it */
if
(
THEMIM
->
getInput
()
)
{
i_delay
=
var_GetTime
(
THEMIM
->
getInput
(),
"spu-delay"
);
AVSpin
->
setValue
(
(
(
double
)
i_delay
)
/
1000000
);
i_delay
=
var_GetTime
(
THEMIM
->
getInput
(),
"audio-delay"
);
subsSpin
->
setValue
(
(
(
double
)
i_delay
)
/
1000000
);
}
}
void
SyncControls
::
advanceAudio
(
double
f_advance
)
{
if
(
THEMIM
->
getInput
()
)
{
int64_t
i_delay
=
var_GetTime
(
THEMIM
->
getInput
(),
"audio-delay"
);
i_delay
+=
f_advance
*
1000000
;
var_SetTime
(
THEMIM
->
getInput
(),
"audio-delay"
,
i_delay
);
msg_Dbg
(
p_intf
,
"I am advancing Audio %d"
,
f_advance
);
}
}
void
SyncControls
::
advanceSubs
(
double
f_advance
)
{
if
(
THEMIM
->
getInput
()
)
{
int64_t
i_delay
=
var_GetTime
(
THEMIM
->
getInput
(),
"spu-delay"
);
i_delay
+=
f_advance
*
1000000
;
var_SetTime
(
THEMIM
->
getInput
(),
"spu-delay"
,
i_delay
);
msg_Dbg
(
p_intf
,
"I am advancing subtitles %d"
,
f_advance
);
}
}
/**********************************************************************
...
...
modules/gui/qt4/components/extended_panels.hpp
View file @
6d1a4bca
...
...
@@ -160,6 +160,9 @@ private:
intf_thread_t
*
p_intf
;
QDoubleSpinBox
*
AVSpin
;
QDoubleSpinBox
*
subsSpin
;
private
slots
:
void
advanceAudio
(
double
);
void
advanceSubs
(
double
);
};
#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