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
98727134
Commit
98727134
authored
Feb 13, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mozilla: no functional changes
* Rename i_playing to is_playing * Handle case of p_md being NULL.
parent
4a811898
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
projects/mozilla/vlcplugin.cpp
projects/mozilla/vlcplugin.cpp
+20
-19
No files found.
projects/mozilla/vlcplugin.cpp
View file @
98727134
/*****************************************************************************
/*****************************************************************************
* vlcplugin.cpp: a VLC plugin for Mozilla
* vlcplugin.cpp: a VLC plugin for Mozilla
*****************************************************************************
*****************************************************************************
* Copyright (C) 2002-200
8
the VideoLAN team
* Copyright (C) 2002-200
9
the VideoLAN team
* $Id$
* $Id$
*
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Authors: Samuel Hocevar <sam@zoy.org>
...
@@ -118,7 +118,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
...
@@ -118,7 +118,6 @@ NPError VlcPlugin::init(int argc, char* const argn[], char* const argv[])
ppsz_argv
[
ppsz_argc
++
]
=
"--no-media-library"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--no-media-library"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--ignore-config"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--ignore-config"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--intf=dummy"
;
ppsz_argv
[
ppsz_argc
++
]
=
"--intf=dummy"
;
const
char
*
progid
=
NULL
;
const
char
*
progid
=
NULL
;
/* parse plugin arguments */
/* parse plugin arguments */
...
@@ -560,7 +559,7 @@ void VlcPlugin::redrawToolbar()
...
@@ -560,7 +559,7 @@ void VlcPlugin::redrawToolbar()
libvlc_media_player_t
*
p_md
=
NULL
;
libvlc_media_player_t
*
p_md
=
NULL
;
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
float
f_position
=
0.0
;
float
f_position
=
0.0
;
int
i_playing
=
0
;
int
i
s
_playing
=
0
;
bool
b_mute
=
false
;
bool
b_mute
=
false
;
unsigned
int
dst_x
,
dst_y
;
unsigned
int
dst_x
,
dst_y
;
GC
gc
;
GC
gc
;
...
@@ -581,23 +580,25 @@ void VlcPlugin::redrawToolbar()
...
@@ -581,23 +580,25 @@ void VlcPlugin::redrawToolbar()
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
p_md
=
libvlc_playlist_get_media_player
(
getVLC
(),
&
ex
);
p_md
=
libvlc_playlist_get_media_player
(
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
if
(
p_md
)
{
/* get isplaying */
is_playing
=
libvlc_playlist_isplaying
(
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
/* get isplaying */
/* get movie position in % */
i_playing
=
libvlc_playlist_isplaying
(
getVLC
(),
&
ex
);
if
(
is_playing
==
1
)
libvlc_exception_clear
(
&
ex
);
{
f_position
=
libvlc_media_player_get_position
(
p_md
,
&
ex
)
*
100.0
;
libvlc_exception_clear
(
&
ex
);
}
libvlc_media_player_release
(
p_md
);
}
/* get mute info */
/* get mute info */
b_mute
=
libvlc_audio_get_mute
(
getVLC
(),
&
ex
);
b_mute
=
libvlc_audio_get_mute
(
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
/* get movie position in % */
if
(
i_playing
==
1
)
{
f_position
=
libvlc_media_player_get_position
(
p_md
,
&
ex
)
*
100
;
libvlc_exception_clear
(
&
ex
);
}
libvlc_media_player_release
(
p_md
);
gcv
.
foreground
=
BlackPixel
(
p_display
,
0
);
gcv
.
foreground
=
BlackPixel
(
p_display
,
0
);
gc
=
XCreateGC
(
p_display
,
control
,
GCForeground
,
&
gcv
);
gc
=
XCreateGC
(
p_display
,
control
,
GCForeground
,
&
gcv
);
...
@@ -610,7 +611,7 @@ void VlcPlugin::redrawToolbar()
...
@@ -610,7 +611,7 @@ void VlcPlugin::redrawToolbar()
dst_x
=
BTN_SPACE
;
dst_x
=
BTN_SPACE
;
dst_y
=
i_tb_height
>>
1
;
/* baseline = vertical middle */
dst_y
=
i_tb_height
>>
1
;
/* baseline = vertical middle */
if
(
p_btnPause
&&
(
i_playing
==
1
)
)
if
(
p_btnPause
&&
(
i
s
_playing
==
1
)
)
{
{
XPutImage
(
p_display
,
control
,
gc
,
p_btnPause
,
0
,
0
,
dst_x
,
XPutImage
(
p_display
,
control
,
gc
,
p_btnPause
,
0
,
0
,
dst_x
,
dst_y
-
(
p_btnPause
->
height
>>
1
),
dst_y
-
(
p_btnPause
->
height
>>
1
),
...
@@ -677,7 +678,7 @@ void VlcPlugin::redrawToolbar()
...
@@ -677,7 +678,7 @@ void VlcPlugin::redrawToolbar()
vlc_toolbar_clicked_t
VlcPlugin
::
getToolbarButtonClicked
(
int
i_xpos
,
int
i_ypos
)
vlc_toolbar_clicked_t
VlcPlugin
::
getToolbarButtonClicked
(
int
i_xpos
,
int
i_ypos
)
{
{
unsigned
int
i_dest
=
BTN_SPACE
;
//(i_tb_height >> 1);
unsigned
int
i_dest
=
BTN_SPACE
;
//(i_tb_height >> 1);
int
i_playing
=
0
;
int
i
s
_playing
=
0
;
bool
b_mute
=
false
;
bool
b_mute
=
false
;
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
...
@@ -695,7 +696,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
...
@@ -695,7 +696,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
/* get isplaying */
/* get isplaying */
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
i_playing
=
libvlc_playlist_isplaying
(
getVLC
(),
&
ex
);
i
s
_playing
=
libvlc_playlist_isplaying
(
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
/* get mute info */
/* get mute info */
...
@@ -703,7 +704,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
...
@@ -703,7 +704,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
/* is Pause of Play button clicked */
/* is Pause of Play button clicked */
if
(
(
i_playing
!=
1
)
&&
if
(
(
i
s
_playing
!=
1
)
&&
(
i_xpos
>=
(
BTN_SPACE
>>
1
))
&&
(
i_xpos
>=
(
BTN_SPACE
>>
1
))
&&
(
i_xpos
<=
i_dest
+
p_btnPlay
->
width
+
(
BTN_SPACE
>>
1
))
)
(
i_xpos
<=
i_dest
+
p_btnPlay
->
width
+
(
BTN_SPACE
>>
1
))
)
return
clicked_Play
;
return
clicked_Play
;
...
@@ -712,7 +713,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
...
@@ -712,7 +713,7 @@ vlc_toolbar_clicked_t VlcPlugin::getToolbarButtonClicked( int i_xpos, int i_ypos
return
clicked_Pause
;
return
clicked_Pause
;
/* is Stop button clicked */
/* is Stop button clicked */
if
(
i_playing
!=
1
)
if
(
i
s
_playing
!=
1
)
i_dest
+=
(
p_btnPlay
->
width
+
(
BTN_SPACE
>>
1
));
i_dest
+=
(
p_btnPlay
->
width
+
(
BTN_SPACE
>>
1
));
else
else
i_dest
+=
(
p_btnPause
->
width
+
(
BTN_SPACE
>>
1
));
i_dest
+=
(
p_btnPause
->
width
+
(
BTN_SPACE
>>
1
));
...
...
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