Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
f90b88ab
Commit
f90b88ab
authored
Feb 25, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup and fix crash when plugin wasn't playing.
parent
e9347d2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
150 additions
and
153 deletions
+150
-153
projects/mozilla/vlcplugin.cpp
projects/mozilla/vlcplugin.cpp
+1
-0
projects/mozilla/vlcplugin.h
projects/mozilla/vlcplugin.h
+5
-0
projects/mozilla/vlcshell.cpp
projects/mozilla/vlcshell.cpp
+144
-153
No files found.
projects/mozilla/vlcplugin.cpp
View file @
f90b88ab
...
@@ -44,6 +44,7 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
...
@@ -44,6 +44,7 @@ VlcPlugin::VlcPlugin( NPP instance, uint16 mode ) :
i_npmode
(
mode
),
i_npmode
(
mode
),
b_stream
(
0
),
b_stream
(
0
),
b_autoplay
(
1
),
b_autoplay
(
1
),
i_control_height
(
45
),
psz_target
(
NULL
),
psz_target
(
NULL
),
libvlc_instance
(
NULL
),
libvlc_instance
(
NULL
),
libvlc_log
(
NULL
),
libvlc_log
(
NULL
),
...
...
projects/mozilla/vlcplugin.h
View file @
f90b88ab
...
@@ -105,6 +105,10 @@ public:
...
@@ -105,6 +105,10 @@ public:
int
b_autoplay
;
int
b_autoplay
;
char
*
psz_target
;
char
*
psz_target
;
#if XP_UNIX
/* toolbar */
int
i_control_height
;
#endif
private:
private:
/* VLC reference */
/* VLC reference */
libvlc_instance_t
*
libvlc_instance
;
libvlc_instance_t
*
libvlc_instance
;
...
@@ -123,6 +127,7 @@ private:
...
@@ -123,6 +127,7 @@ private:
#if XP_UNIX
#if XP_UNIX
unsigned
int
i_width
,
i_height
;
unsigned
int
i_width
,
i_height
;
Window
npvideo
,
npcontrol
;
Window
npvideo
,
npcontrol
;
#endif
#endif
};
};
...
...
projects/mozilla/vlcshell.cpp
View file @
f90b88ab
...
@@ -52,7 +52,13 @@
...
@@ -52,7 +52,13 @@
#undef X11_RESIZE_DEBUG
#undef X11_RESIZE_DEBUG
#define WINDOW_TEXT "Video is loading..."
#define WINDOW_TEXT "Video is loading..."
#define CONTROL_HEIGHT 45
#ifndef __MAX
# define __MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
#endif
#ifndef __MIN
# define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
#endif
/*****************************************************************************
/*****************************************************************************
* Unix-only declarations
* Unix-only declarations
...
@@ -497,11 +503,11 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
...
@@ -497,11 +503,11 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
int
i_blackColor
=
BlackPixel
(
p_display
,
DefaultScreen
(
p_display
));
int
i_blackColor
=
BlackPixel
(
p_display
,
DefaultScreen
(
p_display
));
Window
video
=
XCreateSimpleWindow
(
p_display
,
parent
,
0
,
0
,
Window
video
=
XCreateSimpleWindow
(
p_display
,
parent
,
0
,
0
,
window
->
width
,
window
->
height
-
CONTROL_HEIGHT
,
0
,
window
->
width
,
window
->
height
-
p_plugin
->
i_control_height
,
0
,
i_blackColor
,
i_blackColor
);
i_blackColor
,
i_blackColor
);
Window
controls
=
XCreateSimpleWindow
(
p_display
,
parent
,
0
,
Window
controls
=
XCreateSimpleWindow
(
p_display
,
parent
,
0
,
window
->
height
-
CONTROL_HEIGHT
-
1
,
window
->
width
,
window
->
height
-
p_plugin
->
i_control_height
-
1
,
window
->
width
,
CONTROL_HEIGHT
-
1
,
0
,
i_blackColor
,
i_blackColor
);
p_plugin
->
i_control_height
-
1
,
0
,
i_blackColor
,
i_blackColor
);
XMapWindow
(
p_display
,
parent
);
XMapWindow
(
p_display
,
parent
);
XMapWindow
(
p_display
,
video
);
XMapWindow
(
p_display
,
video
);
...
@@ -774,14 +780,14 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
...
@@ -774,14 +780,14 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
XGCValues
gcv
;
XGCValues
gcv
;
/* Toolbar */
/* Toolbar */
XImage
*
p_
playIcon
=
NULL
;
XImage
*
p_
btnPlay
=
NULL
;
XImage
*
p_
pauseIcon
=
NULL
;
XImage
*
p_
btnPause
=
NULL
;
XImage
*
p_
stopIcon
=
NULL
;
XImage
*
p_
btnStop
=
NULL
;
XImage
*
p_timeline
=
NULL
;
XImage
*
p_timeline
=
NULL
;
XImage
*
p_
timeKnob
=
NULL
;
XImage
*
p_
btnTime
=
NULL
;
XImage
*
p_
f
screen
=
NULL
;
XImage
*
p_
btnFull
screen
=
NULL
;
XImage
*
p_
muteIcon
=
NULL
;
XImage
*
p_
btnMute
=
NULL
;
XImage
*
p_
unmuteIcon
=
NULL
;
XImage
*
p_
btnUnmute
=
NULL
;
libvlc_media_instance_t
*
p_md
=
NULL
;
libvlc_media_instance_t
*
p_md
=
NULL
;
float
f_position
=
0
;
float
f_position
=
0
;
...
@@ -792,17 +798,55 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
...
@@ -792,17 +798,55 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
Window
control
=
p_plugin
->
getControlWindow
();
Window
control
=
p_plugin
->
getControlWindow
();
Display
*
p_display
=
((
NPSetWindowCallbackStruct
*
)
window
.
ws_info
)
->
display
;
Display
*
p_display
=
((
NPSetWindowCallbackStruct
*
)
window
.
ws_info
)
->
display
;
/* load icons */
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/play.xpm"
,
&
p_btnPlay
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnPlay
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/pause.xpm"
,
&
p_btnPause
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnPause
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/stop.xpm"
,
&
p_btnStop
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnStop
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/time_line.xpm"
,
&
p_timeline
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_timeline
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/time_icon.xpm"
,
&
p_btnTime
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnTime
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/fullscreen.xpm"
,
&
p_btnFullscreen
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnFullscreen
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/volume_max.xpm"
,
&
p_btnMute
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnMute
->
height
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/volume_mute.xpm"
,
&
p_btnUnmute
,
NULL
,
NULL
);
p_plugin
->
i_control_height
=
__MAX
(
p_plugin
->
i_control_height
,
p_btnUnmute
->
height
);
if
(
!
p_btnPlay
||
!
p_btnPause
||
!
p_btnStop
||
!
p_timeline
||
!
p_btnTime
||
!
p_btnFullscreen
||
!
p_btnMute
||
!
p_btnUnmute
)
fprintf
(
stderr
,
"Error: some button images not found in %s
\n
"
,
DATA_PATH
);
gcv
.
foreground
=
BlackPixel
(
p_display
,
0
);
gcv
.
foreground
=
BlackPixel
(
p_display
,
0
);
gc
=
XCreateGC
(
p_display
,
video
,
GCForeground
,
&
gcv
);
gc
=
XCreateGC
(
p_display
,
video
,
GCForeground
,
&
gcv
);
XFillRectangle
(
p_display
,
video
,
gc
,
XFillRectangle
(
p_display
,
video
,
gc
,
0
,
0
,
window
.
width
,
window
.
height
-
CONTROL_HEIGHT
);
0
,
0
,
window
.
width
,
window
.
height
-
p_plugin
->
i_control_height
);
gcv
.
foreground
=
WhitePixel
(
p_display
,
0
);
gcv
.
foreground
=
WhitePixel
(
p_display
,
0
);
XChangeGC
(
p_display
,
gc
,
GCForeground
,
&
gcv
);
XChangeGC
(
p_display
,
gc
,
GCForeground
,
&
gcv
);
XDrawString
(
p_display
,
video
,
gc
,
XDrawString
(
p_display
,
video
,
gc
,
window
.
width
/
2
-
40
,
(
window
.
height
-
CONTROL_HEIGHT
)
/
2
,
window
.
width
/
2
-
40
,
(
window
.
height
-
p_plugin
->
i_control_height
)
/
2
,
WINDOW_TEXT
,
strlen
(
WINDOW_TEXT
)
);
WINDOW_TEXT
,
strlen
(
WINDOW_TEXT
)
);
/* RedrawToolbar */
/* RedrawToolbar */
...
@@ -810,7 +854,7 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
...
@@ -810,7 +854,7 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
gc
=
XCreateGC
(
p_display
,
control
,
GCForeground
,
&
gcv
);
gc
=
XCreateGC
(
p_display
,
control
,
GCForeground
,
&
gcv
);
XFillRectangle
(
p_display
,
control
,
gc
,
XFillRectangle
(
p_display
,
control
,
gc
,
0
,
0
,
window
.
width
,
CONTROL_HEIGHT
);
0
,
0
,
window
.
width
,
p_plugin
->
i_control_height
);
gcv
.
foreground
=
WhitePixel
(
p_display
,
0
);
gcv
.
foreground
=
WhitePixel
(
p_display
,
0
);
...
@@ -841,108 +885,55 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
...
@@ -841,108 +885,55 @@ static void Redraw( Widget w, XtPointer closure, XEvent *event )
}
}
libvlc_media_instance_release
(
p_md
);
libvlc_media_instance_release
(
p_md
);
/* load icons */
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/play.xpm"
,
&
p_playIcon
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/pause.xpm"
,
&
p_pauseIcon
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/stop.xpm"
,
&
p_stopIcon
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/time_line.xpm"
,
&
p_timeline
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/time_icon.xpm"
,
&
p_timeKnob
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/fullscreen.xpm"
,
&
p_fscreen
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/volume_max.xpm"
,
&
p_muteIcon
,
NULL
,
NULL
);
XpmReadFileToImage
(
p_display
,
DATA_PATH
"/mozilla/volume_mute.xpm"
,
&
p_unmuteIcon
,
NULL
,
NULL
);
#if 1
/* DEBUG */
if
(
!
p_playIcon
)
{
fprintf
(
stderr
,
"Error: playImage not found
\n
"
);
}
if
(
!
p_pauseIcon
)
{
fprintf
(
stderr
,
"Error: pauseImage not found
\n
"
);
}
if
(
!
p_stopIcon
)
{
fprintf
(
stderr
,
"Error: stopImage not found
\n
"
);
}
if
(
!
p_timeline
)
{
fprintf
(
stderr
,
"Error: TimeLineImage not found
\n
"
);
}
if
(
!
p_timeKnob
)
{
fprintf
(
stderr
,
"Error: TimeIcon not found
\n
"
);
}
if
(
!
p_fscreen
)
{
fprintf
(
stderr
,
"Error: FullscreenImage not found
\n
"
);
}
if
(
!
p_muteIcon
)
{
fprintf
(
stderr
,
"Error: MuteImage not found
\n
"
);
}
if
(
!
p_unmuteIcon
)
{
fprintf
(
stderr
,
"Error: UnMuteImage not found
\n
"
);
}
#endif
/* position icons */
/* position icons */
if
(
p_
pauseIcon
&&
(
i_playing
==
1
)
)
if
(
p_
btnPause
&&
(
i_playing
==
1
)
)
{
{
XPutImage
(
p_display
,
control
,
gc
,
p_
pauseIcon
,
0
,
0
,
4
,
14
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnPause
,
0
,
0
,
4
,
14
,
p_
pauseIcon
->
width
,
p_pauseIcon
->
height
);
p_
btnPause
->
width
,
p_btnPause
->
height
);
}
}
else
if
(
p_
playIcon
)
else
if
(
p_
btnPlay
)
{
{
XPutImage
(
p_display
,
control
,
gc
,
p_
playIcon
,
0
,
0
,
4
,
14
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnPlay
,
0
,
0
,
4
,
14
,
p_
playIcon
->
width
,
p_playIcon
->
height
);
p_
btnPlay
->
width
,
p_btnPlay
->
height
);
}
}
if
(
p_
stopIcon
)
if
(
p_
btnStop
)
XPutImage
(
p_display
,
control
,
gc
,
p_
stopIcon
,
0
,
0
,
39
,
14
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnStop
,
0
,
0
,
39
,
14
,
p_
stopIcon
->
width
,
p_stopIcon
->
height
);
p_
btnStop
->
width
,
p_btnStop
->
height
);
if
(
p_
f
screen
)
if
(
p_
btnFull
screen
)
XPutImage
(
p_display
,
control
,
gc
,
p_
f
screen
,
0
,
0
,
67
,
21
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnFull
screen
,
0
,
0
,
67
,
21
,
p_
fscreen
->
width
,
p_f
screen
->
height
);
p_
btnFullscreen
->
width
,
p_btnFull
screen
->
height
);
if
(
p_
unmuteIcon
&&
b_mute
)
if
(
p_
btnUnmute
&&
b_mute
)
{
{
XPutImage
(
p_display
,
control
,
gc
,
p_
unmuteIcon
,
0
,
0
,
94
,
30
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnUnmute
,
0
,
0
,
94
,
30
,
p_unmuteIcon
->
width
,
p_unmuteIcon
->
height
);
p_btnUnmute
->
width
,
p_btnUnmute
->
height
);
}
}
else
if
(
p_
muteIcon
)
else
if
(
p_
btnMute
)
{
{
XPutImage
(
p_display
,
control
,
gc
,
p_
muteIcon
,
0
,
0
,
94
,
30
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnMute
,
0
,
0
,
94
,
30
,
p_
muteIcon
->
width
,
p_muteIcon
->
height
);
p_
btnMute
->
width
,
p_btnMute
->
height
);
}
}
if
(
p_timeline
)
if
(
p_timeline
)
XPutImage
(
p_display
,
control
,
gc
,
p_timeline
,
0
,
0
,
4
,
4
,
XPutImage
(
p_display
,
control
,
gc
,
p_timeline
,
0
,
0
,
4
,
4
,
(
window
.
width
-
8
),
p_timeline
->
height
);
(
window
.
width
-
8
),
p_timeline
->
height
);
if
(
p_
timeKnob
&&
(
f_position
>
0
)
)
if
(
p_
btnTime
&&
(
f_position
>
0
)
)
{
{
f_position
=
(((
float
)
window
.
width
-
8
)
/
100
)
*
f_position
;
f_position
=
(((
float
)
window
.
width
-
8
)
/
100
)
*
f_position
;
XPutImage
(
p_display
,
control
,
gc
,
p_
timeKnob
,
0
,
0
,
(
4
+
f_position
),
2
,
XPutImage
(
p_display
,
control
,
gc
,
p_
btnTime
,
0
,
0
,
(
4
+
f_position
),
2
,
p_
timeKnob
->
width
,
p_timeKnob
->
height
);
p_
btnTime
->
width
,
p_btnTime
->
height
);
}
}
/* Cleanup */
/* Cleanup */
if
(
p_
playIcon
)
XDestroyImage
(
p_playIcon
);
if
(
p_
btnPlay
)
XDestroyImage
(
p_btnPlay
);
if
(
p_
pauseIcon
)
XDestroyImage
(
p_pauseIcon
);
if
(
p_
btnPause
)
XDestroyImage
(
p_btnPause
);
if
(
p_
stopIcon
)
XDestroyImage
(
p_stopIcon
);
if
(
p_
btnStop
)
XDestroyImage
(
p_btnStop
);
if
(
p_timeline
)
XDestroyImage
(
p_timeline
);
if
(
p_timeline
)
XDestroyImage
(
p_timeline
);
if
(
p_
timeKnob
)
XDestroyImage
(
p_timeKnob
);
if
(
p_
btnTime
)
XDestroyImage
(
p_btnTime
);
if
(
p_
fscreen
)
XDestroyImage
(
p_f
screen
);
if
(
p_
btnFullscreen
)
XDestroyImage
(
p_btnFull
screen
);
if
(
p_
muteIcon
)
XDestroyImage
(
p_muteIcon
);
if
(
p_
btnMute
)
XDestroyImage
(
p_btnMute
);
if
(
p_
unmuteIcon
)
XDestroyImage
(
p_unmuteIcon
);
if
(
p_
btnUnmute
)
XDestroyImage
(
p_btnUnmute
);
XFreeGC
(
p_display
,
gc
);
XFreeGC
(
p_display
,
gc
);
}
}
...
@@ -957,69 +948,71 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
...
@@ -957,69 +948,71 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
int
i_xPos
=
event
->
xbutton
.
x
;
int
i_xPos
=
event
->
xbutton
.
x
;
int
i_yPos
=
event
->
xbutton
.
y
;
int
i_yPos
=
event
->
xbutton
.
y
;
libvlc_exception_t
ex
;
if
(
p_plugin
)
libvlc_exception_init
(
&
ex
);
libvlc_media_instance_t
*
p_md
=
libvlc_playlist_get_media_instance
(
p_plugin
->
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
/* jump in the movie */
if
(
i_yPos
<=
(
i_height
-
30
)
)
{
{
vlc_int64_t
f_length
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
f_length
=
libvlc_media_instance_get_length
(
p_md
,
&
ex
)
/
100
;
libvlc_media_instance_t
*
p_md
=
libvlc_playlist_get_media_instance
(
p_plugin
->
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
f_length
=
(
float
)
f_length
*
/* jump in the movie */
(
((
float
)
i_xPos
-
4
)
/
(
((
float
)
i_width
-
8
)
/
100
)
);
if
(
i_yPos
<=
(
i_height
-
30
)
)
{
vlc_int64_t
f_length
;
libvlc_exception_init
(
&
ex
);
f_length
=
libvlc_media_instance_get_length
(
p_md
,
&
ex
)
/
100
;
libvlc_exception_clear
(
&
ex
);
libvlc_exception_init
(
&
ex
);
f_length
=
(
float
)
f_length
*
libvlc_media_instance_set_time
(
p_md
,
f_length
,
&
ex
);
(
((
float
)
i_xPos
-
4
)
/
(
((
float
)
i_width
-
8
)
/
100
)
);
libvlc_exception_clear
(
&
ex
);
}
/* play/pause toggle */
libvlc_exception_init
(
&
ex
);
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>
4
)
&&
(
i_xPos
<=
39
)
)
libvlc_media_instance_set_time
(
p_md
,
f_length
,
&
ex
);
{
libvlc_exception_clear
(
&
ex
);
int
i_playing
;
}
libvlc_exception_init
(
&
ex
);
i_playing
=
libvlc_playlist_isplaying
(
p_plugin
->
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_init
(
&
ex
);
/* play/pause toggle */
if
(
i_playing
==
1
)
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>
4
)
&&
(
i_xPos
<=
39
)
)
libvlc_playlist_pause
(
p_plugin
->
getVLC
(),
&
ex
);
{
else
int
i_playing
;
libvlc_
playlist_play
(
p_plugin
->
getVLC
(),
-
1
,
0
,
NULL
,
&
ex
);
libvlc_
exception_init
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
i_playing
=
libvlc_playlist_isplaying
(
p_plugin
->
getVLC
(),
&
ex
);
}
libvlc_exception_clear
(
&
ex
);
/* stop */
libvlc_exception_init
(
&
ex
);
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>
39
)
&&
(
i_xPos
<
67
)
)
if
(
i_playing
==
1
)
{
libvlc_playlist_pause
(
p_plugin
->
getVLC
(),
&
ex
);
libvlc_exception_init
(
&
ex
);
else
libvlc_playlist_stop
(
p_plugin
->
getVLC
()
,
&
ex
);
libvlc_playlist_play
(
p_plugin
->
getVLC
(),
-
1
,
0
,
NULL
,
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
}
}
/* fullscreen
*/
/* stop
*/
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>=
67
)
&&
(
i_xPos
<
94
)
)
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>
39
)
&&
(
i_xPos
<
67
)
)
{
{
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
libvlc_set_fullscreen
(
p_md
,
1
,
&
ex
);
libvlc_playlist_stop
(
p_plugin
->
getVLC
()
,
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
}
}
/* mute toggle */
/* fullscreen */
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>=
94
)
&&
(
i_xPos
<
109
))
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>=
67
)
&&
(
i_xPos
<
94
)
)
{
{
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
libvlc_audio_toggle_mute
(
p_plugin
->
getVLC
(),
&
ex
);
libvlc_set_fullscreen
(
p_md
,
1
,
&
ex
);
libvlc_exception_clear
(
&
ex
);
libvlc_exception_clear
(
&
ex
);
}
}
libvlc_media_instance_release
(
p_md
);
/* mute toggle */
if
(
(
i_yPos
>
(
i_height
-
30
))
&&
(
i_xPos
>=
94
)
&&
(
i_xPos
<
109
))
{
libvlc_exception_init
(
&
ex
);
libvlc_audio_toggle_mute
(
p_plugin
->
getVLC
(),
&
ex
);
libvlc_exception_clear
(
&
ex
);
}
libvlc_media_instance_release
(
p_md
);
}
Redraw
(
w
,
closure
,
event
);
Redraw
(
w
,
closure
,
event
);
}
}
...
@@ -1047,14 +1040,13 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
...
@@ -1047,14 +1040,13 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
}
}
#endif
/* X11_RESIZE_DEBUG */
#endif
/* X11_RESIZE_DEBUG */
if
(
!
p_plugin
->
setSize
(
window
.
width
,
(
window
.
height
-
CONTROL_HEIGHT
))
)
if
(
!
p_plugin
->
setSize
(
window
.
width
,
(
window
.
height
-
p_plugin
->
i_control_height
))
)
{
{
/* size already set */
/* size already set */
return
;
return
;
}
}
i_ret
=
XResizeWindow
(
p_display
,
drawable
,
window
.
width
,
(
window
.
height
-
p_plugin
->
i_control_height
)
);
i_ret
=
XResizeWindow
(
p_display
,
drawable
,
window
.
width
,
(
window
.
height
-
CONTROL_HEIGHT
)
);
#ifdef X11_RESIZE_DEBUG
#ifdef X11_RESIZE_DEBUG
fprintf
(
stderr
,
fprintf
(
stderr
,
...
@@ -1086,7 +1078,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
...
@@ -1086,7 +1078,7 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
#endif
/* X11_RESIZE_DEBUG */
#endif
/* X11_RESIZE_DEBUG */
i_ret
=
XResizeWindow
(
p_display
,
base_window
,
i_ret
=
XResizeWindow
(
p_display
,
base_window
,
window
.
width
,
(
window
.
height
-
CONTROL_HEIGHT
)
);
window
.
width
,
(
window
.
height
-
p_plugin
->
i_control_height
)
);
#ifdef X11_RESIZE_DEBUG
#ifdef X11_RESIZE_DEBUG
fprintf
(
stderr
,
fprintf
(
stderr
,
...
@@ -1102,4 +1094,3 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
...
@@ -1102,4 +1094,3 @@ static void Resize ( Widget w, XtPointer closure, XEvent *event )
}
}
#endif
/* XP_UNIX */
#endif
/* XP_UNIX */
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