annotate gui/win32/preferences.c @ 23868:09c2fe1e021d

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