ReactOS  0.4.15-dev-5109-g2469ce2
volume.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Multimedia Control Panel
3  * FILE: dll/cpl/mmsys/volume.c
4  * PURPOSE: ReactOS Multimedia Control Panel
5  * PROGRAMMER: Thomas Weidenmueller <w3seek@reactos.com>
6  * Johannes Anderwald <janderwald@reactos.com>
7  * Dmitry Chapyshev <dmitry@reactos.org>
8  */
9 
10 #include "mmsys.h"
11 
12 #include <shellapi.h>
13 
14 
15 typedef struct _GLOBAL_DATA
16 {
17  HMIXER hMixer;
22 
25 
31 
36 
38 
39 
40 VOID
42 {
43  MIXERLINEW mxln;
44  MIXERCONTROLW mxc;
45  MIXERLINECONTROLSW mxlctrl;
46 
47  if (pGlobalData->hMixer == NULL)
48  return;
49 
50  mxln.cbStruct = sizeof(MIXERLINEW);
52 
55  return;
56 
57  mxlctrl.cbStruct = sizeof(MIXERLINECONTROLSW);
58  mxlctrl.dwLineID = mxln.dwLineID;
60  mxlctrl.cControls = 1;
61  mxlctrl.cbmxctrl = sizeof(MIXERCONTROLW);
62  mxlctrl.pamxctrl = &mxc;
63 
66  return;
67 
68  pGlobalData->muteControlID = mxc.dwControlID;
69 }
70 
71 
72 VOID
74 {
77 
78  if (pGlobalData->hMixer == NULL)
79  return;
80 
81  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
82  mxcd.dwControlID = pGlobalData->muteControlID;
83  mxcd.cChannels = 1;
84  mxcd.cMultipleItems = 0;
86  mxcd.paDetails = &mxcdMute;
87 
90  return;
91 
92  pGlobalData->muteVal = mxcdMute.fValue;
93 }
94 
95 
96 VOID
98 {
100  MIXERCONTROLDETAILS mxcd;
101 
102  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
103  mxcd.dwControlID = pGlobalData->muteControlID;
104  mxcd.cChannels = 1;
105  mxcd.cMultipleItems = 0;
106  mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN);
107  mxcd.paDetails = &mxcdMute;
108 
109  mxcdMute.fValue = !pGlobalData->muteVal;
111  != MMSYSERR_NOERROR)
112  return;
113 
114  pGlobalData->muteVal = mxcdMute.fValue;
115 }
116 
117 
118 VOID
120 {
121  MIXERLINEW mxln;
122  MIXERCONTROLW mxc;
123  MIXERLINECONTROLSW mxlc;
124 
125  if (pGlobalData->hMixer == NULL)
126  return;
127 
128  mxln.cbStruct = sizeof(MIXERLINEW);
131  != MMSYSERR_NOERROR)
132  return;
133 
134  pGlobalData->volumeChannels = mxln.cChannels;
135 
136  mxlc.cbStruct = sizeof(MIXERLINECONTROLSW);
137  mxlc.dwLineID = mxln.dwLineID;
139  mxlc.cControls = 1;
140  mxlc.cbmxctrl = sizeof(MIXERCONTROLW);
141  mxlc.pamxctrl = &mxc;
143  != MMSYSERR_NOERROR)
144  return;
145 
146  pGlobalData->volumeMinimum = mxc.Bounds.dwMinimum;
147  pGlobalData->volumeMaximum = mxc.Bounds.dwMaximum;
148  pGlobalData->volumeControlID = mxc.dwControlID;
149  pGlobalData->volumeStep = (pGlobalData->volumeMaximum - pGlobalData->volumeMinimum) / (VOLUME_MAX - VOLUME_MIN);
150 
152  0,
153  mxln.cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED));
154  if (pGlobalData->volumeInitialValues == NULL)
155  return;
156 
158  0,
159  mxln.cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED));
160  if (pGlobalData->volumePreviousValues == NULL)
161  return;
162 
164  0,
165  mxln.cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED));
166  if (pGlobalData->volumeCurrentValues == NULL)
167  return;
168 }
169 
170 
171 VOID
173  PGLOBAL_DATA pGlobalData,
174  BOOL bInit)
175 {
176  MIXERCONTROLDETAILS mxcd;
177  DWORD i;
178 
179  if (pGlobalData->hMixer == NULL)
180  return;
181 
182  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
183  mxcd.dwControlID = pGlobalData->volumeControlID;
184  mxcd.cChannels = pGlobalData->volumeChannels;
185  mxcd.cMultipleItems = 0;
187  mxcd.paDetails = pGlobalData->volumePreviousValues;
188 
190  != MMSYSERR_NOERROR)
191  return;
192 
193  pGlobalData->maxVolume = 0;
194  for (i = 0; i < pGlobalData->volumeChannels; i++)
195  {
196  pGlobalData->volumeCurrentValues[i].dwValue = pGlobalData->volumePreviousValues[i].dwValue;
197 
198  if (pGlobalData->volumePreviousValues[i].dwValue > pGlobalData->maxVolume)
199  pGlobalData->maxVolume = pGlobalData->volumePreviousValues[i].dwValue;
200 
201  if (bInit)
202  pGlobalData->volumeInitialValues[i].dwValue = pGlobalData->volumeCurrentValues[i].dwValue;
203  }
204 }
205 
206 
207 VOID
209  DWORD dwPosition)
210 {
211  MIXERCONTROLDETAILS mxcd;
212  DWORD dwVolume, i;
213 
214  if (pGlobalData->hMixer == NULL)
215  return;
216 
217  if (dwPosition == VOLUME_MIN)
218  dwVolume = pGlobalData->volumeMinimum;
219  else if (dwPosition == VOLUME_MAX)
220  dwVolume = pGlobalData->volumeMaximum;
221  else
222  dwVolume = (dwPosition * pGlobalData->volumeStep) + pGlobalData->volumeMinimum;
223 
224  for (i = 0; i < pGlobalData->volumeChannels; i++)
225  {
226  if (pGlobalData->volumePreviousValues[i].dwValue == pGlobalData->maxVolume)
227  {
228  pGlobalData->volumeCurrentValues[i].dwValue = dwVolume;
229  }
230  else
231  {
232  pGlobalData->volumeCurrentValues[i].dwValue =
233  pGlobalData->volumePreviousValues[i].dwValue * dwVolume / pGlobalData->maxVolume;
234  }
235  }
236 
237  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
238  mxcd.dwControlID = pGlobalData->volumeControlID;
239  mxcd.cChannels = pGlobalData->volumeChannels;
240  mxcd.cMultipleItems = 0;
242  mxcd.paDetails = pGlobalData->volumeCurrentValues;
243 
245  != MMSYSERR_NOERROR)
246  return;
247 }
248 
249 
250 static
251 VOID
253  PGLOBAL_DATA pGlobalData)
254 {
255  MIXERCONTROLDETAILS mxcd;
256 
257  if (pGlobalData->hMixer == NULL)
258  return;
259 
260  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
261  mxcd.dwControlID = pGlobalData->volumeControlID;
262  mxcd.cChannels = pGlobalData->volumeChannels;
263  mxcd.cMultipleItems = 0;
265  mxcd.paDetails = pGlobalData->volumeInitialValues;
266 
267  mixerSetControlDetails((HMIXEROBJ)pGlobalData->hMixer,
268  &mxcd,
270 }
271 
272 
273 static
274 VOID
276 {
277  HWND hwndTaskBar;
278 
279  hwndTaskBar = FindWindowW(L"SystemTray_Main", NULL);
280  if (hwndTaskBar == NULL)
281  return;
282 
283  SendMessageW(hwndTaskBar, WM_USER + 220, 4, bEnabled);
284 }
285 
286 static
287 BOOL
289 {
290  HWND hwndTaskBar;
291 
292  hwndTaskBar = FindWindowW(L"SystemTray_Main", NULL);
293  if (hwndTaskBar == NULL)
294  {
295  return FALSE;
296  }
297 
298  return (BOOL)SendMessageW(hwndTaskBar, WM_USER + 221, 4, 0);
299 }
300 
301 VOID
302 InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
303 {
304  UINT NumMixers;
305  MIXERCAPSW mxc;
306  WCHAR szNoDevices[256];
307 
308  LoadStringW(hApplet, IDS_NO_DEVICES, szNoDevices, _countof(szNoDevices));
309 
313 
314  NumMixers = mixerGetNumDevs();
315  if (!NumMixers)
316  {
326  SetDlgItemTextW(hwndDlg, IDC_DEVICE_NAME, szNoDevices);
327  return;
328  }
329 
330  if (mixerOpen(&pGlobalData->hMixer, 0, PtrToUlong(hwndDlg), 0, MIXER_OBJECTF_MIXER | CALLBACK_WINDOW) != MMSYSERR_NOERROR)
331  {
332  MessageBoxW(hwndDlg, L"Cannot open mixer", NULL, MB_OK);
333  return;
334  }
335 
336  ZeroMemory(&mxc, sizeof(MIXERCAPSW));
337  if (mixerGetDevCapsW(PtrToUint(pGlobalData->hMixer), &mxc, sizeof(MIXERCAPSW)) != MMSYSERR_NOERROR)
338  {
339  MessageBoxW(hwndDlg, L"mixerGetDevCaps failed", NULL, MB_OK);
340  return;
341  }
342 
343  CheckDlgButton(hwndDlg,
346 
347  GetMuteControl(pGlobalData);
348  GetMuteState(pGlobalData);
349  if (pGlobalData->muteVal)
350  {
353  }
354  else
355  {
358  }
359 
360  GetVolumeControl(pGlobalData);
361  GetVolumeValue(pGlobalData, TRUE);
362 
364  SendDlgItemMessageW(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->maxVolume - pGlobalData->volumeMinimum) / pGlobalData->volumeStep);
365 }
366 
367 VOID
368 SaveData(HWND hwndDlg)
369 {
370  BOOL bShowIcon;
371 
372  bShowIcon = (IsDlgButtonChecked(hwndDlg, IDC_ICON_IN_TASKBAR) == BST_CHECKED);
373 
374  SetSystrayVolumeIconState(bShowIcon);
375 }
376 
377 VOID
379 {
380  if ((INT_PTR)ShellExecuteW(NULL, L"open", L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL) > 32)
381  return;
382  MessageBoxW(hwndDlg, L"Cannot run sndvol32.exe", NULL, MB_OK);
383 }
384 
385 /* Volume property page dialog callback */
386 //static INT_PTR CALLBACK
389  UINT uMsg,
390  WPARAM wParam,
391  LPARAM lParam)
392 {
393  static const INT speakImgSize[] = {72, 72};
394  PGLOBAL_DATA pGlobalData;
395 
396  pGlobalData = (PGLOBAL_DATA)GetWindowLongPtrW(hwndDlg, DWLP_USER);
397 
398  switch (uMsg)
399  {
400  case MM_MIXM_LINE_CHANGE:
401  {
402  GetMuteState(pGlobalData);
403  if (pGlobalData->muteVal)
404  {
407  }
408  else
409  {
412  }
413  break;
414  }
416  {
417  GetVolumeValue(pGlobalData, FALSE);
418  SendDlgItemMessageW(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->maxVolume - pGlobalData->volumeMinimum) / pGlobalData->volumeStep);
419  break;
420  }
421  case WM_INITDIALOG:
422  {
424  SetWindowLongPtrW(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
425 
426  pGlobalData->hIconUnMuted = LoadImageW(hApplet, MAKEINTRESOURCEW(IDI_CPLICON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
427  pGlobalData->hIconMuted = LoadImageW(hApplet, MAKEINTRESOURCEW(IDI_MUTED_ICON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
428  pGlobalData->hIconNoHW = LoadImageW(hApplet, MAKEINTRESOURCEW(IDI_NO_HW), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
429  pGlobalData->hIconSpeakImg = LoadImageW(hApplet,
431  IMAGE_ICON,
432  speakImgSize[0],
433  speakImgSize[1],
435 
436  InitVolumeControls(hwndDlg, pGlobalData);
437  break;
438  }
439 
440  case WM_DRAWITEM:
441  {
442  LPDRAWITEMSTRUCT lpDrawItem;
443  lpDrawItem = (LPDRAWITEMSTRUCT)lParam;
444  if (lpDrawItem->CtlID == IDC_SPEAKIMG)
445  {
446  LONG left;
447 
448  /* Position image in centre of dialog */
449  left = (lpDrawItem->rcItem.right - speakImgSize[0]) / 2;
450 
451  DrawIconEx(lpDrawItem->hDC,
452  left,
453  lpDrawItem->rcItem.top,
454  pGlobalData->hIconSpeakImg,
455  speakImgSize[0],
456  speakImgSize[1],
457  0,
458  NULL,
459  DI_NORMAL);
460  }
461  break;
462  }
463 
464  case WM_COMMAND:
465  {
466  switch (LOWORD(wParam))
467  {
468  case IDC_MUTE_CHECKBOX:
469  if (HIWORD(wParam) == BN_CLICKED)
470  {
471  SwitchMuteState(pGlobalData);
472  if (pGlobalData->muteVal)
473  {
475  }
476  else
477  {
479  }
480 
481  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
482  }
483  break;
484 
485  case IDC_ICON_IN_TASKBAR:
486  if (HIWORD(wParam) == BN_CLICKED)
487  {
488  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
489  }
490  break;
491 
492  case IDC_ADVANCED_BTN:
493  LaunchSoundControl(hwndDlg);
494  break;
495 
496  case IDC_SPEAKER_VOL_BTN:
497  SpeakerVolume(hwndDlg);
498  break;
499  }
500  break;
501  }
502 
503  case WM_HSCROLL:
504  {
505  HWND hVolumeTrackbar = GetDlgItem(hwndDlg, IDC_VOLUME_TRACKBAR);
506  if (hVolumeTrackbar == (HWND)lParam)
507  {
508  switch (LOWORD(wParam))
509  {
510  case TB_THUMBPOSITION:
511  break;
512 
513  case TB_ENDTRACK:
515  break;
516 
517  default:
518  SetVolumeValue(pGlobalData,
520  break;
521  }
522  }
523  break;
524  }
525 
526  case WM_DESTROY:
527  if (pGlobalData)
528  {
529  HeapFree(GetProcessHeap(), 0, pGlobalData->volumeCurrentValues);
530  HeapFree(GetProcessHeap(), 0, pGlobalData->volumePreviousValues);
531  HeapFree(GetProcessHeap(), 0, pGlobalData->volumeInitialValues);
532  mixerClose(pGlobalData->hMixer);
533 
534  if (pGlobalData->hIconSpeakImg)
535  DestroyIcon(pGlobalData->hIconSpeakImg);
536 
537  if (pGlobalData->hIconNoHW)
538  DestroyIcon(pGlobalData->hIconNoHW);
539 
540  if (pGlobalData->hIconMuted)
541  DestroyIcon(pGlobalData->hIconMuted);
542 
543  if (pGlobalData->hIconUnMuted)
544  DestroyIcon(pGlobalData->hIconUnMuted);
545 
546  HeapFree(GetProcessHeap(), 0, pGlobalData);
547  }
548  break;
549 
550  case WM_NOTIFY:
551  switch (((LPNMHDR)lParam)->code)
552  {
553  case PSN_APPLY:
554  SaveData(hwndDlg);
555  break;
556 
557  case PSN_RESET:
558  RestoreVolumeValue(pGlobalData);
559  break;
560  }
561  return TRUE;
562  }
563 
564  return FALSE;
565 }
PMIXERCONTROLDETAILS_UNSIGNED volumeInitialValues
Definition: volume.c:33
INT_PTR CALLBACK VolumeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: volume.c:388
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:684
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
#define PtrToUint(p)
Definition: basetsd.h:85
#define SND_ALIAS_ID
Definition: mmsystem.h:161
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
static HICON
Definition: imagelist.c:84
#define IMAGE_ICON
Definition: winuser.h:212
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
struct tMIXERCONTROLDETAILS_UNSIGNED MIXERCONTROLDETAILS_UNSIGNED
UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
Definition: winmm.c:595
LPMIXERCONTROLW pamxctrl
Definition: mmsystem.h:1350
UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW, DWORD fdwDetails)
Definition: winmm.c:426
#define IDI_MUTED_ICON
Definition: resource.h:14
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HICON hIconNoHW
Definition: volume.c:20
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define TRUE
Definition: types.h:120
static BOOL GetSystrayVolumeIconState(VOID)
Definition: volume.c:288
DWORD volumeMaximum
Definition: volume.c:29
struct _GLOBAL_DATA * PGLOBAL_DATA
#define IDI_SPEAKIMG
Definition: resource.h:69
#define CALLBACK
Definition: compat.h:35
VOID LaunchSoundControl(HWND hwndDlg)
Definition: volume.c:378
#define TBM_SETRANGE
Definition: commctrl.h:2037
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
struct tagMIXERLINECONTROLSW MIXERLINECONTROLSW
DWORD maxVolume
Definition: volume.c:32
LONG top
Definition: windef.h:307
#define IDC_VOLUME_LOW
Definition: resource.h:34
DWORD dwLineID
Definition: mmsystem.h:1258
#define ZeroMemory
Definition: winbase.h:1667
DWORD volumeMinimum
Definition: volume.c:28
#define TBM_SETPOS
Definition: commctrl.h:2036
#define VOLUME_MAX
Definition: sndvol32.h:19
HINSTANCE hApplet
Definition: access.c:17
#define MIXER_GETLINEINFOF_COMPONENTTYPE
Definition: mmsystem.h:347
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define GetWindowLongPtrW
Definition: winuser.h:4819
DWORD volumeControlID
Definition: volume.c:26
#define PSN_APPLY
Definition: prsht.h:117
int32_t INT_PTR
Definition: typedefs.h:64
struct tagMIXERCONTROLW MIXERCONTROLW
LONG right
Definition: windef.h:308
#define IDC_VOLUME_HIGH
Definition: resource.h:35
VOID SetVolumeValue(PGLOBAL_DATA pGlobalData, DWORD dwPosition)
Definition: volume.c:208
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
VOID GetVolumeValue(PGLOBAL_DATA pGlobalData, BOOL bInit)
Definition: volume.c:172
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
PMIXERCONTROLDETAILS_UNSIGNED volumePreviousValues
Definition: volume.c:34
HICON hIconSpeakImg
Definition: volume.c:21
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
VOID InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
Definition: volume.c:302
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
struct tagMIXERLINEW MIXERLINEW
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
long LONG
Definition: pedump.c:60
#define IDC_VOLUME_TRACKBAR
Definition: resource.h:33
#define TBM_GETPOS
Definition: commctrl.h:2031
VOID GetMuteState(PGLOBAL_DATA pGlobalData)
Definition: volume.c:73
DWORD dwComponentType
Definition: mmsystem.h:1261
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define TBM_SETPAGESIZE
Definition: commctrl.h:2051
LONG_PTR LPARAM
Definition: windef.h:208
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342
#define TBM_SETTICFREQ
Definition: commctrl.h:2050
#define IDC_ICON_IN_TASKBAR
Definition: resource.h:37
#define VOLUME_PAGESIZE
Definition: mmsys.h:45
#define WM_SETTEXT
Definition: winuser.h:1607
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define PtrToUlong(u)
Definition: config.h:107
#define WM_DESTROY
Definition: winuser.h:1599
#define SND_ALIAS_SYSTEMDEFAULT
Definition: mmsystem.h:175
#define IDC_ADVANCED_BTN
Definition: resource.h:51
#define BM_SETCHECK
Definition: winuser.h:1911
struct _GLOBAL_DATA GLOBAL_DATA
HICON hIconMuted
Definition: volume.c:18
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HMIXER hMixer
Definition: volume.c:17
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
#define VOLUME_TICFREQ
Definition: mmsys.h:44
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
DWORD cChannels
Definition: mmsystem.h:1262
#define _countof(array)
Definition: sndvol32.h:68
DWORD cbStruct
Definition: mmsystem.h:1255
#define BN_CLICKED
Definition: winuser.h:1915
#define for
Definition: utility.h:88
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
#define IDI_CPLICON
Definition: resource.h:4
union tagMIXERCONTROLW::@3003 Bounds
#define IDS_NO_DEVICES
Definition: resource.h:91
#define SND_ASYNC
Definition: mmsystem.h:154
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR SpeakerVolume(HWND hwndDlg)
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
#define IDC_DEVICE_NAME
Definition: resource.h:50
DWORD volumeChannels
Definition: volume.c:27
#define TB_ENDTRACK
Definition: commctrl.h:2081
UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, DWORD fdwControls)
Definition: winmm.c:574
PMIXERCONTROLDETAILS_UNSIGNED volumeCurrentValues
Definition: volume.c:35
#define IDC_ADVANCED2_BTN
Definition: resource.h:54
#define IDI_NO_HW
Definition: resource.h:13
#define DWLP_USER
Definition: winuser.h:866
static VOID RestoreVolumeValue(PGLOBAL_DATA pGlobalData)
Definition: volume.c:252
#define DI_NORMAL
Definition: wingdi.h:72
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
Definition: winmm.c:317
#define WM_COMMAND
Definition: winuser.h:1730
DWORD muteControlID
Definition: volume.c:24
Definition: inflate.c:139
#define BST_UNCHECKED
Definition: winuser.h:199
#define WM_USER
Definition: winuser.h:1885
HICON hIconUnMuted
Definition: volume.c:19
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
struct tMIXERCONTROLDETAILS_BOOLEAN MIXERCONTROLDETAILS_BOOLEAN
HWND WINAPI GetParent(_In_ HWND)
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
Definition: mmsystem.h:319
DWORD volumeStep
Definition: volume.c:30
#define PSN_RESET
Definition: prsht.h:118
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:283
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static VOID SetSystrayVolumeIconState(BOOL bEnabled)
Definition: volume.c:275
#define VOLUME_MIN
Definition: sndvol32.h:18
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
#define WM_HSCROLL
Definition: winuser.h:1733
#define MB_OK
Definition: winuser.h:784
#define MIXER_GETLINECONTROLSF_ONEBYTYPE
Definition: mmsystem.h:410
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define STM_SETIMAGE
Definition: winuser.h:2083
#define BST_CHECKED
Definition: winuser.h:197
#define WM_DRAWITEM
Definition: winuser.h:1635
#define IDC_MUTE_CHECKBOX
Definition: resource.h:36
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2354
#define HIWORD(l)
Definition: typedefs.h:247
LONG muteVal
Definition: volume.c:23
#define IDC_SPEAKIMG
Definition: resource.h:70
#define SetWindowLongPtrW
Definition: winuser.h:5336
#define MM_MIXM_LINE_CHANGE
Definition: mmsystem.h:82
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDC_MUTE_ICON
Definition: resource.h:71
VOID GetVolumeControl(PGLOBAL_DATA pGlobalData)
Definition: volume.c:119
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081
#define TB_THUMBPOSITION
Definition: commctrl.h:2077
#define WM_INITDIALOG
Definition: winuser.h:1729
VOID SaveData(HWND hwndDlg)
Definition: volume.c:368
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDC_SPEAKER_VOL_BTN
Definition: resource.h:53
#define HeapFree(x, y, z)
Definition: compat.h:594
#define WM_NOTIFY
Definition: richedit.h:61
VOID SwitchMuteState(PGLOBAL_DATA pGlobalData)
Definition: volume.c:97
VOID GetMuteControl(PGLOBAL_DATA pGlobalData)
Definition: volume.c:41
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:531
#define MM_MIXM_CONTROL_CHANGE
Definition: mmsystem.h:83