Mercurial > mplayer.hg
annotate gui/win32/preferences.c @ 34168:55abe5125482
Make include recursion depth actually have some effect.
Not working yet though, needs another change to really work properly.
author | reimar |
---|---|
date | Tue, 25 Oct 2011 19:22:10 +0000 |
parents | d57ed389b6e2 |
children | 9082a0976655 |
rev | line source |
---|---|
23077 | 1 /* |
23079 | 2 * MPlayer GUI for Win32 |
3 * Copyright (C) 2003 Sascha Sommer <saschasommer@freenet.de> | |
4 * Copyright (C) 2006 Erik Augustson <erik_27can@yahoo.com> | |
5 * Copyright (C) 2006 Gianluigi Tiesi <sherpya@netfarm.it> | |
6 * | |
7 * This file is part of MPlayer. | |
8 * | |
9 * MPlayer is free software; you can redistribute it and/or modify | |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * MPlayer is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
26457 | 19 * You should have received a copy of the GNU General Public License along |
20 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
23079 | 22 */ |
23077 | 23 |
24 #include <windows.h> | |
25 #include <commctrl.h> | |
26 #include <stdio.h> | |
27 #include <stdlib.h> | |
28 #include <string.h> | |
23091
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
29 |
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
30 #include "libvo/video_out.h" |
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
31 #include "libao2/audio_out.h" |
32068
ab6ac5b156ca
Replace proc_priority extern declaration by osdep/priority.h #include.
diego
parents:
30558
diff
changeset
|
32 #include "osdep/priority.h" |
23091
52488bb09d90
Consistently use quotes instead of angled brackets in #include
diego
parents:
23079
diff
changeset
|
33 #include "mixer.h" |
33761 | 34 #include "gui/util/list.h" |
33557 | 35 #include "gui/ui/gmplayer.h" |
26372
76413880bfad
Update include paths to account for build system changes.
diego
parents:
26193
diff
changeset
|
36 #include "gui/interface.h" |
23077 | 37 #include "gui.h" |
38 #include "mp_msg.h" | |
39 #include "help_mp.h" | |
40 #include "dialogs.h" | |
41 | |
33619
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
42 |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
43 static void set_defaults(void) |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
44 { |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
45 proc_priority = "normal"; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
46 vo_doublebuffering = 1; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
47 vo_directrendering = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
48 frame_dropping = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
49 soft_vol = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
50 gtkAONorm = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
51 gtkAOExtraStereo = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
52 gtkAOExtraStereoMul = 1.0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
53 audio_delay = 0.0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
54 sub_window = 1; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
55 gtkCacheOn = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
56 gtkCacheSize = 2048; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
57 gtkAutoSyncOn = 0; |
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
58 gtkAutoSync = 0; |
34087 | 59 player_idle_mode = 1; |
33619
35a12ef532de
win32 gui: Move static function around to avoid a forward declaration.
diego
parents:
33614
diff
changeset
|
60 } |
23077 | 61 |
62 static LRESULT CALLBACK PrefsWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) | |
63 { | |
64 HWND btn, label, edit1, edit2, edit3, updown1, updown2, track1, track2; | |
65 static HWND vo_driver, ao_driver, prio; | |
66 int i = 0, j = 0; | |
67 char dvddevice[MAX_PATH]; | |
68 char cdromdevice[MAX_PATH]; | |
69 char procprio[11]; | |
70 float x = 10.0, y = 100.0, stereopos, delaypos; | |
71 stereopos = gtkAOExtraStereoMul * x; | |
72 delaypos = audio_delay * y; | |
73 | |
74 switch (iMsg) | |
75 { | |
76 case WM_CREATE: | |
77 { | |
78 /* video and audio drivers */ | |
34163 | 79 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Video), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
80 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
81 10, 14, 60, 15, hwnd, |
23077 | 82 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
83 NULL); | |
84 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
85 | |
34163 | 86 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Audio), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
87 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
88 205, 14, 60, 15, hwnd, |
23077 | 89 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
90 NULL); | |
91 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
92 | |
34163 | 93 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Coefficient), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
94 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
95 10, 148, 140, 15, hwnd, |
23077 | 96 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
97 NULL); | |
98 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
99 | |
34163 | 100 label = CreateWindow("static", acp(MSGTR_PREFERENCES_AudioDelay), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
101 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
102 10, 187, 140, 15, hwnd, |
23077 | 103 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
104 NULL); | |
105 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
106 | |
34163 | 107 label = CreateWindow("static", acp(MSGTR_PREFERENCES_FRAME_OSD_Level), |
23077 | 108 WS_CHILD | WS_VISIBLE, |
34087 | 109 10, 286, 115, 15, hwnd, |
23077 | 110 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
111 NULL); | |
112 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
113 | |
34163 | 114 label = CreateWindow("static", acp(MSGTR_PREFERENCES_DVDDevice), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
115 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
116 55, 387, 100, 15, hwnd, |
23077 | 117 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
118 NULL); | |
119 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
120 | |
34163 | 121 label = CreateWindow("static", acp(MSGTR_PREFERENCES_CDROMDevice), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
122 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
123 185, 387, 100, 15, hwnd, |
23077 | 124 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
125 NULL); | |
126 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
127 | |
34163 | 128 label = CreateWindow("static", acp(MSGTR_PREFERENCES_Priority), |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
129 WS_CHILD | WS_VISIBLE | SS_RIGHT, |
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
130 200, 286, 100, 15, hwnd, |
23077 | 131 NULL, ((LPCREATESTRUCT) lParam) -> hInstance, |
132 NULL); | |
133 SendMessage(label, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
134 | |
135 vo_driver = CreateWindow("combobox", NULL, | |
136 CBS_DROPDOWNLIST | CB_SHOWDROPDOWN | | |
137 CBS_NOINTEGRALHEIGHT | CBS_HASSTRINGS | | |
138 WS_CHILD | WS_VISIBLE | | |
139 WS_VSCROLL | WS_TABSTOP, | |
140 80, 10, 100, 160, hwnd, | |
141 (HMENU) ID_VO_DRIVER, | |
142 ((LPCREATESTRUCT) lParam) -> hInstance, | |
143 NULL); | |
144 | |
145 ao_driver = CreateWindow("combobox", NULL, | |
146 CBS_DROPDOWNLIST | CB_SHOWDROPDOWN | | |
147 CBS_NOINTEGRALHEIGHT | CBS_HASSTRINGS | | |
148 WS_CHILD | WS_VISIBLE | | |
149 WS_VSCROLL | WS_TABSTOP, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
150 275, 10, 100, 160, hwnd, |
23077 | 151 (HMENU) ID_AO_DRIVER, |
152 ((LPCREATESTRUCT) lParam) -> hInstance, | |
153 NULL); | |
154 | |
155 prio = CreateWindow("combobox", NULL, | |
156 CBS_DROPDOWNLIST | CB_SHOWDROPDOWN | | |
157 CBS_NOINTEGRALHEIGHT | CBS_HASSTRINGS | | |
158 WS_CHILD | WS_VISIBLE | | |
159 WS_VSCROLL | WS_TABSTOP, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
160 310, 282, 100, 160, hwnd, |
23077 | 161 (HMENU) ID_PRIO, |
162 ((LPCREATESTRUCT) lParam) -> hInstance, | |
163 NULL); | |
164 | |
165 /* checkboxes */ | |
34163 | 166 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_DoubleBuffer), |
23077 | 167 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
168 10, 35, 160, 25, |
23077 | 169 hwnd, (HMENU) ID_DOUBLE, |
170 ((LPCREATESTRUCT) lParam) -> hInstance, | |
171 NULL); | |
172 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
173 | |
34163 | 174 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_DirectRender), |
23077 | 175 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
176 10, 57, 160, 25, |
23077 | 177 hwnd, (HMENU) ID_DIRECT, |
178 ((LPCREATESTRUCT) lParam) -> hInstance, | |
179 NULL); | |
180 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
181 | |
34163 | 182 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_FrameDrop), |
23077 | 183 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
184 10, 79, 160, 25, |
23077 | 185 hwnd, (HMENU) ID_FRAMEDROP, |
186 ((LPCREATESTRUCT) lParam) -> hInstance, | |
187 NULL); | |
188 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
189 | |
34163 | 190 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_NoIdle), |
34087 | 191 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
192 10, 101, 225, 25, |
34087 | 193 hwnd, (HMENU) ID_IDLE, |
194 ((LPCREATESTRUCT) lParam) -> hInstance, | |
195 NULL); | |
196 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
197 | |
34163 | 198 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_NormalizeSound), |
23077 | 199 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
200 220, 35, 160, 25, |
23077 | 201 hwnd, (HMENU) ID_NORMALIZE, |
202 ((LPCREATESTRUCT) lParam) -> hInstance, | |
203 NULL); | |
204 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
205 | |
34163 | 206 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_SoftwareMixer), |
23077 | 207 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
208 220, 57, 160, 25, |
23077 | 209 hwnd, (HMENU) ID_SOFTMIX, |
210 ((LPCREATESTRUCT) lParam) -> hInstance, | |
211 NULL); | |
212 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
213 | |
34163 | 214 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_ExtraStereo), |
23077 | 215 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
216 220, 79, 160, 25, |
23077 | 217 hwnd, (HMENU) ID_EXTRASTEREO, |
218 ((LPCREATESTRUCT) lParam) -> hInstance, | |
219 NULL); | |
220 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
221 | |
34163 | 222 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_Cache), |
23077 | 223 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34087 | 224 10, 222, 90, 25, |
23077 | 225 hwnd, (HMENU) ID_CACHE, |
226 ((LPCREATESTRUCT) lParam) -> hInstance, | |
227 NULL); | |
228 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
229 | |
34163 | 230 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_AutoSync), |
23077 | 231 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
232 240, 222, 110, 25, hwnd, |
23077 | 233 (HMENU) ID_AUTOSYNC, |
234 ((LPCREATESTRUCT) lParam) -> hInstance, | |
235 NULL); | |
236 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
237 | |
34163 | 238 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_VideoInSubwin), |
23077 | 239 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
240 10, 249, 250, 25, |
23077 | 241 hwnd, (HMENU) ID_SUBWINDOW, |
242 ((LPCREATESTRUCT) lParam) -> hInstance, | |
243 NULL); | |
244 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
245 | |
246 /* osd level */ | |
34163 | 247 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL0), |
23077 | 248 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
249 15, 297, 200, 25, hwnd, |
23077 | 250 (HMENU) ID_NONE, |
251 ((LPCREATESTRUCT) lParam) -> hInstance, | |
252 NULL); | |
253 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
254 | |
34163 | 255 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL1), |
23077 | 256 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
257 15, 317, 395, 25, hwnd, |
23077 | 258 (HMENU) ID_OSD1, |
259 ((LPCREATESTRUCT) lParam) -> hInstance, | |
260 NULL); | |
261 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
262 | |
34163 | 263 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL2), |
23077 | 264 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
265 15, 337, 395, 25, hwnd, |
23077 | 266 (HMENU) ID_OSD2, |
267 ((LPCREATESTRUCT) lParam) -> hInstance, | |
268 NULL); | |
269 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
270 | |
34163 | 271 btn = CreateWindow("button", acp(MSGTR_PREFERENCES_OSD_LEVEL3), |
23077 | 272 WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
273 15, 357, 395, 25, hwnd, |
23077 | 274 (HMENU) ID_OSD3, |
275 ((LPCREATESTRUCT) lParam) -> hInstance, | |
276 NULL); | |
277 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
278 | |
34163 | 279 btn = CreateWindow("button", acp(MSGTR_Ok), |
23077 | 280 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
281 248, 417, 80, 25, hwnd, |
23077 | 282 (HMENU) ID_APPLY, |
283 ((LPCREATESTRUCT) lParam) -> hInstance, | |
284 NULL); | |
285 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
286 | |
34163 | 287 btn = CreateWindow("button", acp(MSGTR_Cancel), |
23077 | 288 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
289 334, 417, 80, 25, hwnd, |
23077 | 290 (HMENU) ID_CANCEL, |
291 ((LPCREATESTRUCT) lParam) -> hInstance, | |
292 NULL); | |
293 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
294 | |
34163 | 295 btn = CreateWindow("button", acp(MSGTR_Default), |
23077 | 296 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
297 5, 417, 80, 25, hwnd, |
23077 | 298 (HMENU) ID_DEFAULTS, |
299 ((LPCREATESTRUCT) lParam) -> hInstance, | |
300 NULL); | |
301 SendMessage(btn, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
302 | |
303 /* extra stereo coefficient trackbar */ | |
304 track1 = CreateWindow(TRACKBAR_CLASS, "Coefficient", | |
305 WS_CHILD | WS_VISIBLE | WS_TABSTOP | | |
306 WS_DISABLED | TBS_HORZ | | |
307 TBS_BOTTOM | TBS_NOTICKS, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
308 165, 142, 245, 35, hwnd, |
23077 | 309 (HMENU) ID_TRACKBAR1, |
310 ((LPCREATESTRUCT) lParam) -> hInstance, | |
311 NULL); | |
312 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETRANGE, 1, MAKELONG(-100, 100)); | |
313 | |
314 /* audio delay */ | |
315 track2 = CreateWindow(TRACKBAR_CLASS, "Audio delay", | |
316 WS_CHILD | WS_VISIBLE | WS_TABSTOP | | |
317 WS_DISABLED | TBS_HORZ | | |
318 TBS_BOTTOM | TBS_NOTICKS, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
319 165, 182, 245, 35, hwnd, |
23077 | 320 (HMENU) ID_TRACKBAR2, |
321 ((LPCREATESTRUCT) lParam) -> hInstance, | |
322 NULL); | |
323 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETRANGE, 1, MAKELONG(-1000, 1000)); | |
324 | |
325 /* cache */ | |
326 edit1 = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "cache", | |
327 WS_CHILD | WS_VISIBLE | WS_DISABLED | | |
328 ES_LEFT | ES_AUTOHSCROLL, | |
34087 | 329 105, 225, 40, 20, hwnd, |
23077 | 330 (HMENU) ID_EDIT1, |
331 ((LPCREATESTRUCT) lParam) -> hInstance, | |
332 NULL); | |
333 SendMessage(edit1, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
334 | |
335 updown1 = CreateUpDownControl(WS_CHILD | WS_VISIBLE | | |
336 WS_DISABLED | UDS_SETBUDDYINT | | |
337 UDS_ARROWKEYS | UDS_NOTHOUSANDS, | |
34087 | 338 145, 225, 20, 20, hwnd, |
23077 | 339 ID_UPDOWN1, |
340 ((LPCREATESTRUCT) lParam) -> hInstance, | |
341 (HWND)edit1, 0, 0, 0); | |
342 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETRANGE32, (WPARAM)0, (LPARAM)65535); | |
343 | |
344 /* autosync */ | |
345 edit2 = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", "autosync", | |
346 WS_CHILD | WS_VISIBLE | WS_DISABLED | | |
347 ES_LEFT | ES_AUTOHSCROLL, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
348 355, 225, 40, 20, hwnd, |
23077 | 349 (HMENU) ID_EDIT2, |
350 ((LPCREATESTRUCT) lParam) -> hInstance, | |
351 NULL); | |
352 SendMessage(edit2, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
353 | |
354 updown2 = CreateUpDownControl(WS_CHILD | WS_VISIBLE | | |
355 WS_DISABLED | UDS_SETBUDDYINT | | |
356 UDS_ARROWKEYS | UDS_NOTHOUSANDS, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
357 395, 225, 20, 20, hwnd, |
23077 | 358 ID_UPDOWN2, |
359 ((LPCREATESTRUCT) lParam) -> hInstance, | |
360 (HWND)edit2, 0, 0, 0); | |
361 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETRANGE32, (WPARAM)0, (LPARAM)10000); | |
362 | |
363 /* dvd and cd devices */ | |
364 edit3 = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", NULL, | |
365 WS_CHILD | WS_VISIBLE | | |
366 ES_LEFT | ES_AUTOHSCROLL, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
367 165, 384, 20, 20, hwnd, |
23077 | 368 (HMENU) ID_DVDDEVICE, |
369 ((LPCREATESTRUCT) lParam) -> hInstance, | |
370 NULL); | |
371 SendMessage(edit3, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
372 | |
373 edit3 = CreateWindowEx(WS_EX_CLIENTEDGE, "edit", NULL, | |
374 WS_CHILD | WS_VISIBLE | | |
375 ES_LEFT| ES_AUTOHSCROLL, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
376 295, 384, 20, 20, hwnd, |
23077 | 377 (HMENU) ID_CDDEVICE, |
378 ((LPCREATESTRUCT) lParam) -> hInstance, | |
379 NULL); | |
380 SendMessage(edit3, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
381 | |
382 while(video_out_drivers[i]) | |
383 { | |
384 const vo_info_t *info = video_out_drivers[i++]->info; | |
385 if(!video_driver_list) gaddlist(&video_driver_list, (char *)info->short_name); | |
386 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_ADDSTRING, 0, (LPARAM) info->short_name); | |
387 } | |
388 /* Special case for directx:noaccel */ | |
389 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_ADDSTRING, 0, (LPARAM) "directx:noaccel"); | |
390 SendMessage(vo_driver, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
391 | |
392 while(audio_out_drivers[j]) | |
393 { | |
394 const ao_info_t *info = audio_out_drivers[j++]->info; | |
395 if(!audio_driver_list) | |
396 { | |
397 // FIXME: default priority (i.e. order in audio_out_drivers) should be fixed instead | |
398 // if win32 as default is really desirable | |
399 gaddlist(&audio_driver_list, "win32"/*(char *)info->short_name*/); | |
400 } | |
401 SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_ADDSTRING, 0, (LPARAM) info->short_name); | |
402 } | |
403 SendMessage(ao_driver, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
404 | |
405 /* priority list, i'm leaving out realtime for safety's sake */ | |
34163 | 406 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityLow)); |
407 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormalBelow)); | |
408 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormal)); | |
409 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityNormalAbove)); | |
410 SendDlgItemMessage(hwnd, ID_PRIO, CB_INSERTSTRING, 0, (LPARAM) acp(MSGTR_PREFERENCES_PriorityHigh)); | |
23077 | 411 SendMessage(prio, WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); |
412 | |
413 /* set our preferences on what we already have */ | |
414 if(video_driver_list) | |
415 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_SETCURSEL, | |
416 (WPARAM)SendMessage(vo_driver, CB_FINDSTRING, -1, | |
417 (LPARAM)video_driver_list[0]), 0); | |
418 | |
419 if(audio_driver_list) | |
420 SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_SETCURSEL, | |
421 (WPARAM)SendMessage(ao_driver, CB_FINDSTRING, -1, | |
422 (LPARAM)audio_driver_list[0]), 0); | |
423 | |
424 if(vo_doublebuffering) | |
425 SendDlgItemMessage(hwnd, ID_DOUBLE, BM_SETCHECK, 1, 0); | |
426 if(vo_directrendering) | |
427 SendDlgItemMessage(hwnd, ID_DIRECT, BM_SETCHECK, 1, 0); | |
34087 | 428 if(!player_idle_mode) |
429 SendDlgItemMessage(hwnd, ID_IDLE, BM_SETCHECK, 1, 0); | |
23077 | 430 if(frame_dropping) |
431 SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_SETCHECK, 1, 0); | |
432 if(gtkAONorm) | |
433 SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_SETCHECK, 1, 0); | |
434 if(soft_vol) | |
435 SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_SETCHECK, 1, 0); | |
436 if(gtkAOExtraStereo) | |
437 { | |
438 SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_SETCHECK, 1, 0); | |
33555 | 439 if(!guiInfo.Playing) |
23077 | 440 { |
441 EnableWindow(track1, 1); | |
442 EnableWindow(track2, 1); | |
443 } | |
444 } | |
445 else gtkAOExtraStereoMul = 1.0; | |
446 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)stereopos); | |
447 | |
448 if(audio_delay) | |
449 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)delaypos); | |
450 | |
451 if(gtkCacheOn) { | |
452 SendDlgItemMessage(hwnd, ID_CACHE, BM_SETCHECK, 1, 0); | |
453 EnableWindow(edit1, 1); | |
454 EnableWindow(updown1, 1); | |
455 } | |
456 else gtkCacheSize = 2048; | |
457 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 0, (LPARAM)gtkCacheSize); | |
458 | |
459 if(gtkAutoSyncOn) { | |
460 SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_SETCHECK, 1, 0); | |
461 EnableWindow(edit2, 1); | |
462 EnableWindow(updown2, 1); | |
463 } | |
464 else gtkAutoSync = 0; | |
465 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 0, (LPARAM)gtkAutoSync); | |
466 | |
467 if(sub_window) | |
468 SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_SETCHECK, 1, 0); | |
469 | |
470 if(!osd_level) | |
471 SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 1, 0); | |
472 else if(osd_level == 1) | |
473 SendDlgItemMessage(hwnd, ID_OSD1, BM_SETCHECK, 1, 0); | |
474 else if(osd_level == 2) | |
475 SendDlgItemMessage(hwnd, ID_OSD2, BM_SETCHECK, 1, 0); | |
476 else if(osd_level == 3) | |
477 SendDlgItemMessage(hwnd, ID_OSD3, BM_SETCHECK, 1, 0); | |
478 | |
479 if(dvd_device) | |
480 SendDlgItemMessage(hwnd, ID_DVDDEVICE, WM_SETTEXT, 0, (LPARAM)dvd_device); | |
481 else SendDlgItemMessage(hwnd, ID_DVDDEVICE, WM_SETTEXT, 0, (LPARAM)"D:"); | |
482 | |
483 if(cdrom_device) | |
484 SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_SETTEXT, 0, (LPARAM)cdrom_device); | |
485 else SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_SETTEXT, 0, (LPARAM)"D:"); | |
486 | |
487 if(proc_priority) | |
488 SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL, | |
489 (WPARAM)SendMessage(prio, CB_FINDSTRING, -1, | |
490 (LPARAM)proc_priority), 0); | |
491 | |
492 else SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL, 2, 0); | |
493 | |
494 break; | |
495 } | |
496 case WM_CTLCOLORDLG: | |
497 case WM_CTLCOLOREDIT: | |
498 case WM_CTLCOLORBTN: | |
499 case WM_CTLCOLORSTATIC: | |
500 { | |
501 HDC hdc = (HDC)wParam; | |
502 SetBkMode(hdc, TRANSPARENT); | |
503 return (INT_PTR)SOLID_GREY; | |
504 } | |
505 break; | |
506 case WM_COMMAND: | |
507 { | |
508 switch (LOWORD(wParam)) | |
509 { | |
510 case ID_EXTRASTEREO: | |
511 { | |
512 if(SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
513 { | |
514 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR1), 1); | |
515 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR2), 1); | |
516 } else { | |
517 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR1), 0); | |
518 EnableWindow(GetDlgItem(hwnd, ID_TRACKBAR2), 0); | |
519 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)10.0); | |
520 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)0); | |
521 } | |
522 break; | |
523 } | |
524 case ID_CACHE: | |
525 { | |
526 if(SendDlgItemMessage(hwnd, ID_CACHE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
527 { | |
528 EnableWindow(GetDlgItem(hwnd, ID_EDIT1), 1); | |
529 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN1), 1); | |
530 } else { | |
531 EnableWindow(GetDlgItem(hwnd, ID_EDIT1), 0); | |
532 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN1), 0); | |
533 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 1, (LPARAM)2048); | |
534 } | |
535 break; | |
536 } | |
537 case ID_AUTOSYNC: | |
538 { | |
539 if(SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
540 { | |
541 EnableWindow(GetDlgItem(hwnd, ID_EDIT2), 1); | |
542 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN2), 1); | |
543 } else { | |
544 EnableWindow(GetDlgItem(hwnd, ID_EDIT2), 0); | |
545 EnableWindow(GetDlgItem(hwnd, ID_UPDOWN2), 0); | |
546 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 1, (LPARAM)0); | |
547 } | |
548 break; | |
549 } | |
550 case ID_DEFAULTS: | |
551 { | |
552 set_defaults(); | |
553 SendDlgItemMessage(hwnd, ID_VO_DRIVER, CB_SETCURSEL, | |
554 (WPARAM)SendMessage(vo_driver, CB_FINDSTRING, -1, (LPARAM)"directx"), 0); | |
555 | |
556 SendDlgItemMessage(hwnd, ID_AO_DRIVER, CB_SETCURSEL, | |
557 (WPARAM)SendMessage(ao_driver, CB_FINDSTRING, -1, (LPARAM)"dsound"), 0); | |
558 | |
559 SendDlgItemMessage(hwnd, ID_PRIO, CB_SETCURSEL, | |
560 (WPARAM)SendMessage(prio, CB_FINDSTRING, -1, (LPARAM)proc_priority), 0); | |
561 | |
562 SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_SETPOS, 1, (LPARAM)10.0); | |
563 SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_SETPOS, 1, (LPARAM)0.0); | |
564 SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_SETPOS32, 0, (LPARAM)gtkCacheSize); | |
565 SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_SETPOS32, 0, (LPARAM)gtkAutoSync); | |
566 SendDlgItemMessage(hwnd, ID_DOUBLE, BM_SETCHECK, 0, 0); | |
567 SendDlgItemMessage(hwnd, ID_DIRECT, BM_SETCHECK, 0, 0); | |
34087 | 568 SendDlgItemMessage(hwnd, ID_IDLE, BM_SETCHECK, 0, 0); |
23077 | 569 SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_SETCHECK, 0, 0); |
570 SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_SETCHECK, 0, 0); | |
571 SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_SETCHECK, 0, 0); | |
572 SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_SETCHECK, 0, 0); | |
573 SendDlgItemMessage(hwnd, ID_CACHE, BM_SETCHECK, 0, 0); | |
574 SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_SETCHECK, 0, 0); | |
575 SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_SETCHECK, 1, 0); | |
576 SendDlgItemMessage(hwnd, ID_NONE, BM_SETCHECK, 0, 0); | |
577 SendDlgItemMessage(hwnd, ID_OSD1, BM_SETCHECK, 1, 0); | |
578 SendDlgItemMessage(hwnd, ID_OSD2, BM_SETCHECK, 0, 0); | |
579 SendDlgItemMessage(hwnd, ID_OSD3, BM_SETCHECK, 0, 0); | |
580 SendDlgItemMessage(hwnd, ID_DVDDEVICE, WM_SETTEXT, 0, (LPARAM)"D:"); | |
581 SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_SETTEXT, 0, (LPARAM)"D:"); | |
582 SendMessage(hwnd, WM_COMMAND, (WPARAM)ID_APPLY, 0); | |
583 break; | |
584 } | |
585 case ID_CANCEL: | |
586 DestroyWindow(hwnd); | |
587 return 0; | |
588 case ID_APPLY: | |
589 { | |
590 int strl; | |
33731
81f71d910333
Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents:
33725
diff
changeset
|
591 if(guiInfo.Playing) gui(GUI_SET_STATE, (void *)GUI_STOP); |
23077 | 592 |
593 /* Set the video driver */ | |
33298 | 594 free(video_driver_list[0]); |
23077 | 595 strl = SendMessage(vo_driver, CB_GETCURSEL, 0, 0); |
596 video_driver_list[0] = malloc(strl); | |
597 SendMessage(vo_driver, CB_GETLBTEXT, (WPARAM)strl, | |
598 (LPARAM)video_driver_list[0]); | |
599 | |
600 /* Set the audio driver */ | |
33298 | 601 free(audio_driver_list[0]); |
23077 | 602 strl = SendMessage(ao_driver, CB_GETCURSEL, 0, 0); |
603 audio_driver_list[0] = malloc(strl); | |
604 SendMessage(ao_driver, CB_GETLBTEXT, (WPARAM)strl, | |
605 (LPARAM)audio_driver_list[0]); | |
606 | |
607 /* Set the priority level */ | |
608 SendMessage(prio, CB_GETLBTEXT, (WPARAM)SendMessage(prio, CB_GETCURSEL, 0, 0), (LPARAM)procprio); | |
609 proc_priority = strdup(procprio); | |
610 | |
611 /* double buffering */ | |
612 if(SendDlgItemMessage(hwnd, ID_DOUBLE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
613 vo_doublebuffering = 1; | |
614 else vo_doublebuffering = 0; | |
615 | |
616 /* direct rendering */ | |
617 if(SendDlgItemMessage(hwnd, ID_DIRECT, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
618 vo_directrendering = 1; | |
619 else vo_directrendering = 0; | |
620 | |
34087 | 621 /* quit after playing */ |
622 if(SendDlgItemMessage(hwnd, ID_IDLE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
623 player_idle_mode = 0; | |
624 else player_idle_mode = 1; | |
625 | |
23077 | 626 /* frame dropping */ |
627 if(SendDlgItemMessage(hwnd, ID_FRAMEDROP, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
628 frame_dropping = 1; | |
629 else frame_dropping = 0; | |
630 | |
631 /* normalize */ | |
632 if(SendDlgItemMessage(hwnd, ID_NORMALIZE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
633 gtkAONorm = 1; | |
634 else gtkAONorm = 0; | |
635 | |
636 /* software mixer */ | |
637 if(SendDlgItemMessage(hwnd, ID_SOFTMIX, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
638 soft_vol = 1; | |
639 else soft_vol = 0; | |
640 | |
641 /* extra stereo */ | |
642 if(SendDlgItemMessage(hwnd, ID_EXTRASTEREO, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
643 gtkAOExtraStereo = 1; | |
644 else { | |
645 gtkAOExtraStereo = 0; | |
646 gtkAOExtraStereoMul = 10.0; | |
647 } | |
648 gtkAOExtraStereoMul = SendDlgItemMessage(hwnd, ID_TRACKBAR1, TBM_GETPOS, 0, 0) / 10.0; | |
649 | |
650 /* audio delay */ | |
651 audio_delay = SendDlgItemMessage(hwnd, ID_TRACKBAR2, TBM_GETPOS, 0, 0) / 100.0; | |
652 | |
653 /* cache */ | |
654 if(SendDlgItemMessage(hwnd, ID_CACHE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
655 gtkCacheOn = 1; | |
656 else gtkCacheOn = 0; | |
657 gtkCacheSize = SendDlgItemMessage(hwnd, ID_UPDOWN1, UDM_GETPOS32, 0, 0); | |
658 | |
659 /* autosync */ | |
660 if(SendDlgItemMessage(hwnd, ID_AUTOSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
661 gtkAutoSyncOn = 1; | |
662 else gtkAutoSyncOn = 0; | |
663 gtkAutoSync = SendDlgItemMessage(hwnd, ID_UPDOWN2, UDM_GETPOS32, 0, 0); | |
664 | |
665 /* sub window */ | |
666 if(SendDlgItemMessage(hwnd, ID_SUBWINDOW, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
667 sub_window = 1; | |
668 else sub_window = 0; | |
669 | |
670 /* osd level */ | |
671 if(SendDlgItemMessage(hwnd, ID_NONE, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
672 osd_level = 0; | |
673 else if(SendDlgItemMessage(hwnd, ID_OSD1, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
674 osd_level = 1; | |
675 else if(SendDlgItemMessage(hwnd, ID_OSD2, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
676 osd_level = 2; | |
677 else if(SendDlgItemMessage(hwnd, ID_OSD3, BM_GETCHECK, 0, 0) == BST_CHECKED) | |
678 osd_level = 3; | |
679 | |
680 /* dvd and cd devices */ | |
681 SendDlgItemMessage(hwnd, ID_DVDDEVICE, WM_GETTEXT, MAX_PATH, (LPARAM)dvddevice); | |
682 dvd_device = strdup(dvddevice); | |
683 SendDlgItemMessage(hwnd, ID_CDDEVICE, WM_GETTEXT, MAX_PATH, (LPARAM)cdromdevice); | |
684 cdrom_device = strdup(cdromdevice); | |
685 | |
34163 | 686 MessageBox(hwnd, acp(MSGTR_PREFERENCES_Message), acp(MSGTR_MSGBOX_LABEL_Warning), MB_OK); |
23077 | 687 DestroyWindow(hwnd); |
688 break; | |
689 } | |
690 } | |
691 return 0; | |
692 } | |
693 } | |
694 return DefWindowProc(hwnd, iMsg, wParam, lParam); | |
695 } | |
696 | |
697 void display_prefswindow(gui_t *gui) | |
698 { | |
699 HWND hWnd; | |
700 HINSTANCE hInstance = GetModuleHandle(NULL); | |
701 WNDCLASS wc; | |
702 int x, y; | |
34163 | 703 if(FindWindow(NULL, acp(MSGTR_Preferences))) return; |
23077 | 704 wc.style = CS_HREDRAW | CS_VREDRAW; |
705 wc.lpfnWndProc = PrefsWndProc; | |
706 wc.cbClsExtra = 0; | |
707 wc.cbWndExtra = 0; | |
708 wc.hInstance = hInstance; | |
709 wc.hCursor = LoadCursor(NULL,IDC_ARROW); | |
710 wc.hIcon = gui->icon; | |
711 wc.hbrBackground = SOLID_GREY; | |
34163 | 712 wc.lpszClassName = acp(MSGTR_Preferences); |
23077 | 713 wc.lpszMenuName = NULL; |
714 RegisterClass(&wc); | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
715 x = (GetSystemMetrics(SM_CXSCREEN) / 2) - (425 / 2); |
34087 | 716 y = (GetSystemMetrics(SM_CYSCREEN) / 2) - (474 / 2); |
34163 | 717 hWnd = CreateWindow(acp(MSGTR_Preferences), |
718 acp(MSGTR_Preferences), | |
23077 | 719 WS_POPUPWINDOW | WS_CAPTION, |
720 x, | |
721 y, | |
34164
d57ed389b6e2
Resize the Win32 GUI preference window and reposition items.
ib
parents:
34163
diff
changeset
|
722 425, |
34087 | 723 474, |
23077 | 724 NULL, |
725 NULL, | |
726 hInstance, | |
727 NULL); | |
33638
dbca6aa18b50
Cast new user data value in SetWindowLongPtr() to LONG_PTR.
ib
parents:
33619
diff
changeset
|
728 SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) gui); |
23077 | 729 ShowWindow(hWnd, SW_SHOW); |
730 UpdateWindow(hWnd); | |
731 } |