Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 6996:163f78ece9c2
add uri2filename converter
author | pontscho |
---|---|
date | Wed, 14 Aug 2002 12:17:04 +0000 |
parents | 0fa27966ac47 |
children | 98bed9e12087 |
rev | line source |
---|---|
4428 | 1 #include <inttypes.h> |
1693 | 2 #include <stdlib.h> |
3 #include <stdio.h> | |
4 | |
5 #include <unistd.h> | |
6 #include <signal.h> | |
7 | |
8 #include "../wm/ws.h" | |
9 #include "../../config.h" | |
1884 | 10 #include "../../help_mp.h" |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
11 #include "../../libvo/x11_common.h" |
5665 | 12 #include "../../input/input.h" |
1693 | 13 |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
14 #include "../app.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
15 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
16 #include "../wm/wskeys.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
17 #include "../wm/widget.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
18 #include "../interface.h" |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
19 |
1693 | 20 #include "widgets.h" |
21 #include "./mplayer.h" | |
22 #include "play.h" | |
23 | |
1800 | 24 #include "../skin/skin.h" |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
25 #include "../skin/font.h" |
1693 | 26 |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
27 extern float rel_seek_secs; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
28 extern int abs_seek_pos; |
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
29 |
6713 | 30 static int mplGotoTheNext = 1; |
31 | |
1693 | 32 void mplFullScreen( void ) |
33 { | |
2029 | 34 static int sx,sy; |
2979 | 35 |
5910
20c335d98ab3
fix fullscreen bug es ilyen libvo not initialized bug with gui igy
pontscho
parents:
5701
diff
changeset
|
36 #if 0 |
5032 | 37 // if ( !guiIntfStruct.Playing ) |
2029 | 38 { |
4981 | 39 wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); |
40 if ( appMPlayer.subWindow.isFullScreen ) | |
41 { | |
42 wsResizeWindow( &appMPlayer.subWindow,sx,sy ); | |
43 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); | |
44 wsWindowDecoration( &appMPlayer.subWindow,appMPlayer.subWindow.Decorations ); | |
45 appMPlayer.subWindow.isFullScreen=0; | |
46 } | |
47 else | |
48 { | |
49 sx=appMPlayer.subWindow.Width; sy=appMPlayer.subWindow.Height; | |
50 wsResizeWindow( &appMPlayer.subWindow,wsMaxX,wsMaxY ); | |
51 wsMoveWindow( &appMPlayer.subWindow,True,0,0 ); | |
52 wsWindowDecoration( &appMPlayer.subWindow,0 ); | |
53 appMPlayer.subWindow.isFullScreen=1; | |
54 } | |
5032 | 55 vo_fs=appMPlayer.subWindow.isFullScreen; |
4981 | 56 wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); |
5032 | 57 }// else { vo_x11_fullscreen(); appMPlayer.subWindow.isFullScreen=vo_fs; } |
5910
20c335d98ab3
fix fullscreen bug es ilyen libvo not initialized bug with gui igy
pontscho
parents:
5701
diff
changeset
|
58 #else |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
59 if ( ( guiIntfStruct.Playing )&&( appMPlayer.subWindow.isFullScreen ) ) |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
60 { |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
61 appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
62 switch ( appMPlayer.sub.x ) |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
63 { |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
64 case -1: appMPlayer.subWindow.OldX=( wsMaxX / 2 ) - ( appMPlayer.subWindow.OldWidth / 2 ); break; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
65 case -2: appMPlayer.subWindow.OldX=wsMaxX - appMPlayer.subWindow.OldWidth; break; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
66 default: appMPlayer.subWindow.OldX=appMPlayer.sub.x; break; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
67 } |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
68 switch ( appMPlayer.sub.y ) |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
69 { |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
70 case -1: appMPlayer.subWindow.OldY=( wsMaxY / 2 ) - ( appMPlayer.subWindow.OldHeight / 2 ); break; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
71 case -2: appMPlayer.subWindow.OldY=wsMaxY - appMPlayer.subWindow.OldHeight; break; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
72 default: appMPlayer.subWindow.OldY=appMPlayer.sub.y; break; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
73 } |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
74 } |
5910
20c335d98ab3
fix fullscreen bug es ilyen libvo not initialized bug with gui igy
pontscho
parents:
5701
diff
changeset
|
75 wsFullScreen( &appMPlayer.subWindow ); |
5997
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
76 vo_fs=appMPlayer.subWindow.isFullScreen; |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
77 wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen ); |
b5fb9a927bf3
add WM detection, and wm specific fullscreen code. (???)
pontscho
parents:
5986
diff
changeset
|
78 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
|
79 #endif |
20c335d98ab3
fix fullscreen bug es ilyen libvo not initialized bug with gui igy
pontscho
parents:
5701
diff
changeset
|
80 |
4981 | 81 fullscreen=appMPlayer.subWindow.isFullScreen; |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
82 if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 ); |
2045 | 83 else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); |
1693 | 84 } |
85 | |
86 extern int mplSubRender; | |
87 | |
6713 | 88 void mplEnd( void ) |
89 { | |
90 plItem * next; | |
91 | |
92 if ( !mplGotoTheNext ) { mplGotoTheNext=1; return; } | |
93 | |
6794 | 94 if ( guiIntfStruct.Playing && (next=gtkSet( gtkGetNextPlItem,0,NULL )) && plLastPlayed != next ) |
6713 | 95 { |
96 plLastPlayed=next; | |
97 guiSetDF( guiIntfStruct.Filename,next->path,next->name ); | |
98 guiIntfStruct.StreamType=STREAMTYPE_FILE; | |
99 guiIntfStruct.FilenameChanged=1; | |
6857 | 100 gfree( (void **)&guiIntfStruct.AudioFile ); |
101 gfree( (void **)&guiIntfStruct.Subtitlename ); | |
6794 | 102 } |
103 else | |
104 { | |
6912 | 105 if ( guiIntfStruct.FilenameChanged ) return; |
6903 | 106 |
6794 | 107 guiIntfStruct.TimeSec=0; |
108 guiIntfStruct.Position=0; | |
109 guiIntfStruct.AudioType=0; | |
6996 | 110 #ifdef USE_DVDREAD |
6912 | 111 guiIntfStruct.DVD.current_title=1; |
112 guiIntfStruct.DVD.current_chapter=1; | |
113 guiIntfStruct.DVD.current_angle=1; | |
6996 | 114 #endif |
6713 | 115 |
6794 | 116 if ( !appMPlayer.subWindow.isFullScreen ) |
117 { | |
118 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | |
119 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); | |
120 } | |
121 guiGetEvent( guiCEvent,guiSetStop ); | |
122 mplSubRender=1; | |
123 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); | |
124 wsClearWindow( appMPlayer.subWindow ); | |
125 wsPostRedisplay( &appMPlayer.subWindow ); | |
126 } | |
1693 | 127 } |
128 | |
129 void mplPlay( void ) | |
130 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
131 if ( ( !guiIntfStruct.Filename )|| |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
132 ( guiIntfStruct.Filename[0] == 0 )|| |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
133 ( guiIntfStruct.Playing == 1 ) ) return; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
134 if ( guiIntfStruct.Playing == 2 ) { mplPause(); return; } |
6794 | 135 guiGetEvent( guiCEvent,(void *)guiSetPlay ); |
1791 | 136 mplSubRender=0; |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1852
diff
changeset
|
137 wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
138 wsClearWindow( appMPlayer.subWindow ); |
1693 | 139 } |
140 | |
141 void mplPause( void ) | |
142 { | |
6794 | 143 if ( !guiIntfStruct.Playing ) return; |
144 if ( guiIntfStruct.Playing == 1 ) | |
145 { | |
146 mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) ); | |
147 cmd->id=MP_CMD_PAUSE; | |
148 cmd->name=strdup("pause"); | |
149 mp_input_queue_cmd(cmd); | |
150 } else guiIntfStruct.Playing=1; | |
1693 | 151 } |
152 | |
4465 | 153 void mplState( void ) |
154 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
155 if ( ( guiIntfStruct.Playing == 0 )||( guiIntfStruct.Playing == 2 ) ) |
4465 | 156 { |
157 btnModify( evPlaySwitchToPause,btnReleased ); | |
158 btnModify( evPauseSwitchToPlay,btnDisabled ); | |
159 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
160 else |
4465 | 161 { |
162 btnModify( evPlaySwitchToPause,btnDisabled ); | |
163 btnModify( evPauseSwitchToPlay,btnReleased ); | |
164 } | |
165 } | |
166 | |
1693 | 167 float mplGetPosition( void ) |
168 { // return 0.0 ... 100.0 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
169 return guiIntfStruct.Position; |
1693 | 170 } |
171 | |
172 void mplRelSeek( float s ) | |
173 { // -+s | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
174 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 175 } |
176 | |
177 void mplAbsSeek( float s ) | |
178 { // 0.0 ... 100.0 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
179 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 180 } |
181 | |
1800 | 182 listItems tmpList; |
183 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
184 void ChangeSkin( char * name ) |
1800 | 185 { |
1907 | 186 int ret; |
5690 | 187 |
1907 | 188 mainVisible=0; |
1800 | 189 |
1907 | 190 appInitStruct( &tmpList ); |
191 skinAppMPlayer=&tmpList; | |
192 fntFreeFont(); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
193 ret=skinRead( name ); |
1800 | 194 |
1907 | 195 appInitStruct( &tmpList ); |
196 skinAppMPlayer=&appMPlayer; | |
197 appInitStruct( &appMPlayer ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
198 if ( ret ) name=skinName; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
199 if ( skinRead( name ) ) |
1907 | 200 { |
201 mainVisible=1; | |
202 return; | |
203 } | |
204 if ( appMPlayer.menuBase.Bitmap.Image ) | |
205 { | |
206 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); | |
207 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
|
208 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } |
1907 | 209 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); |
210 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | |
6221 | 211 wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image ); |
6089 | 212 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow ); |
1907 | 213 } |
1800 | 214 |
2226 | 215 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
|
216 if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) ) |
2226 | 217 { |
218 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | |
2854 | 219 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
|
220 } |
2226 | 221 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
|
222 if ( !guiIntfStruct.Playing ) |
2226 | 223 { |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
224 mplSubRender=1; |
2911 | 225 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); |
2226 | 226 wsClearWindow( appMPlayer.subWindow ); |
227 wsPostRedisplay( &appMPlayer.subWindow ); | |
228 } | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1861
diff
changeset
|
229 |
1907 | 230 if ( mplDrawBuffer ) free( mplDrawBuffer ); |
231 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
|
232 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } |
6146 | 233 |
234 if ( wsWMType == wsWMUnknown ) wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); | |
1907 | 235 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); |
2854 | 236 wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y ); |
1907 | 237 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); |
238 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
2979 | 239 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); |
1907 | 240 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); |
241 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
242 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
243 btnModify( evSetVolume,guiIntfStruct.Volume ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
244 btnModify( evSetBalance,guiIntfStruct.Balance ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
245 btnModify( evSetMoviePosition,guiIntfStruct.Position ); |
3479 | 246 btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen ); |
1800 | 247 } |
1802 | 248 |
6794 | 249 void mplSetFileName( char * dir,char * name ) |
2854 | 250 { |
6967
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
251 if ( !name ) return; |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
252 |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
253 if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name ) |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
254 else guiSetDF( guiIntfStruct.Filename,dir,name ) |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
255 |
6794 | 256 guiIntfStruct.StreamType=STREAMTYPE_FILE; |
257 guiIntfStruct.FilenameChanged=1; | |
258 gfree( (void **)&guiIntfStruct.AudioFile ); | |
259 gfree( (void **)&guiIntfStruct.Subtitlename ); | |
2854 | 260 } |
5689 | 261 |
262 void mplPrev( void ) | |
263 { | |
6713 | 264 plItem * prev; |
265 int stop = 0; | |
6280 | 266 |
267 if ( guiIntfStruct.Playing == 2 ) return; | |
5689 | 268 switch ( guiIntfStruct.StreamType ) |
269 { | |
5701 | 270 #ifdef USE_DVDREAD |
5689 | 271 case STREAMTYPE_DVD: |
272 if ( --guiIntfStruct.DVD.current_chapter == 0 ) | |
273 { | |
274 guiIntfStruct.DVD.current_chapter=1; | |
275 if ( --guiIntfStruct.DVD.current_title <= 0 ) { guiIntfStruct.DVD.current_title=1; stop=1; } | |
276 } | |
277 guiIntfStruct.Track=guiIntfStruct.DVD.current_title; | |
278 break; | |
5701 | 279 #endif |
6280 | 280 #ifdef HAVE_VCD |
281 case STREAMTYPE_VCD: | |
282 if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; } | |
283 break; | |
284 #endif | |
6713 | 285 default: |
6794 | 286 if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) ) |
287 { | |
288 mplSetFileName( prev->path,prev->name ); | |
289 mplGotoTheNext=0; | |
290 break; | |
291 } | |
6713 | 292 return; |
5689 | 293 } |
6280 | 294 if ( stop ) mplEventHandling( evStop,0 ); |
295 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); | |
5689 | 296 } |
297 | |
298 void mplNext( void ) | |
299 { | |
6713 | 300 int stop = 0; |
301 plItem * next; | |
6280 | 302 |
303 if ( guiIntfStruct.Playing == 2 ) return; | |
5689 | 304 switch ( guiIntfStruct.StreamType ) |
305 { | |
5701 | 306 #ifdef USE_DVDREAD |
5689 | 307 case STREAMTYPE_DVD: |
308 if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters ) | |
309 { | |
310 guiIntfStruct.DVD.current_chapter=1; | |
311 if ( ++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles ) { guiIntfStruct.DVD.current_title=guiIntfStruct.DVD.titles; stop=1; } | |
312 } | |
313 guiIntfStruct.Track=guiIntfStruct.DVD.current_title; | |
314 break; | |
5701 | 315 #endif |
6280 | 316 #ifdef HAVE_VCD |
317 case STREAMTYPE_VCD: | |
318 if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; } | |
319 break; | |
320 #endif | |
6713 | 321 default: |
6794 | 322 if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) ) |
323 { | |
324 mplSetFileName( next->path,next->name ); | |
325 mplGotoTheNext=0; | |
326 break; | |
327 } | |
6713 | 328 return; |
5689 | 329 } |
6280 | 330 if ( stop ) mplEventHandling( evStop,0 ); |
331 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); | |
5689 | 332 } |