annotate gui/win32/preferences.c @ 29396:2de35e358503

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