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