annotate gui/mplayer/play.c @ 33554:02d94048970e

build: Only compile DLL loader test program under x86_32.
author diego
date Sat, 18 Jun 2011 10:33:30 +0000
parents 55b8f5d5df15
children c5a19bbeac2b
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
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
22 #include "play.h"
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"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
28 #include "gui/wm/wsxdnd.h"
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
29 #include "widgets.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
31 #include "config.h"
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
32 #include "help_mp.h"
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
33 #include "input/input.h"
30653
3d23e24c5c60 Declare externally used variables from vd.c as extern in vd.h.
diego
parents: 29263
diff changeset
34 #include "libmpcodecs/vd.h"
26382
b2f4abcf20ed Make include paths consistent; do not use ../ in them.
diego
parents: 26365
diff changeset
35 #include "libvo/video_out.h"
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
36 #include "mp_core.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 #include "stream/stream.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
38
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
39 int mplGotoTheNext = 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
41 void mplFullScreen(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
43 if (guiIntfStruct.NoWindow && guiIntfStruct.Playing)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
44 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
45
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
46 if (guiIntfStruct.Playing && appMPlayer.subWindow.isFullScreen) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
47 appMPlayer.subWindow.OldWidth = guiIntfStruct.MovieWidth;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
48 appMPlayer.subWindow.OldHeight = guiIntfStruct.MovieHeight;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
49
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
50 switch (appMPlayer.sub.x) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
51 case -1:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
52 appMPlayer.subWindow.OldX = wsMaxX / 2 - appMPlayer.subWindow.OldWidth / 2 + wsOrgX;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
53 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
54
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
55 case -2:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
56 appMPlayer.subWindow.OldX = wsMaxX - appMPlayer.subWindow.OldWidth + wsOrgX;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
57 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
58
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
59 default:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
60 appMPlayer.subWindow.OldX = appMPlayer.sub.x;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
61 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
62 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
64 switch (appMPlayer.sub.y) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
65 case -1:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
66 appMPlayer.subWindow.OldY = wsMaxY / 2 - appMPlayer.subWindow.OldHeight / 2 + wsOrgY;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
67 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
68
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
69 case -2:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
70 appMPlayer.subWindow.OldY = wsMaxY - appMPlayer.subWindow.OldHeight + wsOrgY;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
71 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
73 default:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
74 appMPlayer.subWindow.OldY = appMPlayer.sub.y;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
75 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
76 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
77 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
78
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
79 if (guiIntfStruct.Playing || gtkShowVideoWindow)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
80 wsFullScreen(&appMPlayer.subWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
81
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
82 fullscreen = vo_fs = appMPlayer.subWindow.isFullScreen;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
83 wsSetLayer(wsDisplay, appMPlayer.mainWindow.WindowID, appMPlayer.subWindow.isFullScreen);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
84
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
85 if (appMPlayer.menuIsPresent)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
86 wsSetLayer(wsDisplay, appMPlayer.menuWindow.WindowID, appMPlayer.subWindow.isFullScreen);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
87
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
88 if (guiIntfStruct.Playing)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
89 wsSetBackgroundRGB(&appMPlayer.subWindow, 0, 0, 0);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
90 else
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
91 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
94 void mplEnd(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
96 plItem *next;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
98 if (!mplGotoTheNext && guiIntfStruct.Playing) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
99 mplGotoTheNext = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
100 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
101 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
103 if (guiIntfStruct.Playing && (next = gtkSet(gtkGetNextPlItem, 0, NULL)) && (plLastPlayed != next)) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
104 plLastPlayed = next;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
105 guiSetDF(guiIntfStruct.Filename, next->path, next->name);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
106 guiIntfStruct.StreamType = STREAMTYPE_FILE;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
107 guiIntfStruct.FilenameChanged = guiIntfStruct.NewPlay = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
108 gfree((void **)&guiIntfStruct.AudioFile);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
109 gfree((void **)&guiIntfStruct.Subtitlename);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
110 } else {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
111 if (guiIntfStruct.FilenameChanged || guiIntfStruct.NewPlay)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
112 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
113
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
114 guiIntfStruct.TimeSec = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
115 guiIntfStruct.Position = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
116 guiIntfStruct.AudioType = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
117 guiIntfStruct.NoWindow = False;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
118
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
119 #ifdef CONFIG_DVDREAD
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
120 guiIntfStruct.DVD.current_title = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
121 guiIntfStruct.DVD.current_chapter = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
122 guiIntfStruct.DVD.current_angle = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
123 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
124
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
125 if (!appMPlayer.subWindow.isFullScreen && gtkShowVideoWindow) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
126 wsResizeWindow(&appMPlayer.subWindow, appMPlayer.sub.width, appMPlayer.sub.height);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
127 wsMoveWindow(&appMPlayer.subWindow, True, appMPlayer.sub.x, appMPlayer.sub.y);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
128 } else
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
129 wsVisibleWindow(&appMPlayer.subWindow, wsHideWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
130
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
131 guiGetEvent(guiCEvent, guiSetStop);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
132 mplSubRender = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
133 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
134 wsClearWindow(appMPlayer.subWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
135 wsPostRedisplay(&appMPlayer.subWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
137 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
138
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
139 void mplPlay(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
140 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
141 if (!guiIntfStruct.Filename ||
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
142 (guiIntfStruct.Filename[0] == 0) ||
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
143 (guiIntfStruct.Playing == 1))
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
144 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
145
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
146 if (guiIntfStruct.Playing == 2) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
147 mplPause();
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
148 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
149 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
150
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
151 guiGetEvent(guiCEvent, (void *)guiSetPlay);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
152 mplSubRender = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
153 wsSetBackgroundRGB(&appMPlayer.subWindow, 0, 0, 0);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
154 wsClearWindow(appMPlayer.subWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
155 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
156
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
157 void mplPause(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
159 if (!guiIntfStruct.Playing)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
160 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
161
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
162 if (guiIntfStruct.Playing == 1) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
163 mp_cmd_t *cmd = calloc(1, sizeof(*cmd));
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
164 cmd->id = MP_CMD_PAUSE;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
165 cmd->name = strdup("pause");
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
166 mp_input_queue_cmd(cmd);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
167 } else
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
168 guiIntfStruct.Playing = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
169 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
171 void mplState(void)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
172 {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
173 if (guiIntfStruct.Playing == 0 || guiIntfStruct.Playing == 2) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
174 btnModify(evPlaySwitchToPause, btnReleased);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
175 btnModify(evPauseSwitchToPlay, btnDisabled);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
176 } else {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
177 btnModify(evPlaySwitchToPause, btnDisabled);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
178 btnModify(evPauseSwitchToPlay, btnReleased);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
179 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181
32971
dc905c693b7a Choose informative variable names.
ib
parents: 32970
diff changeset
182 void mplRelSeek(float sec)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
183 {
32971
dc905c693b7a Choose informative variable names.
ib
parents: 32970
diff changeset
184 rel_seek_secs = sec;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
185 abs_seek_pos = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
186 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
187
32971
dc905c693b7a Choose informative variable names.
ib
parents: 32970
diff changeset
188 void mplAbsSeek(float percent)
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
189 {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
190 if (guiIntfStruct.StreamType == STREAMTYPE_STREAM)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
191 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
192
32971
dc905c693b7a Choose informative variable names.
ib
parents: 32970
diff changeset
193 rel_seek_secs = percent / 100.0;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
194 abs_seek_pos = 3;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
195 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
196
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
197 void ChangeSkin(char *name)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198 {
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
199 int prev, bprev;
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
200
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
201 prev = appMPlayer.menuIsPresent;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
202 bprev = appMPlayer.barIsPresent;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
203
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
204 mainVisible = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
205
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
206 if (skinRead(name) != 0) {
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
207 if (skinRead(skinName) != 0) {
32894
f01aafc5a961 Cosmetic: Adjust indent.
ib
parents: 32893
diff changeset
208 mainVisible = 1;
f01aafc5a961 Cosmetic: Adjust indent.
ib
parents: 32893
diff changeset
209 return;
32893
c873777e957d Get rid of needless listItems variable and pointer.
ib
parents: 32882
diff changeset
210 }
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
211 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
212
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
213 // reload menu window
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
214
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
215 if (prev && appMPlayer.menuIsPresent) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
216 free(mplMenuDrawBuffer);
33084
b8779b19730e Cosmetic: Rename menuBase menu.
ib
parents: 33003
diff changeset
217 mplMenuDrawBuffer = calloc(1, appMPlayer.menu.Bitmap.ImageSize);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
218
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
219 if (!mplMenuDrawBuffer) {
33530
7ced3616af42 Revise some messages.
ib
parents: 33529
diff changeset
220 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
7ced3616af42 Revise some messages.
ib
parents: 33529
diff changeset
221 guiExit(EXIT_ERROR);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
222 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
223
33084
b8779b19730e Cosmetic: Rename menuBase menu.
ib
parents: 33003
diff changeset
224 wsResizeWindow(&appMPlayer.menuWindow, appMPlayer.menu.width, appMPlayer.menu.height);
b8779b19730e Cosmetic: Rename menuBase menu.
ib
parents: 33003
diff changeset
225 wsResizeImage(&appMPlayer.menuWindow, appMPlayer.menu.width, appMPlayer.menu.height);
b8779b19730e Cosmetic: Rename menuBase menu.
ib
parents: 33003
diff changeset
226 wsSetShape(&appMPlayer.menuWindow, appMPlayer.menu.Mask.Image);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
227 wsVisibleWindow(&appMPlayer.menuWindow, wsHideWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
228 } else
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
229 mplMenuInit();
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
230
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
231 // reload sub window
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
232
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
233 if (appMPlayer.sub.Bitmap.Image)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
234 wsResizeImage(&appMPlayer.subWindow, appMPlayer.sub.Bitmap.Width, appMPlayer.sub.Bitmap.Height);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
235
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
236 if (!appMPlayer.subWindow.isFullScreen && !guiIntfStruct.Playing) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
237 wsResizeWindow(&appMPlayer.subWindow, appMPlayer.sub.width, appMPlayer.sub.height);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
238 wsMoveWindow(&appMPlayer.subWindow, True, appMPlayer.sub.x, appMPlayer.sub.y);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
239 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
240
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
241 if (appMPlayer.sub.Bitmap.Image)
33548
55b8f5d5df15 Remove unused parameter 'Size' in wsConvert().
ib
parents: 33530
diff changeset
242 wsConvert(&appMPlayer.subWindow, appMPlayer.sub.Bitmap.Image);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
243
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
244 if (!guiIntfStruct.Playing) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
245 mplSubRender = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
246 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
247 wsClearWindow(appMPlayer.subWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
248 wsPostRedisplay(&appMPlayer.subWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
249 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
250
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
251 // reload play bar
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
252
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
253 if (bprev)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
254 wsDestroyWindow(&appMPlayer.barWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
255
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
256 mplPBInit();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
257
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
258 // reload main window
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
259
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
260 free(mplDrawBuffer);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
261 mplDrawBuffer = calloc(1, appMPlayer.main.Bitmap.ImageSize);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
262
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
263 if (!mplDrawBuffer) {
33530
7ced3616af42 Revise some messages.
ib
parents: 33529
diff changeset
264 gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_NEMDB);
7ced3616af42 Revise some messages.
ib
parents: 33529
diff changeset
265 guiExit(EXIT_ERROR);
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
266 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
267
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
268 wsDestroyWindow(&appMPlayer.mainWindow);
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 wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsMaxSize | wsHideWindow, "MPlayer");
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
271 wsCreateImage(&appMPlayer.mainWindow, appMPlayer.main.Bitmap.Width, appMPlayer.main.Bitmap.Height);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
272 wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image);
33529
276eef06fb3d Store icon data in a struct variable.
ib
parents: 33482
diff changeset
273 wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, &guiIcon);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
274
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
275 appMPlayer.mainWindow.ReDraw = (void *)mplMainDraw;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
276 appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
277 appMPlayer.mainWindow.KeyHandler = mplMainKeyHandle;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
278 appMPlayer.mainWindow.DandDHandler = mplDandDHandler;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
279
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
280 wsXDNDMakeAwareness(&appMPlayer.mainWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
281
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
282 if (!appMPlayer.mainDecoration)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
283 wsWindowDecoration(&appMPlayer.mainWindow, 0);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
284
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
285 wsVisibleWindow(&appMPlayer.mainWindow, wsShowWindow);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
286 mainVisible = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
287
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
288 btnModify(evSetVolume, guiIntfStruct.Volume);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
289 btnModify(evSetBalance, guiIntfStruct.Balance);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
290 btnModify(evSetMoviePosition, guiIntfStruct.Position);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
291 btnModify(evFullScreen, !appMPlayer.subWindow.isFullScreen);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
292
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
293 wsSetLayer(wsDisplay, appMPlayer.mainWindow.WindowID, appMPlayer.subWindow.isFullScreen);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
294 wsSetLayer(wsDisplay, appMPlayer.menuWindow.WindowID, appMPlayer.subWindow.isFullScreen);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
295 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
296
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
297 void mplSetFileName(char *dir, char *name, int type)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
298 {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
299 if (!name)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
300 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
301
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
302 if (!dir)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
303 guiSetFilename(guiIntfStruct.Filename, name)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
304 else
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
305 guiSetDF(guiIntfStruct.Filename, dir, name)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
306
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
307 guiIntfStruct.StreamType = type;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
308 gfree((void **)&guiIntfStruct.AudioFile);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
309 gfree((void **)&guiIntfStruct.Subtitlename);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
310 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
311
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
312 void mplCurr(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
313 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
314 plItem *curr;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
315 int stop = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
316
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
317 if (guiIntfStruct.Playing == 2)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
318 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
319
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
320 switch (guiIntfStruct.StreamType) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
321 #ifdef CONFIG_DVDREAD
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
322 case STREAMTYPE_DVD:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
323 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
324 #endif
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27370
diff changeset
325
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27341
diff changeset
326 #ifdef CONFIG_VCD
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
327 case STREAMTYPE_VCD:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
328 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
329 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
330
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
331 default:
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 curr = gtkSet(gtkGetCurrPlItem, 0, NULL);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
334
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
335 if (curr) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
336 mplSetFileName(curr->path, curr->name, STREAMTYPE_FILE);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
337 mplGotoTheNext = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
338 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
339 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
340
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
341 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
342 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
343
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
344 if (stop)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
345 mplEventHandling(evStop, 0);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
346
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
347 if (guiIntfStruct.Playing == 1)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
348 mplEventHandling(evPlay, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
349 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
350
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
351 void mplPrev(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
352 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
353 plItem *prev;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
354 int stop = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
355
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
356 if (guiIntfStruct.Playing == 2)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
357 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
358
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
359 switch (guiIntfStruct.StreamType) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
360 #ifdef CONFIG_DVDREAD
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
361 case STREAMTYPE_DVD:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27370
diff changeset
362
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
363 if (--guiIntfStruct.DVD.current_chapter == 0) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
364 guiIntfStruct.DVD.current_chapter = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
365
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
366 if (--guiIntfStruct.DVD.current_title <= 0) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
367 guiIntfStruct.DVD.current_title = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
368 stop = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
369 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
370 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
371
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
372 guiIntfStruct.Track = guiIntfStruct.DVD.current_title;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
373 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
374 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
375
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27341
diff changeset
376 #ifdef CONFIG_VCD
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
377 case STREAMTYPE_VCD:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
378 if (--guiIntfStruct.Track == 0) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
379 guiIntfStruct.Track = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
380 stop = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
381 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
382 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
383 #endif
32881
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 default:
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 prev = gtkSet(gtkGetPrevPlItem, 0, NULL);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
388
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
389 if (prev) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
390 mplSetFileName(prev->path, prev->name, STREAMTYPE_FILE);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
391 mplGotoTheNext = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
392 break;
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
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
395 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
396 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
397
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
398 if (stop)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
399 mplEventHandling(evStop, 0);
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 if (guiIntfStruct.Playing == 1)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
402 mplEventHandling(evPlay, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
403 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
404
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
405 void mplNext(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
406 {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
407 int stop = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
408 plItem *next;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
409
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
410 if (guiIntfStruct.Playing == 2)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
411 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
412
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
413 switch (guiIntfStruct.StreamType) {
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
414 #ifdef CONFIG_DVDREAD
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
415 case STREAMTYPE_DVD:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
416
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
417 if (guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
418 guiIntfStruct.DVD.current_chapter = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
419
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
420 if (++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
421 guiIntfStruct.DVD.current_title = guiIntfStruct.DVD.titles;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
422 stop = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
423 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
424 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
425
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
426 guiIntfStruct.Track = guiIntfStruct.DVD.current_title;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
427 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
428 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
429
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27341
diff changeset
430 #ifdef CONFIG_VCD
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
431 case STREAMTYPE_VCD:
33003
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
432
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
433 if (++guiIntfStruct.Track >= guiIntfStruct.VCDTracks) {
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
434 guiIntfStruct.Track = guiIntfStruct.VCDTracks;
33003
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
435
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
436 if (guiIntfStruct.VCDTracks > 1)
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
437 guiIntfStruct.Track--;
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
438
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
439 stop = 1;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
440 }
33003
ccf1cb01d6a8 Correct next track button functionality for VCDs.
ib
parents: 32971
diff changeset
441
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
442 break;
32953
5e58be6ff558 Cosmetic: Separate #endif from following line.
ib
parents: 32894
diff changeset
443 #endif
32881
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
444
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
445 default:
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
446
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
447 next = gtkSet(gtkGetNextPlItem, 0, NULL);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
448
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
449 if (next) {
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
450 mplSetFileName(next->path, next->name, STREAMTYPE_FILE);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
451 mplGotoTheNext = 0;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
452 break;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
453 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
454
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
455 return;
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
456 }
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
457
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
458 if (stop)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
459 mplEventHandling(evStop, 0);
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
460
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
461 if (guiIntfStruct.Playing == 1)
dd3b365972a4 Cosmetic: Format to MPlayer coding style.
ib
parents: 32537
diff changeset
462 mplEventHandling(evPlay, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
463 }
33482
7e41f14e7778 Fix segmentation fault when pressing U (stop playing) in GUI.
ib
parents: 33084
diff changeset
464
7e41f14e7778 Fix segmentation fault when pressing U (stop playing) in GUI.
ib
parents: 33084
diff changeset
465 void mplStop(void)
7e41f14e7778 Fix segmentation fault when pressing U (stop playing) in GUI.
ib
parents: 33084
diff changeset
466 {
7e41f14e7778 Fix segmentation fault when pressing U (stop playing) in GUI.
ib
parents: 33084
diff changeset
467 mplEventHandling(evStop, 0);
7e41f14e7778 Fix segmentation fault when pressing U (stop playing) in GUI.
ib
parents: 33084
diff changeset
468 }