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