Mercurial > mplayer.hg
annotate Gui/mplayer/play.c @ 14456:cf6d4eb322b4
synced with 1.851
author | paszczi |
---|---|
date | Mon, 10 Jan 2005 22:12:05 +0000 |
parents | df423e2d71dc |
children | 7989bfeaca47 |
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 |
10193 | 35 int mplGotoTheNext = 1; |
6713 | 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 { |
10194 | 46 case -1: appMPlayer.subWindow.OldX=( wsMaxX / 2 ) - ( appMPlayer.subWindow.OldWidth / 2 ) + wsOrgX; break; |
47 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
|
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 { |
10194 | 52 case -1: appMPlayer.subWindow.OldY=( wsMaxY / 2 ) - ( appMPlayer.subWindow.OldHeight / 2 ) + wsOrgY; break; |
53 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
|
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 ); |
10193 | 60 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
|
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 | |
9291
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
72 if ( !mplGotoTheNext && guiIntfStruct.Playing) { mplGotoTheNext=1; return; } |
6713 | 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 |
12068 | 98 if ( !appMPlayer.subWindow.isFullScreen && gtkShowVideoWindow) |
6794 | 99 { |
100 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | |
101 wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y ); | |
102 } | |
12068 | 103 else wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow ); |
6794 | 104 guiGetEvent( guiCEvent,guiSetStop ); |
105 mplSubRender=1; | |
8973 | 106 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B ); |
6794 | 107 wsClearWindow( appMPlayer.subWindow ); |
108 wsPostRedisplay( &appMPlayer.subWindow ); | |
109 } | |
1693 | 110 } |
111 | |
112 void mplPlay( void ) | |
113 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
114 if ( ( !guiIntfStruct.Filename )|| |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
115 ( guiIntfStruct.Filename[0] == 0 )|| |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
116 ( guiIntfStruct.Playing == 1 ) ) return; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
117 if ( guiIntfStruct.Playing == 2 ) { mplPause(); return; } |
6794 | 118 guiGetEvent( guiCEvent,(void *)guiSetPlay ); |
1791 | 119 mplSubRender=0; |
1858
88a88d0a3f94
fix skin changing, xv fullscreen redraw bug, etc.
pontscho
parents:
1852
diff
changeset
|
120 wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
121 wsClearWindow( appMPlayer.subWindow ); |
1693 | 122 } |
123 | |
124 void mplPause( void ) | |
125 { | |
6794 | 126 if ( !guiIntfStruct.Playing ) return; |
127 if ( guiIntfStruct.Playing == 1 ) | |
128 { | |
129 mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) ); | |
130 cmd->id=MP_CMD_PAUSE; | |
131 cmd->name=strdup("pause"); | |
132 mp_input_queue_cmd(cmd); | |
133 } else guiIntfStruct.Playing=1; | |
1693 | 134 } |
135 | |
4465 | 136 void mplState( void ) |
137 { | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
138 if ( ( guiIntfStruct.Playing == 0 )||( guiIntfStruct.Playing == 2 ) ) |
4465 | 139 { |
140 btnModify( evPlaySwitchToPause,btnReleased ); | |
141 btnModify( evPauseSwitchToPlay,btnDisabled ); | |
142 } | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
143 else |
4465 | 144 { |
145 btnModify( evPlaySwitchToPause,btnDisabled ); | |
146 btnModify( evPauseSwitchToPlay,btnReleased ); | |
147 } | |
148 } | |
149 | |
1693 | 150 float mplGetPosition( void ) |
151 { // return 0.0 ... 100.0 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
152 return guiIntfStruct.Position; |
1693 | 153 } |
154 | |
155 void mplRelSeek( float s ) | |
156 { // -+s | |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
157 rel_seek_secs=s; abs_seek_pos=0; |
1693 | 158 } |
159 | |
160 void mplAbsSeek( float s ) | |
161 { // 0.0 ... 100.0 | |
8280
72700fefd3dc
no seeking if stream is STREAMTYPE_STREAM (net/stdin)
pontscho
parents:
8055
diff
changeset
|
162 if ( guiIntfStruct.StreamType == STREAMTYPE_STREAM ) return; |
1723
5e4214a7540e
GUI stuff. now seeking works, and xmga renders to video window
arpi
parents:
1693
diff
changeset
|
163 rel_seek_secs=0.01*s; abs_seek_pos=3; |
1693 | 164 } |
165 | |
1800 | 166 listItems tmpList; |
167 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
168 void ChangeSkin( char * name ) |
1800 | 169 { |
1907 | 170 int ret; |
8949 | 171 int prev = appMPlayer.menuIsPresent; |
8973 | 172 int bprev = appMPlayer.barIsPresent; |
5690 | 173 |
1907 | 174 mainVisible=0; |
8973 | 175 |
1907 | 176 appInitStruct( &tmpList ); |
177 skinAppMPlayer=&tmpList; | |
178 fntFreeFont(); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
179 ret=skinRead( name ); |
1800 | 180 |
1907 | 181 appInitStruct( &tmpList ); |
182 skinAppMPlayer=&appMPlayer; | |
183 appInitStruct( &appMPlayer ); | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
184 if ( ret ) name=skinName; |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
185 if ( skinRead( name ) ) |
1907 | 186 { |
187 mainVisible=1; | |
188 return; | |
189 } | |
8949 | 190 |
8973 | 191 // --- reload menu window |
192 | |
8949 | 193 if ( prev && appMPlayer.menuIsPresent ) |
1907 | 194 { |
195 if ( mplMenuDrawBuffer ) free( mplMenuDrawBuffer ); | |
196 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
|
197 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } |
1907 | 198 wsResizeWindow( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); |
199 wsResizeImage( &appMPlayer.menuWindow,appMPlayer.menuBase.width,appMPlayer.menuBase.height ); | |
6221 | 200 wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image ); |
6089 | 201 wsVisibleWindow( &appMPlayer.menuWindow,wsHideWindow ); |
8949 | 202 } else { mplMenuInit(); } |
1800 | 203 |
8973 | 204 // --- reload sub window |
2226 | 205 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
|
206 if ( ( !appMPlayer.subWindow.isFullScreen )&&( !guiIntfStruct.Playing ) ) |
2226 | 207 { |
208 wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height ); | |
2854 | 209 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
|
210 } |
2226 | 211 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
|
212 if ( !guiIntfStruct.Playing ) |
2226 | 213 { |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
214 mplSubRender=1; |
8973 | 215 wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B ); |
2226 | 216 wsClearWindow( appMPlayer.subWindow ); |
217 wsPostRedisplay( &appMPlayer.subWindow ); | |
218 } | |
1866
32b1bb50a0e8
some bug fix, and add decoration item to skin conffile. faszom(C)
pontscho
parents:
1861
diff
changeset
|
219 |
8973 | 220 // --- reload play bar |
221 if ( bprev ) wsDestroyWindow( &appMPlayer.barWindow ); | |
222 mplPBInit(); | |
223 | |
224 // --- reload main window | |
1907 | 225 if ( mplDrawBuffer ) free( mplDrawBuffer ); |
226 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
|
227 { mp_msg( MSGT_GPLAYER,MSGL_STATUS,MSGTR_NEMDB ); return; } |
6146 | 228 |
8949 | 229 wsDestroyWindow( &appMPlayer.mainWindow ); |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
230 |
8949 | 231 wsCreateWindow( &appMPlayer.mainWindow, |
232 appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height, | |
233 wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,wsShowFrame|wsMaxSize|wsHideWindow,"MPlayer" ); | |
234 wsCreateImage( &appMPlayer.mainWindow,appMPlayer.main.Bitmap.Width,appMPlayer.main.Bitmap.Height ); | |
235 wsSetShape( &appMPlayer.mainWindow,appMPlayer.main.Mask.Image ); | |
236 wsSetIcon( wsDisplay,appMPlayer.mainWindow.WindowID,guiIcon,guiIconMask ); | |
237 | |
238 appMPlayer.mainWindow.ReDraw=(void *)mplMainDraw; | |
239 appMPlayer.mainWindow.MouseHandler=mplMainMouseHandle; | |
240 appMPlayer.mainWindow.KeyHandler=mplMainKeyHandle; | |
241 appMPlayer.mainWindow.DandDHandler=mplDandDHandler; | |
242 | |
243 wsXDNDMakeAwareness( &appMPlayer.mainWindow ); | |
244 if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 ); | |
245 wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow ); | |
246 mainVisible=1; | |
8973 | 247 // --- |
248 | |
4818
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
249 btnModify( evSetVolume,guiIntfStruct.Volume ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
250 btnModify( evSetBalance,guiIntfStruct.Balance ); |
3473ca9ef158
new gui interface, and gtk moved into mplayer process. fork ... bleh :)
pontscho
parents:
4798
diff
changeset
|
251 btnModify( evSetMoviePosition,guiIntfStruct.Position ); |
3479 | 252 btnModify( evFullScreen,!appMPlayer.subWindow.isFullScreen ); |
8973 | 253 |
254 wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen ); | |
255 wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen ); | |
256 | |
1800 | 257 } |
1802 | 258 |
7009 | 259 void mplSetFileName( char * dir,char * name,int type ) |
2854 | 260 { |
6967
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
261 if ( !name ) return; |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
262 |
0fa27966ac47
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
pontscho
parents:
6912
diff
changeset
|
263 if ( !dir ) guiSetFilename( guiIntfStruct.Filename,name ) |
8423 | 264 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
|
265 |
8423 | 266 // filename=guiIntfStruct.Filename; |
7009 | 267 guiIntfStruct.StreamType=type; |
6794 | 268 gfree( (void **)&guiIntfStruct.AudioFile ); |
269 gfree( (void **)&guiIntfStruct.Subtitlename ); | |
2854 | 270 } |
5689 | 271 |
9291
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
272 void mplCurr( void ) |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
273 { |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
274 plItem * curr; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
275 int stop = 0; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
276 |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
277 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
|
278 switch ( guiIntfStruct.StreamType ) |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
279 { |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
280 #ifdef USE_DVDREAD |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
281 case STREAMTYPE_DVD: |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
282 break; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
283 #endif |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
284 #ifdef HAVE_VCD |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
285 case STREAMTYPE_VCD: |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
286 break; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
287 #endif |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
288 default: |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
289 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
|
290 { |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
291 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
|
292 mplGotoTheNext=0; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
293 break; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
294 } |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
295 return; |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
296 } |
64b8c5a07c2c
- It adds an option enqueue/noenqueue, so users can choose if they want to
arpi
parents:
9202
diff
changeset
|
297 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
|
298 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
|
299 } |
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 |
5689 | 302 void mplPrev( void ) |
303 { | |
6713 | 304 plItem * prev; |
305 int stop = 0; | |
6280 | 306 |
307 if ( guiIntfStruct.Playing == 2 ) return; | |
5689 | 308 switch ( guiIntfStruct.StreamType ) |
309 { | |
5701 | 310 #ifdef USE_DVDREAD |
5689 | 311 case STREAMTYPE_DVD: |
312 if ( --guiIntfStruct.DVD.current_chapter == 0 ) | |
313 { | |
314 guiIntfStruct.DVD.current_chapter=1; | |
315 if ( --guiIntfStruct.DVD.current_title <= 0 ) { guiIntfStruct.DVD.current_title=1; stop=1; } | |
316 } | |
317 guiIntfStruct.Track=guiIntfStruct.DVD.current_title; | |
318 break; | |
5701 | 319 #endif |
6280 | 320 #ifdef HAVE_VCD |
321 case STREAMTYPE_VCD: | |
322 if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; } | |
323 break; | |
324 #endif | |
6713 | 325 default: |
6794 | 326 if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) ) |
327 { | |
7009 | 328 mplSetFileName( prev->path,prev->name,STREAMTYPE_FILE ); |
6794 | 329 mplGotoTheNext=0; |
330 break; | |
331 } | |
6713 | 332 return; |
5689 | 333 } |
6280 | 334 if ( stop ) mplEventHandling( evStop,0 ); |
335 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); | |
5689 | 336 } |
337 | |
338 void mplNext( void ) | |
339 { | |
6713 | 340 int stop = 0; |
341 plItem * next; | |
6280 | 342 |
343 if ( guiIntfStruct.Playing == 2 ) return; | |
5689 | 344 switch ( guiIntfStruct.StreamType ) |
345 { | |
5701 | 346 #ifdef USE_DVDREAD |
5689 | 347 case STREAMTYPE_DVD: |
348 if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters ) | |
349 { | |
350 guiIntfStruct.DVD.current_chapter=1; | |
351 if ( ++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles ) { guiIntfStruct.DVD.current_title=guiIntfStruct.DVD.titles; stop=1; } | |
352 } | |
353 guiIntfStruct.Track=guiIntfStruct.DVD.current_title; | |
354 break; | |
5701 | 355 #endif |
6280 | 356 #ifdef HAVE_VCD |
357 case STREAMTYPE_VCD: | |
358 if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; } | |
359 break; | |
360 #endif | |
6713 | 361 default: |
6794 | 362 if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) ) |
363 { | |
7009 | 364 mplSetFileName( next->path,next->name,STREAMTYPE_FILE ); |
6794 | 365 mplGotoTheNext=0; |
366 break; | |
367 } | |
6713 | 368 return; |
5689 | 369 } |
6280 | 370 if ( stop ) mplEventHandling( evStop,0 ); |
371 if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); | |
5689 | 372 } |