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
76beeb83
Commit
76beeb83
authored
Jan 31, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mozilla: factorize.
parent
b3958ce9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
27 deletions
+12
-27
projects/mozilla/control/npolibvlc.cpp
projects/mozilla/control/npolibvlc.cpp
+10
-25
projects/mozilla/vlcplugin.h
projects/mozilla/vlcplugin.h
+1
-1
projects/mozilla/vlcshell.cpp
projects/mozilla/vlcshell.cpp
+1
-1
No files found.
projects/mozilla/control/npolibvlc.cpp
View file @
76beeb83
...
@@ -255,36 +255,31 @@ LibvlcAudioNPObject::getProperty(int index, NPVariant &result)
...
@@ -255,36 +255,31 @@ LibvlcAudioNPObject::getProperty(int index, NPVariant &result)
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
switch
(
index
)
switch
(
index
)
{
{
case
ID_audio_mute
:
case
ID_audio_mute
:
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
bool
muted
=
libvlc_audio_get_mute
(
p_md
);
bool
muted
=
libvlc_audio_get_mute
(
p_md
);
BOOLEAN_TO_NPVARIANT
(
muted
,
result
);
BOOLEAN_TO_NPVARIANT
(
muted
,
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
case
ID_audio_volume
:
case
ID_audio_volume
:
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
int
volume
=
libvlc_audio_get_volume
(
p_md
);
int
volume
=
libvlc_audio_get_volume
(
p_md
);
INT32_TO_NPVARIANT
(
volume
,
result
);
INT32_TO_NPVARIANT
(
volume
,
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
case
ID_audio_track
:
case
ID_audio_track
:
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
int
track
=
libvlc_audio_get_track
(
p_md
);
int
track
=
libvlc_audio_get_track
(
p_md
);
INT32_TO_NPVARIANT
(
track
,
result
);
INT32_TO_NPVARIANT
(
track
,
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
case
ID_audio_count
:
case
ID_audio_count
:
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
// get the number of audio track available
// get the number of audio track available
int
i_track
=
libvlc_audio_get_track_count
(
p_md
);
int
i_track
=
libvlc_audio_get_track_count
(
p_md
);
// return it
// return it
...
@@ -293,8 +288,6 @@ LibvlcAudioNPObject::getProperty(int index, NPVariant &result)
...
@@ -293,8 +288,6 @@ LibvlcAudioNPObject::getProperty(int index, NPVariant &result)
}
}
case
ID_audio_channel
:
case
ID_audio_channel
:
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
int
channel
=
libvlc_audio_get_channel
(
p_md
);
int
channel
=
libvlc_audio_get_channel
(
p_md
);
INT32_TO_NPVARIANT
(
channel
,
result
);
INT32_TO_NPVARIANT
(
channel
,
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
...
@@ -316,13 +309,14 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
...
@@ -316,13 +309,14 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
switch
(
index
)
switch
(
index
)
{
{
case
ID_audio_mute
:
case
ID_audio_mute
:
if
(
NPVARIANT_IS_BOOLEAN
(
value
)
)
if
(
NPVARIANT_IS_BOOLEAN
(
value
)
)
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
libvlc_audio_set_mute
(
p_md
,
libvlc_audio_set_mute
(
p_md
,
NPVARIANT_TO_BOOLEAN
(
value
));
NPVARIANT_TO_BOOLEAN
(
value
));
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
...
@@ -331,8 +325,6 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
...
@@ -331,8 +325,6 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
case
ID_audio_volume
:
case
ID_audio_volume
:
if
(
isNumberValue
(
value
)
)
if
(
isNumberValue
(
value
)
)
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
libvlc_audio_set_volume
(
p_md
,
numberValue
(
value
));
libvlc_audio_set_volume
(
p_md
,
numberValue
(
value
));
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
...
@@ -340,8 +332,6 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
...
@@ -340,8 +332,6 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
case
ID_audio_track
:
case
ID_audio_track
:
if
(
isNumberValue
(
value
)
)
if
(
isNumberValue
(
value
)
)
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
libvlc_audio_set_track
(
p_md
,
numberValue
(
value
));
libvlc_audio_set_track
(
p_md
,
numberValue
(
value
));
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
...
@@ -349,8 +339,6 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
...
@@ -349,8 +339,6 @@ LibvlcAudioNPObject::setProperty(int index, const NPVariant &value)
case
ID_audio_channel
:
case
ID_audio_channel
:
if
(
isNumberValue
(
value
)
)
if
(
isNumberValue
(
value
)
)
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
libvlc_audio_set_channel
(
p_md
,
numberValue
(
value
));
libvlc_audio_set_channel
(
p_md
,
numberValue
(
value
));
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
...
@@ -386,13 +374,14 @@ LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
...
@@ -386,13 +374,14 @@ LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
switch
(
index
)
switch
(
index
)
{
{
case
ID_audio_togglemute
:
case
ID_audio_togglemute
:
if
(
argCount
==
0
)
if
(
argCount
==
0
)
{
{
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
libvlc_audio_toggle_mute
(
p_md
);
libvlc_audio_toggle_mute
(
p_md
);
VOID_TO_NPVARIANT
(
result
);
VOID_TO_NPVARIANT
(
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
...
@@ -406,9 +395,6 @@ LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
...
@@ -406,9 +395,6 @@ LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
int
i_trackID
,
i_limit
,
i
;
int
i_trackID
,
i_limit
,
i
;
libvlc_track_description_t
*
p_trackDesc
;
libvlc_track_description_t
*
p_trackDesc
;
libvlc_media_player_t
*
p_md
=
p_plugin
->
getMD
(
&
ex
);
RETURN_ON_EXCEPTION
(
this
,
ex
);
/* get tracks description */
/* get tracks description */
p_trackDesc
=
libvlc_audio_get_track_description
(
p_md
);
p_trackDesc
=
libvlc_audio_get_track_description
(
p_md
);
if
(
!
p_trackDesc
)
if
(
!
p_trackDesc
)
...
@@ -945,8 +931,7 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
...
@@ -945,8 +931,7 @@ LibvlcPlaylistNPObject::invoke(int index, const NPVariant *args,
case
ID_playlist_togglepause
:
case
ID_playlist_togglepause
:
if
(
argCount
==
0
)
if
(
argCount
==
0
)
{
{
p_plugin
->
playlist_pause
(
&
ex
);
p_plugin
->
playlist_pause
();
RETURN_ON_EXCEPTION
(
this
,
ex
);
VOID_TO_NPVARIANT
(
result
);
VOID_TO_NPVARIANT
(
result
);
return
INVOKERESULT_NO_ERROR
;
return
INVOKERESULT_NO_ERROR
;
}
}
...
...
projects/mozilla/vlcplugin.h
View file @
76beeb83
...
@@ -249,7 +249,7 @@ public:
...
@@ -249,7 +249,7 @@ public:
if
(
playlist_select
(
playlist_index
-
1
,
ex
)
)
if
(
playlist_select
(
playlist_index
-
1
,
ex
)
)
libvlc_media_player_play
(
libvlc_media_player
);
libvlc_media_player_play
(
libvlc_media_player
);
}
}
void
playlist_pause
(
libvlc_exception_t
*
ex
)
void
playlist_pause
()
{
{
if
(
libvlc_media_player
)
if
(
libvlc_media_player
)
libvlc_media_player_pause
(
libvlc_media_player
);
libvlc_media_player_pause
(
libvlc_media_player
);
...
...
projects/mozilla/vlcshell.cpp
View file @
76beeb83
...
@@ -822,7 +822,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
...
@@ -822,7 +822,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
case
clicked_Pause
:
case
clicked_Pause
:
{
{
if
(
i_playing
==
1
)
if
(
i_playing
==
1
)
p_plugin
->
playlist_pause
(
&
ex
);
p_plugin
->
playlist_pause
();
else
else
p_plugin
->
playlist_play
(
&
ex
);
p_plugin
->
playlist_play
(
&
ex
);
...
...
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