annotate gui/win32/preferences.c @ 34815:049b24e18a65

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