Mercurial > mplayer.hg
annotate gui/ui/actions.c @ 35627:51358e7bde85
Cosmetic: Add and adjust comments.
author | ib |
---|---|
date | Thu, 10 Jan 2013 10:48:27 +0000 |
parents | 29761b2b8cb0 |
children | a30496350cb9 |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
23077 | 18 |
35437 | 19 /** |
20 * @file | |
21 * @brief User interface actions | |
22 */ | |
23 | |
23077 | 24 #include <stdlib.h> |
25 #include <string.h> | |
26 | |
33556 | 27 #include "actions.h" |
35528 | 28 #include "ui.h" |
35525 | 29 #include "gui/app/app.h" |
30 #include "gui/app/gui.h" | |
32881 | 31 #include "gui/interface.h" |
32 #include "gui/skin/skin.h" | |
33742
e1539e14d60f
Move purely list related parts of gtkSet() from interface.c to list.c.
ib
parents:
33740
diff
changeset
|
33 #include "gui/util/list.h" |
33739 | 34 #include "gui/util/mem.h" |
33737 | 35 #include "gui/util/string.h" |
35435 | 36 #include "gui/wm/ws.h" |
32881 | 37 #include "gui/wm/wsxdnd.h" |
23077 | 38 |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
39 #include "help_mp.h" |
32881 | 40 #include "input/input.h" |
35431 | 41 #include "libmpdemux/demuxer.h" |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
42 #include "libvo/video_out.h" |
32881 | 43 #include "mp_core.h" |
35435 | 44 #include "mp_msg.h" |
45 #include "mplayer.h" | |
23077 | 46 |
35437 | 47 /** |
48 * @brief Switch video window fullscreen mode. | |
49 * | |
50 * Switch normal video to fullscreen and fullscreen video to normal. | |
51 */ | |
33555 | 52 void uiFullScreen(void) |
23077 | 53 { |
33960 | 54 if (!guiInfo.VideoWindow) |
32881 | 55 return; |
56 | |
34697 | 57 wsFullScreen(&guiApp.videoWindow); |
23077 | 58 |
34697 | 59 vo_fs = guiApp.videoWindow.isFullScreen; |
23077 | 60 |
34697 | 61 wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen); |
32881 | 62 |
33555 | 63 if (guiApp.menuIsPresent) |
34697 | 64 wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen); |
32881 | 65 |
33555 | 66 if (guiInfo.Playing) |
34697 | 67 wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0); |
32881 | 68 else |
34697 | 69 wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); |
23077 | 70 } |
71 | |
35437 | 72 /** |
73 * @brief Switch to play mode. | |
74 */ | |
33555 | 75 void uiPlay(void) |
23077 | 76 { |
34401
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
77 if (guiInfo.Playing == GUI_PLAY) |
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
78 return; |
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
79 |
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
80 if (guiInfo.StreamType != STREAMTYPE_CDDA && |
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
81 guiInfo.StreamType != STREAMTYPE_VCD && |
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
82 guiInfo.StreamType != STREAMTYPE_DVD && |
af8838c2b60b
Allow uiPlay() without guiInfo.Filename for some stream types.
ib
parents:
34400
diff
changeset
|
83 (!guiInfo.Filename || (guiInfo.Filename[0] == 0))) |
32881 | 84 return; |
23077 | 85 |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
86 if (guiInfo.Playing == GUI_PAUSE) { |
33555 | 87 uiPause(); |
32881 | 88 return; |
89 } | |
90 | |
33731
81f71d910333
Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents:
33725
diff
changeset
|
91 gui(GUI_SET_STATE, (void *)GUI_PLAY); |
35493 | 92 uiVideoRender = False; |
34697 | 93 wsSetBackgroundRGB(&guiApp.videoWindow, 0, 0, 0); |
35357
80fe9ad7f318
Pass guiApp's wsTWindow parameters always by reference (if possible).
ib
parents:
34697
diff
changeset
|
94 wsClearWindow(&guiApp.videoWindow); |
23077 | 95 } |
96 | |
35437 | 97 /** |
98 * @brief Switch to pause mode. | |
99 */ | |
33555 | 100 void uiPause(void) |
23077 | 101 { |
33555 | 102 if (!guiInfo.Playing) |
32881 | 103 return; |
104 | |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
105 if (guiInfo.Playing == GUI_PLAY) { |
32881 | 106 mp_cmd_t *cmd = calloc(1, sizeof(*cmd)); |
35433 | 107 |
35432 | 108 if (cmd) { |
35433 | 109 cmd->id = MP_CMD_PAUSE; |
110 cmd->name = strdup("pause"); | |
111 mp_input_queue_cmd(cmd); | |
35432 | 112 } |
32881 | 113 } else |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
114 guiInfo.Playing = GUI_PLAY; |
23077 | 115 } |
116 | |
35437 | 117 /** |
118 * @brief Adjust GUI items to reflect current state (i.e. current playing mode). | |
119 */ | |
33555 | 120 void uiState(void) |
32881 | 121 { |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
122 if (guiInfo.Playing == GUI_STOP || guiInfo.Playing == GUI_PAUSE) { |
33978 | 123 btnSet(evPlaySwitchToPause, btnReleased); |
124 btnSet(evPauseSwitchToPlay, btnDisabled); | |
32881 | 125 } else { |
35434 | 126 btnSet(evPauseSwitchToPlay, btnReleased); |
33978 | 127 btnSet(evPlaySwitchToPause, btnDisabled); |
32881 | 128 } |
23077 | 129 } |
130 | |
35437 | 131 /** |
132 * @brief Seek new playback position. | |
133 * | |
35438 | 134 * The new position is a relative one. |
35437 | 135 * |
136 * @param sec seconds to seek (either forward (> 0) or backward (< 0)) | |
137 */ | |
33555 | 138 void uiRelSeek(float sec) |
32881 | 139 { |
32971 | 140 rel_seek_secs = sec; |
32881 | 141 abs_seek_pos = 0; |
142 } | |
143 | |
35437 | 144 /** |
145 * @brief Seek new playback position. | |
146 * | |
35438 | 147 * The new position is an absolute one. |
35437 | 148 * |
149 * @param percent percentage of playback time to position to | |
150 */ | |
33555 | 151 void uiAbsSeek(float percent) |
32881 | 152 { |
32971 | 153 rel_seek_secs = percent / 100.0; |
35431 | 154 abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR; |
23077 | 155 } |
156 | |
35437 | 157 /** |
158 * @brief Change to a different skin. | |
159 * | |
160 * @param name name of the skin to change to | |
161 */ | |
33555 | 162 void uiChangeSkin(char *name) |
23077 | 163 { |
32893 | 164 int prev, bprev; |
32881 | 165 |
33555 | 166 prev = guiApp.menuIsPresent; |
167 bprev = guiApp.playbarIsPresent; | |
32881 | 168 |
35493 | 169 mainVisible = False; |
32881 | 170 |
32893 | 171 if (skinRead(name) != 0) { |
172 if (skinRead(skinName) != 0) { | |
35493 | 173 mainVisible = True; |
32894 | 174 return; |
32893 | 175 } |
32881 | 176 } |
177 | |
34684 | 178 /* reload menu window */ |
23077 | 179 |
33555 | 180 if (prev && guiApp.menuIsPresent) { |
181 free(menuDrawBuffer); | |
182 menuDrawBuffer = calloc(1, guiApp.menu.Bitmap.ImageSize); | |
32881 | 183 |
33555 | 184 if (!menuDrawBuffer) { |
33530 | 185 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB); |
33768 | 186 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); |
32881 | 187 } |
23077 | 188 |
33555 | 189 wsResizeWindow(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height); |
190 wsResizeImage(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height); | |
191 wsSetShape(&guiApp.menuWindow, guiApp.menu.Mask.Image); | |
192 wsVisibleWindow(&guiApp.menuWindow, wsHideWindow); | |
32881 | 193 } else |
33555 | 194 uiMenuInit(); |
32881 | 195 |
34697 | 196 /* reload video window */ |
23077 | 197 |
34697 | 198 if (guiApp.video.Bitmap.Image) |
199 wsResizeImage(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height); | |
32881 | 200 |
34697 | 201 if (!guiApp.videoWindow.isFullScreen && !guiInfo.Playing) { |
202 wsResizeWindow(&guiApp.videoWindow, guiApp.video.width, guiApp.video.height); | |
203 wsMoveWindow(&guiApp.videoWindow, False, guiApp.video.x, guiApp.video.y); | |
32881 | 204 } |
205 | |
34697 | 206 if (guiApp.video.Bitmap.Image) |
207 wsConvert(&guiApp.videoWindow, guiApp.video.Bitmap.Image); | |
23077 | 208 |
33555 | 209 if (!guiInfo.Playing) { |
35493 | 210 uiVideoRender = True; |
34697 | 211 wsSetBackgroundRGB(&guiApp.videoWindow, guiApp.video.R, guiApp.video.G, guiApp.video.B); |
35357
80fe9ad7f318
Pass guiApp's wsTWindow parameters always by reference (if possible).
ib
parents:
34697
diff
changeset
|
212 wsClearWindow(&guiApp.videoWindow); |
34697 | 213 wsPostRedisplay(&guiApp.videoWindow); |
32881 | 214 } |
215 | |
34684 | 216 /* reload playbar */ |
32881 | 217 |
218 if (bprev) | |
33555 | 219 wsDestroyWindow(&guiApp.playbarWindow); |
32881 | 220 |
33555 | 221 uiPlaybarInit(); |
23077 | 222 |
34684 | 223 /* reload main window */ |
32881 | 224 |
33555 | 225 free(mainDrawBuffer); |
226 mainDrawBuffer = calloc(1, guiApp.main.Bitmap.ImageSize); | |
23077 | 227 |
33555 | 228 if (!mainDrawBuffer) { |
33530 | 229 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB); |
33768 | 230 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0); |
32881 | 231 } |
23077 | 232 |
33555 | 233 wsDestroyWindow(&guiApp.mainWindow); |
32881 | 234 |
33555 | 235 wsCreateWindow(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer"); |
236 wsCreateImage(&guiApp.mainWindow, guiApp.main.Bitmap.Width, guiApp.main.Bitmap.Height); | |
237 wsSetShape(&guiApp.mainWindow, guiApp.main.Mask.Image); | |
238 wsSetIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon); | |
23077 | 239 |
33555 | 240 guiApp.mainWindow.ReDraw = (void *)uiMainDraw; |
241 guiApp.mainWindow.MouseHandler = uiMainMouseHandle; | |
242 guiApp.mainWindow.KeyHandler = uiMainKeyHandle; | |
243 guiApp.mainWindow.DandDHandler = uiDandDHandler; | |
32881 | 244 |
33555 | 245 wsXDNDMakeAwareness(&guiApp.mainWindow); |
23077 | 246 |
33555 | 247 if (!guiApp.mainDecoration) |
35497 | 248 wsWindowDecoration(&guiApp.mainWindow, False); |
32881 | 249 |
33555 | 250 wsVisibleWindow(&guiApp.mainWindow, wsShowWindow); |
35493 | 251 mainVisible = True; |
32881 | 252 |
33555 | 253 btnModify(evSetVolume, guiInfo.Volume); |
254 btnModify(evSetBalance, guiInfo.Balance); | |
255 btnModify(evSetMoviePosition, guiInfo.Position); | |
34697 | 256 btnSet(evFullScreen, (guiApp.videoWindow.isFullScreen ? btnPressed : btnReleased)); |
23077 | 257 |
34697 | 258 wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.videoWindow.isFullScreen); |
259 wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.videoWindow.isFullScreen); | |
32881 | 260 } |
261 | |
35437 | 262 /** |
35452 | 263 * @brief Set the file to be played. |
35437 | 264 * |
265 * @param dir directory (optional, else NULL) | |
266 * @param name filename | |
267 * @param type stream type of the file | |
35483
8ac7761bcb7c
Clear information associated with a file when setting a new one.
ib
parents:
35462
diff
changeset
|
268 * |
8ac7761bcb7c
Clear information associated with a file when setting a new one.
ib
parents:
35462
diff
changeset
|
269 * @note All #guiInfo members associated with the file will be cleared. |
35437 | 270 */ |
35452 | 271 void uiSetFile(char *dir, char *name, int type) |
32881 | 272 { |
273 if (!dir) | |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
274 setdup(&guiInfo.Filename, name); |
32881 | 275 else |
33740
2c02269701bd
Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents:
33739
diff
changeset
|
276 setddup(&guiInfo.Filename, dir, name); |
23077 | 277 |
34064 | 278 filename = guiInfo.Filename; |
34399
f2c03009068d
Don't explicitly set stream type if the type doesn't change.
ib
parents:
34387
diff
changeset
|
279 |
35483
8ac7761bcb7c
Clear information associated with a file when setting a new one.
ib
parents:
35462
diff
changeset
|
280 if (type != SAME_STREAMTYPE) { |
34400 | 281 guiInfo.StreamType = type; |
35568 | 282 uiUnsetMedia(False); |
35483
8ac7761bcb7c
Clear information associated with a file when setting a new one.
ib
parents:
35462
diff
changeset
|
283 } |
23077 | 284 } |
285 | |
35437 | 286 /** |
35453 | 287 * @brief Unset the file being played. |
288 */ | |
289 void uiUnsetFile(void) | |
290 { | |
291 uiSetFile(NULL, NULL, STREAMTYPE_DUMMY); | |
292 } | |
293 | |
294 /** | |
35562 | 295 * @brief Unset media information. |
35568 | 296 * |
297 * @param totals whether to unset number of chapters and angles (#True) or | |
298 * just track, chapter and angle (#False) as well | |
35562 | 299 */ |
35568 | 300 void uiUnsetMedia(int totals) |
35562 | 301 { |
302 guiInfo.VideoWidth = 0; | |
303 guiInfo.VideoHeight = 0; | |
304 guiInfo.AudioChannels = 0; | |
305 guiInfo.RunningTime = 0; | |
35568 | 306 |
307 if (totals) { | |
308 guiInfo.Chapters = 0; | |
309 guiInfo.Angles = 0; | |
310 } else { | |
35569 | 311 guiInfo.Track = 0; |
312 guiInfo.Chapter = 0; | |
313 guiInfo.Angle = 0; | |
35568 | 314 } |
35562 | 315 |
316 nfree(guiInfo.CodecName); | |
317 nfree(guiInfo.AudioFilename); | |
318 nfree(guiInfo.SubtitleFilename); | |
319 } | |
320 | |
321 /** | |
35437 | 322 * @brief Set file to be played to current playlist entry. |
323 */ | |
33555 | 324 void uiCurr(void) |
23077 | 325 { |
32881 | 326 plItem *curr; |
23077 | 327 |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
328 if (guiInfo.Playing == GUI_PAUSE) |
32881 | 329 return; |
23077 | 330 |
33555 | 331 switch (guiInfo.StreamType) { |
34387 | 332 case STREAMTYPE_CDDA: |
34077 | 333 case STREAMTYPE_VCD: |
334 case STREAMTYPE_DVD: | |
35433 | 335 |
32881 | 336 break; |
337 | |
338 default: | |
339 | |
34663 | 340 curr = listMgr(PLAYLIST_ITEM_GET_CURR, 0); |
32881 | 341 |
342 if (curr) { | |
35452 | 343 uiSetFile(curr->path, curr->name, STREAMTYPE_FILE); |
35493 | 344 guiInfo.PlaylistNext = False; |
35485 | 345 guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, curr); |
32881 | 346 break; |
347 } | |
348 | |
349 return; | |
350 } | |
351 | |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
352 if (guiInfo.Playing == GUI_PLAY) |
33555 | 353 uiEventHandling(evPlay, 0); |
23077 | 354 } |
355 | |
35437 | 356 /** |
357 * @brief Switch to previous playback track. | |
358 */ | |
33555 | 359 void uiPrev(void) |
23077 | 360 { |
35571
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
361 int stop = False, unset = True; |
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
362 plItem *prev = NULL; |
32881 | 363 |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
364 if (guiInfo.Playing == GUI_PAUSE) |
32881 | 365 return; |
366 | |
33555 | 367 switch (guiInfo.StreamType) { |
34387 | 368 case STREAMTYPE_CDDA: |
35426 | 369 |
34387 | 370 if (--guiInfo.Track == 0) { |
371 guiInfo.Track = 1; | |
35493 | 372 stop = True; |
34387 | 373 } |
35426 | 374 |
34387 | 375 break; |
376 | |
34077 | 377 case STREAMTYPE_VCD: |
35426 | 378 |
34077 | 379 if (--guiInfo.Track == 1) { |
380 guiInfo.Track = 2; | |
35493 | 381 stop = True; |
34077 | 382 } |
35426 | 383 |
34077 | 384 break; |
385 | |
32881 | 386 case STREAMTYPE_DVD: |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27370
diff
changeset
|
387 |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
388 if (--guiInfo.Chapter == 0) { |
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
389 guiInfo.Chapter = 1; |
32881 | 390 |
35428 | 391 if (--guiInfo.Track == 0) { |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
392 guiInfo.Track = 1; |
35493 | 393 stop = True; |
32881 | 394 } |
35571
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
395 } else |
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
396 unset = False; |
32881 | 397 |
398 break; | |
399 | |
400 default: | |
401 | |
34663 | 402 prev = listMgr(PLAYLIST_ITEM_GET_PREV, 0); |
32881 | 403 |
404 if (prev) { | |
35452 | 405 uiSetFile(prev->path, prev->name, STREAMTYPE_FILE); |
35500 | 406 guiInfo.PlaylistNext = !guiInfo.Playing; |
35458 | 407 guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, prev); |
32881 | 408 break; |
409 } | |
410 | |
411 return; | |
412 } | |
413 | |
414 if (stop) | |
33555 | 415 uiEventHandling(evStop, 0); |
32881 | 416 |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
417 if (guiInfo.Playing == GUI_PLAY) |
33555 | 418 uiEventHandling(evPlay, 0); |
35571
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
419 else if (!stop && !prev && unset) |
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
420 uiUnsetMedia(True); |
23077 | 421 } |
422 | |
35437 | 423 /** |
424 * @brief Switch to next playback track. | |
425 */ | |
33555 | 426 void uiNext(void) |
23077 | 427 { |
35571
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
428 int stop = False, unset = True; |
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
429 plItem *next = NULL; |
23077 | 430 |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
431 if (guiInfo.Playing == GUI_PAUSE) |
32881 | 432 return; |
433 | |
33555 | 434 switch (guiInfo.StreamType) { |
34387 | 435 case STREAMTYPE_CDDA: |
35425 | 436 case STREAMTYPE_VCD: |
34387 | 437 |
438 if (++guiInfo.Track > guiInfo.Tracks) { | |
439 guiInfo.Track = guiInfo.Tracks; | |
35493 | 440 stop = True; |
34387 | 441 } |
442 | |
443 break; | |
444 | |
32881 | 445 case STREAMTYPE_DVD: |
446 | |
35570 | 447 if (guiInfo.Chapter++ >= guiInfo.Chapters) { |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
448 guiInfo.Chapter = 1; |
32881 | 449 |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33874
diff
changeset
|
450 if (++guiInfo.Track > guiInfo.Tracks) { |
35561 | 451 guiInfo.Track = guiInfo.Tracks; |
35560
1a2200a93ea8
Make DVD stop if manually advancing beyond last chapter of last track.
ib
parents:
35528
diff
changeset
|
452 guiInfo.Chapter = guiInfo.Chapters; |
35493 | 453 stop = True; |
32881 | 454 } |
35571
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
455 } else |
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
456 unset = False; |
32881 | 457 |
458 break; | |
459 | |
460 default: | |
461 | |
34663 | 462 next = listMgr(PLAYLIST_ITEM_GET_NEXT, 0); |
32881 | 463 |
464 if (next) { | |
35452 | 465 uiSetFile(next->path, next->name, STREAMTYPE_FILE); |
35500 | 466 guiInfo.PlaylistNext = !guiInfo.Playing; |
35458 | 467 guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, next); |
32881 | 468 break; |
469 } | |
470 | |
471 return; | |
472 } | |
473 | |
474 if (stop) | |
33555 | 475 uiEventHandling(evStop, 0); |
32881 | 476 |
33615
1f9a31d4f114
Replace all playback integer constants by their symbolic constants.
ib
parents:
33614
diff
changeset
|
477 if (guiInfo.Playing == GUI_PLAY) |
33555 | 478 uiEventHandling(evPlay, 0); |
35571
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
479 else if (!stop && !next && unset) |
29761b2b8cb0
Reset media information while changing tracks in stop mode.
ib
parents:
35570
diff
changeset
|
480 uiUnsetMedia(True); |
23077 | 481 } |