annotate gui/ui/actions.c @ 34399:f2c03009068d

Don't explicitly set stream type if the type doesn't change. Use a self-explanatory symbolic constant which makes the code more easily understandable.
author ib
date Mon, 02 Jan 2012 15:16:55 +0000
parents 0ba85cad4c7e
children 19b68f388735
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
5 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
14 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
17 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
19 #include <stdlib.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20 #include <string.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21
33556
520fb0f7544c Rename GUI directory 'mplayer' and some files in it.
ib
parents: 33555
diff changeset
22 #include "actions.h"
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
23 #include "gmplayer.h"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
24 #include "gui/app.h"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
25 #include "gui/interface.h"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
26 #include "gui/skin/font.h"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
27 #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
28 #include "gui/util/list.h"
33739
9f6d46d325de Remove gfree() from interface.c.
ib
parents: 33737
diff changeset
29 #include "gui/util/mem.h"
33737
71c29e8ec68f Move string functions from interface.c to string.c.
ib
parents: 33731
diff changeset
30 #include "gui/util/string.h"
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
31 #include "gui/wm/wsxdnd.h"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
32 #include "widgets.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
33
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
34 #include "config.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
35 #include "help_mp.h"
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
36 #include "input/input.h"
30653
3d23e24c5c60 Declare externally used variables from vd.c as extern in vd.h.
diego
parents: 29263
diff changeset
37 #include "libmpcodecs/vd.h"
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
38 #include "libvo/video_out.h"
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
39 #include "mp_core.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
41 int uiGotoTheNext = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
43 void uiFullScreen(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44 {
33960
1cd81338af07 Rework fullscreen handling.
ib
parents: 33957
diff changeset
45 if (!guiInfo.VideoWindow)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
46 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
47
33960
1cd81338af07 Rework fullscreen handling.
ib
parents: 33957
diff changeset
48 wsFullScreen(&guiApp.subWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49
33960
1cd81338af07 Rework fullscreen handling.
ib
parents: 33957
diff changeset
50 vo_fs = guiApp.subWindow.isFullScreen;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
52 wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.subWindow.isFullScreen);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
53
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
54 if (guiApp.menuIsPresent)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
55 wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.subWindow.isFullScreen);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
56
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
57 if (guiInfo.Playing)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
58 wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
59 else
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
60 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
63 void uiPlay(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
64 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
65 if (!guiInfo.Filename ||
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
66 (guiInfo.Filename[0] == 0) ||
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
67 (guiInfo.Playing == GUI_PLAY))
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
68 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
70 if (guiInfo.Playing == GUI_PAUSE) {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
71 uiPause();
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
72 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
73 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
74
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33725
diff changeset
75 gui(GUI_SET_STATE, (void *)GUI_PLAY);
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
76 uiSubRender = 0;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
77 wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
78 wsClearWindow(guiApp.subWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
81 void uiPause(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
83 if (!guiInfo.Playing)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
84 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
85
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
86 if (guiInfo.Playing == GUI_PLAY) {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
87 mp_cmd_t *cmd = calloc(1, sizeof(*cmd));
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
88 cmd->id = MP_CMD_PAUSE;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
89 cmd->name = strdup("pause");
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
90 mp_input_queue_cmd(cmd);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
91 } else
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
92 guiInfo.Playing = GUI_PLAY;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
95 void uiState(void)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
96 {
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
97 if (guiInfo.Playing == GUI_STOP || guiInfo.Playing == GUI_PAUSE) {
33978
81aaa1420337 Replace some btnModify() calls by btnSet().
ib
parents: 33960
diff changeset
98 btnSet(evPlaySwitchToPause, btnReleased);
81aaa1420337 Replace some btnModify() calls by btnSet().
ib
parents: 33960
diff changeset
99 btnSet(evPauseSwitchToPlay, btnDisabled);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
100 } else {
33978
81aaa1420337 Replace some btnModify() calls by btnSet().
ib
parents: 33960
diff changeset
101 btnSet(evPlaySwitchToPause, btnDisabled);
81aaa1420337 Replace some btnModify() calls by btnSet().
ib
parents: 33960
diff changeset
102 btnSet(evPauseSwitchToPlay, btnReleased);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
103 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
105
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
106 void uiRelSeek(float sec)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
107 {
32971
dc905c693b7a Choose informative variable names.
ib
parents: 32970
diff changeset
108 rel_seek_secs = sec;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
109 abs_seek_pos = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
110 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
111
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
112 void uiAbsSeek(float percent)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
113 {
32971
dc905c693b7a Choose informative variable names.
ib
parents: 32970
diff changeset
114 rel_seek_secs = percent / 100.0;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
115 abs_seek_pos = 3;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
116 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
118 void uiChangeSkin(char *name)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
119 {
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
120 int prev, bprev;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
121
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
122 prev = guiApp.menuIsPresent;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
123 bprev = guiApp.playbarIsPresent;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
124
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
125 mainVisible = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
126
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
127 if (skinRead(name) != 0) {
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
128 if (skinRead(skinName) != 0) {
32894
f01aafc5a961 Cosmetic: Adjust indent.
ib
parents: 32893
diff changeset
129 mainVisible = 1;
f01aafc5a961 Cosmetic: Adjust indent.
ib
parents: 32893
diff changeset
130 return;
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
131 }
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
132 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
133
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
134 // reload menu window
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
135
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
136 if (prev && guiApp.menuIsPresent) {
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
137 free(menuDrawBuffer);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
138 menuDrawBuffer = calloc(1, guiApp.menu.Bitmap.ImageSize);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
139
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
140 if (!menuDrawBuffer) {
33530
7ced3616af42 Revise some messages.
ib
parents: 33529
diff changeset
141 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
33768
cee9987bc81d Remove guiExit().
ib
parents: 33742
diff changeset
142 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
143 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
144
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
145 wsResizeWindow(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
146 wsResizeImage(&guiApp.menuWindow, guiApp.menu.width, guiApp.menu.height);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
147 wsSetShape(&guiApp.menuWindow, guiApp.menu.Mask.Image);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
148 wsVisibleWindow(&guiApp.menuWindow, wsHideWindow);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
149 } else
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
150 uiMenuInit();
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
151
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
152 // reload sub window
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
153
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
154 if (guiApp.sub.Bitmap.Image)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
155 wsResizeImage(&guiApp.subWindow, guiApp.sub.Bitmap.Width, guiApp.sub.Bitmap.Height);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
156
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
157 if (!guiApp.subWindow.isFullScreen && !guiInfo.Playing) {
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
158 wsResizeWindow(&guiApp.subWindow, guiApp.sub.width, guiApp.sub.height);
33993
57d711d3dcca Change parameter b of wsMoveWindow().
ib
parents: 33978
diff changeset
159 wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
160 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
161
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
162 if (guiApp.sub.Bitmap.Image)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
163 wsConvert(&guiApp.subWindow, guiApp.sub.Bitmap.Image);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
165 if (!guiInfo.Playing) {
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
166 uiSubRender = 1;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
167 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
168 wsClearWindow(guiApp.subWindow);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
169 wsPostRedisplay(&guiApp.subWindow);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
170 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
171
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
172 // reload playbar
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
173
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
174 if (bprev)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
175 wsDestroyWindow(&guiApp.playbarWindow);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
176
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
177 uiPlaybarInit();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
178
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
179 // reload main window
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
180
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
181 free(mainDrawBuffer);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
182 mainDrawBuffer = calloc(1, guiApp.main.Bitmap.ImageSize);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
184 if (!mainDrawBuffer) {
33530
7ced3616af42 Revise some messages.
ib
parents: 33529
diff changeset
185 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
33768
cee9987bc81d Remove guiExit().
ib
parents: 33742
diff changeset
186 mplayer(MPLAYER_EXIT_GUI, EXIT_ERROR, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
187 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
188
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
189 wsDestroyWindow(&guiApp.mainWindow);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
190
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
191 wsCreateWindow(&guiApp.mainWindow, guiApp.main.x, guiApp.main.y, guiApp.main.width, guiApp.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer");
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
192 wsCreateImage(&guiApp.mainWindow, guiApp.main.Bitmap.Width, guiApp.main.Bitmap.Height);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
193 wsSetShape(&guiApp.mainWindow, guiApp.main.Mask.Image);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
194 wsSetIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
195
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
196 guiApp.mainWindow.ReDraw = (void *)uiMainDraw;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
197 guiApp.mainWindow.MouseHandler = uiMainMouseHandle;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
198 guiApp.mainWindow.KeyHandler = uiMainKeyHandle;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
199 guiApp.mainWindow.DandDHandler = uiDandDHandler;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
200
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
201 wsXDNDMakeAwareness(&guiApp.mainWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
202
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
203 if (!guiApp.mainDecoration)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
204 wsWindowDecoration(&guiApp.mainWindow, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
205
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
206 wsVisibleWindow(&guiApp.mainWindow, wsShowWindow);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
207 mainVisible = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
208
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
209 btnModify(evSetVolume, guiInfo.Volume);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
210 btnModify(evSetBalance, guiInfo.Balance);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
211 btnModify(evSetMoviePosition, guiInfo.Position);
33978
81aaa1420337 Replace some btnModify() calls by btnSet().
ib
parents: 33960
diff changeset
212 btnSet(evFullScreen, (guiApp.subWindow.isFullScreen ? btnPressed : btnReleased));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
213
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
214 wsSetLayer(wsDisplay, guiApp.mainWindow.WindowID, guiApp.subWindow.isFullScreen);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
215 wsSetLayer(wsDisplay, guiApp.menuWindow.WindowID, guiApp.subWindow.isFullScreen);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
216 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
217
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
218 void uiSetFileName(char *dir, char *name, int type)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
219 {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
220 if (!name)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
221 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
222
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
223 if (!dir)
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33739
diff changeset
224 setdup(&guiInfo.Filename, name);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
225 else
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33739
diff changeset
226 setddup(&guiInfo.Filename, dir, name);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227
34064
54becc464788 Set MPlayer filename in uiSetFileName().
ib
parents: 33993
diff changeset
228 filename = guiInfo.Filename;
34399
f2c03009068d Don't explicitly set stream type if the type doesn't change.
ib
parents: 34387
diff changeset
229
f2c03009068d Don't explicitly set stream type if the type doesn't change.
ib
parents: 34387
diff changeset
230 if (type != SAME_STREAMTYPE)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
231 guiInfo.StreamType = type;
34064
54becc464788 Set MPlayer filename in uiSetFileName().
ib
parents: 33993
diff changeset
232
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33876
diff changeset
233 nfree(guiInfo.AudioFilename);
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33876
diff changeset
234 nfree(guiInfo.SubtitleFilename);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
235 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
236
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
237 void uiCurr(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
238 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
239 plItem *curr;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
240 int stop = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
241
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
242 if (guiInfo.Playing == GUI_PAUSE)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
243 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
244
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
245 switch (guiInfo.StreamType) {
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
246 #ifdef CONFIG_CDDA
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
247 case STREAMTYPE_CDDA:
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
248 break;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
249 #endif
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
250
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
251 #ifdef CONFIG_VCD
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
252 case STREAMTYPE_VCD:
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
253 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
254 #endif
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27370
diff changeset
255
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
256 #ifdef CONFIG_DVDREAD
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
257 case STREAMTYPE_DVD:
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
258 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
259 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
260
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
261 default:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
262
33742
e1539e14d60f Move purely list related parts of gtkSet() from interface.c to list.c.
ib
parents: 33740
diff changeset
263 curr = listSet(gtkGetCurrPlItem, NULL);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
264
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
265 if (curr) {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
266 uiSetFileName(curr->path, curr->name, STREAMTYPE_FILE);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
267 uiGotoTheNext = 0;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
268 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
269 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
270
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
271 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
272 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
273
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
274 if (stop)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
275 uiEventHandling(evStop, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
276
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
277 if (guiInfo.Playing == GUI_PLAY)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
278 uiEventHandling(evPlay, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
279 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
280
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
281 void uiPrev(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
282 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
283 plItem *prev;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
284 int stop = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
285
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
286 if (guiInfo.Playing == GUI_PAUSE)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
287 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
288
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
289 switch (guiInfo.StreamType) {
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
290 #ifdef CONFIG_CDDA
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
291 case STREAMTYPE_CDDA:
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
292 if (--guiInfo.Track == 0) {
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
293 guiInfo.Track = 1;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
294 stop = 1;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
295 }
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
296 break;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
297 #endif
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
298
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
299 #ifdef CONFIG_VCD
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
300 case STREAMTYPE_VCD:
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
301 if (--guiInfo.Track == 1) {
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
302 guiInfo.Track = 2;
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
303 stop = 1;
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
304 }
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
305 break;
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
306 #endif
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
307
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
308 #ifdef CONFIG_DVDREAD
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
309 case STREAMTYPE_DVD:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27370
diff changeset
310
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
311 if (--guiInfo.Chapter == 0) {
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
312 guiInfo.Chapter = 1;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
313
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
314 if (--guiInfo.Track <= 0) {
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
315 guiInfo.Track = 1;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
316 stop = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
317 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
318 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
319
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
320 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
321 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
322
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
323 default:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
324
33742
e1539e14d60f Move purely list related parts of gtkSet() from interface.c to list.c.
ib
parents: 33740
diff changeset
325 prev = listSet(gtkGetPrevPlItem, NULL);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
326
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
327 if (prev) {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
328 uiSetFileName(prev->path, prev->name, STREAMTYPE_FILE);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
329 uiGotoTheNext = 0;
33898
67790ce1185e Provide track information for playlists.
ib
parents: 33897
diff changeset
330 guiInfo.Track--;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
331 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
332 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
333
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
334 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
335 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
336
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
337 if (stop)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
338 uiEventHandling(evStop, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
339
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
340 if (guiInfo.Playing == GUI_PLAY)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
341 uiEventHandling(evPlay, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
342 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
343
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
344 void uiNext(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
345 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
346 int stop = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
347 plItem *next;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
348
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
349 if (guiInfo.Playing == GUI_PAUSE)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
350 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
351
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
352 switch (guiInfo.StreamType) {
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
353 #ifdef CONFIG_CDDA
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
354 case STREAMTYPE_CDDA:
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
355
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
356 if (++guiInfo.Track > guiInfo.Tracks) {
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
357 guiInfo.Track = guiInfo.Tracks;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
358 stop = 1;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
359 }
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
360
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
361 break;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
362 #endif
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34077
diff changeset
363
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
364 #ifdef CONFIG_VCD
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
365 case STREAMTYPE_VCD:
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
366
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
367 if (++guiInfo.Track >= guiInfo.Tracks) {
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
368 stop = (guiInfo.Track > guiInfo.Tracks);
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
369 guiInfo.Track = FFMAX(2, guiInfo.Tracks);
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
370 }
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
371
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
372 break;
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
373 #endif
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 34074
diff changeset
374
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
375 #ifdef CONFIG_DVDREAD
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
376 case STREAMTYPE_DVD:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
377
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
378 if (guiInfo.Chapter++ == guiInfo.Chapters) {
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
379 guiInfo.Chapter = 1;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
380
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
381 if (++guiInfo.Track > guiInfo.Tracks) {
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
382 guiInfo.Track = guiInfo.Tracks;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
383 stop = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
384 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
385 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
386
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
387 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
388 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
389
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
390 default:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
391
33742
e1539e14d60f Move purely list related parts of gtkSet() from interface.c to list.c.
ib
parents: 33740
diff changeset
392 next = listSet(gtkGetNextPlItem, NULL);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
393
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
394 if (next) {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
395 uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
396 uiGotoTheNext = 0;
33898
67790ce1185e Provide track information for playlists.
ib
parents: 33897
diff changeset
397 guiInfo.Track++;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
398 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
399 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
400
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
401 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
402 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
403
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
404 if (stop)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
405 uiEventHandling(evStop, 0);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
406
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
407 if (guiInfo.Playing == GUI_PLAY)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
408 uiEventHandling(evPlay, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
409 }