comparison gui/mplayer/play.c @ 33555:c5a19bbeac2b

Cosmetic: Rename some GUI variables and functions. The new names are more intelligible and consistent. List of changes: guiIntfStruct -> guiInfo appMPlayer -> guiApp txSample -> guiImage (and member BPP -> Bpp) mplDrawBuffer -> mainDrawBuffer mplPBDrawBuffer -> playbarDrawBuffer mplMenuDrawBuffer -> menuDrawBuffer mpl.* -> ui.* (or mpl dropped) .*bar.* -> .*playbar.* URLItem -> urlItem ChangeSkin -> uiChangeSkin Convert32to1 -> bpRenderMask
author ib
date Sat, 18 Jun 2011 14:33:41 +0000
parents 55b8f5d5df15
children
comparison
equal deleted inserted replaced
33554:02d94048970e 33555:c5a19bbeac2b
34 #include "libmpcodecs/vd.h" 34 #include "libmpcodecs/vd.h"
35 #include "libvo/video_out.h" 35 #include "libvo/video_out.h"
36 #include "mp_core.h" 36 #include "mp_core.h"
37 #include "stream/stream.h" 37 #include "stream/stream.h"
38 38
39 int mplGotoTheNext = 1; 39 int uiGotoTheNext = 1;
40 40
41 void mplFullScreen(void) 41 void uiFullScreen(void)
42 { 42 {
43 if (guiIntfStruct.NoWindow && guiIntfStruct.Playing) 43 if (guiInfo.NoWindow && guiInfo.Playing)
44 return; 44 return;
45 45
46 if (guiIntfStruct.Playing && appMPlayer.subWindow.isFullScreen) { 46 if (guiInfo.Playing && guiApp.subWindow.isFullScreen) {
47 appMPlayer.subWindow.OldWidth = guiIntfStruct.MovieWidth; 47 guiApp.subWindow.OldWidth = guiInfo.MovieWidth;
48 appMPlayer.subWindow.OldHeight = guiIntfStruct.MovieHeight; 48 guiApp.subWindow.OldHeight = guiInfo.MovieHeight;
49 49
50 switch (appMPlayer.sub.x) { 50 switch (guiApp.sub.x) {
51 case -1: 51 case -1:
52 appMPlayer.subWindow.OldX = wsMaxX / 2 - appMPlayer.subWindow.OldWidth / 2 + wsOrgX; 52 guiApp.subWindow.OldX = wsMaxX / 2 - guiApp.subWindow.OldWidth / 2 + wsOrgX;
53 break; 53 break;
54 54
55 case -2: 55 case -2:
56 appMPlayer.subWindow.OldX = wsMaxX - appMPlayer.subWindow.OldWidth + wsOrgX; 56 guiApp.subWindow.OldX = wsMaxX - guiApp.subWindow.OldWidth + wsOrgX;
57 break; 57 break;
58 58
59 default: 59 default:
60 appMPlayer.subWindow.OldX = appMPlayer.sub.x; 60 guiApp.subWindow.OldX = guiApp.sub.x;
61 break; 61 break;
62 } 62 }
63 63
64 switch (appMPlayer.sub.y) { 64 switch (guiApp.sub.y) {
65 case -1: 65 case -1:
66 appMPlayer.subWindow.OldY = wsMaxY / 2 - appMPlayer.subWindow.OldHeight / 2 + wsOrgY; 66 guiApp.subWindow.OldY = wsMaxY / 2 - guiApp.subWindow.OldHeight / 2 + wsOrgY;
67 break; 67 break;
68 68
69 case -2: 69 case -2:
70 appMPlayer.subWindow.OldY = wsMaxY - appMPlayer.subWindow.OldHeight + wsOrgY; 70 guiApp.subWindow.OldY = wsMaxY - guiApp.subWindow.OldHeight + wsOrgY;
71 break; 71 break;
72 72
73 default: 73 default:
74 appMPlayer.subWindow.OldY = appMPlayer.sub.y; 74 guiApp.subWindow.OldY = guiApp.sub.y;
75 break; 75 break;
76 } 76 }
77 } 77 }
78 78
79 if (guiIntfStruct.Playing || gtkShowVideoWindow) 79 if (guiInfo.Playing || gtkShowVideoWindow)
80 wsFullScreen(&appMPlayer.subWindow); 80 wsFullScreen(&guiApp.subWindow);
81 81
82 fullscreen = vo_fs = appMPlayer.subWindow.isFullScreen; 82 fullscreen = vo_fs = guiApp.subWindow.isFullScreen;
83 wsSetLayer(wsDisplay, appMPlayer.mainWindow.WindowID, appMPlayer.subWindow.isFullScreen); 83 wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.subWindow.isFullScreen);
84 84
85 if (appMPlayer.menuIsPresent) 85 if (guiApp.menuIsPresent)
86 wsSetLayer(wsDisplay, appMPlayer.menuWindow.WindowID, appMPlayer.subWindow.isFullScreen); 86 wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.subWindow.isFullScreen);
87 87
88 if (guiIntfStruct.Playing) 88 if (guiInfo.Playing)
89 wsSetBackgroundRGB(&appMPlayer.subWindow, 0, 0, 0); 89 wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
90 else 90 else
91 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B); 91 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
92 } 92 }
93 93
94 void mplEnd(void) 94 void uiEnd(void)
95 { 95 {
96 plItem *next; 96 plItem *next;
97 97
98 if (!mplGotoTheNext && guiIntfStruct.Playing) { 98 if (!uiGotoTheNext && guiInfo.Playing) {
99 mplGotoTheNext = 1; 99 uiGotoTheNext = 1;
100 return; 100 return;
101 } 101 }
102 102
103 if (guiIntfStruct.Playing && (next = gtkSet(gtkGetNextPlItem, 0, NULL)) && (plLastPlayed != next)) { 103 if (guiInfo.Playing && (next = gtkSet(gtkGetNextPlItem, 0, NULL)) && (plLastPlayed != next)) {
104 plLastPlayed = next; 104 plLastPlayed = next;
105 guiSetDF(guiIntfStruct.Filename, next->path, next->name); 105 guiSetDF(guiInfo.Filename, next->path, next->name);
106 guiIntfStruct.StreamType = STREAMTYPE_FILE; 106 guiInfo.StreamType = STREAMTYPE_FILE;
107 guiIntfStruct.FilenameChanged = guiIntfStruct.NewPlay = 1; 107 guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
108 gfree((void **)&guiIntfStruct.AudioFile); 108 gfree((void **)&guiInfo.AudioFile);
109 gfree((void **)&guiIntfStruct.Subtitlename); 109 gfree((void **)&guiInfo.Subtitlename);
110 } else { 110 } else {
111 if (guiIntfStruct.FilenameChanged || guiIntfStruct.NewPlay) 111 if (guiInfo.FilenameChanged || guiInfo.NewPlay)
112 return; 112 return;
113 113
114 guiIntfStruct.TimeSec = 0; 114 guiInfo.TimeSec = 0;
115 guiIntfStruct.Position = 0; 115 guiInfo.Position = 0;
116 guiIntfStruct.AudioType = 0; 116 guiInfo.AudioType = 0;
117 guiIntfStruct.NoWindow = False; 117 guiInfo.NoWindow = False;
118 118
119 #ifdef CONFIG_DVDREAD 119 #ifdef CONFIG_DVDREAD
120 guiIntfStruct.DVD.current_title = 1; 120 guiInfo.DVD.current_title = 1;
121 guiIntfStruct.DVD.current_chapter = 1; 121 guiInfo.DVD.current_chapter = 1;
122 guiIntfStruct.DVD.current_angle = 1; 122 guiInfo.DVD.current_angle = 1;
123 #endif 123 #endif
124 124
125 if (!appMPlayer.subWindow.isFullScreen && gtkShowVideoWindow) { 125 if (!guiApp.subWindow.isFullScreen && gtkShowVideoWindow) {
126 wsResizeWindow(&appMPlayer.subWindow, appMPlayer.sub.width, appMPlayer.sub.height); 126 wsResizeWindow(&guiApp.subWindow, guiApp.sub.width, guiApp.sub.height);
127 wsMoveWindow(&appMPlayer.subWindow, True, appMPlayer.sub.x, appMPlayer.sub.y); 127 wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y);
128 } else 128 } else
129 wsVisibleWindow(&appMPlayer.subWindow, wsHideWindow); 129 wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
130 130
131 guiGetEvent(guiCEvent, guiSetStop); 131 guiGetEvent(guiCEvent, guiSetStop);
132 mplSubRender = 1; 132 uiSubRender = 1;
133 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B); 133 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
134 wsClearWindow(appMPlayer.subWindow); 134 wsClearWindow(guiApp.subWindow);
135 wsPostRedisplay(&appMPlayer.subWindow); 135 wsPostRedisplay(&guiApp.subWindow);
136 } 136 }
137 } 137 }
138 138
139 void mplPlay(void) 139 void uiPlay(void)
140 { 140 {
141 if (!guiIntfStruct.Filename || 141 if (!guiInfo.Filename ||
142 (guiIntfStruct.Filename[0] == 0) || 142 (guiInfo.Filename[0] == 0) ||
143 (guiIntfStruct.Playing == 1)) 143 (guiInfo.Playing == 1))
144 return; 144 return;
145 145
146 if (guiIntfStruct.Playing == 2) { 146 if (guiInfo.Playing == 2) {
147 mplPause(); 147 uiPause();
148 return; 148 return;
149 } 149 }
150 150
151 guiGetEvent(guiCEvent, (void *)guiSetPlay); 151 guiGetEvent(guiCEvent, (void *)guiSetPlay);
152 mplSubRender = 0; 152 uiSubRender = 0;
153 wsSetBackgroundRGB(&appMPlayer.subWindow, 0, 0, 0); 153 wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
154 wsClearWindow(appMPlayer.subWindow); 154 wsClearWindow(guiApp.subWindow);
155 } 155 }
156 156
157 void mplPause(void) 157 void uiPause(void)
158 { 158 {
159 if (!guiIntfStruct.Playing) 159 if (!guiInfo.Playing)
160 return; 160 return;
161 161
162 if (guiIntfStruct.Playing == 1) { 162 if (guiInfo.Playing == 1) {
163 mp_cmd_t *cmd = calloc(1, sizeof(*cmd)); 163 mp_cmd_t *cmd = calloc(1, sizeof(*cmd));
164 cmd->id = MP_CMD_PAUSE; 164 cmd->id = MP_CMD_PAUSE;
165 cmd->name = strdup("pause"); 165 cmd->name = strdup("pause");
166 mp_input_queue_cmd(cmd); 166 mp_input_queue_cmd(cmd);
167 } else 167 } else
168 guiIntfStruct.Playing = 1; 168 guiInfo.Playing = 1;
169 } 169 }
170 170
171 void mplState(void) 171 void uiState(void)
172 { 172 {
173 if (guiIntfStruct.Playing == 0 || guiIntfStruct.Playing == 2) { 173 if (guiInfo.Playing == 0 || guiInfo.Playing == 2) {
174 btnModify(evPlaySwitchToPause, btnReleased); 174 btnModify(evPlaySwitchToPause, btnReleased);
175 btnModify(evPauseSwitchToPlay, btnDisabled); 175 btnModify(evPauseSwitchToPlay, btnDisabled);
176 } else { 176 } else {
177 btnModify(evPlaySwitchToPause, btnDisabled); 177 btnModify(evPlaySwitchToPause, btnDisabled);
178 btnModify(evPauseSwitchToPlay, btnReleased); 178 btnModify(evPauseSwitchToPlay, btnReleased);
179 } 179 }
180 } 180 }
181 181
182 void mplRelSeek(float sec) 182 void uiRelSeek(float sec)
183 { 183 {
184 rel_seek_secs = sec; 184 rel_seek_secs = sec;
185 abs_seek_pos = 0; 185 abs_seek_pos = 0;
186 } 186 }
187 187
188 void mplAbsSeek(float percent) 188 void uiAbsSeek(float percent)
189 { 189 {
190 if (guiIntfStruct.StreamType == STREAMTYPE_STREAM) 190 if (guiInfo.StreamType == STREAMTYPE_STREAM)
191 return; 191 return;
192 192
193 rel_seek_secs = percent / 100.0; 193 rel_seek_secs = percent / 100.0;
194 abs_seek_pos = 3; 194 abs_seek_pos = 3;
195 } 195 }
196 196
197 void ChangeSkin(char *name) 197 void uiChangeSkin(char *name)
198 { 198 {
199 int prev, bprev; 199 int prev, bprev;
200 200
201 prev = appMPlayer.menuIsPresent; 201 prev = guiApp.menuIsPresent;
202 bprev = appMPlayer.barIsPresent; 202 bprev = guiApp.playbarIsPresent;
203 203
204 mainVisible = 0; 204 mainVisible = 0;
205 205
206 if (skinRead(name) != 0) { 206 if (skinRead(name) != 0) {
207 if (skinRead(skinName) != 0) { 207 if (skinRead(skinName) != 0) {
210 } 210 }
211 } 211 }
212 212
213 // reload menu window 213 // reload menu window
214 214
215 if (prev && appMPlayer.menuIsPresent) { 215 if (prev && guiApp.menuIsPresent) {
216 free(mplMenuDrawBuffer); 216 free(menuDrawBuffer);
217 mplMenuDrawBuffer = calloc(1, appMPlayer.menu.Bitmap.ImageSize); 217 menuDrawBuffer = calloc(1, guiApp.menu.Bitmap.ImageSize);
218 218
219 if (!mplMenuDrawBuffer) { 219 if (!menuDrawBuffer) {
220 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB); 220 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
221 guiExit(EXIT_ERROR); 221 guiExit(EXIT_ERROR);
222 } 222 }
223 223
224 wsResizeWindow(&appMPlayer.menuWindow, appMPlayer.menu.width, appMPlayer.menu.height); 224 wsResizeWindow(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height);
225 wsResizeImage(&appMPlayer.menuWindow, appMPlayer.menu.width, appMPlayer.menu.height); 225 wsResizeImage(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height);
226 wsSetShape(&appMPlayer.menuWindow, appMPlayer.menu.Mask.Image); 226 wsSetShape(&guiApp.menuWindow, guiApp.menu.Mask.Image);
227 wsVisibleWindow(&appMPlayer.menuWindow, wsHideWindow); 227 wsVisibleWindow(&guiApp.menuWindow, wsHideWindow);
228 } else 228 } else
229 mplMenuInit(); 229 uiMenuInit();
230 230
231 // reload sub window 231 // reload sub window
232 232
233 if (appMPlayer.sub.Bitmap.Image) 233 if (guiApp.sub.Bitmap.Image)
234 wsResizeImage(&appMPlayer.subWindow, appMPlayer.sub.Bitmap.Width, appMPlayer.sub.Bitmap.Height); 234 wsResizeImage(&guiApp.subWindow, guiApp.sub.Bitmap.Width, guiApp.sub.Bitmap.Height);
235 235
236 if (!appMPlayer.subWindow.isFullScreen && !guiIntfStruct.Playing) { 236 if (!guiApp.subWindow.isFullScreen && !guiInfo.Playing) {
237 wsResizeWindow(&appMPlayer.subWindow, appMPlayer.sub.width, appMPlayer.sub.height); 237 wsResizeWindow(&guiApp.subWindow, guiApp.sub.width, guiApp.sub.height);
238 wsMoveWindow(&appMPlayer.subWindow, True, appMPlayer.sub.x, appMPlayer.sub.y); 238 wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y);
239 } 239 }
240 240
241 if (appMPlayer.sub.Bitmap.Image) 241 if (guiApp.sub.Bitmap.Image)
242 wsConvert(&appMPlayer.subWindow, appMPlayer.sub.Bitmap.Image); 242 wsConvert(&guiApp.subWindow, guiApp.sub.Bitmap.Image);
243 243
244 if (!guiIntfStruct.Playing) { 244 if (!guiInfo.Playing) {
245 mplSubRender = 1; 245 uiSubRender = 1;
246 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B); 246 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
247 wsClearWindow(appMPlayer.subWindow); 247 wsClearWindow(guiApp.subWindow);
248 wsPostRedisplay(&appMPlayer.subWindow); 248 wsPostRedisplay(&guiApp.subWindow);
249 } 249 }
250 250
251 // reload play bar 251 // reload playbar
252 252
253 if (bprev) 253 if (bprev)
254 wsDestroyWindow(&appMPlayer.barWindow); 254 wsDestroyWindow(&guiApp.playbarWindow);
255 255
256 mplPBInit(); 256 uiPlaybarInit();
257 257
258 // reload main window 258 // reload main window
259 259
260 free(mplDrawBuffer); 260 free(mainDrawBuffer);
261 mplDrawBuffer = calloc(1, appMPlayer.main.Bitmap.ImageSize); 261 mainDrawBuffer = calloc(1, guiApp.main.Bitmap.ImageSize);
262 262
263 if (!mplDrawBuffer) { 263 if (!mainDrawBuffer) {
264 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB); 264 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
265 guiExit(EXIT_ERROR); 265 guiExit(EXIT_ERROR);
266 } 266 }
267 267
268 wsDestroyWindow(&appMPlayer.mainWindow); 268 wsDestroyWindow(&guiApp.mainWindow);
269 269
270 wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer"); 270 wsCreateWindow(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer");
271 wsCreateImage(&appMPlayer.mainWindow, appMPlayer.main.Bitmap.Width, appMPlayer.main.Bitmap.Height); 271 wsCreateImage(&guiApp.mainWindow, guiApp.main.Bitmap.Width, guiApp.main.Bitmap.Height);
272 wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image); 272 wsSetShape(&guiApp.mainWindow, guiApp.main.Mask.Image);
273 wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, &guiIcon); 273 wsSetIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
274 274
275 appMPlayer.mainWindow.ReDraw = (void *)mplMainDraw; 275 guiApp.mainWindow.ReDraw = (void *)uiMainDraw;
276 appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle; 276 guiApp.mainWindow.MouseHandler = uiMainMouseHandle;
277 appMPlayer.mainWindow.KeyHandler = mplMainKeyHandle; 277 guiApp.mainWindow.KeyHandler = uiMainKeyHandle;
278 appMPlayer.mainWindow.DandDHandler = mplDandDHandler; 278 guiApp.mainWindow.DandDHandler = uiDandDHandler;
279 279
280 wsXDNDMakeAwareness(&appMPlayer.mainWindow); 280 wsXDNDMakeAwareness(&guiApp.mainWindow);
281 281
282 if (!appMPlayer.mainDecoration) 282 if (!guiApp.mainDecoration)
283 wsWindowDecoration(&appMPlayer.mainWindow, 0); 283 wsWindowDecoration(&guiApp.mainWindow, 0);
284 284
285 wsVisibleWindow(&appMPlayer.mainWindow, wsShowWindow); 285 wsVisibleWindow(&guiApp.mainWindow, wsShowWindow);
286 mainVisible = 1; 286 mainVisible = 1;
287 287
288 btnModify(evSetVolume, guiIntfStruct.Volume); 288 btnModify(evSetVolume, guiInfo.Volume);
289 btnModify(evSetBalance, guiIntfStruct.Balance); 289 btnModify(evSetBalance, guiInfo.Balance);
290 btnModify(evSetMoviePosition, guiIntfStruct.Position); 290 btnModify(evSetMoviePosition, guiInfo.Position);
291 btnModify(evFullScreen, !appMPlayer.subWindow.isFullScreen); 291 btnModify(evFullScreen, !guiApp.subWindow.isFullScreen);
292 292
293 wsSetLayer(wsDisplay, appMPlayer.mainWindow.WindowID, appMPlayer.subWindow.isFullScreen); 293 wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.subWindow.isFullScreen);
294 wsSetLayer(wsDisplay, appMPlayer.menuWindow.WindowID, appMPlayer.subWindow.isFullScreen); 294 wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.subWindow.isFullScreen);
295 } 295 }
296 296
297 void mplSetFileName(char *dir, char *name, int type) 297 void uiSetFileName(char *dir, char *name, int type)
298 { 298 {
299 if (!name) 299 if (!name)
300 return; 300 return;
301 301
302 if (!dir) 302 if (!dir)
303 guiSetFilename(guiIntfStruct.Filename, name) 303 guiSetFilename(guiInfo.Filename, name)
304 else 304 else
305 guiSetDF(guiIntfStruct.Filename, dir, name) 305 guiSetDF(guiInfo.Filename, dir, name)
306 306
307 guiIntfStruct.StreamType = type; 307 guiInfo.StreamType = type;
308 gfree((void **)&guiIntfStruct.AudioFile); 308 gfree((void **)&guiInfo.AudioFile);
309 gfree((void **)&guiIntfStruct.Subtitlename); 309 gfree((void **)&guiInfo.Subtitlename);
310 } 310 }
311 311
312 void mplCurr(void) 312 void uiCurr(void)
313 { 313 {
314 plItem *curr; 314 plItem *curr;
315 int stop = 0; 315 int stop = 0;
316 316
317 if (guiIntfStruct.Playing == 2) 317 if (guiInfo.Playing == 2)
318 return; 318 return;
319 319
320 switch (guiIntfStruct.StreamType) { 320 switch (guiInfo.StreamType) {
321 #ifdef CONFIG_DVDREAD 321 #ifdef CONFIG_DVDREAD
322 case STREAMTYPE_DVD: 322 case STREAMTYPE_DVD:
323 break; 323 break;
324 #endif 324 #endif
325 325
331 default: 331 default:
332 332
333 curr = gtkSet(gtkGetCurrPlItem, 0, NULL); 333 curr = gtkSet(gtkGetCurrPlItem, 0, NULL);
334 334
335 if (curr) { 335 if (curr) {
336 mplSetFileName(curr->path, curr->name, STREAMTYPE_FILE); 336 uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE);
337 mplGotoTheNext = 0; 337 uiGotoTheNext = 0;
338 break; 338 break;
339 } 339 }
340 340
341 return; 341 return;
342 } 342 }
343 343
344 if (stop) 344 if (stop)
345 mplEventHandling(evStop, 0); 345 uiEventHandling(evStop, 0);
346 346
347 if (guiIntfStruct.Playing == 1) 347 if (guiInfo.Playing == 1)
348 mplEventHandling(evPlay, 0); 348 uiEventHandling(evPlay, 0);
349 } 349 }
350 350
351 void mplPrev(void) 351 void uiPrev(void)
352 { 352 {
353 plItem *prev; 353 plItem *prev;
354 int stop = 0; 354 int stop = 0;
355 355
356 if (guiIntfStruct.Playing == 2) 356 if (guiInfo.Playing == 2)
357 return; 357 return;
358 358
359 switch (guiIntfStruct.StreamType) { 359 switch (guiInfo.StreamType) {
360 #ifdef CONFIG_DVDREAD 360 #ifdef CONFIG_DVDREAD
361 case STREAMTYPE_DVD: 361 case STREAMTYPE_DVD:
362 362
363 if (--guiIntfStruct.DVD.current_chapter == 0) { 363 if (--guiInfo.DVD.current_chapter == 0) {
364 guiIntfStruct.DVD.current_chapter = 1; 364 guiInfo.DVD.current_chapter = 1;
365 365
366 if (--guiIntfStruct.DVD.current_title <= 0) { 366 if (--guiInfo.DVD.current_title <= 0) {
367 guiIntfStruct.DVD.current_title = 1; 367 guiInfo.DVD.current_title = 1;
368 stop = 1; 368 stop = 1;
369 } 369 }
370 } 370 }
371 371
372 guiIntfStruct.Track = guiIntfStruct.DVD.current_title; 372 guiInfo.Track = guiInfo.DVD.current_title;
373 break; 373 break;
374 #endif 374 #endif
375 375
376 #ifdef CONFIG_VCD 376 #ifdef CONFIG_VCD
377 case STREAMTYPE_VCD: 377 case STREAMTYPE_VCD:
378 if (--guiIntfStruct.Track == 0) { 378 if (--guiInfo.Track == 0) {
379 guiIntfStruct.Track = 1; 379 guiInfo.Track = 1;
380 stop = 1; 380 stop = 1;
381 } 381 }
382 break; 382 break;
383 #endif 383 #endif
384 384
385 default: 385 default:
386 386
387 prev = gtkSet(gtkGetPrevPlItem, 0, NULL); 387 prev = gtkSet(gtkGetPrevPlItem, 0, NULL);
388 388
389 if (prev) { 389 if (prev) {
390 mplSetFileName(prev->path, prev->name, STREAMTYPE_FILE); 390 uiSetFileName(prev->path, prev->name, STREAMTYPE_FILE);
391 mplGotoTheNext = 0; 391 uiGotoTheNext = 0;
392 break; 392 break;
393 } 393 }
394 394
395 return; 395 return;
396 } 396 }
397 397
398 if (stop) 398 if (stop)
399 mplEventHandling(evStop, 0); 399 uiEventHandling(evStop, 0);
400 400
401 if (guiIntfStruct.Playing == 1) 401 if (guiInfo.Playing == 1)
402 mplEventHandling(evPlay, 0); 402 uiEventHandling(evPlay, 0);
403 } 403 }
404 404
405 void mplNext(void) 405 void uiNext(void)
406 { 406 {
407 int stop = 0; 407 int stop = 0;
408 plItem *next; 408 plItem *next;
409 409
410 if (guiIntfStruct.Playing == 2) 410 if (guiInfo.Playing == 2)
411 return; 411 return;
412 412
413 switch (guiIntfStruct.StreamType) { 413 switch (guiInfo.StreamType) {
414 #ifdef CONFIG_DVDREAD 414 #ifdef CONFIG_DVDREAD
415 case STREAMTYPE_DVD: 415 case STREAMTYPE_DVD:
416 416
417 if (guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters) { 417 if (guiInfo.DVD.current_chapter++ == guiInfo.DVD.chapters) {
418 guiIntfStruct.DVD.current_chapter = 1; 418 guiInfo.DVD.current_chapter = 1;
419 419
420 if (++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles) { 420 if (++guiInfo.DVD.current_title > guiInfo.DVD.titles) {
421 guiIntfStruct.DVD.current_title = guiIntfStruct.DVD.titles; 421 guiInfo.DVD.current_title = guiInfo.DVD.titles;
422 stop = 1; 422 stop = 1;
423 } 423 }
424 } 424 }
425 425
426 guiIntfStruct.Track = guiIntfStruct.DVD.current_title; 426 guiInfo.Track = guiInfo.DVD.current_title;
427 break; 427 break;
428 #endif 428 #endif
429 429
430 #ifdef CONFIG_VCD 430 #ifdef CONFIG_VCD
431 case STREAMTYPE_VCD: 431 case STREAMTYPE_VCD:
432 432
433 if (++guiIntfStruct.Track >= guiIntfStruct.VCDTracks) { 433 if (++guiInfo.Track >= guiInfo.VCDTracks) {
434 guiIntfStruct.Track = guiIntfStruct.VCDTracks; 434 guiInfo.Track = guiInfo.VCDTracks;
435 435
436 if (guiIntfStruct.VCDTracks > 1) 436 if (guiInfo.VCDTracks > 1)
437 guiIntfStruct.Track--; 437 guiInfo.Track--;
438 438
439 stop = 1; 439 stop = 1;
440 } 440 }
441 441
442 break; 442 break;
445 default: 445 default:
446 446
447 next = gtkSet(gtkGetNextPlItem, 0, NULL); 447 next = gtkSet(gtkGetNextPlItem, 0, NULL);
448 448
449 if (next) { 449 if (next) {
450 mplSetFileName(next->path, next->name, STREAMTYPE_FILE); 450 uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
451 mplGotoTheNext = 0; 451 uiGotoTheNext = 0;
452 break; 452 break;
453 } 453 }
454 454
455 return; 455 return;
456 } 456 }
457 457
458 if (stop) 458 if (stop)
459 mplEventHandling(evStop, 0); 459 uiEventHandling(evStop, 0);
460 460
461 if (guiIntfStruct.Playing == 1) 461 if (guiInfo.Playing == 1)
462 mplEventHandling(evPlay, 0); 462 uiEventHandling(evPlay, 0);
463 } 463 }
464 464
465 void mplStop(void) 465 void uiStop(void)
466 { 466 {
467 mplEventHandling(evStop, 0); 467 uiEventHandling(evStop, 0);
468 } 468 }