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