annotate Gui/win32/preferences.c @ 19285:87e3e034e324

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