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