annotate gui/interface.c @ 33005:d116366f3523

Remove unused variable vcd_track.
author ib
date Mon, 21 Mar 2011 19:21:32 +0000
parents d14cac89630d
children 66d908462d76
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
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: 25851
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
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: 25851
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25851
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
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
22 #include "interface.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
23 #include "app.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
24 #include "mplayer/gmplayer.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
25 #include "mplayer/widgets.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
26 #include "skin/skin.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27 #include "wm/ws.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28 #include "wm/wsxdnd.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 #include "access_mpcontext.h"
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
31 #include "config.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32 #include "help_mp.h"
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
33 #include "input/input.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
34 #include "libaf/equalizer.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
35 #include "libao2/audio_out.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
36 #include "libmpcodecs/dec_audio.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
37 #include "libmpcodecs/dec_video.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
38 #include "libmpcodecs/vd.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
39 #include "libmpcodecs/vf.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
40 #include "libvo/video_out.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
41 #include "libvo/x11_common.h"
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
42 #include "mixer.h"
30516
f4e017b6921a Fix exit_player() usage throughout the codebase.
diego
parents: 30063
diff changeset
43 #include "mp_core.h"
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
44 #include "mp_msg.h"
32032
52b0385d2d7a Move **sub_name extern declaration to mpcommon.h.
diego
parents: 32030
diff changeset
45 #include "mpcommon.h"
30536
39a4dd7ec420 Move GUI-related extern declarations to a GUI header file.
diego
parents: 30535
diff changeset
46 #include "mplayer.h"
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
47 #include "path.h"
32466
9e627a1793b1 Move font_load.[ch], font_load_ft.c and osd_font.h from libvo to sub.
cigaes
parents: 32461
diff changeset
48 #include "sub/font_load.h"
32467
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents: 32466
diff changeset
49 #include "sub/sub.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
51 #ifdef CONFIG_DVDREAD
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 #include "stream/stream_dvd.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
55 guiInterface_t guiIntfStruct;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
57 int guiWinID = -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58
32900
1481268ccd30 Move global skin directory variables.
ib
parents: 32847
diff changeset
59 char *skinName;
1481268ccd30 Move global skin directory variables.
ib
parents: 32847
diff changeset
60 char *skinDirInHome;
1481268ccd30 Move global skin directory variables.
ib
parents: 32847
diff changeset
61 char *skinMPlayerDir;
1481268ccd30 Move global skin directory variables.
ib
parents: 32847
diff changeset
62
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
63 plItem *plCurrent = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
64 plItem *plList = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
65 plItem *plLastPlayed = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
66
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
67 URLItem *URLList = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
68
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
69 char *fsHistory[fsPersistant_MaxPos] = { NULL, NULL, NULL, NULL, NULL };
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
70
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
71 float gtkEquChannels[6][10];
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
72
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
73 int gstrcmp(const char *a, const char *b)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
75 if (!a && !b)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
76 return 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
77 if (!a || !b)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
78 return -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
80 return strcmp(a, b);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
83 static int gstrncmp(const char *a, const char *b, int size)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
85 if (!a && !b)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
86 return 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
87 if (!a || !b)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
88 return -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
89
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
90 return strncmp(a, b, size);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
93 char *gstrdup(const char *str)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
95 if (!str)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
96 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
97
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
98 return strdup(str);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
99 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
100
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
101 char *gstrchr(char *str, int c)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
103 if (!str)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
104 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
105
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
106 return strchr(str, c);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
107 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
108
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
109 void gfree(void **p)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
110 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
111 free(*p);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
112 *p = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
113 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
114
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
115 /**
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
116 * \brief This actually creates a new list containing only one element...
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117 */
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
118 void gaddlist(char ***list, const char *entry)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
119 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
120 int i;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
121
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
122 if (*list) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
123 for (i = 0; (*list)[i]; i++)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
124 free((*list)[i]);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
125
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
126 free(*list);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
127 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
128
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
129 *list = malloc(2 * sizeof(char **));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
130 (*list)[0] = gstrdup(entry);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
131 (*list)[1] = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
132 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
134 /**
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
135 * \brief This replaces a string starting with search by replace.
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 * If not found, replace is appended.
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
137 */
30535
016e5fc1dead GUI: Mark functions that are not used outside their files as static.
diego
parents: 30516
diff changeset
138 static void greplace(char ***list, const char *search, const char *replace)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
139 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
140 int i = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
141 int len = (search ? strlen(search) : 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
142
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
143 if (*list) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
144 for (i = 0; (*list)[i]; i++) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
145 if (search && (strncmp((*list)[i], search, len) == 0)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
146 free((*list)[i]);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
147 (*list)[i] = gstrdup(replace);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
148 return;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
149 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
150 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
152 *list = realloc(*list, (i + 2) * sizeof(char *));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
153 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
154 *list = malloc(2 * sizeof(char *));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
155
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
156 (*list)[i] = gstrdup(replace);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
157 (*list)[i + 1] = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
159
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
160 void guiInit(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
162 int i;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
164 memset(&guiIntfStruct, 0, sizeof(guiIntfStruct));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
165 guiIntfStruct.Balance = 50.0f;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
166 guiIntfStruct.StreamType = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
167
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
168 appInitStruct();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
169
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
170 memset(&gtkEquChannels, 0, sizeof(gtkEquChannels));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
171
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
172 #ifdef CONFIG_DXR3
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
173 if (!gtkDXR3Device)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
174 gtkDXR3Device = strdup("/dev/em8300-0");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
175 #endif
32927
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32900
diff changeset
176
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
177 if (stream_cache_size > 0) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
178 gtkCacheOn = 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
179 gtkCacheSize = stream_cache_size;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
180 } else if (stream_cache_size == 0)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
181 gtkCacheOn = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
182
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
183 if (autosync && (autosync != gtkAutoSync)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
184 gtkAutoSyncOn = 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
185 gtkAutoSync = autosync;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
186 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
187
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
188 #ifdef CONFIG_ASS
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
189 gtkASS.enabled = ass_enabled;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
190 gtkASS.use_margins = ass_use_margins;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
191 gtkASS.top_margin = ass_top_margin;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
192 gtkASS.bottom_margin = ass_bottom_margin;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
193 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
194
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
195 gtkInit();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
196
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
197 // initialize X
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
198 wsXInit((void *)mDisplay);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
199
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
200 // load skin
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
201
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
202 skinDirInHome = get_path("skins");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
203 skinMPlayerDir = MPLAYER_DATADIR "/skins";
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
204
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
205 mp_msg(MSGT_GPLAYER, MSGL_V, "SKIN dir 1: '%s'\n", skinDirInHome);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
206 mp_msg(MSGT_GPLAYER, MSGL_V, "SKIN dir 2: '%s'\n", skinMPlayerDir);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
207
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
208 if (!skinName)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
209 skinName = strdup("default");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
210
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
211 i = skinRead(skinName);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
212
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
213 if (i == -1 && strcmp(skinName, "default") != 0) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
214 mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_SKIN_SKINCFG_SelectedSkinNotFound, skinName);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
215
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
216 skinName = strdup("default");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
217 i = skinRead(skinName);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
218 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
219
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
220 switch (i) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
221 case -1:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
222 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SKINCFG_SkinNotFound, skinName);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
223 exit(0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
225 case -2:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
226 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_SKIN_SKINCFG_SkinCfgReadError, skinName);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
227 exit(0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
228 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
229
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
230 // initialize windows
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
231
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
232 mplDrawBuffer = malloc(appMPlayer.main.Bitmap.ImageSize);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
233
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
234 if (!mplDrawBuffer) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
235 fprintf(stderr, MSGTR_NEMDB); // NOTE TO MYSELF: (g)mp_msg this
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
236 exit(0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
237 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
238
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
239 if (gui_save_pos) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
240 appMPlayer.main.x = gui_main_pos_x;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
241 appMPlayer.main.y = gui_main_pos_y;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
242 appMPlayer.sub.x = gui_sub_pos_x;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
243 appMPlayer.sub.y = gui_sub_pos_y;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
244 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
245
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
246 if (WinID > 0) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
247 appMPlayer.subWindow.Parent = WinID;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
248 appMPlayer.sub.x = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
249 appMPlayer.sub.y = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
250 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
251
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
252 if (guiWinID >= 0)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
253 appMPlayer.mainWindow.Parent = guiWinID;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
254
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
255 wsCreateWindow(&appMPlayer.subWindow, appMPlayer.sub.x, appMPlayer.sub.y, appMPlayer.sub.width, appMPlayer.sub.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, wsShowFrame | wsHideWindow, "MPlayer - Video");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
256 wsDestroyImage(&appMPlayer.subWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
257 wsCreateImage(&appMPlayer.subWindow, appMPlayer.sub.Bitmap.Width, appMPlayer.sub.Bitmap.Height);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
258 wsXDNDMakeAwareness(&appMPlayer.subWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
259
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
260 mplMenuInit();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
261 mplPBInit();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
262
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
263 // i=wsHideFrame|wsMaxSize|wsHideWindow;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
264 // if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
265 i = wsShowFrame | wsMaxSize | wsHideWindow;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
266 wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, i, "MPlayer");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
267 wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
268 wsXDNDMakeAwareness(&appMPlayer.mainWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
269
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
270 #ifdef DEBUG
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
271 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] depth on screen: %d\n", wsDepthOnScreen);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
272 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] parent: 0x%x\n", (int)appMPlayer.mainWindow.WindowID);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
273 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] sub: 0x%x\n", (int)appMPlayer.subWindow.WindowID);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
274 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
275
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
276 appMPlayer.mainWindow.ReDraw = (void *)mplMainDraw;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
277 appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
278 appMPlayer.mainWindow.KeyHandler = mplMainKeyHandle;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
279 appMPlayer.mainWindow.DandDHandler = mplDandDHandler;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
280
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
281 appMPlayer.subWindow.ReDraw = (void *)mplSubDraw;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
282 appMPlayer.subWindow.MouseHandler = mplSubMouseHandle;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
283 appMPlayer.subWindow.KeyHandler = mplMainKeyHandle;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
284 appMPlayer.subWindow.DandDHandler = mplDandDHandler;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
285
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
286 wsSetBackgroundRGB(&appMPlayer.subWindow, appMPlayer.sub.R, appMPlayer.sub.G, appMPlayer.sub.B);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
287 wsClearWindow(appMPlayer.subWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
288
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
289 if (appMPlayer.sub.Bitmap.Image)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
290 wsConvert(&appMPlayer.subWindow, appMPlayer.sub.Bitmap.Image, appMPlayer.sub.Bitmap.ImageSize);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
291
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
292 btnModify(evSetVolume, guiIntfStruct.Volume);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
293 btnModify(evSetBalance, guiIntfStruct.Balance);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
294 btnModify(evSetMoviePosition, guiIntfStruct.Position);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
295
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
296 wsSetIcon(wsDisplay, appMPlayer.mainWindow.WindowID, guiIcon, guiIconMask);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
297 wsSetIcon(wsDisplay, appMPlayer.subWindow.WindowID, guiIcon, guiIconMask);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
298
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
299 guiIntfStruct.Playing = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
300
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
301 if (!appMPlayer.mainDecoration)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
302 wsWindowDecoration(&appMPlayer.mainWindow, 0);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
303
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
304 wsVisibleWindow(&appMPlayer.mainWindow, wsShowWindow);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
305
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
306 #if 0
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
307 wsVisibleWindow(&appMPlayer.subWindow, wsShowWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
308 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
309 XEvent xev;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
310
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
311 do
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
312 XNextEvent(wsDisplay, &xev);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
313 while (xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
314
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
315 appMPlayer.subWindow.Mapped = wsMapped;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
316 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
317
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
318 if (!fullscreen)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
319 fullscreen = gtkLoadFullscreen;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
320
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
321 if (fullscreen) {
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
322 mplFullScreen();
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
323 btnModify(evFullScreen, btnPressed);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
324 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
325 #else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
326 if (!fullscreen)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
327 fullscreen = gtkLoadFullscreen;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
328
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
329 if (gtkShowVideoWindow) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
330 wsVisibleWindow(&appMPlayer.subWindow, wsShowWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
331 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
332 XEvent xev;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
333
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
334 do
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
335 XNextEvent(wsDisplay, &xev);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
336 while (xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
337
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
338 appMPlayer.subWindow.Mapped = wsMapped;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
339 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
340
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
341 if (fullscreen) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
342 mplFullScreen();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
343 btnModify(evFullScreen, btnPressed);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
344 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
345 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
346 if (fullscreen) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
347 wsVisibleWindow(&appMPlayer.subWindow, wsShowWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
348 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
349 XEvent xev;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
350
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
351 do
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
352 XNextEvent(wsDisplay, &xev);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
353 while (xev.type != MapNotify || xev.xmap.event != appMPlayer.subWindow.WindowID);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
354
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
355 appMPlayer.subWindow.Mapped = wsMapped;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
356 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
357 wsVisibleWindow(&appMPlayer.subWindow, wsShowWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
358 mplFullScreen();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
359 btnModify(evFullScreen, btnPressed);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
360 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
361 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
362 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
363
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
364 mplSubRender = 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
365
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
366 if (filename)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
367 mplSetFileName(NULL, filename, STREAMTYPE_FILE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
368
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
369 if (plCurrent && !filename)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
370 mplSetFileName(plCurrent->path, plCurrent->name, STREAMTYPE_FILE);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
371
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
372 if (subdata)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
373 guiSetFilename(guiIntfStruct.Subtitlename, subdata->filename);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
374
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
375 guiLoadFont();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
376 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
377
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
378 void guiDone(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
379 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
380 mplMainRender = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
381
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
382 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] done.\n");
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
383
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
384 if (gui_save_pos) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
385 gui_main_pos_x = appMPlayer.mainWindow.X;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
386 gui_main_pos_y = appMPlayer.mainWindow.Y;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
387 gui_sub_pos_x = appMPlayer.subWindow.X;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
388 gui_sub_pos_y = appMPlayer.subWindow.Y;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
389 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
390
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
391 #ifdef CONFIG_ASS
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
392 ass_enabled = gtkASS.enabled;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
393 ass_use_margins = gtkASS.use_margins;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
394 ass_top_margin = gtkASS.top_margin;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
395 ass_bottom_margin = gtkASS.bottom_margin;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
396 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
397
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
398 cfg_write();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
399 wsXDone();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
400 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
401
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
402 void guiLoadFont(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
403 {
27393
4876c89bafdd Rename font-related preprocessor directives.
diego
parents: 27390
diff changeset
404 #ifdef CONFIG_FREETYPE
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
405 load_font_ft(vo_image_width, vo_image_height, &vo_font, font_name, osd_font_scale_factor);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
406 #else
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
407 if (vo_font) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
408 int i;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
409
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
410 free(vo_font->name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
411 free(vo_font->fpath);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
412
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
413 for (i = 0; i < 16; i++) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
414 if (vo_font->pic_a[i]) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
415 free(vo_font->pic_a[i]->bmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
416 free(vo_font->pic_a[i]->pal);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
417 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
418 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
419
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
420 for (i = 0; i < 16; i++) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
421 if (vo_font->pic_b[i]) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
422 free(vo_font->pic_b[i]->bmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
423 free(vo_font->pic_b[i]->pal);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
424 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
425 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
426
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
427 free(vo_font);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
428 vo_font = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
429 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
430
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
431 if (font_name) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
432 vo_font = read_font_desc(font_name, font_factor, 0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
433
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
434 if (!vo_font)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
435 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CantLoadFont, font_name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
436 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
437 font_name = gstrdup(get_path("font/font.desc"));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
438 vo_font = read_font_desc(font_name, font_factor, 0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
439
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
440 if (!vo_font) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
441 gfree((void **)&font_name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
442 font_name = gstrdup(MPLAYER_DATADIR "/font/font.desc");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
443 vo_font = read_font_desc(font_name, font_factor, 0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
444 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
445 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
446 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
447 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
448
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
449 void guiLoadSubtitle(char *name)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
450 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
451 if (guiIntfStruct.Playing == 0) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
452 guiIntfStruct.SubtitleChanged = 1; // what is this for? (mw)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
453 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
454 }
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
455
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
456 if (subdata) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
457 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_DeletingSubtitles);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
458
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
459 sub_free(subdata);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
460 subdata = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
461 vo_sub = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
462
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
463 if (vo_osd_list) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
464 int len;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
465 mp_osd_obj_t *osd;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
466
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
467 osd = vo_osd_list;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
468
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
469 while (osd) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
470 if (osd->type == OSDTYPE_SUBTITLE)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
471 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
472
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
473 osd = osd->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
474 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
475
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
476 if (osd && (osd->flags & OSDFLAG_VISIBLE)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
477 len = osd->stride * (osd->bbox.y2 - osd->bbox.y1);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
478 memset(osd->bitmap_buffer, 0, len);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
479 memset(osd->alpha_buffer, 0, len);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
480 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
481 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
482 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
483
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
484 if (name) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
485 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_LoadingSubtitles, name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
486
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
487 subdata = sub_read_file(name, guiIntfStruct.FPS);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
488
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
489 if (!subdata)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
490 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub, name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
491
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
492 sub_name = (malloc(2 * sizeof(char *))); // when mplayer will be restarted
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
493 sub_name[0] = strdup(name); // sub_name[0] will be read
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
494 sub_name[1] = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
495 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
496
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
497 update_set_of_subtitles();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
498 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
499
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
500 static void add_vf(char *str)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
501 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
502 void *p;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
503
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
504 if (vf_settings) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
505 int i = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
506
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
507 while (vf_settings[i].name) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
508 if (!gstrcmp(vf_settings[i++].name, str)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
509 i = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
510 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
511 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
512 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
513
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
514 if (i != -1) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
515 p = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t));
32712
6ff3cc81d602 Fix resource leaks and check for realloc failures
ib
parents: 32543
diff changeset
516
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
517 if (!p)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
518 return;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
519
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
520 vf_settings = p;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
521 vf_settings[i].name = strdup(str);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
522 vf_settings[i].attribs = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
523 vf_settings[i + 1].name = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
524 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
525 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
526 vf_settings = malloc(2 * sizeof(m_obj_settings_t));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
527 vf_settings[0].name = strdup(str);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
528 vf_settings[0].attribs = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
529 vf_settings[1].name = NULL;
32712
6ff3cc81d602 Fix resource leaks and check for realloc failures
ib
parents: 32543
diff changeset
530 }
6ff3cc81d602 Fix resource leaks and check for realloc failures
ib
parents: 32543
diff changeset
531
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
532 mp_msg(MSGT_GPLAYER, MSGL_STATUS, MSGTR_AddingVideoFilter, str);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
533 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
534
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
535 static void remove_vf(char *str)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
536 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
537 int n = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
538
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
539 if (!vf_settings)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
540 return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
541
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
542 mp_msg(MSGT_GPLAYER, MSGL_STATUS, MSGTR_RemovingVideoFilter, str);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
543
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
544 while (vf_settings[n++].name) ;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
545
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
546 n--;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
547
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
548 if (n > -1) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
549 int i = 0, m = -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
550
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
551 while (vf_settings[i].name) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
552 if (!gstrcmp(vf_settings[i++].name, str)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
553 m = i - 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
554 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
555 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
556 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
557
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
558 i--;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
559
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
560 if (m > -1) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
561 if (n == 1) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
562 free(vf_settings[0].name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
563 free(vf_settings[0].attribs);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
564 free(vf_settings);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
565 vf_settings = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
566 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
567 free(vf_settings[i].name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
568 free(vf_settings[i].attribs);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
569 memcpy(&vf_settings[i], &vf_settings[i + 1], (n - i) * sizeof(m_obj_settings_t));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
570 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
571 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
572 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
573 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
574
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
575 int guiGetEvent(int type, void *arg)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
576 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
577 const ao_functions_t *audio_out = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
578 const vo_functions_t *video_out = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
579 mixer_t *mixer = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
580
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
581 stream_t *stream = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
582
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
583 #ifdef CONFIG_DVDREAD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
584 dvd_priv_t *dvdp = arg;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
585 #endif
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
586
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
587 if (guiIntfStruct.mpcontext) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
588 audio_out = mpctx_get_audio_out(guiIntfStruct.mpcontext);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
589 video_out = mpctx_get_video_out(guiIntfStruct.mpcontext);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
590 mixer = mpctx_get_mixer(guiIntfStruct.mpcontext);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
591 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
592
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
593 switch (type) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
594 case guiXEvent:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
595 guiIntfStruct.event_struct = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
596 wsEvents(wsDisplay, arg, NULL);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
597 gtkEventHandling();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
598 break;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
599
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
600 case guiCEvent:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
601
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
602 switch ((int)arg) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
603 case guiSetPlay:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
604 guiIntfStruct.Playing = 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
605 // if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
606 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
607
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
608 case guiSetStop:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
609 guiIntfStruct.Playing = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
610 // if ( !gtkShowVideoWindow ) wsVisibleWindow( &appMPlayer.subWindow,wsHideWindow );
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
611 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
612
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
613 case guiSetPause:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
614 guiIntfStruct.Playing = 2;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
615 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
616 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
617
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
618 mplState();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
619 break;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
620
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
621 case guiSetState:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
622 mplState();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
623 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
624
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
625 case guiSetFileName:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
626 if (arg)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
627 guiSetFilename(guiIntfStruct.Filename, arg);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
628 break;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
629
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
630 case guiSetAudioOnly:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
631
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
632 guiIntfStruct.AudioOnly = (int)arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
633
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
634 if ((int)arg) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
635 guiIntfStruct.NoWindow = True;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
636 wsVisibleWindow(&appMPlayer.subWindow, wsHideWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
637 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
638 wsVisibleWindow(&appMPlayer.subWindow, wsShowWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
639
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
640 break;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
641
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
642 case guiSetContext:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
643 guiIntfStruct.mpcontext = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
644 // NOTE TO MYSELF: is break missing?
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
645
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
646 case guiSetDemuxer:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
647 guiIntfStruct.demuxer = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
648 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
649
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
650 case guiSetAfilter:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
651 guiIntfStruct.afilter = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
652 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
653
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
654 case guiSetShVideo:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
655
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
656 if (!appMPlayer.subWindow.isFullScreen) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
657 wsResizeWindow(&appMPlayer.subWindow, vo_dwidth, vo_dheight);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
658 wsMoveWindow(&appMPlayer.subWindow, True, appMPlayer.sub.x, appMPlayer.sub.y);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
659 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
660
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
661 guiIntfStruct.MovieWidth = vo_dwidth;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
662 guiIntfStruct.MovieHeight = vo_dheight;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
663
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
664 if (guiWinID >= 0)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
665 wsMoveWindow(&appMPlayer.mainWindow, 0, 0, vo_dheight);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
666
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
667 WinID = appMPlayer.subWindow.WindowID;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
668 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
669
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
670 #ifdef CONFIG_DVDREAD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
671 case guiSetDVD:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
672 guiIntfStruct.DVD.titles = dvdp->vmg_file->tt_srpt->nr_of_srpts;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
673 guiIntfStruct.DVD.chapters = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
674 guiIntfStruct.DVD.angles = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
675 guiIntfStruct.DVD.nr_of_audio_channels = dvdp->nr_of_channels;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
676 memcpy(guiIntfStruct.DVD.audio_streams, dvdp->audio_streams, sizeof(dvdp->audio_streams));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
677 guiIntfStruct.DVD.nr_of_subtitles = dvdp->nr_of_subtitles;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
678 memcpy(guiIntfStruct.DVD.subtitles, dvdp->subtitles, sizeof(dvdp->subtitles));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
679 guiIntfStruct.DVD.current_title = dvd_title + 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
680 guiIntfStruct.DVD.current_chapter = dvd_chapter + 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
681 guiIntfStruct.DVD.current_angle = dvd_angle + 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
682 guiIntfStruct.Track = dvd_title + 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
683 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
684 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
685
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
686 case guiSetStream:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
687
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
688 guiIntfStruct.StreamType = stream->type;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
689
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
690 switch (stream->type) {
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
691 #ifdef CONFIG_DVDREAD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
692 case STREAMTYPE_DVD:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
693 guiGetEvent(guiSetDVD, (char *)stream->priv);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
694 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
695 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
696
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27359
diff changeset
697 #ifdef CONFIG_VCD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
698 case STREAMTYPE_VCD:
33001
d14cac89630d Replace vcd_seek_to_track() by stream_control().
ib
parents: 32984
diff changeset
699 if (!stream->priv)
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
700 guiIntfStruct.VCDTracks = 0;
33001
d14cac89630d Replace vcd_seek_to_track() by stream_control().
ib
parents: 32984
diff changeset
701 else
d14cac89630d Replace vcd_seek_to_track() by stream_control().
ib
parents: 32984
diff changeset
702 stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiIntfStruct.VCDTracks);
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
703 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
704 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
705
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
706 default:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
707 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
708 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
709
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
710 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
711
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
712 case guiIEvent:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
713
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
714 mp_msg(MSGT_GPLAYER, MSGL_V, "cmd: %d\n", (int)arg);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
715
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
716 switch ((int)arg) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
717 case MP_CMD_QUIT:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
718 mplEventHandling(evExit, 0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
719 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
720
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
721 case MP_CMD_VO_FULLSCREEN:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
722 mplEventHandling(evFullScreen, 0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
723 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
724 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
725
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
726 break;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
727
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
728 case guiReDraw:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
729 mplEventHandling(evRedraw, 0);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
730 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
731
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
732 case guiSetVolume:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
733 if (audio_out) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
734 float l, r;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
735
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
736 mixer_getvolume(mixer, &l, &r);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
737 guiIntfStruct.Volume = (r > l ? r : l);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
738
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
739 if (r != l)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
740 guiIntfStruct.Balance = ((r - l) + 100) * 0.5f;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
741 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
742 guiIntfStruct.Balance = 50.0f;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
743
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
744 btnModify(evSetVolume, guiIntfStruct.Volume);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
745 btnModify(evSetBalance, guiIntfStruct.Balance);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
746 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
747 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
748
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
749 case guiSetFileFormat:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
750 guiIntfStruct.FileFormat = (int)arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
751 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
752
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
753 case guiSetValues:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
754
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
755 // video
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
756
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
757 guiIntfStruct.sh_video = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
758
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
759 if (arg) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
760 sh_video_t *sh = arg;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
761 guiIntfStruct.FPS = sh->fps;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
762 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
763
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
764 if (guiIntfStruct.NoWindow)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
765 wsVisibleWindow(&appMPlayer.subWindow, wsHideWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
766
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
767 if (guiIntfStruct.StreamType == STREAMTYPE_STREAM)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
768 btnSet(evSetMoviePosition, btnDisabled);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
769 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
770 btnSet(evSetMoviePosition, btnReleased);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
771
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
772 // audio
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
773
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
774 if (audio_out) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
775 float l, r;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
776
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
777 mixer_getvolume(mixer, &l, &r);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
778 guiIntfStruct.Volume = (r > l ? r : l);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
779
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
780 if (r != l)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
781 guiIntfStruct.Balance = ((r - l) + 100) * 0.5f;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
782 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
783 guiIntfStruct.Balance = 50.0f;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
784
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
785 btnModify(evSetVolume, guiIntfStruct.Volume);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
786 btnModify(evSetBalance, guiIntfStruct.Balance);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
787 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
788
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
789 if (gtkEnableAudioEqualizer) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
790 equalizer_t eq;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
791 int i, j;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
792
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
793 for (i = 0; i < 6; i++) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
794 for (j = 0; j < 10; j++) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
795 eq.channel = i;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
796 eq.band = j;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
797 eq.gain = gtkEquChannels[i][j];
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
798 gtkSet(gtkSetEqualizer, 0, &eq);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
799 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
800 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
801 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
802
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
803 // subtitle
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
804
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27359
diff changeset
805 #ifdef CONFIG_DXR3
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
806 if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3") && (guiIntfStruct.FileFormat != DEMUXER_TYPE_MPEG_PS) && !gtkVfLAVC) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
807 gtkMessageBox(GTK_MB_FATAL, MSGTR_NEEDLAVC);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
808 guiIntfStruct.Playing = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
809 return True;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
810 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
811 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
812
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
813 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
814
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
815 case guiSetDefaults:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
816
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
817 // if ( guiIntfStruct.Playing == 1 && guiIntfStruct.FilenameChanged )
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
818 if (guiIntfStruct.FilenameChanged) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
819 audio_id = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
820 video_id = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
821 dvdsub_id = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
822 vobsub_id = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
823 stream_cache_size = -1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
824 autosync = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
825 dvd_title = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
826 force_fps = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
827 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
828
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
829 guiIntfStruct.demuxer = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
830 guiIntfStruct.sh_video = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
831 wsPostRedisplay(&appMPlayer.subWindow);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
832
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
833 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
834
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
835 case guiSetParameters:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
836
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
837 guiGetEvent(guiSetDefaults, NULL);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
838
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
839 switch (guiIntfStruct.StreamType) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
840 case STREAMTYPE_PLAYLIST:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
841 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
842
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
843 #ifdef CONFIG_VCD
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
844 case STREAMTYPE_VCD:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
845 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
846 char tmp[512];
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
847
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
848 sprintf(tmp, "vcd://%d", guiIntfStruct.Track + 1);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
849 guiSetFilename(guiIntfStruct.Filename, tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
850 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
851 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
852 #endif
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
853
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
854 #ifdef CONFIG_DVDREAD
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
855 case STREAMTYPE_DVD:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
856 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
857 char tmp[512];
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
858
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
859 sprintf(tmp, "dvd://%d", guiIntfStruct.Title);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
860 guiSetFilename(guiIntfStruct.Filename, tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
861 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
862
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
863 dvd_chapter = guiIntfStruct.Chapter;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
864 dvd_angle = guiIntfStruct.Angle;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
865
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
866 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
867 #endif
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
868 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
869
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
870 // if ( guiIntfStruct.StreamType != STREAMTYPE_PLAYLIST ) // Does not make problems anymore!
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
871 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
872 if (guiIntfStruct.Filename)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
873 filename = gstrdup(guiIntfStruct.Filename);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
874 else if (filename)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
875 guiSetFilename(guiIntfStruct.Filename, filename);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
876 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
877
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
878 // video opts
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
879
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
880 if (!video_driver_list) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
881 int i = 0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
882
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
883 while (video_out_drivers[i++]) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
884 if (video_out_drivers[i - 1]->control(VOCTRL_GUISUPPORT, NULL) == VO_TRUE) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
885 gaddlist(&video_driver_list, (char *)video_out_drivers[i - 1]->info->short_name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
886 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
887 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
888 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
889 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
890
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
891 if (!video_driver_list && !video_driver_list[0]) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
892 gtkMessageBox(GTK_MB_FATAL, MSGTR_IDFGCVD);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
893 exit_player(EXIT_ERROR);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
894 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
895
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
896 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
897 int i = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
898
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
899 guiIntfStruct.NoWindow = False;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
900
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
901 while (video_out_drivers[i++]) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
902 if (video_out_drivers[i - 1]->control(VOCTRL_GUISUPPORT, NULL) == VO_TRUE) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
903 if ((video_driver_list && !gstrcmp(video_driver_list[0], (char *)video_out_drivers[i - 1]->info->short_name)) && (video_out_drivers[i - 1]->control(VOCTRL_GUI_NOWINDOW, NULL) == VO_TRUE)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
904 guiIntfStruct.NoWindow = True;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
905 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
906 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
907 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
908 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
909 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
910
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
911 #ifdef CONFIG_DXR3
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
912 remove_vf("lavc");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
913
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
914 if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3"))
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
915 if (guiIntfStruct.StreamType != STREAMTYPE_DVD && guiIntfStruct.StreamType != STREAMTYPE_VCD)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
916 if (gtkVfLAVC)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
917 add_vf("lavc");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
918 #endif
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
919
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
920 if (gtkVfPP)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
921 add_vf("pp");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
922 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
923 remove_vf("pp");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
924
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
925 // audio opts
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
926
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
927 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
928 if (gtkAONorm)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
929 greplace(&af_cfg.list, "volnorm", "volnorm");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
930
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
931 if (gtkEnableAudioEqualizer)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
932 greplace(&af_cfg.list, "equalizer", "equalizer");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
933
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
934 if (gtkAOExtraStereo) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
935 char *name;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
936
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
937 name = malloc(12 + 20 + 1);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
938 snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
939 name[12 + 20] = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
940 greplace(&af_cfg.list, "extrastereo", name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
941 free(name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
942 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
943
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
944 #ifdef CONFIG_OSS_AUDIO
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
945 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "oss", 3)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
946 char *tmp;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
947
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
948 mixer_device = gtkAOOSSMixer;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
949 mixer_channel = gtkAOOSSMixerChannel;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
950
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
951 if (gtkAOOSSDevice) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
952 tmp = calloc(1, strlen(gtkAOOSSDevice) + 7);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
953 sprintf(tmp, "oss:%s", gtkAOOSSDevice);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
954 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
955 tmp = strdup("oss");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
956
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
957 gaddlist(&audio_driver_list, tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
958 free(tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
959 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
960 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
961
27390
9d95dc936e66 Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents: 27387
diff changeset
962 #ifdef CONFIG_ALSA
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
963 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "alsa", 4)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
964 char *tmp;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
965
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
966 mixer_device = gtkAOALSAMixer;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
967 mixer_channel = gtkAOALSAMixerChannel;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
968
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
969 if (gtkAOALSADevice) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
970 tmp = calloc(1, strlen(gtkAOALSADevice) + 14);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
971 sprintf(tmp, "alsa:device=%s", gtkAOALSADevice);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
972 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
973 tmp = strdup("alsa");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
974
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
975 gaddlist(&audio_driver_list, tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
976 free(tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
977 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
978 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
979
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27359
diff changeset
980 #ifdef CONFIG_SDL
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
981 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "sdl", 3)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
982 char *tmp;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
983
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
984 if (gtkAOSDLDriver) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
985 tmp = calloc(1, strlen(gtkAOSDLDriver) + 10);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
986 sprintf(tmp, "sdl:%s", gtkAOSDLDriver);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
987 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
988 tmp = strdup("sdl");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
989
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
990 gaddlist(&audio_driver_list, tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
991 free(tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
992 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
993 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
994
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
995 #ifdef CONFIG_ESD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
996 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "esd", 3)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
997 char *tmp;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
998
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
999 if (gtkAOESDDevice) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1000 tmp = calloc(1, strlen(gtkAOESDDevice) + 10);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1001 sprintf(tmp, "esd:%s", gtkAOESDDevice);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1002 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1003 tmp = strdup("esd");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1004
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1005 gaddlist(&audio_driver_list, tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1006 free(tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1007 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1008 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1009
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1010 // subtitle
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1011
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1012 // subdata->filename=gstrdup( guiIntfStruct.Subtitlename );
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1013 stream_dump_type = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1014
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1015 if (gtkSubDumpMPSub)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1016 stream_dump_type = 4;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1017
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1018 if (gtkSubDumpSrt)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1019 stream_dump_type = 6;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1020
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1021 gtkSubDumpMPSub = gtkSubDumpSrt = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1022 guiLoadFont();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1023
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1024 // misc
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1025
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1026 if (gtkCacheOn)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1027 stream_cache_size = gtkCacheSize;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1028
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1029 if (gtkAutoSyncOn)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1030 autosync = gtkAutoSync;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1031
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1032 if (guiIntfStruct.AudioFile)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1033 audio_stream = gstrdup(guiIntfStruct.AudioFile);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1034 else if (guiIntfStruct.FilenameChanged)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1035 gfree((void **)&audio_stream);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1036
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1037 // audio_stream = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1038
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1039 guiIntfStruct.DiskChanged = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1040 guiIntfStruct.FilenameChanged = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1041 guiIntfStruct.NewPlay = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1042
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
1043 #ifdef CONFIG_ASS
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1044 ass_enabled = gtkASS.enabled;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1045 ass_use_margins = gtkASS.use_margins;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1046 ass_top_margin = gtkASS.top_margin;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1047 ass_bottom_margin = gtkASS.bottom_margin;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1048 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1049
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1050 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1051 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1052
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1053 return False;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1054 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1055
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1056 void guiEventHandling(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1057 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1058 if (!guiIntfStruct.Playing || guiIntfStruct.NoWindow)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1059 wsHandleEvents();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1060
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1061 gtkEventHandling();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1062 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1063
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1064 // ---
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1065 #if defined(MP_DEBUG) && 0
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1066 void list(void)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1067 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1068 plItem *next = plList;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1069
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1070 printf("--- list ---\n");
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1071
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1072 while (next || next->next) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1073 printf("item: %s/%s\n", next->path, next->name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1074
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1075 if (next->next)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1076 next = next->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1077 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1078 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1079 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1080
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1081 printf("--- end of list ---\n");
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1082 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1083 #else
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1084 #define list();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1085 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1086
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1087 void *gtkSet(int cmd, float fparam, void *vparam)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1088 {
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1089 equalizer_t *eq = (equalizer_t *)vparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1090 plItem *item = (plItem *)vparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1091 URLItem *url_item = (URLItem *)vparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1092 int is_added = True;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1093
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1094 switch (cmd) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1095 // handle playlist
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1096
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1097 // add item to playlist
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1098 case gtkAddPlItem:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1099
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1100 if (plList) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1101 plItem *next = plList;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1102
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1103 while (next->next)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1104 // {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1105 // printf( "%s\n",next->name );
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1106 next = next->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1107 // }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1108
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1109 next->next = item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1110 item->prev = next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1111 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1112 item->prev = item->next = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1113 plCurrent = plList = item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1114 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1115
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1116 list();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1117 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1118
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1119 // add item into playlist after current
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1120 case gtkInsertPlItem:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1121 if (plCurrent) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1122 plItem *curr = plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1123 item->next = curr->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1124
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1125 if (item->next)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1126 item->next->prev = item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1127
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1128 item->prev = curr;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1129 curr->next = item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1130 plCurrent = plCurrent->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1131
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1132 return plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1133 } else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1134 return gtkSet(gtkAddPlItem, 0, (void *)item);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1135 return NULL; // NOTE TO MYSELF: remove this
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1136
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1137 // get current item from playlist
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1138 case gtkGetNextPlItem:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1139 if (plCurrent && plCurrent->next) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1140 plCurrent = plCurrent->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1141 // if (!plCurrent && plList)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1142 // {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1143 // plItem *next = plList;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1144 //
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1145 // while (next->next)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1146 // {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1147 // if (!next->next) break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1148 // next = next->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1149 // }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1150 //
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1151 // plCurrent = next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1152 // }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1153 return plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1154 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1155 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1156
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1157 case gtkGetPrevPlItem:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1158 if (plCurrent && plCurrent->prev) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1159 plCurrent = plCurrent->prev;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1160 // if ( !plCurrent && plList ) plCurrent=plList;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1161 return plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1162 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1163 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1164
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1165 // set current item
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1166 case gtkSetCurrPlItem:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1167 plCurrent = item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1168 return plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1169
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1170 // get current item
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1171 case gtkGetCurrPlItem:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1172 return plCurrent;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1173
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1174 // delete current item
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1175 case gtkDelCurrPlItem:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1176 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1177 plItem *curr = plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1178
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1179 if (!curr)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1180 return NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1181
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1182 if (curr->prev)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1183 curr->prev->next = curr->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1184 if (curr->next)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1185 curr->next->prev = curr->prev;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1186 if (curr == plList)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1187 plList = curr->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1188
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1189 plCurrent = curr->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1190
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1191 // free it
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1192 free(curr->path);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1193 free(curr->name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1194 free(curr);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1195 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1196
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1197 mplCurr(); // instead of using mplNext && mplPrev
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1198 return plCurrent;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1199
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1200 // delete list
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1201 case gtkDelPl:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1202 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1203 plItem *curr = plList;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1204 plItem *next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1205
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1206 if (!plList)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1207 return NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1208
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1209 if (!curr->next) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1210 free(curr->path);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1211 free(curr->name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1212 free(curr);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1213 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1214 while (curr->next) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1215 next = curr->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1216 free(curr->path);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1217 free(curr->name);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1218 free(curr);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1219 curr = next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1220 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1221 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1222
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1223 plList = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1224 plCurrent = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1225 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1226 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1227
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1228 // handle url
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1229 case gtkAddURLItem:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1230 if (URLList) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1231 URLItem *next_url = URLList;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1232 is_added = False;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1233
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1234 while (next_url->next) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1235 if (!gstrcmp(next_url->url, url_item->url)) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1236 is_added = True;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1237 break;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1238 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1239
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1240 next_url = next_url->next;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1241 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1242
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1243 if (!is_added && gstrcmp(next_url->url, url_item->url))
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1244 next_url->next = url_item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1245 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1246 url_item->next = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1247 URLList = url_item;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1248 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1249 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1250
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1251 // subtitle
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1252
27393
4876c89bafdd Rename font-related preprocessor directives.
diego
parents: 27390
diff changeset
1253 #ifndef CONFIG_FREETYPE
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1254 case gtkSetFontFactor:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1255 font_factor = fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1256 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1257 return NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1258 #else
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1259 case gtkSetFontOutLine:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1260 subtitle_font_thickness = (8.0f / 100.0f) * fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1261 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1262 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1263
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1264 case gtkSetFontBlur:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1265 subtitle_font_radius = (8.0f / 100.0f) * fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1266 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1267 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1268
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1269 case gtkSetFontTextScale:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1270 text_font_scale_factor = fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1271 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1272 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1273
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1274 case gtkSetFontOSDScale:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1275 osd_font_scale_factor = fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1276 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1277 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1278
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1279 case gtkSetFontEncoding:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1280 gfree((void **)&subtitle_font_encoding);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1281 subtitle_font_encoding = gstrdup((char *)vparam);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1282 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1283 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1284
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1285 case gtkSetFontAutoScale:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1286 subtitle_autoscale = (int)fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1287 guiLoadFont();
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1288 return NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1289 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1290
27393
4876c89bafdd Rename font-related preprocessor directives.
diego
parents: 27390
diff changeset
1291 #ifdef CONFIG_ICONV
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1292 case gtkSetSubEncoding:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1293 gfree((void **)&sub_cp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1294 sub_cp = gstrdup((char *)vparam);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1295 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1296 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1297
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1298 // misc
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1299
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1300 case gtkClearStruct:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1301
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1302 if ((unsigned int)vparam & guiFilenames) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1303 gfree((void **)&guiIntfStruct.Filename);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1304 gfree((void **)&guiIntfStruct.Subtitlename);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1305 gfree((void **)&guiIntfStruct.AudioFile);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1306 gtkSet(gtkDelPl, 0, NULL);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1307 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1308
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26458
diff changeset
1309 #ifdef CONFIG_DVDREAD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1310 if ((unsigned int)vparam & guiDVD)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1311 memset(&guiIntfStruct.DVD, 0, sizeof(guiDVDStruct));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1312 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1313
27370
14c5017f40d2 Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents: 27359
diff changeset
1314 #ifdef CONFIG_VCD
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1315 if ((unsigned int)vparam & guiVCD)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1316 guiIntfStruct.VCDTracks = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1317 #endif
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1318
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1319 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1320
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1321 case gtkSetExtraStereo:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1322 gtkAOExtraStereoMul = fparam;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1323 if (guiIntfStruct.afilter)
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1324 af_control_any_rev(guiIntfStruct.afilter, AF_CONTROL_ES_MUL | AF_CONTROL_SET, &gtkAOExtraStereoMul);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1325 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1326
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1327 case gtkSetPanscan:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1328 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1329 mp_cmd_t *mp_cmd;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1330
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1331 mp_cmd = calloc(1, sizeof(*mp_cmd));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1332 mp_cmd->id = MP_CMD_PANSCAN;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1333 mp_cmd->name = strdup("panscan");
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1334 mp_cmd->args[0].v.f = fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1335 mp_cmd->args[1].v.i = 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1336 mp_input_queue_cmd(mp_cmd);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1337 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1338 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1339
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1340 case gtkSetAutoq:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1341 auto_quality = (int)fparam;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1342 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1343
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1344 // set equalizers
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1345
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1346 case gtkSetContrast:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1347 if (guiIntfStruct.sh_video)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1348 set_video_colors(guiIntfStruct.sh_video, "contrast", (int)fparam);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1349 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1350
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1351 case gtkSetBrightness:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1352 if (guiIntfStruct.sh_video)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1353 set_video_colors(guiIntfStruct.sh_video, "brightness", (int)fparam);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1354 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1355
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1356 case gtkSetHue:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1357 if (guiIntfStruct.sh_video)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1358 set_video_colors(guiIntfStruct.sh_video, "hue", (int)fparam);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1359 return NULL;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1360
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1361 case gtkSetSaturation:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1362 if (guiIntfStruct.sh_video)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1363 set_video_colors(guiIntfStruct.sh_video, "saturation", (int)fparam);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1364 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1365
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1366 case gtkSetEqualizer:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1367 {
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1368 af_control_ext_t tmp;
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1369
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1370 if (eq) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1371 gtkEquChannels[eq->channel][eq->band] = eq->gain;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1372 tmp.ch = eq->channel;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1373 tmp.arg = gtkEquChannels[eq->channel];
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1374
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1375 if (guiIntfStruct.afilter)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1376 af_control_any_rev(guiIntfStruct.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1377 } else {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1378 int i;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1379
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1380 memset(gtkEquChannels, 0, sizeof(gtkEquChannels));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1381
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1382 if (guiIntfStruct.afilter) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1383 for (i = 0; i < 6; i++) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1384 tmp.ch = i;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1385 tmp.arg = gtkEquChannels[i];
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1386 af_control_any_rev(guiIntfStruct.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1387 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1388 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1389 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1390
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1391 return NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1392 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1393 }
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1394
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1395 return NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1396 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1397
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1398 // This function adds/inserts one file into the gui playlist.
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1399 static int import_file_into_gui(char *temp, int insert)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1400 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1401 char *filename, *pathname;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1402 plItem *item;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1403
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1404 filename = strdup(mp_basename(temp));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1405 pathname = strdup(temp);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1406
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1407 if (strlen(pathname) - strlen(filename) > 0)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1408 pathname[strlen(pathname) - strlen(filename) - 1] = 0; // we have some path, so remove / at end
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1409 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1410 pathname[strlen(pathname) - strlen(filename)] = 0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1411
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1412 // NOTE TO MYSELF: FIXME: Change to MSGL_DBG2?
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1413 mp_msg(MSGT_PLAYTREE, MSGL_V, "Adding filename %s && pathname %s\n", filename, pathname);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1414
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1415 item = calloc(1, sizeof(plItem));
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1416
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1417 if (!item)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1418 return 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1419
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1420 item->name = filename;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1421 item->path = pathname;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1422
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1423 if (insert)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1424 gtkSet(gtkInsertPlItem, 0, (void *)item); // inserts the item after current, and makes current=item
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1425 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1426 gtkSet(gtkAddPlItem, 0, (void *)item);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1427
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1428 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1429 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1430
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1431 // This function imports the initial playtree (based on cmd-line files)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1432 // into the gui playlist by either:
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1433 // - overwriting gui pl (enqueue=0)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1434 // - appending it to gui pl (enqueue=1)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1435 int import_initial_playtree_into_gui(play_tree_t *my_playtree, m_config_t *config, int enqueue)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1436 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1437 play_tree_iter_t *my_pt_iter = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1438 int result = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1439
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1440 if (!enqueue)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1441 gtkSet(gtkDelPl, 0, 0); // delete playlist before "appending"
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1442
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1443 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1444 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1445 // add it to end of list
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1446 if (import_file_into_gui(filename, 0))
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1447 result = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1448 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1449
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1450 mplCurr(); // update filename
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1451 mplGotoTheNext = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1452
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1453 if (!enqueue)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1454 filename = guiIntfStruct.Filename; // Backward compatibility; if file is specified on commandline,
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1455 // gmplayer does directly start in Play-Mode.
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1456 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1457 filename = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1458
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1459 return result;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1460 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1461
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1462 // This function imports and inserts an playtree, that is created "on the fly",
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1463 // for example by parsing some MOV-Reference-File; or by loading an playlist
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1464 // with "File Open".
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1465 // The file which contained the playlist is thereby replaced with it's contents.
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1466 int import_playtree_playlist_into_gui(play_tree_t *my_playtree, m_config_t *config)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1467 {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1468 play_tree_iter_t *my_pt_iter = NULL;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1469 int result = 0;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1470 plItem *save;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1471
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1472 save = (plItem *)gtkSet(gtkGetCurrPlItem, 0, 0); // save current item
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1473
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1474 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) {
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1475 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1476 // insert it into the list and set plCurrent=new item
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1477 if (import_file_into_gui(filename, 1))
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1478 result = 1;
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1479
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1480 pt_iter_destroy(&my_pt_iter);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1481 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1482
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1483 if (save)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1484 gtkSet(gtkSetCurrPlItem, 0, (void *)save);
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1485 else
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1486 gtkSet(gtkSetCurrPlItem, 0, (void *)plList); // go to head, if plList was empty before
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1487
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1488 if (save && result)
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1489 gtkSet(gtkDelCurrPlItem, 0, 0);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1490
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1491 mplCurr(); // update filename
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1492 filename = NULL;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27393
diff changeset
1493
32984
eb831a979df7 Cosmetic: Format to MPlayer coding style.
ib
parents: 32978
diff changeset
1494 return result;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1495 }