Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 6763:e29f95ed5d36
Fix vbr muxing and win32 codec crash on init
author | albeu |
---|---|
date | Sun, 21 Jul 2002 14:36:33 +0000 |
parents | cc917a581b6e |
children | 77980ab4e296 |
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 | |
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 ) | |
1693 | 106 { |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
107 guiIntfStruct.Playing=0; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
108 guiIntfStruct.TimeSec=0; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
109 guiIntfStruct.Position=0; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
110 guiIntfStruct.AudioType=0; |
6713 | 111 |
1796 | 112 if ( !appMPlayer.subWindow.isFullScreen ) |
113 { | |
2025
0653e90b3118
some bug fix, and sub window render speed up.. 10l kola ? :)
pontscho
parents:
1953
diff
changeset
|
114 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); |
2854 | 115 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); |
1796 | 116 } |
5689 | 117 guiGetEvent( guiCEvent,guiSetStop ); |
1797 | 118 mplSubRender=1; |
2045 | 119 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); |
1953 | 120 wsClearWindow( appMPlayer.subWindow ); |
1797 | 121 wsPostRedisplay( &appMPlayer.subWindow ); |
1693 | 122 } |
123 | |
124 void mplPlay( void ) | |
125 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
126 if ( ( !guiIntfStruct.Filename )|| |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
127 ( guiIntfStruct.Filename[0] == 0 )|| |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
128 ( guiIntfStruct.Playing == 1 ) ) return; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
129 if ( guiIntfStruct.Playing == 2 ) { mplPause(); return; } |
4963 | 130 guiGetEvent( guiCEvent,guiSetPlay ); |
1791 | 131 mplSubRender=0; |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1852
diff
changeset
|
132 wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
133 wsClearWindow( appMPlayer.subWindow ); |
4963 | 134 // wsPostRedisplay( &appMPlayer.subWindow ); |
1693 | 135 } |
136 | |
137 void mplPause( void ) | |
138 { | |
5665 | 139 mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) ); |
140 cmd->id=MP_CMD_PAUSE; | |
141 cmd->name=strdup("pause"); | |
142 mp_input_queue_cmd(cmd); | |
1815 | 143 mplSubRender=0; |
1693 | 144 } |
145 | |
4465 | 146 void mplState( void ) |
147 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
148 if ( ( guiIntfStruct.Playing == 0 )||( guiIntfStruct.Playing == 2 ) ) |
4465 | 149 { |
150 btnModify( evPlaySwitchToPause,btnReleased ); | |
151 btnModify( evPauseSwitchToPlay,btnDisabled ); | |
152 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
153 else |
4465 | 154 { |
155 btnModify( evPlaySwitchToPause,btnDisabled ); | |
156 btnModify( evPauseSwitchToPlay,btnReleased ); | |
157 } | |
158 } | |
159 | |
1693 | 160 float mplGetPosition( void ) |
161 { // return 0.0 ... 100.0 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
162 return guiIntfStruct.Position; |
1693 | 163 } |
164 | |
165 void mplRelSeek( float s ) | |
166 { // -+s | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
167 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 168 } |
169 | |
170 void mplAbsSeek( float s ) | |
171 { // 0.0 ... 100.0 | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
172 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 173 } |
174 | |
1800 | 175 listItems tmpList; |
176 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
177 void ChangeSkin( char * name ) |
1800 | 178 { |
1907 | 179 int ret; |
5690 | 180 |
1907 | 181 mainVisible=0; |
1800 | 182 |
1907 | 183 appInitStruct( &tmpList ); |
184 skinAppMPlayer=&tmpList; | |
185 fntFreeFont(); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
186 ret=skinRead( name ); |
1800 | 187 |
1907 | 188 appInitStruct( &tmpList ); |
189 skinAppMPlayer=&appMPlayer; | |
190 appInitStruct( &appMPlayer ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
191 if ( ret ) name=skinName; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
192 if ( skinRead( name ) ) |
1907 | 193 { |
194 mainVisible=1; | |
195 return; | |
196 } | |
197 if ( appMPlayer.menuBase.Bitmap.Image ) | |
198 { | |
199 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); | |
200 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
|
201 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } |
1907 | 202 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); |
203 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | |
6221 | 204 wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image ); |
6089 | 205 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow ); |
1907 | 206 } |
1800 | 207 |
2226 | 208 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
|
209 if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) ) |
2226 | 210 { |
211 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | |
2854 | 212 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
|
213 } |
2226 | 214 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
|
215 if ( !guiIntfStruct.Playing ) |
2226 | 216 { |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
217 mplSubRender=1; |
2911 | 218 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB ); |
2226 | 219 wsClearWindow( appMPlayer.subWindow ); |
220 wsPostRedisplay( &appMPlayer.subWindow ); | |
221 } | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1861
diff
changeset
|
222 |
1907 | 223 if ( mplDrawBuffer ) free( mplDrawBuffer ); |
224 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
|
225 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } |
6146 | 226 |
227 if ( wsWMType == wsWMUnknown ) wsVisibleWindow( &appMPlayer.mainWindow,wsHideWindow ); | |
1907 | 228 wsResizeWindow( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); |
2854 | 229 wsMoveWindow( &appMPlayer.mainWindow,True,appMPlayer.main.x,appMPlayer.main.y ); |
1907 | 230 wsResizeImage( &appMPlayer.mainWindow,appMPlayer.main.width,appMPlayer.main.height ); |
231 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
2979 | 232 wsWindowDecoration( &appMPlayer.mainWindow,appMPlayer.mainDecoration ); |
1907 | 233 mainVisible=1; mplMainRender=1; wsPostRedisplay( &appMPlayer.mainWindow ); |
234 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
235 |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
236 btnModify( evSetVolume,guiIntfStruct.Volume ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
237 btnModify( evSetBalance,guiIntfStruct.Balance ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
238 btnModify( evSetMoviePosition,guiIntfStruct.Position ); |
3479 | 239 btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen ); |
1800 | 240 } |
1802 | 241 |
2854 | 242 void mplSetFileName( char * fname ) |
243 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
244 if ( !fname ) return; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
245 if ( guiIntfStruct.Filename ) free( guiIntfStruct.Filename ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
246 guiIntfStruct.Filename=strdup( fname ); |
2854 | 247 } |
5689 | 248 |
249 void mplPrev( void ) | |
250 { | |
6713 | 251 plItem * prev; |
252 int stop = 0; | |
6280 | 253 |
254 if ( guiIntfStruct.Playing == 2 ) return; | |
5689 | 255 switch ( guiIntfStruct.StreamType ) |
256 { | |
5701 | 257 #ifdef USE_DVDREAD |
5689 | 258 case STREAMTYPE_DVD: |
259 if ( --guiIntfStruct.DVD.current_chapter == 0 ) | |
260 { | |
261 guiIntfStruct.DVD.current_chapter=1; | |
262 if ( --guiIntfStruct.DVD.current_title <= 0 ) { guiIntfStruct.DVD.current_title=1; stop=1; } | |
263 } | |
264 guiIntfStruct.Track=guiIntfStruct.DVD.current_title; | |
265 break; | |
5701 | 266 #endif |
6280 | 267 #ifdef HAVE_VCD |
268 case STREAMTYPE_VCD: | |
269 if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; } | |
270 break; | |
271 #endif | |
6713 | 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; | |
5689 | 280 } |
6280 | 281 if ( stop ) mplEventHandling( evStop,0 ); |
282 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); | |
5689 | 283 } |
284 | |
285 void mplNext( void ) | |
286 { | |
6713 | 287 int stop = 0; |
288 plItem * next; | |
6280 | 289 |
290 if ( guiIntfStruct.Playing == 2 ) return; | |
5689 | 291 switch ( guiIntfStruct.StreamType ) |
292 { | |
5701 | 293 #ifdef USE_DVDREAD |
5689 | 294 case STREAMTYPE_DVD: |
295 if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters ) | |
296 { | |
297 guiIntfStruct.DVD.current_chapter=1; | |
298 if ( ++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles ) { guiIntfStruct.DVD.current_title=guiIntfStruct.DVD.titles; stop=1; } | |
299 } | |
300 guiIntfStruct.Track=guiIntfStruct.DVD.current_title; | |
301 break; | |
5701 | 302 #endif |
6280 | 303 #ifdef HAVE_VCD |
304 case STREAMTYPE_VCD: | |
305 if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; } | |
306 break; | |
307 #endif | |
6713 | 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; | |
5689 | 316 } |
6280 | 317 if ( stop ) mplEventHandling( evStop,0 ); |
318 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); | |
5689 | 319 } |