annotate Gui/mplayer/play.c @ 19056:36f993b7f91d

freeze (this is pretty much oded shimons patch from a few month ago)
author michael
date Thu, 13 Jul 2006 10:26:33 +0000
parents 0e1471d9da74
children 86350b4b8203
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7092
8e9607c5897e - warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents: 7009
diff changeset
1
4428
3e1378354c2e Compilation fixing
nick
parents: 3479
diff changeset
2 #include <inttypes.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
3 #include <stdlib.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
4 #include <stdio.h>
7092
8e9607c5897e - warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
pontscho
parents: 7009
diff changeset
5 #include <string.h>
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
6
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
7 #include <unistd.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
8 #include <signal.h>
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
9
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
10 #include "wm/ws.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
11 #include "wm/wsxdnd.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
12 #include "../config.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
13 #include "../help_mp.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
14 #include "../mplayer.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
15 #include "../libvo/x11_common.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
16 #include "../libvo/video_out.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
17 #include "../input/input.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
18
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
19 #include "app.h"
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
20
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
21 #include "wm/wskeys.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
22 #include "interface.h"
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
23
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
24 #include "widgets.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
25 #include "./mplayer.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
26 #include "play.h"
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
27
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
28 #include "skin/skin.h"
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
29 #include "skin/font.h"
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
30
17144
0e1471d9da74 Unify include paths, -I.. is in CFLAGS.
diego
parents: 16284
diff changeset
31 #include "libmpdemux/stream.h"
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
32
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1693
diff changeset
33 extern float rel_seek_secs;
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1693
diff changeset
34 extern int abs_seek_pos;
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1693
diff changeset
35
10193
f0bcaf5ea675 From: Michael Joosten <joost@c-lab.de>
pontscho
parents: 9291
diff changeset
36 int mplGotoTheNext = 1;
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
37
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
38 void mplFullScreen( void )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
39 {
7151
9e17b153b785 - fix window handling with dxr3
pontscho
parents: 7092
diff changeset
40 if ( guiIntfStruct.NoWindow && guiIntfStruct.Playing ) return;
9202
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9190
diff changeset
41
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
42 if ( ( guiIntfStruct.Playing )&&( appMPlayer.subWindow.isFullScreen ) )
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
43 {
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
44 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight;
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
45 switch ( appMPlayer.sub.x )
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
46 {
10194
2608bf0037b6 From: Ben Low <ben@bdlow.net>
pontscho
parents: 10193
diff changeset
47 case -1: appMPlayer.subWindow.OldX=( wsMaxX / 2 ) - ( appMPlayer.subWindow.OldWidth / 2 ) + wsOrgX; break;
2608bf0037b6 From: Ben Low <ben@bdlow.net>
pontscho
parents: 10193
diff changeset
48 case -2: appMPlayer.subWindow.OldX=wsMaxX - appMPlayer.subWindow.OldWidth + wsOrgX; break;
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
49 default: appMPlayer.subWindow.OldX=appMPlayer.sub.x; break;
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
50 }
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
51 switch ( appMPlayer.sub.y )
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
52 {
10194
2608bf0037b6 From: Ben Low <ben@bdlow.net>
pontscho
parents: 10193
diff changeset
53 case -1: appMPlayer.subWindow.OldY=( wsMaxY / 2 ) - ( appMPlayer.subWindow.OldHeight / 2 ) + wsOrgY; break;
2608bf0037b6 From: Ben Low <ben@bdlow.net>
pontscho
parents: 10193
diff changeset
54 case -2: appMPlayer.subWindow.OldY=wsMaxY - appMPlayer.subWindow.OldHeight + wsOrgY; break;
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
55 default: appMPlayer.subWindow.OldY=appMPlayer.sub.y; break;
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
56 }
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
57 }
9202
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9190
diff changeset
58 if ( guiIntfStruct.Playing || gtkShowVideoWindow ) wsFullScreen( &appMPlayer.subWindow );
c2f31ca14a92 - rewrite Jan Spitalnik's patch
pontscho
parents: 9190
diff changeset
59 fullscreen=vo_fs=appMPlayer.subWindow.isFullScreen;
5997
b5fb9a927bf3 add WM detection, and wm specific fullscreen code. (???)
pontscho
parents: 5986
diff changeset
60 wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen );
10193
f0bcaf5ea675 From: Michael Joosten <joost@c-lab.de>
pontscho
parents: 9291
diff changeset
61 if ( appMPlayer.menuIsPresent ) wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
5910
20c335d98ab3 fix fullscreen bug es ilyen libvo not initialized bug with gui igy
pontscho
parents: 5701
diff changeset
62
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
63 if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
64 else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
65 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
66
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
67 extern int mplSubRender;
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
68
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
69 void mplEnd( void )
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
70 {
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
71 plItem * next;
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
72
9291
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
73 if ( !mplGotoTheNext && guiIntfStruct.Playing) { mplGotoTheNext=1; return; }
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
74
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
75 if ( guiIntfStruct.Playing && (next=gtkSet( gtkGetNextPlItem,0,NULL )) && plLastPlayed != next )
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
76 {
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
77 plLastPlayed=next;
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
78 guiSetDF( guiIntfStruct.Filename,next->path,next->name );
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
79 guiIntfStruct.StreamType=STREAMTYPE_FILE;
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8280
diff changeset
80 guiIntfStruct.FilenameChanged=guiIntfStruct.NewPlay=1;
6857
pontscho
parents: 6794
diff changeset
81 gfree( (void **)&guiIntfStruct.AudioFile );
pontscho
parents: 6794
diff changeset
82 gfree( (void **)&guiIntfStruct.Subtitlename );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
83 }
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
84 else
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
85 {
8484
9ea5f18a7957 - fix (?) "mixer bug"
pontscho
parents: 8423
diff changeset
86 if ( guiIntfStruct.FilenameChanged || guiIntfStruct.NewPlay ) return;
6903
c2d4100c964e - fix mixer handling
pontscho
parents: 6857
diff changeset
87
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
88 guiIntfStruct.TimeSec=0;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
89 guiIntfStruct.Position=0;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
90 guiIntfStruct.AudioType=0;
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8280
diff changeset
91 guiIntfStruct.NoWindow=False;
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8280
diff changeset
92
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6967
diff changeset
93 #ifdef USE_DVDREAD
6912
5ddd609550d5 - fix equ handling
pontscho
parents: 6903
diff changeset
94 guiIntfStruct.DVD.current_title=1;
5ddd609550d5 - fix equ handling
pontscho
parents: 6903
diff changeset
95 guiIntfStruct.DVD.current_chapter=1;
5ddd609550d5 - fix equ handling
pontscho
parents: 6903
diff changeset
96 guiIntfStruct.DVD.current_angle=1;
6996
163f78ece9c2 add uri2filename converter
pontscho
parents: 6967
diff changeset
97 #endif
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
98
12068
df423e2d71dc patch from Rune <runner@mail.tele.dk>
pontscho
parents: 10194
diff changeset
99 if ( !appMPlayer.subWindow.isFullScreen && gtkShowVideoWindow)
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
100 {
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
101 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
102 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
103 }
12068
df423e2d71dc patch from Rune <runner@mail.tele.dk>
pontscho
parents: 10194
diff changeset
104 else wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
105 guiGetEvent( guiCEvent,guiSetStop );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
106 mplSubRender=1;
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
107 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
108 wsClearWindow( appMPlayer.subWindow );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
109 wsPostRedisplay( &appMPlayer.subWindow );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
110 }
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
111 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
112
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
113 void mplPlay( void )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
114 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
115 if ( ( !guiIntfStruct.Filename )||
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
116 ( guiIntfStruct.Filename[0] == 0 )||
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
117 ( guiIntfStruct.Playing == 1 ) ) return;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
118 if ( guiIntfStruct.Playing == 2 ) { mplPause(); return; }
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
119 guiGetEvent( guiCEvent,(void *)guiSetPlay );
1791
2e86c5c8071e fix subvindov
pontscho
parents: 1784
diff changeset
120 mplSubRender=0;
1858
88a88d0a3f94 fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents: 1852
diff changeset
121 wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
122 wsClearWindow( appMPlayer.subWindow );
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
123 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
124
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
125 void mplPause( void )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
126 {
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
127 if ( !guiIntfStruct.Playing ) return;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
128 if ( guiIntfStruct.Playing == 1 )
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
129 {
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
130 mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
131 cmd->id=MP_CMD_PAUSE;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
132 cmd->name=strdup("pause");
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
133 mp_input_queue_cmd(cmd);
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
134 } else guiIntfStruct.Playing=1;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
135 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
136
4465
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
137 void mplState( void )
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
138 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
139 if ( ( guiIntfStruct.Playing == 0 )||( guiIntfStruct.Playing == 2 ) )
4465
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
140 {
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
141 btnModify( evPlaySwitchToPause,btnReleased );
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
142 btnModify( evPauseSwitchToPlay,btnDisabled );
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
143 }
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
144 else
4465
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
145 {
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
146 btnModify( evPlaySwitchToPause,btnDisabled );
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
147 btnModify( evPauseSwitchToPlay,btnReleased );
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
148 }
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
149 }
b013d01d9968 small bugfixes, and kill other warning
pontscho
parents: 4428
diff changeset
150
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
151 float mplGetPosition( void )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
152 { // return 0.0 ... 100.0
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
153 return guiIntfStruct.Position;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
154 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
155
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
156 void mplRelSeek( float s )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
157 { // -+s
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1693
diff changeset
158 rel_seek_secs=s; abs_seek_pos=0;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
159 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
160
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
161 void mplAbsSeek( float s )
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
162 { // 0.0 ... 100.0
8280
72700fefd3dc no seeking if stream is STREAMTYPE_STREAM (net/stdin)
pontscho
parents: 8055
diff changeset
163 if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) return;
1723
5e4214a7540e GUI stuff. now seeking works, and xmga renders to video window
arpi
parents: 1693
diff changeset
164 rel_seek_secs=0.01*s; abs_seek_pos=3;
1693
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
165 }
d237c5d4b216 GUI version n-1
arpi
parents:
diff changeset
166
1800
f5ffb03ebdb5 move skin changing here.
pontscho
parents: 1797
diff changeset
167 listItems tmpList;
f5ffb03ebdb5 move skin changing here.
pontscho
parents: 1797
diff changeset
168
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
169 void ChangeSkin( char * name )
1800
f5ffb03ebdb5 move skin changing here.
pontscho
parents: 1797
diff changeset
170 {
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
171 int ret;
8949
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
172 int prev = appMPlayer.menuIsPresent;
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
173 int bprev = appMPlayer.barIsPresent;
5690
436cf6ef67fd fix skin loading bug
pontscho
parents: 5689
diff changeset
174
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
175 mainVisible=0;
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
176
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
177 appInitStruct( &tmpList );
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
178 skinAppMPlayer=&tmpList;
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
179 fntFreeFont();
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
180 ret=skinRead( name );
1800
f5ffb03ebdb5 move skin changing here.
pontscho
parents: 1797
diff changeset
181
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
182 appInitStruct( &tmpList );
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
183 skinAppMPlayer=&appMPlayer;
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
184 appInitStruct( &appMPlayer );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
185 if ( ret ) name=skinName;
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
186 if ( skinRead( name ) )
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
187 {
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
188 mainVisible=1;
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
189 return;
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
190 }
8949
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
191
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
192 // --- reload menu window
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
193
8949
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
194 if ( prev && appMPlayer.menuIsPresent )
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
195 {
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
196 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer );
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
197 if ( ( mplMenuDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL )
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
198 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
199 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
200 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height );
6221
4b2459557340 add XShape support for gui's submenu
pontscho
parents: 6219
diff changeset
201 wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image );
6089
39c2bfe5c267 small fixes
pontscho
parents: 5997
diff changeset
202 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow );
8949
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
203 } else { mplMenuInit(); }
1800
f5ffb03ebdb5 move skin changing here.
pontscho
parents: 1797
diff changeset
204
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
205 // --- reload sub window
2226
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
206 if ( appMPlayer.sub.Bitmap.Image ) wsResizeImage( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Width,appMPlayer.sub.Bitmap.Height );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
207 if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) )
2226
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
208 {
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
209 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2447
diff changeset
210 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
211 }
2226
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
212 if ( appMPlayer.sub.Bitmap.Image ) wsConvert( &appMPlayer.subWindow,appMPlayer.sub.Bitmap.Image,appMPlayer.sub.Bitmap.ImageSize );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
213 if ( !guiIntfStruct.Playing )
2226
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
214 {
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
215 mplSubRender=1;
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
216 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
2226
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
217 wsClearWindow( appMPlayer.subWindow );
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
218 wsPostRedisplay( &appMPlayer.subWindow );
9582af160d04 skin chaning bug fix.
pontscho
parents: 2045
diff changeset
219 }
1866
32b1bb50a0e8 some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents: 1861
diff changeset
220
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
221 // --- reload play bar
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
222 if ( bprev ) wsDestroyWindow( &appMPlayer.barWindow );
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
223 mplPBInit();
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
224
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
225 // --- reload main window
1907
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
226 if ( mplDrawBuffer ) free( mplDrawBuffer );
83291fafe66c add new features. and fix skin error loop.
pontscho
parents: 1888
diff changeset
227 if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL )
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
228 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; }
6146
b9651eb9749e fix some gtk bug...
pontscho
parents: 6089
diff changeset
229
8949
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
230 wsDestroyWindow( &appMPlayer.mainWindow );
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
231
8949
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
232 wsCreateWindow( &appMPlayer.mainWindow,
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
233 appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
234 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsMaxSize|wsHideWindow,"MPlayer" );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
235 wsCreateImage( &appMPlayer.mainWindow,appMPlayer.main.Bitmap.Width,appMPlayer.main.Bitmap.Height );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
236 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
237 wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
238
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
239 appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw;
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
240 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle;
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
241 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle;
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
242 appMPlayer.mainWindow.DandDHandler=mplDandDHandler;
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
243
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
244 wsXDNDMakeAwareness( &appMPlayer.mainWindow );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
245 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
246 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
d07ab8e088a9 correct skin changing
pontscho
parents: 8864
diff changeset
247 mainVisible=1;
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
248 // ---
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
249
4818
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
250 btnModify( evSetVolume,guiIntfStruct.Volume );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
251 btnModify( evSetBalance,guiIntfStruct.Balance );
3473ca9ef158 new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents: 4798
diff changeset
252 btnModify( evSetMoviePosition,guiIntfStruct.Position );
3479
2704448de713 fs button bug fix
pontscho
parents: 2979
diff changeset
253 btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen );
8973
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
254
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
255 wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen );
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
256 wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
0a665389cf2b - add playbar
pontscho
parents: 8949
diff changeset
257
1800
f5ffb03ebdb5 move skin changing here.
pontscho
parents: 1797
diff changeset
258 }
1802
82e77faa7341 async reply fix ?
pontscho
parents: 1800
diff changeset
259
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
260 void mplSetFileName( char * dir,char * name,int type )
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2447
diff changeset
261 {
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6912
diff changeset
262 if ( !name ) return;
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6912
diff changeset
263
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6912
diff changeset
264 if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name )
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8280
diff changeset
265 else guiSetDF( guiIntfStruct.Filename,dir,name );
6967
0fa27966ac47 add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents: 6912
diff changeset
266
8423
c6a1a5b6ba25 - fix three submenu bug
pontscho
parents: 8280
diff changeset
267 // filename=guiIntfStruct.Filename;
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
268 guiIntfStruct.StreamType=type;
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
269 gfree( (void **)&guiIntfStruct.AudioFile );
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
270 gfree( (void **)&guiIntfStruct.Subtitlename );
2854
fd44ecf77f8d move bug meg fileload bug fixed asszem.
pontscho
parents: 2447
diff changeset
271 }
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
272
9291
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
273 void mplCurr( void )
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
274 {
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
275 plItem * curr;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
276 int stop = 0;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
277
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
278 if ( guiIntfStruct.Playing == 2 ) return;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
279 switch ( guiIntfStruct.StreamType )
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
280 {
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
281 #ifdef USE_DVDREAD
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
282 case STREAMTYPE_DVD:
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
283 break;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
284 #endif
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
285 #ifdef HAVE_VCD
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
286 case STREAMTYPE_VCD:
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
287 break;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
288 #endif
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
289 default:
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
290 if ( (curr=gtkSet( gtkGetCurrPlItem,0,NULL)) )
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
291 {
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
292 mplSetFileName( curr->path,curr->name,STREAMTYPE_FILE );
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
293 mplGotoTheNext=0;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
294 break;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
295 }
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
296 return;
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
297 }
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
298 if ( stop ) mplEventHandling( evStop,0 );
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
299 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
300 }
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
301
64b8c5a07c2c - It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents: 9202
diff changeset
302
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
303 void mplPrev( void )
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
304 {
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
305 plItem * prev;
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
306 int stop = 0;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
307
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
308 if ( guiIntfStruct.Playing == 2 ) return;
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
309 switch ( guiIntfStruct.StreamType )
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
310 {
5701
67f0194f3a8c fix compile bug
pontscho
parents: 5690
diff changeset
311 #ifdef USE_DVDREAD
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
312 case STREAMTYPE_DVD:
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
313 if ( --guiIntfStruct.DVD.current_chapter == 0 )
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
314 {
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
315 guiIntfStruct.DVD.current_chapter=1;
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
316 if ( --guiIntfStruct.DVD.current_title <= 0 ) { guiIntfStruct.DVD.current_title=1; stop=1; }
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
317 }
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
318 guiIntfStruct.Track=guiIntfStruct.DVD.current_title;
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
319 break;
5701
67f0194f3a8c fix compile bug
pontscho
parents: 5690
diff changeset
320 #endif
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
321 #ifdef HAVE_VCD
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
322 case STREAMTYPE_VCD:
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
323 if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; }
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
324 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
325 #endif
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
326 default:
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
327 if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) )
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
328 {
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
329 mplSetFileName( prev->path,prev->name,STREAMTYPE_FILE );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
330 mplGotoTheNext=0;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
331 break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
332 }
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
333 return;
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
334 }
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
335 if ( stop ) mplEventHandling( evStop,0 );
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
336 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
337 }
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
338
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
339 void mplNext( void )
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
340 {
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
341 int stop = 0;
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
342 plItem * next;
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
343
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
344 if ( guiIntfStruct.Playing == 2 ) return;
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
345 switch ( guiIntfStruct.StreamType )
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
346 {
5701
67f0194f3a8c fix compile bug
pontscho
parents: 5690
diff changeset
347 #ifdef USE_DVDREAD
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
348 case STREAMTYPE_DVD:
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
349 if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters )
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
350 {
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
351 guiIntfStruct.DVD.current_chapter=1;
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
352 if ( ++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles ) { guiIntfStruct.DVD.current_title=guiIntfStruct.DVD.titles; stop=1; }
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
353 }
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
354 guiIntfStruct.Track=guiIntfStruct.DVD.current_title;
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
355 break;
5701
67f0194f3a8c fix compile bug
pontscho
parents: 5690
diff changeset
356 #endif
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
357 #ifdef HAVE_VCD
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
358 case STREAMTYPE_VCD:
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
359 if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; }
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
360 break;
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
361 #endif
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
362 default:
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
363 if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) )
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
364 {
7009
98bed9e12087 - add dxr3 gui support (dialogbox, etc.)
pontscho
parents: 6996
diff changeset
365 mplSetFileName( next->path,next->name,STREAMTYPE_FILE );
6794
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
366 mplGotoTheNext=0;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
367 break;
77980ab4e296 - add preferences support (first try)
pontscho
parents: 6713
diff changeset
368 }
6713
cc917a581b6e add simple playlist support
pontscho
parents: 6280
diff changeset
369 return;
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
370 }
6280
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
371 if ( stop ) mplEventHandling( evStop,0 );
cf2c2b92d1a7 add VCD support for GUI
pontscho
parents: 6221
diff changeset
372 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
5689
2077782d0ca9 add prev/next title feature for gui dvd support
pontscho
parents: 5665
diff changeset
373 }