ReactOS  0.4.14-dev-614-gbfd8a84
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 _IMGINFO
16 {
18  INT cxSource;
19  INT cySource;
20 } IMGINFO, *PIMGINFO;
21 
22 
23 typedef struct _GLOBAL_DATA
24 {
25  HMIXER hMixer;
29 
32 
38 
43 
45 
46 
47 static VOID
49 {
50  BITMAP bitmap;
51 
52  ZeroMemory(ImgInfo, sizeof(*ImgInfo));
53 
54  ImgInfo->hBitmap = LoadImage(hApplet,
57  0,
58  0,
60 
61  if (ImgInfo->hBitmap != NULL)
62  {
63  GetObject(ImgInfo->hBitmap, sizeof(BITMAP), &bitmap);
64 
65  ImgInfo->cxSource = bitmap.bmWidth;
66  ImgInfo->cySource = bitmap.bmHeight;
67  }
68 }
69 
70 
71 VOID
73 {
74  MIXERLINE mxln;
75  MIXERCONTROL mxc;
76  MIXERLINECONTROLS mxlctrl;
77 
78  if (pGlobalData->hMixer == NULL)
79  return;
80 
81  mxln.cbStruct = sizeof(MIXERLINE);
83 
85  != MMSYSERR_NOERROR) return;
86 
87  mxlctrl.cbStruct = sizeof(MIXERLINECONTROLS);
88  mxlctrl.dwLineID = mxln.dwLineID;
90  mxlctrl.cControls = 1;
91  mxlctrl.cbmxctrl = sizeof(MIXERCONTROL);
92  mxlctrl.pamxctrl = &mxc;
93 
95  != MMSYSERR_NOERROR) return;
96 
97  pGlobalData->muteControlID = mxc.dwControlID;
98 }
99 
100 
101 VOID
103 {
105  MIXERCONTROLDETAILS mxcd;
106 
107  if (pGlobalData->hMixer == NULL)
108  return;
109 
110  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
111  mxcd.dwControlID = pGlobalData->muteControlID;
112  mxcd.cChannels = 1;
113  mxcd.cMultipleItems = 0;
114  mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN);
115  mxcd.paDetails = &mxcdMute;
116 
118  != MMSYSERR_NOERROR)
119  return;
120 
121  pGlobalData->muteVal = mxcdMute.fValue;
122 }
123 
124 
125 VOID
127 {
129  MIXERCONTROLDETAILS mxcd;
130 
131  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
132  mxcd.dwControlID = pGlobalData->muteControlID;
133  mxcd.cChannels = 1;
134  mxcd.cMultipleItems = 0;
135  mxcd.cbDetails = sizeof(MIXERCONTROLDETAILS_BOOLEAN);
136  mxcd.paDetails = &mxcdMute;
137 
138  mxcdMute.fValue = !pGlobalData->muteVal;
140  != MMSYSERR_NOERROR)
141  return;
142 
143  pGlobalData->muteVal = mxcdMute.fValue;
144 }
145 
146 
147 VOID
149 {
150  MIXERLINE mxln;
151  MIXERCONTROL mxc;
152  MIXERLINECONTROLS mxlc;
153 
154  if (pGlobalData->hMixer == NULL)
155  return;
156 
157  mxln.cbStruct = sizeof(MIXERLINE);
160  != MMSYSERR_NOERROR)
161  return;
162 
163  pGlobalData->volumeChannels = mxln.cChannels;
164 
165  mxlc.cbStruct = sizeof(MIXERLINECONTROLS);
166  mxlc.dwLineID = mxln.dwLineID;
168  mxlc.cControls = 1;
169  mxlc.cbmxctrl = sizeof(MIXERCONTROL);
170  mxlc.pamxctrl = &mxc;
172  != MMSYSERR_NOERROR)
173  return;
174 
175  pGlobalData->volumeMinimum = mxc.Bounds.dwMinimum;
176  pGlobalData->volumeMaximum = mxc.Bounds.dwMaximum;
177  pGlobalData->volumeControlID = mxc.dwControlID;
178  pGlobalData->volumeStep = (pGlobalData->volumeMaximum - pGlobalData->volumeMinimum) / (VOLUME_MAX - VOLUME_MIN);
179 
181  0,
182  mxln.cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED));
183  if (pGlobalData->volumeInitialValues == NULL)
184  return;
185 
187  0,
188  mxln.cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED));
189  if (pGlobalData->volumePreviousValues == NULL)
190  return;
191 
193  0,
194  mxln.cChannels * sizeof(MIXERCONTROLDETAILS_UNSIGNED));
195  if (pGlobalData->volumeCurrentValues == NULL)
196  return;
197 }
198 
199 
200 VOID
202  PGLOBAL_DATA pGlobalData,
203  BOOL bInit)
204 {
205  MIXERCONTROLDETAILS mxcd;
206  DWORD i;
207 
208  if (pGlobalData->hMixer == NULL)
209  return;
210 
211  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
212  mxcd.dwControlID = pGlobalData->volumeControlID;
213  mxcd.cChannels = pGlobalData->volumeChannels;
214  mxcd.cMultipleItems = 0;
216  mxcd.paDetails = pGlobalData->volumePreviousValues;
217 
219  != MMSYSERR_NOERROR)
220  return;
221 
222  pGlobalData->maxVolume = 0;
223  for (i = 0; i < pGlobalData->volumeChannels; i++)
224  {
225  pGlobalData->volumeCurrentValues[i].dwValue = pGlobalData->volumePreviousValues[i].dwValue;
226 
227  if (pGlobalData->volumePreviousValues[i].dwValue > pGlobalData->maxVolume)
228  pGlobalData->maxVolume = pGlobalData->volumePreviousValues[i].dwValue;
229 
230  if (bInit)
231  pGlobalData->volumeInitialValues[i].dwValue = pGlobalData->volumeCurrentValues[i].dwValue;
232  }
233 }
234 
235 
236 VOID
238  DWORD dwPosition)
239 {
240  MIXERCONTROLDETAILS mxcd;
241  DWORD dwVolume, i;
242 
243  if (pGlobalData->hMixer == NULL)
244  return;
245 
246  if (dwPosition == VOLUME_MIN)
247  dwVolume = pGlobalData->volumeMinimum;
248  else if (dwPosition == VOLUME_MAX)
249  dwVolume = pGlobalData->volumeMaximum;
250  else
251  dwVolume = (dwPosition * pGlobalData->volumeStep) + pGlobalData->volumeMinimum;
252 
253  for (i = 0; i < pGlobalData->volumeChannels; i++)
254  {
255  if (pGlobalData->volumePreviousValues[i].dwValue == pGlobalData->maxVolume)
256  {
257  pGlobalData->volumeCurrentValues[i].dwValue = dwVolume;
258  }
259  else
260  {
261  pGlobalData->volumeCurrentValues[i].dwValue =
262  pGlobalData->volumePreviousValues[i].dwValue * dwVolume / pGlobalData-> maxVolume;
263  }
264  }
265 
266  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
267  mxcd.dwControlID = pGlobalData->volumeControlID;
268  mxcd.cChannels = pGlobalData->volumeChannels;
269  mxcd.cMultipleItems = 0;
271  mxcd.paDetails = pGlobalData->volumeCurrentValues;
272 
274  != MMSYSERR_NOERROR)
275  return;
276 }
277 
278 
279 static
280 VOID
282  PGLOBAL_DATA pGlobalData)
283 {
284  MIXERCONTROLDETAILS mxcd;
285 
286  if (pGlobalData->hMixer == NULL)
287  return;
288 
289  mxcd.cbStruct = sizeof(MIXERCONTROLDETAILS);
290  mxcd.dwControlID = pGlobalData->volumeControlID;
291  mxcd.cChannels = pGlobalData->volumeChannels;
292  mxcd.cMultipleItems = 0;
294  mxcd.paDetails = pGlobalData->volumeInitialValues;
295 
296  mixerSetControlDetails((HMIXEROBJ)pGlobalData->hMixer,
297  &mxcd,
299 }
300 
301 
302 static
303 VOID
305 {
306  HWND hwndTaskBar;
307 
308  hwndTaskBar = FindWindowW(L"SystemTray_Main", NULL);
309  if (hwndTaskBar == NULL)
310  return;
311 
312  SendMessageW(hwndTaskBar, WM_USER + 220, 4, bEnabled);
313 }
314 
315 static
316 BOOL
318 {
319  HWND hwndTaskBar;
320 
321  hwndTaskBar = FindWindowW(L"SystemTray_Main", NULL);
322  if (hwndTaskBar == NULL)
323  {
324  return FALSE;
325  }
326 
327  return (BOOL)SendMessageW(hwndTaskBar, WM_USER + 221, 4, 0);
328 }
329 
330 VOID
331 InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
332 {
333  UINT NumMixers;
334  MIXERCAPS mxc;
335  TCHAR szNoDevices[256];
336 
337  LoadString(hApplet, IDS_NO_DEVICES, szNoDevices, _countof(szNoDevices));
338 
342 
343  NumMixers = mixerGetNumDevs();
344  if (!NumMixers)
345  {
355  SetDlgItemText(hwndDlg, IDC_DEVICE_NAME, szNoDevices);
356  return;
357  }
358 
359  if (mixerOpen(&pGlobalData->hMixer, 0, PtrToUlong(hwndDlg), 0, MIXER_OBJECTF_MIXER | CALLBACK_WINDOW) != MMSYSERR_NOERROR)
360  {
361  MessageBox(hwndDlg, _T("Cannot open mixer"), NULL, MB_OK);
362  return;
363  }
364 
365  ZeroMemory(&mxc, sizeof(MIXERCAPS));
366  if (mixerGetDevCaps(PtrToUint(pGlobalData->hMixer), &mxc, sizeof(MIXERCAPS)) != MMSYSERR_NOERROR)
367  {
368  MessageBox(hwndDlg, _T("mixerGetDevCaps failed"), NULL, MB_OK);
369  return;
370  }
371 
372  CheckDlgButton(hwndDlg,
375 
376  GetMuteControl(pGlobalData);
377  GetMuteState(pGlobalData);
378  if (pGlobalData->muteVal)
379  {
382  }
383  else
384  {
387  }
388 
389  GetVolumeControl(pGlobalData);
390  GetVolumeValue(pGlobalData, TRUE);
391 
393  SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->maxVolume - pGlobalData->volumeMinimum) / pGlobalData->volumeStep);
394 }
395 
396 VOID
397 SaveData(HWND hwndDlg)
398 {
399  BOOL bShowIcon;
400 
401  bShowIcon = (IsDlgButtonChecked(hwndDlg, IDC_ICON_IN_TASKBAR) == BST_CHECKED);
402 
403  SetSystrayVolumeIconState(bShowIcon);
404 }
405 
406 VOID
408 {
409  if ((INT_PTR)ShellExecuteW(NULL, L"open", L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL) > 32)
410  return;
411  MessageBox(hwndDlg, _T("Cannot run sndvol32.exe"), NULL, MB_OK);
412 }
413 
414 /* Volume property page dialog callback */
415 //static INT_PTR CALLBACK
418  UINT uMsg,
419  WPARAM wParam,
420  LPARAM lParam)
421 {
422  static IMGINFO ImgInfo;
423  PGLOBAL_DATA pGlobalData;
426 
427  pGlobalData = (PGLOBAL_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
428 
429  switch(uMsg)
430  {
431  case MM_MIXM_LINE_CHANGE:
432  {
433  GetMuteState(pGlobalData);
434  if (pGlobalData->muteVal)
435  {
438  }
439  else
440  {
443  }
444  break;
445  }
447  {
448  GetVolumeValue(pGlobalData, FALSE);
449  SendDlgItemMessage(hwndDlg, IDC_VOLUME_TRACKBAR, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(pGlobalData->maxVolume - pGlobalData->volumeMinimum) / pGlobalData->volumeStep);
450  break;
451  }
452  case WM_INITDIALOG:
453  {
454  pGlobalData = (GLOBAL_DATA*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA));
455  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pGlobalData);
456 
457  pGlobalData->hIconUnMuted = LoadImage(hApplet, MAKEINTRESOURCE(IDI_CPLICON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
458  pGlobalData->hIconMuted = LoadImage(hApplet, MAKEINTRESOURCE(IDI_MUTED_ICON), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
459  pGlobalData->hIconNoHW = LoadImage(hApplet, MAKEINTRESOURCE(IDI_NO_HW), IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR);
460 
461  InitImageInfo(&ImgInfo);
462  InitVolumeControls(hwndDlg, pGlobalData);
463  break;
464  }
465 
466  case WM_DRAWITEM:
467  {
468  LPDRAWITEMSTRUCT lpDrawItem;
469  lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
470  if(lpDrawItem->CtlID == IDC_SPEAKIMG)
471  {
472  HDC hdcMem;
473  LONG left;
474 
475  /* Position image in centre of dialog */
476  left = (lpDrawItem->rcItem.right - ImgInfo.cxSource) / 2;
477 
478  hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
479  if (hdcMem != NULL)
480  {
481  SelectObject(hdcMem, ImgInfo.hBitmap);
482  BitBlt(lpDrawItem->hDC,
483  left,
484  lpDrawItem->rcItem.top,
485  lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
486  lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
487  hdcMem,
488  0,
489  0,
490  SRCCOPY);
491  DeleteDC(hdcMem);
492  }
493  }
494  break;
495  }
496 
497  case WM_COMMAND:
498  {
499  switch (LOWORD(wParam))
500  {
501  case IDC_MUTE_CHECKBOX:
502  if (HIWORD(wParam) == BN_CLICKED)
503  {
504  SwitchMuteState(pGlobalData);
505  if (pGlobalData->muteVal)
506  {
508  }
509  else
510  {
512  }
513 
514  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
515  }
516  break;
517 
518  case IDC_ICON_IN_TASKBAR:
519  if (HIWORD(wParam) == BN_CLICKED)
520  {
521  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
522  }
523  break;
524 
525  case IDC_ADVANCED_BTN:
526  LaunchSoundControl(hwndDlg);
527  break;
528 
529  case IDC_SPEAKER_VOL_BTN:
530  SpeakerVolume(hwndDlg);
531  break;
532  }
533  break;
534  }
535 
536  case WM_HSCROLL:
537  {
538  HWND hVolumeTrackbar = GetDlgItem(hwndDlg, IDC_VOLUME_TRACKBAR);
539  if (hVolumeTrackbar == (HWND)lParam)
540  {
541  switch (LOWORD(wParam))
542  {
543  case TB_THUMBPOSITION:
544  break;
545 
546  case TB_ENDTRACK:
548  break;
549 
550  default:
551  SetVolumeValue(pGlobalData,
553  break;
554  }
555  }
556  break;
557  }
558 
559  case WM_DESTROY:
560  if (pGlobalData)
561  {
562  if (pGlobalData->volumeCurrentValues)
563  HeapFree(GetProcessHeap(), 0, pGlobalData->volumeCurrentValues);
564 
565  if (pGlobalData->volumePreviousValues)
566  HeapFree(GetProcessHeap(), 0, pGlobalData->volumePreviousValues);
567 
568  if (pGlobalData->volumeInitialValues)
569  HeapFree(GetProcessHeap(), 0, pGlobalData->volumeInitialValues);
570 
571  mixerClose(pGlobalData->hMixer);
572  DestroyIcon(pGlobalData->hIconMuted);
573  DestroyIcon(pGlobalData->hIconUnMuted);
574  DestroyIcon(pGlobalData->hIconNoHW);
575  HeapFree(GetProcessHeap(), 0, pGlobalData);
576  }
577  break;
578 
579  case WM_NOTIFY:
580  switch (((LPNMHDR)lParam)->code)
581  {
582  case PSN_APPLY:
583  SaveData(hwndDlg);
584  break;
585 
586  case PSN_RESET:
587  RestoreVolumeValue(pGlobalData);
588  break;
589  }
590  return TRUE;
591  }
592 
593  return FALSE;
594 }
PMIXERCONTROLDETAILS_UNSIGNED volumeInitialValues
Definition: volume.c:40
INT_PTR CALLBACK VolumeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: volume.c:417
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:684
#define MAKEINTRESOURCE
Definition: winuser.h:591
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 TRUE
Definition: types.h:120
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define IMAGE_ICON
Definition: winuser.h:212
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
struct tMIXERCONTROLDETAILS_UNSIGNED MIXERCONTROLDETAILS_UNSIGNED
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
static VOID InitImageInfo(PIMGINFO ImgInfo)
Definition: volume.c:48
#define IDI_MUTED_ICON
Definition: resource.h:14
HICON hIconNoHW
Definition: volume.c:28
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
static BOOL GetSystrayVolumeIconState(VOID)
Definition: volume.c:317
#define _countof(array)
Definition: fontsub.cpp:30
#define mixerGetLineInfo
Definition: mmsystem.h:2853
DWORD volumeMaximum
Definition: volume.c:36
struct _GLOBAL_DATA * PGLOBAL_DATA
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
VOID LaunchSoundControl(HWND hwndDlg)
Definition: volume.c:407
#define TBM_SETRANGE
Definition: commctrl.h:2033
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
DWORD maxVolume
Definition: volume.c:39
#define mixerGetLineControls
Definition: mmsystem.h:2854
LONG top
Definition: windef.h:307
#define IDC_VOLUME_LOW
Definition: resource.h:34
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
struct _IMGINFO * PIMGINFO
#define ZeroMemory
Definition: winbase.h:1642
DWORD volumeMinimum
Definition: volume.c:35
#define IDB_SPEAKIMG
Definition: resource.h:69
#define TBM_SETPOS
Definition: commctrl.h:2032
#define VOLUME_MAX
Definition: sndvol32.h:19
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define MIXER_GETLINEINFOF_COMPONENTTYPE
Definition: mmsystem.h:347
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5817
DWORD volumeControlID
Definition: volume.c:33
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:306
MIXERLINEA MIXERLINE
Definition: mmsystem.h:2824
int32_t INT_PTR
Definition: typedefs.h:62
LONG right
Definition: windef.h:308
#define IDC_VOLUME_HIGH
Definition: resource.h:35
VOID SetVolumeValue(PGLOBAL_DATA pGlobalData, DWORD dwPosition)
Definition: volume.c:237
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
int32_t INT
Definition: typedefs.h:56
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
VOID GetVolumeValue(PGLOBAL_DATA pGlobalData, BOOL bInit)
Definition: volume.c:201
MIXERCONTROLA MIXERCONTROL
Definition: mmsystem.h:2825
#define mixerGetDevCaps
Definition: mmsystem.h:2852
PMIXERCONTROLDETAILS_UNSIGNED volumePreviousValues
Definition: volume.c:41
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
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
VOID InitVolumeControls(HWND hwndDlg, PGLOBAL_DATA pGlobalData)
Definition: volume.c:331
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define IDC_VOLUME_TRACKBAR
Definition: resource.h:33
#define TBM_GETPOS
Definition: commctrl.h:2027
VOID GetMuteState(PGLOBAL_DATA pGlobalData)
Definition: volume.c:102
MIXERLINECONTROLSA MIXERLINECONTROLS
Definition: mmsystem.h:2826
#define MAKELONG(a, b)
Definition: typedefs.h:248
#define TBM_SETPAGESIZE
Definition: commctrl.h:2047
smooth NULL
Definition: ftsmooth.c:416
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:2046
#define IDC_ICON_IN_TASKBAR
Definition: resource.h:37
INT cySource
Definition: userinit.h:51
#define VOLUME_PAGESIZE
Definition: mmsys.h:43
#define WM_SETTEXT
Definition: winuser.h:1599
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define PtrToUlong(u)
Definition: config.h:107
#define WM_DESTROY
Definition: winuser.h:1591
#define SND_ALIAS_SYSTEMDEFAULT
Definition: mmsystem.h:175
union tagMIXERCONTROLA::@2938 Bounds
#define IDC_ADVANCED_BTN
Definition: resource.h:51
Definition: uimain.c:88
char TCHAR
Definition: xmlstorage.h:189
DWORD dwLineID
Definition: mmsystem.h:1235
#define BM_SETCHECK
Definition: winuser.h:1903
#define _T(x)
Definition: vfdio.h:22
struct _GLOBAL_DATA GLOBAL_DATA
HICON hIconMuted
Definition: volume.c:26
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HMIXER hMixer
Definition: volume.c:25
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define VOLUME_TICFREQ
Definition: mmsys.h:42
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define BN_CLICKED
Definition: winuser.h:1907
#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
#define IDS_NO_DEVICES
Definition: resource.h:91
#define SND_ASYNC
Definition: mmsystem.h:154
INT_PTR SpeakerVolume(HWND hwndDlg)
#define GetObject
Definition: wingdi.h:4467
#define SetDlgItemText
Definition: winuser.h:5824
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
#define IDC_DEVICE_NAME
Definition: resource.h:50
DWORD volumeChannels
Definition: volume.c:34
#define TB_ENDTRACK
Definition: commctrl.h:2077
PMIXERCONTROLDETAILS_UNSIGNED volumeCurrentValues
Definition: volume.c:42
static const WCHAR L[]
Definition: oid.c:1250
#define IDC_ADVANCED2_BTN
Definition: resource.h:54
#define IDI_NO_HW
Definition: resource.h:13
#define DWLP_USER
Definition: winuser.h:866
DWORD cChannels
Definition: mmsystem.h:1239
static VOID RestoreVolumeValue(PGLOBAL_DATA pGlobalData)
Definition: volume.c:281
#define MessageBox
Definition: winuser.h:5797
#define WM_COMMAND
Definition: winuser.h:1722
DWORD muteControlID
Definition: volume.c:31
#define BST_UNCHECKED
Definition: winuser.h:199
struct _IMGINFO IMGINFO
#define WM_USER
Definition: winuser.h:1877
HICON hIconUnMuted
Definition: volume.c:27
INT cxSource
Definition: userinit.h:50
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 PlaySound
Definition: mmsystem.h:2842
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
BOOL WINAPI DeleteDC(_In_ HDC)
#define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
Definition: mmsystem.h:319
DWORD volumeStep
Definition: volume.c:37
DWORD cbStruct
Definition: mmsystem.h:1232
#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)
Definition: bl.h:1331
static VOID SetSystrayVolumeIconState(BOOL bEnabled)
Definition: volume.c:304
#define VOLUME_MIN
Definition: sndvol32.h:18
HBITMAP hBitmap
Definition: userinit.h:49
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
unsigned int UINT
Definition: ndis.h:50
#define mixerGetControlDetails
Definition: mmsystem.h:2855
#define WM_HSCROLL
Definition: winuser.h:1725
#define MB_OK
Definition: winuser.h:784
#define IMAGE_BITMAP
Definition: winuser.h:211
#define MIXER_GETLINECONTROLSF_ONEBYTYPE
Definition: mmsystem.h:410
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define STM_SETIMAGE
Definition: winuser.h:2075
#define BST_CHECKED
Definition: winuser.h:197
DWORD dwComponentType
Definition: mmsystem.h:1238
#define WM_DRAWITEM
Definition: winuser.h:1627
#define IDC_MUTE_CHECKBOX
Definition: resource.h:36
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2246
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:309
LONG muteVal
Definition: volume.c:30
#define LoadImage
Definition: winuser.h:5790
static HBITMAP bitmap
Definition: clipboard.c:1344
#define IDC_SPEAKIMG
Definition: resource.h:70
static HBITMAP
Definition: button.c:44
#define MM_MIXM_LINE_CHANGE
Definition: mmsystem.h:82
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDC_MUTE_ICON
Definition: resource.h:71
VOID GetVolumeControl(PGLOBAL_DATA pGlobalData)
Definition: volume.c:148
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define TB_THUMBPOSITION
Definition: commctrl.h:2073
#define WM_INITDIALOG
Definition: winuser.h:1721
VOID SaveData(HWND hwndDlg)
Definition: volume.c:397
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:402
#define SRCCOPY
Definition: wingdi.h:332
#define LoadString
Definition: winuser.h:5794
HDC hdcMem
Definition: welcome.c:104
#define WM_NOTIFY
Definition: richedit.h:61
VOID SwitchMuteState(PGLOBAL_DATA pGlobalData)
Definition: volume.c:126
VOID GetMuteControl(PGLOBAL_DATA pGlobalData)
Definition: volume.c:72
#define MM_MIXM_CONTROL_CHANGE
Definition: mmsystem.h:83