Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
Phonon VLC
Commits
21132b13
Commit
21132b13
authored
Mar 29, 2011
by
Harald Sitter
🏳️🌈
Browse files
style++
parent
b75c7302
Changes
2
Hide whitespace changes
Inline
Side-by-side
vlc/mediacontroller.cpp
View file @
21132b13
...
...
@@ -190,10 +190,6 @@ QVariant MediaController::interfaceCall(Interface iface, int i_command, const QL
return
QVariant
();
}
void
MediaController
::
resetMediaController
()
{
resetMembers
();
...
...
@@ -205,11 +201,11 @@ void MediaController::resetMediaController()
void
MediaController
::
resetMembers
()
{
current
_a
udio
_c
hannel
=
Phonon
::
AudioChannelDescription
();
available
_a
udio
_c
hannels
.
clear
();
m_
current
A
udio
C
hannel
=
Phonon
::
AudioChannelDescription
();
m_
available
A
udio
C
hannels
.
clear
();
current
_s
ubtitle
=
Phonon
::
SubtitleDescription
();
available
_s
ubtitles
.
clear
();
m_
current
S
ubtitle
=
Phonon
::
SubtitleDescription
();
m_
available
S
ubtitles
.
clear
();
m_currentAngle
=
0
;
m_availableAngles
=
0
;
...
...
@@ -234,7 +230,7 @@ void MediaController::audioChannelAdded(int id, const QString &lang)
properties
.
insert
(
"name"
,
lang
);
properties
.
insert
(
"description"
,
""
);
available
_a
udio
_c
hannels
<<
Phonon
::
AudioChannelDescription
(
id
,
properties
);
m_
available
A
udio
C
hannels
<<
Phonon
::
AudioChannelDescription
(
id
,
properties
);
emit
availableAudioChannelsChanged
();
}
...
...
@@ -246,7 +242,7 @@ void MediaController::subtitleAdded(int id, const QString &lang, const QString &
properties
.
insert
(
"description"
,
""
);
properties
.
insert
(
"type"
,
type
);
available
_s
ubtitles
<<
Phonon
::
SubtitleDescription
(
id
,
properties
);
m_
available
S
ubtitles
<<
Phonon
::
SubtitleDescription
(
id
,
properties
);
emit
availableSubtitlesChanged
();
}
...
...
@@ -278,7 +274,7 @@ void MediaController::chapterAdded(int titleId, const QString &name)
void
MediaController
::
setCurrentAudioChannel
(
const
Phonon
::
AudioChannelDescription
&
audioChannel
)
{
current
_a
udio
_c
hannel
=
audioChannel
;
m_
current
A
udio
C
hannel
=
audioChannel
;
if
(
libvlc_audio_set_track
(
m_player
,
audioChannel
.
index
()))
{
error
()
<<
"libVLC:"
<<
LibVLC
::
errorMessage
();
}
...
...
@@ -286,18 +282,18 @@ void MediaController::setCurrentAudioChannel(const Phonon::AudioChannelDescripti
QList
<
Phonon
::
AudioChannelDescription
>
MediaController
::
availableAudioChannels
()
const
{
return
available
_a
udio
_c
hannels
;
return
m_
available
A
udio
C
hannels
;
}
Phonon
::
AudioChannelDescription
MediaController
::
currentAudioChannel
()
const
{
return
current
_a
udio
_c
hannel
;
return
m_
current
A
udio
C
hannel
;
}
void
MediaController
::
refreshAudioChannels
()
{
current
_a
udio
_c
hannel
=
Phonon
::
AudioChannelDescription
();
available
_a
udio
_c
hannels
.
clear
();
m_
current
A
udio
C
hannel
=
Phonon
::
AudioChannelDescription
();
m_
available
A
udio
C
hannels
.
clear
();
libvlc_track_description_t
*
p_info
=
libvlc_audio_get_track_description
(
m_player
);
while
(
p_info
)
{
...
...
@@ -311,12 +307,12 @@ void MediaController::refreshAudioChannels()
void
MediaController
::
setCurrentSubtitle
(
const
Phonon
::
SubtitleDescription
&
subtitle
)
{
current
_s
ubtitle
=
subtitle
;
m_
current
S
ubtitle
=
subtitle
;
// int id = current_subtitle.index();
QString
type
=
current
_s
ubtitle
.
property
(
"type"
).
toString
();
QString
type
=
m_
current
S
ubtitle
.
property
(
"type"
).
toString
();
if
(
type
==
"file"
)
{
QString
filename
=
current
_s
ubtitle
.
property
(
"name"
).
toString
();
QString
filename
=
m_
current
S
ubtitle
.
property
(
"name"
).
toString
();
if
(
!
filename
.
isEmpty
())
{
if
(
!
libvlc_video_set_subtitle_file
(
m_player
,
filename
.
toAscii
().
data
()))
{
...
...
@@ -324,7 +320,7 @@ void MediaController::setCurrentSubtitle(const Phonon::SubtitleDescription &subt
}
// There is no subtitle event inside libvlc so let's send our own event...
available
_s
ubtitles
<<
current
_s
ubtitle
;
m_
available
S
ubtitles
<<
m_
current
S
ubtitle
;
emit
availableSubtitlesChanged
();
}
}
else
{
...
...
@@ -336,21 +332,20 @@ void MediaController::setCurrentSubtitle(const Phonon::SubtitleDescription &subt
QList
<
Phonon
::
SubtitleDescription
>
MediaController
::
availableSubtitles
()
const
{
return
available
_s
ubtitles
;
return
m_
available
S
ubtitles
;
}
Phonon
::
SubtitleDescription
MediaController
::
currentSubtitle
()
const
{
return
current
_s
ubtitle
;
return
m_
current
S
ubtitle
;
}
void
MediaController
::
refreshSubtitles
()
{
current
_s
ubtitle
=
Phonon
::
SubtitleDescription
();
available
_s
ubtitles
.
clear
();
m_
current
S
ubtitle
=
Phonon
::
SubtitleDescription
();
m_
available
S
ubtitles
.
clear
();
libvlc_track_description_t
*
p_info
=
libvlc_video_get_spu_description
(
m_player
);
libvlc_track_description_t
*
p_info
=
libvlc_video_get_spu_description
(
m_player
);
while
(
p_info
)
{
subtitleAdded
(
p_info
->
i_id
,
p_info
->
psz_name
,
""
);
p_info
=
p_info
->
p_next
;
...
...
vlc/mediacontroller.h
View file @
21132b13
...
...
@@ -129,11 +129,11 @@ protected:
*/
void
resetMembers
();
Phonon
::
AudioChannelDescription
current
_a
udio
_c
hannel
;
QList
<
Phonon
::
AudioChannelDescription
>
available
_a
udio
_c
hannels
;
Phonon
::
AudioChannelDescription
m_
current
A
udio
C
hannel
;
QList
<
Phonon
::
AudioChannelDescription
>
m_
available
A
udio
C
hannels
;
Phonon
::
SubtitleDescription
current
_s
ubtitle
;
QList
<
Phonon
::
SubtitleDescription
>
available
_s
ubtitles
;
Phonon
::
SubtitleDescription
m_
current
S
ubtitle
;
QList
<
Phonon
::
SubtitleDescription
>
m_
available
S
ubtitles
;
// Phonon::ChapterDescription current_chapter;
// QList<Phonon::ChapterDescription> available_chapters;
...
...
Write
Preview
Supports
Markdown
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