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