comparison Gui/mplayer/play.c @ 6713:cc917a581b6e

add simple playlist support
author pontscho
date Fri, 12 Jul 2002 00:53:26 +0000
parents cf2c2b92d1a7
children 77980ab4e296
comparison
equal deleted inserted replaced
6712:70aa7a20b9c0 6713:cc917a581b6e
24 #include "../skin/skin.h" 24 #include "../skin/skin.h"
25 #include "../skin/font.h" 25 #include "../skin/font.h"
26 26
27 extern float rel_seek_secs; 27 extern float rel_seek_secs;
28 extern int abs_seek_pos; 28 extern int abs_seek_pos;
29
30 static int mplGotoTheNext = 1;
29 31
30 void mplFullScreen( void ) 32 void mplFullScreen( void )
31 { 33 {
32 static int sx,sy; 34 static int sx,sy;
33 35
81 else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); 83 else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
82 } 84 }
83 85
84 extern int mplSubRender; 86 extern int mplSubRender;
85 87
86 void mplStop() 88 void mplEnd( void )
89 {
90 plItem * next;
91
92 if ( !mplGotoTheNext ) { mplGotoTheNext=1; return; }
93
94 if ( (next=gtkSet( gtkGetNextPlItem,0,NULL )) && plLastPlayed != next )
95 {
96 plLastPlayed=next;
97 guiSetDF( guiIntfStruct.Filename,next->path,next->name );
98 guiIntfStruct.StreamType=STREAMTYPE_FILE;
99 guiIntfStruct.FilenameChanged=1;
100 if ( guiIntfStruct.AudioFile ) free( guiIntfStruct.AudioFile );
101 guiIntfStruct.AudioFile=NULL;
102 } else mplStop();
103 }
104
105 void mplStop( void )
87 { 106 {
88 guiIntfStruct.Playing=0; 107 guiIntfStruct.Playing=0;
89 guiIntfStruct.TimeSec=0; 108 guiIntfStruct.TimeSec=0;
90 guiIntfStruct.Position=0; 109 guiIntfStruct.Position=0;
91 guiIntfStruct.AudioType=0; 110 guiIntfStruct.AudioType=0;
92 // if ( !guiIntfStruct.Playing ) return; 111
93 if ( !appMPlayer.subWindow.isFullScreen ) 112 if ( !appMPlayer.subWindow.isFullScreen )
94 { 113 {
95 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); 114 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
96 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); 115 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
97 } 116 }
227 guiIntfStruct.Filename=strdup( fname ); 246 guiIntfStruct.Filename=strdup( fname );
228 } 247 }
229 248
230 void mplPrev( void ) 249 void mplPrev( void )
231 { 250 {
232 int stop = 0; 251 plItem * prev;
252 int stop = 0;
233 253
234 if ( guiIntfStruct.Playing == 2 ) return; 254 if ( guiIntfStruct.Playing == 2 ) return;
235 switch ( guiIntfStruct.StreamType ) 255 switch ( guiIntfStruct.StreamType )
236 { 256 {
237 #ifdef USE_DVDREAD 257 #ifdef USE_DVDREAD
247 #ifdef HAVE_VCD 267 #ifdef HAVE_VCD
248 case STREAMTYPE_VCD: 268 case STREAMTYPE_VCD:
249 if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; } 269 if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; }
250 break; 270 break;
251 #endif 271 #endif
252 default: return; 272 default:
273 if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) ) { mplGotoTheNext=0; break; }
274 // {
275 // guiSetDF( guiIntfStruct.Filename,prev->path,prev->name );
276 // guiIntfStruct.FilenameChanged=1;
277 // break;
278 // }
279 return;
253 } 280 }
254 if ( stop ) mplEventHandling( evStop,0 ); 281 if ( stop ) mplEventHandling( evStop,0 );
255 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); 282 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
256 } 283 }
257 284
258 void mplNext( void ) 285 void mplNext( void )
259 { 286 {
260 int stop = 0; 287 int stop = 0;
288 plItem * next;
261 289
262 if ( guiIntfStruct.Playing == 2 ) return; 290 if ( guiIntfStruct.Playing == 2 ) return;
263 switch ( guiIntfStruct.StreamType ) 291 switch ( guiIntfStruct.StreamType )
264 { 292 {
265 #ifdef USE_DVDREAD 293 #ifdef USE_DVDREAD
275 #ifdef HAVE_VCD 303 #ifdef HAVE_VCD
276 case STREAMTYPE_VCD: 304 case STREAMTYPE_VCD:
277 if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; } 305 if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; }
278 break; 306 break;
279 #endif 307 #endif
280 default: return; 308 default:
309 if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) ) { mplGotoTheNext=0; break; }
310 // {
311 // guiSetDF( guiIntfStruct.Filename,next->path,next->name );
312 // guiIntfStruct.FilenameChanged=1;
313 // break;
314 // }
315 return;
281 } 316 }
282 if ( stop ) mplEventHandling( evStop,0 ); 317 if ( stop ) mplEventHandling( evStop,0 );
283 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); 318 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
284 } 319 }