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